diff -Nru juju-core-2.6.2/debian/changelog juju-core-2.6.5/debian/changelog --- juju-core-2.6.2/debian/changelog 2019-05-14 19:32:03.000000000 +0000 +++ juju-core-2.6.5/debian/changelog 2019-07-01 19:10:19.000000000 +0000 @@ -1,8 +1,11 @@ -juju-core (1:2.6.2-0ubuntu1~18.10.1~juju1) cosmic; urgency=medium +juju-core (1:2.6.5-0ubuntu1~18.10.1~juju1) cosmic; urgency=medium - * New upstream stable point release. (LP #1827838) + * New upstream stable point release. (LP #1832608, LP #1834017, LP + #1834657, LP #1813886, LP #1831682, LP #1831770, LP #1832779, LP + #1832783, LP #1833449, LP #1833763, LP #1632735, LP #1832777, LP + #1833629, LP #1564168, LP #1642226, LP #1831527) - -- Canonical Juju QA Bot Tue, 14 May 2019 19:32:03 +0000 + -- Canonical Juju QA Bot Mon, 01 Jul 2019 19:10:19 +0000 juju-core (2.2.4-0ubuntu0.17.04.2) zesty; urgency=medium diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_caas_deploy_charms.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_caas_deploy_charms.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_caas_deploy_charms.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_caas_deploy_charms.py 2019-06-28 17:10:43.000000000 +0000 @@ -12,6 +12,7 @@ import argparse import logging import sys +import json from time import sleep import requests @@ -23,6 +24,7 @@ JujuAssertionError, ) +from jujupy.client import temp_bootstrap_env from jujupy.utility import until_timeout from jujupy.k8s_provider import ( providers, @@ -43,11 +45,11 @@ for remaining in until_timeout(timeout): try: r = requests.get(url) - if r.ok and r.status_code < 400: - return success_hook() status_code = r.status_code - except IOError as e: - log.error(e) + if r.ok and status_code < 400: + return success_hook() + except IOError: + ... finally: sleep(3) if remaining % 30 == 0: @@ -57,9 +59,49 @@ raise JujuAssertionError('gitlab is not healthy') -def assess_caas_charm_deployment(caas_client): - external_hostname = caas_client.get_external_hostname() +def get_app_endpoint(caas_client, model_name, app_name, svc_type, timeout=120): + if svc_type == 'LoadBalancer': + for remaining in until_timeout(timeout): + try: + lb_addr = json.loads( + caas_client.kubectl( + '-n', model_name, 'get', 'svc', app_name, '-o', 'json' + ) + )['status']['loadBalancer']['ingress'][0]['ip'] + if lb_addr: + log.info('load balancer addr for %s is %s' % (app_name, lb_addr)) + return lb_addr + except: # noqa: E722 + ... + raise JujuAssertionError('No load balancer addr available for %s' % app_name) + + return caas_client.get_external_hostname() + + +def deploy_test_workloads(caas_client, k8s_model, caas_provider): + k8s_model.deploy( + charm="cs:~juju/mariadb-k8s-0", + ) + svc_type = None + if caas_provider == K8sProviderType.MICROK8S.name: + k8s_model.deploy( + charm="cs:~juju/mediawiki-k8s-3", + config='juju-external-hostname={}'.format(caas_client.get_external_hostname()), + ) + k8s_model.juju('expose', ('mediawiki-k8s',)) + else: + k8s_model.deploy( + charm="cs:~juju/mediawiki-k8s-3", + config='kubernetes-service-type=LoadBalancer', + ) + svc_type = 'LoadBalancer' + k8s_model.juju('relate', ('mediawiki-k8s:db', 'mariadb-k8s:server')) + k8s_model.wait_for_workloads(timeout=600) + return 'http://' + get_app_endpoint(caas_client, k8s_model.model_name, 'mediawiki-k8s', svc_type) + + +def assess_caas_charm_deployment(caas_client, caas_provider): if not caas_client.check_cluster_healthy(timeout=60): raise JujuAssertionError('k8s cluster is not healthy because kubectl is not accessible') @@ -73,30 +115,18 @@ success_hook() log.info(caas_client.kubectl('get', 'pv,pvc', '-n', model_name)) caas_client.ensure_cleanup() - + try: - k8s_model.deploy( - charm="cs:~juju/mediawiki-k8s-3", - config='juju-external-hostname={}'.format(external_hostname), - ) - - k8s_model.deploy( - charm="cs:~juju/mariadb-k8s-0", - ) - - k8s_model.juju('relate', ('mediawiki-k8s:db', 'mariadb-k8s:server')) - k8s_model.juju('expose', ('mediawiki-k8s',)) - k8s_model.wait_for_workloads(timeout=600) - - url = '{}://{}'.format('http', external_hostname) + endpoint = deploy_test_workloads(caas_client, k8s_model, caas_provider) check_app_healthy( - url, timeout=300, + endpoint, timeout=300, success_hook=success_hook, + fail_hook=fail_hook, ) k8s_model.juju(k8s_model._show_status, ('--format', 'tabular')) - except: - # run cleanup steps then raise. - fail_hook() + except: # noqa: E722 + # run cleanup steps then raise. + fail_hook() raise @@ -112,6 +142,11 @@ choices=K8sProviderType.keys(), help='Specify K8s cloud provider to use for CAAS tests.' ) + parser.add_argument( + '--k8s-controller', + action='store_true', + help='Bootstrap to k8s cluster or not.' + ) add_basic_testing_arguments(parser, existing=False) return parser.parse_args(argv) @@ -120,16 +155,24 @@ def main(argv=None): args = parse_args(argv) configure_logging(args.verbose) + + k8s_provider = providers[args.caas_provider] bs_manager = BootstrapManager.from_args(args) - with bs_manager.booted_context( - args.upload_tools, - caas_image_repo=args.caas_image_repo, - ): - client = bs_manager.client - k8s_provider = providers[args.caas_provider] - caas_client = k8s_provider(bs_manager) - assess_caas_charm_deployment(caas_client) - return 0 + + with k8s_provider(bs_manager).substrate_context() as caas_client: + # add-k8s --local + if args.k8s_controller and args.caas_provider != K8sProviderType.MICROK8S.name: + # microk8s is built-in cloud, no need run add-k8s for bootstrapping. + caas_client.add_k8s(True) + with bs_manager.existing_booted_context( + args.upload_tools, + caas_image_repo=args.caas_image_repo, + ): + if not args.k8s_controller: + # add-k8s to controller + caas_client.add_k8s(False) + assess_caas_charm_deployment(caas_client, args.caas_provider) + return 0 if __name__ == '__main__': diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_deploy_trusted_bundle.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_deploy_trusted_bundle.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_deploy_trusted_bundle.py 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_deploy_trusted_bundle.py 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +""" Assess deployments of bundles requiring trust when --trust is passed to + juju deploy. The trust-checker charm used by this test will set its status + to blocked unless it can succesfully access cloud credentials after being + granted trust (either by the operator or the juju deploy command) +""" + +import argparse +import logging +import os +import sys + +from deploy_stack import ( + BootstrapManager, +) +from jujucharm import ( + local_charm_path, +) +from utility import ( + add_basic_testing_arguments, + configure_logging, +) +from jujupy.wait_condition import AllApplicationActive + +__metaclass__ = type +log = logging.getLogger("assess_deploy_trusted_bundle") +default_bundle = 'bundles-trust-checker.yaml' + + +def deploy_bundle(client, charm_bundle): + """Deploy the given charm bundle + :param client: Jujupy ModelClient object + :param charm_bundle: Optional charm bundle string + """ + if not charm_bundle: + bundle = local_charm_path( + charm=default_bundle, + juju_ver=client.version, + repository=os.environ['JUJU_REPOSITORY'] + ) + else: + bundle = charm_bundle + # bump the timeout of the wait_timeout to ensure that we can give more time + # for complex deploys. After deploying wait up to 60sec for the + # applications to register as active. + _, primary = client.deploy(bundle, wait_timeout=1800, trust="true") + client.wait_for(AllApplicationActive(1800)) + + +def parse_args(argv): + parser = argparse.ArgumentParser( + description="Test trusted bundle deployments") + parser.add_argument( + '--charm-bundle', + help="Override the charm bundle to deploy", + ) + add_basic_testing_arguments(parser) + return parser.parse_args(argv) + + +def main(argv=None): + args = parse_args(argv) + configure_logging(args.verbose) + bs_manager = BootstrapManager.from_args(args) + with bs_manager.booted_context(args.upload_tools): + client = bs_manager.client + + deploy_bundle(client, charm_bundle=args.charm_bundle) + + +if __name__ == '__main__': + sys.exit(main()) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_deploy_webscale.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_deploy_webscale.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/assess_deploy_webscale.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/assess_deploy_webscale.py 2019-06-28 17:10:43.000000000 +0000 @@ -117,7 +117,7 @@ } -def calc_stats(prefix, values, include_count=False): +def calc_stats(prefix, values, include_count=False, test_duration=0): """ Calculate statistics for a list of float values and return them as an object where the keys are prefixed using the provided prefix. """ @@ -133,6 +133,9 @@ if include_count: stats[prefix+'count'] = len(values) + if test_duration is not 0: + stats[prefix+'rate'] = float(len(values)) / float(test_duration) + return stats @@ -150,7 +153,8 @@ """ return merge_dicts( - calc_stats('txn_time_', txn_metrics['timings'], include_count=True), + calc_stats('txn_time_', txn_metrics['timings'], include_count=True, + test_duration=test_duration), calc_stats('txn_retries_', txn_metrics['retries']), {'test_duration': test_duration}, ) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/deploy_stack.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/deploy_stack.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/deploy_stack.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/deploy_stack.py 2019-06-28 17:10:43.000000000 +0000 @@ -1004,7 +1004,7 @@ # the failed operation. with logged_exception(logging): yield - except: + except: # noqa: E722 # If run from a windows machine may not have ssh to get # logs with self.client.ignore_soft_deadline(): @@ -1032,7 +1032,7 @@ if addable_machines is not None: self.client.add_ssh_machines(addable_machines) yield - except: + except: # noqa: E722 if self.has_controller: safe_print_status(self.client) else: @@ -1056,9 +1056,12 @@ if not self.keep_env: if self.has_controller: self.collect_resource_details() - self.tear_down() - unclean_resources = self.ensure_cleanup() - error_if_unclean(unclean_resources) + try: + self.tear_down() + finally: + # ensure_cleanup does not reply on controller at all, so always try to do cleanup. + unclean_resources = self.ensure_cleanup() + error_if_unclean(unclean_resources) # GZ 2016-08-11: Should this method be elsewhere to avoid poking backend? def _should_dump(self): diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/client.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/client.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/client.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/client.py 2019-06-28 17:10:43.000000000 +0000 @@ -166,11 +166,13 @@ provider = self.provider except NoProvider: provider = None + self.lxd = ((self._config.get('container') == 'kvm') or (provider == 'lxd')) self.kvm = (bool(self._config.get('container') == 'kvm')) self.maas = bool(provider == 'maas') self.joyent = bool(provider == 'joyent') self.logging_config = self._config.get('logging-config') else: + self.lxd = False self.kvm = False self.maas = False self.joyent = False @@ -200,6 +202,7 @@ model_name, config, juju_home=self.juju_home, controller=self.controller, bootstrap_to=self.bootstrap_to) + result.lxd = self.lxd result.kvm = self.kvm result.maas = self.maas result.joyent = self.joyent @@ -209,6 +212,9 @@ result._cloud_name = self._cloud_name result.logging_config = self.logging_config return result + + def set_cloud_name(self, name): + self._cloud_name = name @classmethod def from_env(cls, env): @@ -361,12 +367,18 @@ raise LookupError('No such endpoint: {}'.format(endpoint)) def find_cloud_by_host_cloud_region(self, host_cloud_region): + self.load_yaml() for cloud, cloud_config in self.clouds['clouds'].items(): if cloud_config['type'] != 'kubernetes': continue if cloud_config['host-cloud-region'] == host_cloud_region: return cloud - raise LookupError('No such host cloud region: {}'.format(host_cloud_region)) + raise LookupError( + 'No such host cloud region: {host_cloud_region}, clouds: {clouds}'.format( + host_cloud_region=host_cloud_region, + clouds=self.clouds['clouds'], + ) + ) def set_model_name(self, model_name, set_controller=True): if set_controller: @@ -422,11 +434,8 @@ }.get(provider, provider) if provider == 'kubernetes': - host_cloud_region, k8s_base_cloud, _ = self.get_host_cloud_region() - if k8s_base_cloud == 'microk8s': - # microk8s is built-in cloud. - return k8s_base_cloud - return self.find_cloud_by_host_cloud_region(host_cloud_region) + _, k8s_base_cloud, _ = self.get_host_cloud_region() + return k8s_base_cloud endpoint = '' if provider == 'maas': @@ -442,8 +451,10 @@ if self.provider != 'kubernetes': raise Exception("cloud type %s has to be kubernetes" % self.provider) + def f(x): + return [x] + x.split('/') + cache_key = 'host-cloud-region' - f = lambda x: [x] + x.split('/') raw = getattr(self, cache_key, None) if raw is not None: return f(raw) @@ -955,9 +966,11 @@ 'management-subscription-id', 'manta-key-id', 'manta-user', + # TODO(thumper): remove max-logs-age and max-logs-size in 2.7 branch. 'max-logs-age', 'max-logs-size', 'max-txn-log-size', + 'model-logs-size', 'name', 'password', 'private-key', @@ -1451,21 +1464,19 @@ def _get_substrate_constraints(self): if self.env.joyent: # Only accept kvm packages by requiring >1 cpu core, see lp:1446264 - return 'mem=2G cpu-cores=1' + return 'cores=1' elif self.env.maas and self._maas_spaces_enabled(): # For now only maas support spaces in a meaningful way. - return 'mem=2G spaces={}'.format(','.join( + return 'spaces={}'.format(','.join( '^' + space for space in sorted(self.excluded_spaces))) else: - return 'mem=2G' + return '' def quickstart(self, bundle_template, upload_tools=False): bundle = self.format_bundle(bundle_template) - constraints = 'mem=2G' - args = ('--constraints', constraints) + args = ('--no-browser', bundle,) if upload_tools: args = ('--upload-tools',) + args - args = args + ('--no-browser', bundle,) self.juju('quickstart', args, extra_env={'JUJU': self.full_path}) def status_until(self, timeout, start=None): diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/base.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/base.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/base.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/base.py 2019-06-28 17:10:43.000000000 +0000 @@ -26,11 +26,16 @@ import subprocess from pprint import pformat from enum import Enum +from contextlib import contextmanager from jujupy.utility import ( ensure_dir, until_timeout, ) +from jujupy.client import ( + temp_bootstrap_env, + JujuData, +) logger = logging.getLogger(__name__) @@ -51,6 +56,7 @@ class K8sProviderType(Enum): MICROK8S = 1 K8S_CORE = 2 + GKE = 3 @classmethod def keys(cls): @@ -79,38 +85,54 @@ kube_config_path = None default_storage_class_name = None + kubeconfig_cluster_name = None def _ensure_cluster_stack(self): """ensures or checks if stack/infrastructure is ready to use. - ensures kubectl/apiserver is functioning. """ - raise NotImplemented() + raise NotImplementedError() def _ensure_cluster_config(self): """ensures the cluster is correctly configured and ready to use. - ensures the cluster is ready to deploy workloads. """ - raise NotImplemented() + raise NotImplementedError() def _ensure_kube_dir(self): """ensures $KUBECONFIG/.kube dir setup correctly: - kubectl bin - config """ - raise NotImplemented() + raise NotImplementedError() def _node_address_getter(self, node): """filters node addresses to get the correct accessible address. """ - raise NotImplemented() + raise NotImplementedError() + + def _tear_down_substrate(self): + """tear down substrate cloud - k8s cluster. + """ + raise NotImplementedError() def __init__(self, bs_manager, timeout=1800): self.client = bs_manager.client + self.bs_manager = bs_manager # register cleanup_hook bs_manager.cleanup_hook = self.ensure_cleanup self.timeout = timeout - self.juju_home = self.client.env.juju_home + old_environment = bs_manager.client.env.environment + + bs_manager.client.env.environment = bs_manager.temp_env_name + with temp_bootstrap_env(bs_manager.client.env.juju_home, bs_manager.client) as tm_h: + self.client.env.juju_home = tm_h + self.refresh_home(self.client) + bs_manager.client.env.environment = old_environment + + def refresh_home(self, client): + self.juju_home = client.env.juju_home self.kubectl_path = os.path.join(self.juju_home, 'kubectl') self.kube_home = os.path.join(self.juju_home, '.kube') @@ -121,20 +143,42 @@ # ensure kube config env var os.environ[KUBE_CONFIG_PATH_ENV_VAR] = self.kube_config_path - self._ensure_cluster_stack() - self._ensure_kube_dir() - self.check_cluster_healthy() - self._ensure_cluster_config() - self._add_k8s() + @contextmanager + def substrate_context(self): + try: + self._ensure_cluster_stack() + self._ensure_kube_dir() + self.check_cluster_healthy() + self._ensure_cluster_config() + + yield self + finally: + # tear down cluster. + self._tear_down_substrate() def add_model(self, model_name): # returns the newly added CAAS model. return self.client.add_model(env=self.client.env.clone(model_name), cloud_region=self.cloud_name) - def _add_k8s(self): - self.client.controller_juju( - 'add-k8s', - (self.cloud_name, '--controller', self.client.env.controller.name) + def add_k8s(self, is_local=False, juju_home=None): + args = ( + self.cloud_name, + ) + juju_home = juju_home or self.client.env.juju_home + if is_local: + args += ( + '--local', + '--cluster-name', self.kubeconfig_cluster_name, + ) + # use this local cloud to bootstrap later. + self.bs_manager.client.env.set_cloud_name(self.cloud_name) + else: + args += ( + '--controller', self.client.env.controller.name, + ) + self.client._backend.juju( + 'add-k8s', args, + used_feature_flags=self.client.used_feature_flags, juju_home=juju_home, ) logger.debug('added caas cloud, now all clouds are -> \n%s', self.client.list_clouds(format='yaml')) @@ -158,10 +202,21 @@ def kubectl(self, *args): return self.sh(*(self._kubectl_bin + args)) + def patch_configmap(self, namespace, cm_name, key, value): + cm = json.loads( + self.kubectl('get', '-n', namespace, 'cm', cm_name, '-o', 'json') + ) + data = cm.get('data', {}) + data[key] = value if isinstance(value, str) else str(value) + cm['data'] = data + self.kubectl_apply(json.dumps(cm)) + def sh(self, *args): + args = [str(arg) for arg in args] + logger.debug('sh -> %s', ' '.join(args)) return subprocess.check_output( - # args should be str. - (str(arg) for arg in args), + # cmd should be a list of str. + args, stderr=subprocess.STDOUT, ).decode('UTF-8').strip() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/factory.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/factory.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/factory.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/factory.py 2019-06-28 17:10:43.000000000 +0000 @@ -42,7 +42,7 @@ key = K8sProviderType[name] return self._providers[key] except KeyError: - raise ProviderNotAvailable("provider {} is not defined".format(key.name)) + raise ProviderNotAvailable("provider {} is not defined".format(name)) @property def providers(self): diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/gke.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/gke.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/gke.py 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/gke.py 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,283 @@ +# This file is part of JujuPy, a library for driving the Juju CLI. +# Copyright 2013-2019 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the Lesser GNU General Public License version 3, as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, +# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser +# GNU General Public License for more details. +# +# You should have received a copy of the Lesser GNU General Public License +# along with this program. If not, see . + +# Functionality for handling installed or other juju binaries +# (including paths etc.) + + +from __future__ import print_function + +import logging +import yaml +import json +from time import sleep +import shutil +import tempfile +import os + +from google.cloud import container_v1 +from google.oauth2 import service_account +from google.api_core import exceptions +from jujupy.utility import until_timeout + +from .base import ( + Base, + K8sProviderType, +) +from .factory import register_provider + + +logger = logging.getLogger(__name__) +CLUSTER_STATUS = container_v1.enums.Cluster.Status + + +@register_provider +class GKE(Base): + + name = K8sProviderType.GKE + + driver = None + gke_cluster_name = None + gke_cluster = None + + default_params = None + + def __init__(self, bs_manager, timeout=1800): + super().__init__(bs_manager, timeout) + + self.gke_cluster_name = self.client.env.controller.name # use controller name for cluster name + self.default_storage_class_name = '' + self.__init_driver(bs_manager.client.env) + + def __init_driver(self, env): + zone = env.get_host_cloud_region()[2] + '-b' + cfg = env._config + self.default_params = dict( + project_id=cfg['project_id'], + zone=zone, + ) + + self.driver = container_v1.ClusterManagerClient( + credentials=service_account.Credentials.from_service_account_info(cfg) + ) + + self.__ensure_gcloud(cfg) + + # list all running clusters + running_clusters = self.driver.list_clusters(**self.default_params) + logger.info('running gke clusters: %s', running_clusters) + + def _ensure_cluster_stack(self): + self.provision_gke() + + def __ensure_gcloud(self, cfg): + gcloud_bin = shutil.which('gcloud') + if gcloud_bin is None: + # ensure gcloud installed. + self.sh('sudo', 'snap', 'install', 'google-cloud-sdk', '--classic') + logger.debug("gcloud installed successfully") + gcloud_bin = shutil.which('gcloud') + + cred = { + k: cfg[k] for k in ( + 'project_id', + 'private_key_id', + 'private_key', + 'client_email', + 'client_id', + 'auth_uri', + 'token_uri', + 'auth_provider_x509_cert_url', + 'client_x509_cert_url', + ) + } + cred['type'] = 'service_account' + cred_file = tempfile.NamedTemporaryFile(suffix='.json', delete=False) + try: + with open(cred_file.name, 'w') as f: + json.dump(cred, f) + + # set credential; + o = self.sh(gcloud_bin, 'auth', 'activate-service-account', '--key-file', cred_file.name) + logger.debug(o) + # set project; + o = self.sh(gcloud_bin, 'config', 'set', 'project', cfg['project_id']) + logger.debug(o) + finally: + os.unlink(cred_file.name) + + def _tear_down_substrate(self): + try: + self.driver.delete_cluster( + cluster_id=self.gke_cluster_name, **self.default_params, + ) + except exceptions.NotFound: + pass + + def _ensure_kube_dir(self): + cluster = self._get_cluster(self.gke_cluster_name) + cluster_config = ClusterConfig( + project_id=self.default_params['project_id'], + cluster=cluster, + ) + self.kubeconfig_cluster_name = cluster_config.context_name + kubeconfig_content = cluster_config.dump() + with open(self.kube_config_path, 'w') as f: + logger.debug('writing kubeconfig to %s\n%s', self.kube_config_path, kubeconfig_content) + f.write(kubeconfig_content) + + # ensure kubectl + kubectl_bin_path = shutil.which('kubectl') + if kubectl_bin_path is not None: + self.kubectl_path = kubectl_bin_path + else: + self.sh( + 'curl', 'https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectl', + '-o', self.kubectl_path + ) + os.chmod(self.kubectl_path, 0o774) + + def _ensure_cluster_config(self): + ... + + def _node_address_getter(self, node): + return [addr['address'] for addr in node['status']['addresses'] if addr['type'] == 'ExternalIP'][0] + + def _get_cluster(self, name): + return self.driver.get_cluster( + cluster_id=self.gke_cluster_name, **self.default_params, + ) + + def provision_gke(self): + def log_remaining(remaining, msg=''): + sleep(3) + if remaining % 30 == 0: + msg += ' timeout in %ss...' % remaining + logger.info(msg) + + # do pre cleanup; + self._tear_down_substrate() + for remaining in until_timeout(600): + # wait for the old cluster to be deleted. + try: + self._get_cluster(self.gke_cluster_name) + except exceptions.NotFound: + break + finally: + log_remaining(remaining) + + # provision cluster. + cluster = dict( + name=self.gke_cluster_name, + initial_node_count=1, + ) + logger.info('creating cluster -> %s', cluster) + r = self.driver.create_cluster( + cluster=cluster, + **self.default_params, + ) + logger.info('created cluster -> %s', r) + # wait until cluster fully provisioned. + logger.info('waiting for cluster fully provisioned.') + for remaining in until_timeout(600): + try: + cluster = self._get_cluster(self.gke_cluster_name) + if cluster.status == CLUSTER_STATUS.RUNNING: + return + except Exception as e: # noqa + logger.info(e) + finally: + log_remaining(remaining) + + +class ClusterConfig(object): + + def __init__(self, project_id, cluster): + self.cluster_name = cluster.name + self.zone_id = cluster.zone + self.project_id = project_id + self.server = 'https://' + cluster.endpoint + self.ca_data = cluster.master_auth.cluster_ca_certificate + self.client_key_data = cluster.master_auth.client_key + self.client_cert_data = cluster.master_auth.client_certificate + self.context_name = 'gke_{project_id}_{zone_id}_{cluster_name}'.format( + project_id=self.project_id, + zone_id=self.zone_id, + cluster_name=self.cluster_name, + ) + + def user(self, auth_provider='gcp'): + if auth_provider is None: + return { + 'name': self.context_name, + 'user': { + 'client-certificate-data': self.client_cert_data, + 'client-key-data': self.client_key_data + }, + } + # TODO(ycliuhw): remove gcloud dependency once 'google-cloud-container' supports defining master-auth type. + gcloud_bin_path = shutil.which('gcloud') + if gcloud_bin_path is None: + raise AssertionError("gcloud bin is required!") + return { + 'name': self.context_name, + 'user': { + 'auth-provider': { + 'name': auth_provider, + 'config': { + # Command for gcloud credential helper + 'cmd-path': gcloud_bin_path, + # Args for gcloud credential helper + 'cmd-args': 'config config-helper --format=json', + # JSONpath to the field that is the raw access token + 'token-key': '{.credential.access_token}', + # JSONpath to the field that is the expiration timestamp + 'expiry-key': '{.credential.token_expiry}', + } + }, + }, + } + + @property + def cluster(self): + return { + 'name': self.context_name, + 'cluster': { + 'server': self.server, + 'certificate-authority-data': self.ca_data, + }, + } + + @property + def context(self): + return { + 'name': self.context_name, + 'context': { + 'cluster': self.context_name, + 'user': self.context_name, + }, + } + + def dump(self): + d = { + 'apiVersion': 'v1', + 'kind': 'Config', + 'contexts': [self.context], + 'clusters': [self.cluster], + 'current-context': self.context_name, + 'preferences': {}, + 'users': [self.user()], + } + return yaml.dump(d) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/__init__.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/__init__.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/__init__.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/__init__.py 2019-06-28 17:10:43.000000000 +0000 @@ -23,3 +23,4 @@ # it's not for outside to use, so alias them to _. from .kubernetes_core import KubernetesCore as _ # noqa from .microk8s import MicroK8s as _ # noqa +from .gke import GKE as _ # noqa diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/kubernetes_core.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/kubernetes_core.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/kubernetes_core.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/kubernetes_core.py 2019-06-28 17:10:43.000000000 +0000 @@ -206,7 +206,7 @@ def _node_address_getter(self, node): # TODO(ycliuhw): implement here once described k8s core node to find the corrent node ip. - raise NotImplemented() + raise NotImplementedError() def __ensure_lxd_profile(self, profile, model_name): profile = profile.format(model_name=model_name) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/microk8s.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/microk8s.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/microk8s.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/k8s_provider/microk8s.py 2019-06-28 17:10:43.000000000 +0000 @@ -21,6 +21,10 @@ import logging import shutil +import os +import json + +import dns.resolver from .base import ( Base, @@ -36,6 +40,7 @@ class MicroK8s(Base): name = K8sProviderType.MICROK8S + cloud_name = 'microk8s' # built-in cloud name def __init__(self, bs_manager, timeout=1800): super().__init__(bs_manager, timeout) @@ -44,11 +49,15 @@ def _ensure_cluster_stack(self): self.__ensure_microk8s_installed() + def _tear_down_substrate(self): + # No need to tear down microk8s. + logger.warn('skip tearing down microk8s') + def _ensure_kube_dir(self): # choose to use microk8s.kubectl mkubectl = shutil.which('microk8s.kubectl') if mkubectl is None: - raise AssertionError(mkubectl + "is required!") + raise AssertionError("microk8s.kubectl is required!") self.kubectl_path = mkubectl # export microk8s.config to kubeconfig file. @@ -59,6 +68,10 @@ def _ensure_cluster_config(self): self.__enable_addons() + try: + self.__tmp_fix_patch_kubedns() + except Exception as e: + logger.error(e) def _node_address_getter(self, node): # microk8s uses the node's 'InternalIP`. @@ -80,3 +93,14 @@ "microk8s status \n%s", self.sh('microk8s.status', '--wait-ready', '--timeout', self.timeout, '--yaml'), ) + + def __tmp_fix_patch_kubedns(self): + # patch nameservers of kubedns because the google one used in microk8s is blocked in our network. + def ping(addr): + return os.system('ping -c 1 ' + addr) == 0 + + nameservers = dns.resolver.Resolver().nameservers + for ns in nameservers: + if ping(ns): + return self.patch_configmap('kube-system', 'kube-dns', 'upstreamNameservers', json.dumps([ns])) + raise Exception('No working nameservers found from %s to use for patching kubedns' % nameservers) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/tests/test_client.py juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/tests/test_client.py --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/jujupy/tests/test_client.py 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/jujupy/tests/test_client.py 2019-06-28 17:10:43.000000000 +0000 @@ -388,7 +388,7 @@ client.bootstrap() mock.assert_called_once_with( 'bootstrap', ( - '--constraints', 'mem=2G cpu-cores=1', + '--constraints', 'cores=1', 'joyent/foo', 'joyent', '--config', config_file.name, '--default-model', 'joyent', '--agent-version', '2.0', diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/bundles-trust-checker.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/bundles-trust-checker.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/bundles-trust-checker.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/bundles-trust-checker.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +services: + trust-checker: + charm: cs:~juju-qa/bionic/trust-checker-0 + num_units: 1 + trust: true diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/chaos-monkey/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/chaos-monkey/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/chaos-monkey/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/chaos-monkey/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/client-forwardproxy/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/client-forwardproxy/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/client-forwardproxy/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/client-forwardproxy/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -14,3 +14,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-resource/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-resource/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-resource/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-resource/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ - xenial - artful - bionic + - disco resources: foo: type: file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-sink/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-sink/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-sink/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-sink/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -13,3 +13,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-source/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-source/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-source/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-source/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -13,4 +13,5 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-storage/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-storage/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-storage/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-storage/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ - xenial - artful - bionic + - disco storage: single-fs: type: filesystem diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-subordinate/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/dummy-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/fill-logs/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/fill-logs/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/fill-logs/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/fill-logs/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -9,3 +9,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-juju-ci/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-juju-ci/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-juju-ci/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-juju-ci/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -19,3 +19,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-slave/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-slave/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-slave/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/jenkins-slave/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -16,3 +16,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -40,3 +40,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/README.md juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/README.md --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/README.md 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/mysql/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -12,7 +12,7 @@ juju deploy mysql -Once deployed, you can retrive the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: +Once deployed, you can retrieve the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: juju ssh mysql/0 mysql -u root -p=`cat /var/lib/mysql/mysql.passwd` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/network-health/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/network-health/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/network-health/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/network-health/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ - xenial - artful - bionic + - disco requires: juju-info: interface: juju-info diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/peer-xplod/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/peer-xplod/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/peer-xplod/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/peer-xplod/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -12,6 +12,7 @@ - xenial - artful - bionic + - disco subordinate: false peers: xplod: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resolve/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resolve/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resolve/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resolve/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -10,3 +10,4 @@ - bionic - trusty - artful + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resource-http/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resource-http/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resource-http/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/simple-resource-http/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ - xenial - artful - bionic + - disco resources: index: type: file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/squid-forwardproxy/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/squid-forwardproxy/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/squid-forwardproxy/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/squid-forwardproxy/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -14,3 +14,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/statusstresser/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/statusstresser/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/statusstresser/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/statusstresser/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -10,3 +10,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +credential-get && status-set active "fetched cloud credentials" || status-set blocked "missing credentials access; grant with: juju trust" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/start juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/start --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/start 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/hooks/start 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +credential-get && status-set active "fetched cloud credentials" || status-set blocked "missing credentials access; grant with: juju trust" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/icon.svg juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/icon.svg --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/icon.svg 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/trust-checker/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,13 @@ +name: trust-checker +summary: "A charm that sets its status to blocked unless it can access credentials." +maintainer: +description: | + The charm initially sets its status to blocked and then attempts to fetch + the cloud credentials each time its configuration changes. Once deployed + you can toggle its state between active/blocked by running + + juju trust trust-checker + juju trust trust-checker --remove +series: + - bionic + - xenial diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/ubuntu/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/ubuntu/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/ubuntu/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/ubuntu/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -10,3 +10,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/update-status-tester/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/update-status-tester/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/update-status-tester/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/update-status-tester/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -10,3 +10,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/wordpress/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/wordpress/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms/wordpress/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms/wordpress/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -23,4 +23,5 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/dummy-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/dummy-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/dummy-subordinate/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/dummy-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/charms-centos/dummy-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/trusty/dummy-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/trusty/dummy-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/trusty/dummy-subordinate/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/trusty/dummy-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/trusty/mysql/README.md juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/trusty/mysql/README.md --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/trusty/mysql/README.md 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/trusty/mysql/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -12,7 +12,7 @@ juju deploy mysql -Once deployed, you can retrive the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: +Once deployed, you can retrieve the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: juju ssh mysql/0 mysql -u root -p=`cat /var/lib/mysql/mysql.passwd` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/xenial/dummy-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/xenial/dummy-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/xenial/dummy-subordinate/metadata.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/xenial/dummy-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -15,3 +15,4 @@ - xenial - artful - bionic + - disco diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/xenial/mysql/README.md juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/xenial/mysql/README.md --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/repository/xenial/mysql/README.md 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/repository/xenial/mysql/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -12,7 +12,7 @@ juju deploy mysql -Once deployed, you can retrive the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: +Once deployed, you can retrieve the MySQL root user password by logging in to the machine via `juju ssh` and readin the `/var/lib/mysql/mysql.passwd` file. To log in as root MySQL User at the MySQL console you can issue the following: juju ssh mysql/0 mysql -u root -p=`cat /var/lib/mysql/mysql.passwd` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/requirements.txt juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/requirements.txt --- juju-core-2.6.2/src/github.com/juju/juju/acceptancetests/requirements.txt 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/acceptancetests/requirements.txt 2019-06-28 17:10:43.000000000 +0000 @@ -1,4 +1,4 @@ -apache-libcloud>=2.2.1 +apache-libcloud>=2.4.0 azure>=2.0.0rc3 azure-batch>=0.30.0rc3 azure-common>=1.1.3 @@ -38,3 +38,7 @@ pyOpenSSL>=17.5.0 boto3>=1.5.18 pyaml>=17.12.1 +pycrypto==2.6.1 +dnspython==1.16.0 +google-api-python-client==1.7.8 +google-cloud-container==0.2.1 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/agent/agentbootstrap/bootstrap_test.go juju-core-2.6.5/src/github.com/juju/juju/agent/agentbootstrap/bootstrap_test.go --- juju-core-2.6.2/src/github.com/juju/juju/agent/agentbootstrap/bootstrap_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/agent/agentbootstrap/bootstrap_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -224,9 +224,8 @@ "state-port": 1234, "api-port": 17777, "set-numa-control-policy": false, - "max-logs-age": "72h", - "max-logs-size": "4G", "max-txn-log-size": "10M", + "model-logs-size": "1M", "auditing-enabled": false, "audit-log-capture-args": true, "audit-log-max-size": "200M", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/agent/uninstall.go juju-core-2.6.5/src/github.com/juju/juju/agent/uninstall.go --- juju-core-2.6.2/src/github.com/juju/juju/agent/uninstall.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/agent/uninstall.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package agent - -import ( - "io/ioutil" - "os" - "path/filepath" - - "gopkg.in/juju/names.v2" -) - -const ( - // UninstallFile is the name of the file inside the data dir that, - // if it exists, will cause the machine agent to uninstall itself - // when it receives the termination signal or ErrTerminateAgent. - UninstallFile = "uninstall-agent" -) - -// WARNING: this is linked with the use of UninstallFile in the -// provider/manual package. Don't change it without extreme care, -// and handling for mismatches with already-deployed agents. -func uninstallFile(a Agent) string { - return filepath.Join(a.CurrentConfig().DataDir(), UninstallFile) -} - -// SetCanUninstall creates the uninstall file in the data dir. It does -// nothing if the supplied agent doesn't have a machine tag. -func SetCanUninstall(a Agent) error { - tag := a.CurrentConfig().Tag() - if _, ok := tag.(names.MachineTag); !ok { - logger.Debugf("cannot uninstall non-machine agent %q", tag) - return nil - } - logger.Infof("marking agent ready for uninstall") - return ioutil.WriteFile(uninstallFile(a), nil, 0644) -} - -// CanUninstall returns true if the uninstall file exists in the agent's -// data dir. If it encounters an error, it fails safe and returns false. -func CanUninstall(a Agent) bool { - if _, err := os.Stat(uninstallFile(a)); err != nil { - logger.Debugf("agent not marked ready for uninstall") - return false - } - logger.Infof("agent already marked ready for uninstall") - return true -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/applicationoffers/client.go juju-core-2.6.5/src/github.com/juju/juju/api/applicationoffers/client.go --- juju-core-2.6.2/src/github.com/juju/juju/api/applicationoffers/client.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/applicationoffers/client.go 2019-06-28 17:10:43.000000000 +0000 @@ -195,7 +195,7 @@ // ApplicationOffer returns offered remote application details for a given URL. func (c *Client) ApplicationOffer(urlStr string) (*crossmodel.ApplicationOfferDetails, error) { - url, err := crossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { return nil, errors.Trace(err) } @@ -254,8 +254,7 @@ // GetConsumeDetails returns details necessary to consue an offer at a given URL. func (c *Client) GetConsumeDetails(urlStr string) (params.ConsumeOfferDetails, error) { - - url, err := crossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { return params.ConsumeOfferDetails{}, errors.Trace(err) } @@ -301,7 +300,7 @@ OfferURLs: make([]string, len(offerURLs)), } for i, url := range offerURLs { - if _, err := crossmodel.ParseOfferURL(url); err != nil { + if _, err := charm.ParseOfferURL(url); err != nil { return errors.Trace(err) } args.OfferURLs[i] = url diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/caasunitprovisioner/client.go juju-core-2.6.5/src/github.com/juju/juju/api/caasunitprovisioner/client.go --- juju-core-2.6.2/src/github.com/juju/juju/api/caasunitprovisioner/client.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/caasunitprovisioner/client.go 2019-06-28 17:10:43.000000000 +0000 @@ -291,6 +291,9 @@ if result.Results[0].Error == nil { return nil } + if params.IsCodeForbidden(result.Results[0].Error) { + return errors.NewForbidden(result.Results[0].Error, "") + } return maybeNotFound(result.Results[0].Error) } @@ -308,6 +311,9 @@ if result.Results[0].Error == nil { return nil } + if params.IsCodeForbidden(result.Results[0].Error) { + return errors.NewForbidden(result.Results[0].Error, "") + } return maybeNotFound(result.Results[0].Error) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/facadeversions.go juju-core-2.6.5/src/github.com/juju/juju/api/facadeversions.go --- juju-core-2.6.2/src/github.com/juju/juju/api/facadeversions.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/facadeversions.go 2019-06-28 17:10:43.000000000 +0000 @@ -23,7 +23,7 @@ "ApplicationScaler": 1, "Backups": 2, "Block": 2, - "Bundle": 2, + "Bundle": 3, "CAASAgent": 1, "CAASFirewaller": 1, "CAASOperator": 1, @@ -53,7 +53,7 @@ "ImageManager": 2, "ImageMetadata": 3, "ImageMetadataManager": 1, - "InstanceMutater": 1, + "InstanceMutater": 2, "InstancePoller": 3, "KeyManager": 1, "KeyUpdater": 1, @@ -75,7 +75,7 @@ "MigrationStatusWatcher": 1, "MigrationTarget": 1, "ModelConfig": 2, - "ModelGeneration": 1, + "ModelGeneration": 2, "ModelManager": 7, "ModelUpgrader": 1, "NotifyWatcher": 1, @@ -106,6 +106,7 @@ "Uniter": 12, "Upgrader": 1, "UpgradeSeries": 1, + "UpgradeSteps": 1, "UserManager": 2, "VolumeAttachmentsWatcher": 2, "VolumeAttachmentPlansWatcher": 1, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/instancemutater.go juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/instancemutater.go --- juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/instancemutater.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/instancemutater.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,7 +20,7 @@ facade base.FacadeCaller } -// NewState creates a new provisioner facade using the input caller. +// NewState creates a new instance mutater facade using the input caller. func NewClient(caller base.APICaller) *Client { facadeCaller := base.NewFacadeCaller(caller, instanceMutaterFacade) return NewClientFromFacade(facadeCaller) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/machine.go juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/machine.go --- juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/machine.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/machine.go 2019-06-28 17:10:43.000000000 +0000 @@ -29,6 +29,9 @@ // CharmProfilingInfo returns info to update lxd profiles on the machine CharmProfilingInfo() (*UnitProfileInfo, error) + // ContainerType returns the container type for this machine. + ContainerType() (instance.ContainerType, error) + // SetCharmProfiles records the given slice of charm profile names. SetCharmProfiles([]string) error @@ -70,6 +73,20 @@ life params.Life } +// ContainerType implements MutaterMachine.ContainerType. +func (m *Machine) ContainerType() (instance.ContainerType, error) { + var result params.ContainerTypeResult + args := params.Entity{Tag: m.tag.String()} + err := m.facade.FacadeCall("ContainerType", args, &result) + if err != nil { + return "", err + } + if result.Error != nil { + return "", result.Error + } + return result.Type, nil +} + // InstanceId implements MutaterMachine.InstanceId. func (m *Machine) InstanceId() (string, error) { var results params.StringResults diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/mocks/machinemutater_mock.go juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/mocks/machinemutater_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/api/instancemutater/mocks/machinemutater_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/instancemutater/mocks/machinemutater_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,6 +8,7 @@ gomock "github.com/golang/mock/gomock" instancemutater "github.com/juju/juju/api/instancemutater" params "github.com/juju/juju/apiserver/params" + instance "github.com/juju/juju/core/instance" status "github.com/juju/juju/core/status" watcher "github.com/juju/juju/core/watcher" names_v2 "gopkg.in/juju/names.v2" @@ -50,6 +51,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CharmProfilingInfo", reflect.TypeOf((*MockMutaterMachine)(nil).CharmProfilingInfo)) } +// ContainerType mocks base method +func (m *MockMutaterMachine) ContainerType() (instance.ContainerType, error) { + ret := m.ctrl.Call(m, "ContainerType") + ret0, _ := ret[0].(instance.ContainerType) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerType indicates an expected call of ContainerType +func (mr *MockMutaterMachineMockRecorder) ContainerType() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerType", reflect.TypeOf((*MockMutaterMachine)(nil).ContainerType)) +} + // InstanceId mocks base method func (m *MockMutaterMachine) InstanceId() (string, error) { ret := m.ctrl.Call(m, "InstanceId") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/interface.go juju-core-2.6.5/src/github.com/juju/juju/api/interface.go --- juju-core-2.6.2/src/github.com/juju/juju/api/interface.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/interface.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,8 +20,6 @@ "gopkg.in/macaroon.v2-unstable" "github.com/juju/juju/api/base" - "github.com/juju/juju/api/charmrevisionupdater" - "github.com/juju/juju/api/cleaner" "github.com/juju/juju/api/instancepoller" "github.com/juju/juju/api/reboot" "github.com/juju/juju/api/unitassigner" @@ -306,7 +304,5 @@ Upgrader() *upgrader.State Reboot() (reboot.State, error) InstancePoller() *instancepoller.API - CharmRevisionUpdater() *charmrevisionupdater.State - Cleaner() *cleaner.API UnitAssigner() unitassigner.API } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/state.go juju-core-2.6.5/src/github.com/juju/juju/api/state.go --- juju-core-2.6.2/src/github.com/juju/juju/api/state.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/state.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,8 +19,6 @@ "gopkg.in/macaroon.v2-unstable" "github.com/juju/juju/api/base" - "github.com/juju/juju/api/charmrevisionupdater" - "github.com/juju/juju/api/cleaner" "github.com/juju/juju/api/instancepoller" "github.com/juju/juju/api/keyupdater" "github.com/juju/juju/api/reboot" @@ -323,16 +321,6 @@ return instancepoller.NewAPI(st) } -// CharmRevisionUpdater returns access to the CharmRevisionUpdater API -func (st *state) CharmRevisionUpdater() *charmrevisionupdater.State { - return charmrevisionupdater.NewState(st) -} - -// Cleaner returns a version of the state that provides access to the cleaner API -func (st *state) Cleaner() *cleaner.API { - return cleaner.NewAPI(st) -} - // ServerVersion holds the version of the API server that we are connected to. // It is possible that this version is Zero if the server does not report this // during login. The second result argument indicates if the version number is diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/uniter/unit_test.go juju-core-2.6.5/src/github.com/juju/juju/api/uniter/unit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/api/uniter/unit_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/uniter/unit_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -522,12 +522,16 @@ }) c.Assert(err, jc.ErrorIsNil) + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.Model.UUID()) + settings, err = s.apiUnit.ConfigSettings() c.Assert(err, jc.ErrorIsNil) c.Assert(settings, gc.DeepEquals, charm.Settings{ "blog-title": "superhero paparazzi", }) } + func (s *unitSuite) TestWatchConfigSettingsHash(c *gc.C) { // Make sure WatchConfigSettingsHash returns an error when // no charm URL is set, as its state counterpart does. @@ -542,20 +546,29 @@ wc := watchertest.NewStringsWatcherC(c, w, s.BackingState.StartSync) defer wc.AssertStops() - // Initial event - this is the sha-256 hash of an empty bson.D. - wc.AssertChange("e8d7e8dfff0eed1e77b15638581672f7b25ecc1163cc5fd5a52d29d51d096c00") + // See core/cache/hash.go for the hash implementation. + // This is a hash of the charm URL PLUS an empty map[string]interface{}. + wc.AssertChange("0affda4fb1eaa8df870459625aa93c85e9fd6fc5374ac69f509575d139032262") err = s.wordpressApplication.UpdateCharmConfig(model.GenerationMaster, charm.Settings{ "blog-title": "sauceror central", }) + + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.Model.UUID()) + c.Assert(err, jc.ErrorIsNil) - wc.AssertChange("7ed6151e9c3d5144faf0946d20c283c466b4885dded6a6122ff3fdac7ee2334f") + wc.AssertChange("bfeb5aee52e6dea59d9c2a0c35a4d7fffa690c7230b1dd66f16832e4094905ae") // Non-change is not reported. err = s.wordpressApplication.UpdateCharmConfig(model.GenerationMaster, charm.Settings{ "blog-title": "sauceror central", }) c.Assert(err, jc.ErrorIsNil) + + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.Model.UUID()) + wc.AssertNoChange() } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/package_test.go juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/package_test.go --- juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/package_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps_test + +import ( + "testing" + + gc "gopkg.in/check.v1" +) + +func TestPackage(t *testing.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/upgradesteps.go juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/upgradesteps.go --- juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/upgradesteps.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/upgradesteps.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps + +import ( + "github.com/juju/errors" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/base" + "github.com/juju/juju/apiserver/params" +) + +const upgradeStepsFacade = "UpgradeSteps" + +type Client struct { + facade base.FacadeCaller +} + +// NewState creates a new upgrade steps facade using the input caller. +func NewClient(caller base.APICaller) *Client { + facadeCaller := base.NewFacadeCaller(caller, upgradeStepsFacade) + return NewClientFromFacade(facadeCaller) +} + +// NewStateFromFacade creates a new upgrade steps facade using the input +// facade caller. +func NewClientFromFacade(facadeCaller base.FacadeCaller) *Client { + return &Client{ + facade: facadeCaller, + } +} + +// ResetKVMMachineModificationStatusIdle +func (c *Client) ResetKVMMachineModificationStatusIdle(tag names.Tag) error { + var result params.ErrorResult + arg := params.Entity{tag.String()} + err := c.facade.FacadeCall("ResetKVMMachineModificationStatusIdle", arg, &result) + if err != nil { + return errors.Trace(err) + } + if result.Error != nil { + return result.Error + } + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/upgradesteps_test.go juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/upgradesteps_test.go --- juju-core-2.6.2/src/github.com/juju/juju/api/upgradesteps/upgradesteps_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/api/upgradesteps/upgradesteps_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps_test + +import ( + "github.com/golang/mock/gomock" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/base/mocks" + "github.com/juju/juju/api/upgradesteps" + "github.com/juju/juju/apiserver/params" + jujutesting "github.com/juju/juju/testing" +) + +type upgradeStepsSuite struct { + jujutesting.BaseSuite + + tag names.Tag + arg params.Entity + + fCaller *mocks.MockFacadeCaller +} + +var _ = gc.Suite(&upgradeStepsSuite{}) + +func (s *upgradeStepsSuite) SetUpTest(c *gc.C) { + s.tag = names.NewMachineTag("0/kvm/0") + s.arg = params.Entity{Tag: s.tag.String()} + s.BaseSuite.SetUpTest(c) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdle(c *gc.C) { + defer s.setupMocks(c).Finish() + + s.expectResetKVMMachineModificationStatusIdleSuccess() + + client := upgradesteps.NewClientFromFacade(s.fCaller) + err := client.ResetKVMMachineModificationStatusIdle(s.tag) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdleError(c *gc.C) { + defer s.setupMocks(c).Finish() + + s.expectResetKVMMachineModificationStatusIdleError() + + client := upgradesteps.NewClientFromFacade(s.fCaller) + err := client.ResetKVMMachineModificationStatusIdle(s.tag) + c.Assert(err, gc.ErrorMatches, "did not find") +} + +func (s *upgradeStepsSuite) setupMocks(c *gc.C) *gomock.Controller { + ctrl := gomock.NewController(c) + s.fCaller = mocks.NewMockFacadeCaller(ctrl) + return ctrl +} + +func (s *upgradeStepsSuite) expectResetKVMMachineModificationStatusIdleSuccess() { + fExp := s.fCaller.EXPECT() + resultSource := params.ErrorResult{} + fExp.FacadeCall("ResetKVMMachineModificationStatusIdle", s.arg, gomock.Any()).SetArg(2, resultSource) +} + +func (s *upgradeStepsSuite) expectResetKVMMachineModificationStatusIdleError() { + fExp := s.fCaller.EXPECT() + resultSource := params.ErrorResult{ + Error: ¶ms.Error{ + Code: params.CodeNotFound, + Message: "did not find", + }, + } + fExp.FacadeCall("ResetKVMMachineModificationStatusIdle", s.arg, gomock.Any()).SetArg(2, resultSource) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/allfacades.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/allfacades.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/allfacades.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/allfacades.go 2019-06-28 17:10:43.000000000 +0000 @@ -41,6 +41,7 @@ "github.com/juju/juju/apiserver/facades/agent/uniter" "github.com/juju/juju/apiserver/facades/agent/upgrader" "github.com/juju/juju/apiserver/facades/agent/upgradeseries" + "github.com/juju/juju/apiserver/facades/agent/upgradesteps" "github.com/juju/juju/apiserver/facades/client/action" "github.com/juju/juju/apiserver/facades/client/annotations" // ModelUser Write "github.com/juju/juju/apiserver/facades/client/application" // ModelUser Write @@ -157,6 +158,7 @@ reg("Block", 2, block.NewAPI) reg("Bundle", 1, bundle.NewFacadeV1) reg("Bundle", 2, bundle.NewFacadeV2) + reg("Bundle", 3, bundle.NewFacadeV3) reg("CharmRevisionUpdater", 2, charmrevisionupdater.NewCharmRevisionUpdaterAPI) reg("Charms", 2, charms.NewFacade) reg("Cleaner", 2, cleaner.NewCleanerAPI) @@ -206,6 +208,7 @@ } reg("InstanceMutater", 1, instancemutater.NewFacadeV1) + reg("InstanceMutater", 2, instancemutater.NewFacadeV2) reg("InstancePoller", 3, instancepoller.NewFacade) reg("KeyManager", 1, keymanager.NewKeyManagerAPI) @@ -240,6 +243,7 @@ reg("ModelConfig", 1, modelconfig.NewFacadeV1) reg("ModelConfig", 2, modelconfig.NewFacadeV2) reg("ModelGeneration", 1, modelgeneration.NewModelGenerationFacade) + reg("ModelGeneration", 2, modelgeneration.NewModelGenerationFacadeV2) reg("ModelManager", 2, modelmanager.NewFacadeV2) reg("ModelManager", 3, modelmanager.NewFacadeV3) reg("ModelManager", 4, modelmanager.NewFacadeV4) @@ -307,6 +311,7 @@ reg("Upgrader", 1, upgrader.NewUpgraderFacade) reg("UpgradeSeries", 1, upgradeseries.NewAPI) + reg("UpgradeSteps", 1, upgradesteps.NewFacadeV1) reg("UserManager", 1, usermanager.NewUserManagerAPI) reg("UserManager", 2, usermanager.NewUserManagerAPI) // Adds ResetPassword diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/apiserver.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/apiserver.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/apiserver.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/apiserver.go 2019-06-28 17:10:43.000000000 +0000 @@ -541,6 +541,17 @@ } return rst, st, entity.Tag(), nil }, + ChangeAllowedFunc: func(req *http.Request) error { + st, err := httpCtxt.stateForRequestUnauthenticated(req) + if err != nil { + return errors.Trace(err) + } + blockChecker := common.NewBlockChecker(st) + if err := blockChecker.ChangeAllowed(); err != nil { + return errors.Trace(err) + } + return nil + }, } unitResourcesHandler := &UnitResourcesHandler{ NewOpener: func(req *http.Request, tagKinds ...string) (resource.Opener, state.PoolHelper, error) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/credentialcommon/modelcredential.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/credentialcommon/modelcredential.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/credentialcommon/modelcredential.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/credentialcommon/modelcredential.go 2019-06-28 17:10:43.000000000 +0000 @@ -130,7 +130,8 @@ machinesByInstance[string(instanceId)] = machine.Id() } - // Check can see all machines' instances + // Check that we can see all machines' instances regardless of their state as perceived by the cloud, i.e. + // this call will return all non-terminated instances. instances, err := provider.AllInstances(callCtx) if err != nil { return fail(errors.Trace(err)) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/crossmodel/interface.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/crossmodel/interface.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/crossmodel/interface.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/crossmodel/interface.go 2019-06-28 17:10:43.000000000 +0000 @@ -84,6 +84,9 @@ // FirewallRule returns the firewall rule for the specified service. FirewallRule(service state.WellKnownServiceType) (*state.FirewallRule, error) + + // ApplyOperation applies a model operation to the state. + ApplyOperation(op state.ModelOperation) error } // Relation provides access a relation in global state. @@ -239,4 +242,9 @@ // SetStatus sets the status of the remote application. SetStatus(info status.StatusInfo) error + + // TerminateOperation returns an operation that will set this + // remote application to terminated and leave it in a state + // enabling it to be removed cleanly. + TerminateOperation(string) state.ModelOperation } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/errors.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/errors.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/errors.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/errors.go 2019-06-28 17:10:43.000000000 +0000 @@ -272,6 +272,8 @@ code = params.CodeMethodNotAllowed case errors.IsNotImplemented(err): code = params.CodeNotImplemented + case errors.IsForbidden(err): + code = params.CodeForbidden case state.IsIncompatibleSeriesError(err): code = params.CodeIncompatibleSeries case IsDischargeRequiredError(err): diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modeldestroy.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modeldestroy.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modeldestroy.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modeldestroy.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/errors" "github.com/juju/juju/apiserver/facades/agent/metricsender" + "github.com/juju/juju/core/status" "github.com/juju/juju/state" ) @@ -109,8 +110,19 @@ if err != nil { return errors.Trace(err) } + notForcing := args.Force == nil || !*args.Force + if notForcing { + // If model status is suspended, then model's cloud credential is invalid. + modelStatus, err := model.Status() + if err != nil { + return errors.Trace(err) + } + if modelStatus.Status == status.Suspended { + return errors.Errorf("invalid cloud credential, use --force") + } + } if err := model.Destroy(args); err != nil { - if args.Force == nil || !*args.Force { + if notForcing { return errors.Trace(err) } logger.Warningf("failed destroying model %v: %v", model.UUID(), err) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modeldestroy_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modeldestroy_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modeldestroy_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modeldestroy_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,6 +14,7 @@ "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/facades/agent/metricsender" + "github.com/juju/juju/core/status" "github.com/juju/juju/state" "github.com/juju/juju/testing" ) @@ -33,8 +34,8 @@ otherModelTag := names.NewModelTag("deadbeef-0bad-400d-8000-4b1d0d06f33d") s.modelManager = &mockModelManager{ models: []*mockModel{ - {tag: testing.ModelTag}, - {tag: otherModelTag}, + {tag: testing.ModelTag, currentStatus: status.StatusInfo{Status: status.Available}}, + {tag: otherModelTag, currentStatus: status.StatusInfo{Status: status.Available}}, }, } s.metricSender = &testMetricSender{} @@ -84,13 +85,17 @@ {"Model", nil}, }) - s.modelManager.models[0].CheckCalls(c, []jtesting.StubCall{ - {"Destroy", []interface{}{state.DestroyModelParams{ - DestroyStorage: destroyStorage, - Force: force, - MaxWait: common.MaxWait(maxWait), - }}}, - }) + expectedModelCalls := []jtesting.StubCall{{"Destroy", []interface{}{state.DestroyModelParams{ + DestroyStorage: destroyStorage, + Force: force, + MaxWait: common.MaxWait(maxWait), + }}}} + notForcing := force == nil || !*force + if notForcing { + // We expect to check model status. + expectedModelCalls = append([]jtesting.StubCall{{"Status", nil}}, expectedModelCalls...) + } + s.modelManager.models[0].CheckCalls(c, expectedModelCalls) } func (s *destroyModelSuite) TestDestroyModelBlocked(c *gc.C) { @@ -121,6 +126,7 @@ {"Model", nil}, }) s.modelManager.models[0].CheckCalls(c, []jtesting.StubCall{ + {"Status", nil}, {"Destroy", []interface{}{state.DestroyModelParams{}}}, }) } @@ -138,6 +144,7 @@ {"Model", nil}, }) s.modelManager.models[0].CheckCalls(c, []jtesting.StubCall{ + {"Status", nil}, {"Destroy", []interface{}{state.DestroyModelParams{ DestroyStorage: &destroyStorage, }}}, @@ -168,6 +175,7 @@ {"Model", nil}, }) s.modelManager.models[0].CheckCalls(c, []jtesting.StubCall{ + {"Status", nil}, {"Destroy", []interface{}{state.DestroyModelParams{ DestroyHostedModels: true, }}}, @@ -206,6 +214,19 @@ c.Assert(err, gc.ErrorMatches, "I have a problem") } +func (s *destroyModelSuite) TestDestroyModelWithInvalidCredentialWithoutForce(c *gc.C) { + s.modelManager.models[0].currentStatus = status.StatusInfo{Status: status.Suspended} + + err := common.DestroyModel(s.modelManager, nil, nil, nil) + c.Assert(err, gc.ErrorMatches, "invalid cloud credential, use --force") +} + +func (s *destroyModelSuite) TestDestroyModelWithInvalidCredentialWithForce(c *gc.C) { + s.modelManager.models[0].currentStatus = status.StatusInfo{Status: status.Suspended} + true_ := true + s.testDestroyModel(c, nil, &true_, nil) +} + type testMetricSender struct { jtesting.Stub } @@ -268,7 +289,8 @@ type mockModel struct { common.Model jtesting.Stub - tag names.ModelTag + tag names.ModelTag + currentStatus status.StatusInfo } func (m *mockModel) ModelTag() names.ModelTag { @@ -283,3 +305,8 @@ m.MethodCall(m, "Destroy", args) return m.NextErr() } + +func (m *mockModel) Status() (status.StatusInfo, error) { + m.MethodCall(m, "Status") + return m.currentStatus, m.NextErr() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modelmanagerinterface.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modelmanagerinterface.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/modelmanagerinterface.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/modelmanagerinterface.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,6 +14,7 @@ "github.com/juju/juju/core/status" "github.com/juju/juju/environs" "github.com/juju/juju/environs/config" + "github.com/juju/juju/network" "github.com/juju/juju/permission" "github.com/juju/juju/state" ) @@ -111,12 +112,21 @@ *state.State model *state.Model pool *state.StatePool + user names.UserTag } // NewModelManagerBackend returns a modelManagerStateShim wrapping the passed // state, which implements ModelManagerBackend. func NewModelManagerBackend(m *state.Model, pool *state.StatePool) ModelManagerBackend { - return modelManagerStateShim{m.State(), m, pool} + return modelManagerStateShim{m.State(), m, pool, names.UserTag{}} +} + +// NewUserAwareModelManagerBackend returns a user-aware modelManagerStateShim +// wrapping the passed state, which implements ModelManagerBackend. The +// returned backend may emit redirect errors when attempting a model lookup for +// a migrated model that this user had been granted access to. +func NewUserAwareModelManagerBackend(m *state.Model, pool *state.StatePool, u names.UserTag) ModelManagerBackend { + return modelManagerStateShim{m.State(), m, pool, u} } // NewModel implements ModelManagerBackend. @@ -126,7 +136,7 @@ if err != nil { return nil, nil, err } - return modelShim{otherModel}, modelManagerStateShim{otherState, otherModel, st.pool}, nil + return modelShim{otherModel}, modelManagerStateShim{otherState, otherModel, st.pool, st.user}, nil } func (st modelManagerStateShim) ModelConfigDefaultValues(cloudName string) (config.ModelDefaultAttributes, error) { @@ -151,10 +161,39 @@ } otherModel, err := otherState.Model() if err != nil { - otherState.Release() - return nil, nil, err + defer otherState.Release() + if !errors.IsNotFound(err) || st.user.Id() == "" { + return nil, nil, err + } + + // Check if this model has been migrated and this user had + // access to it before its migration. + mig, mErr := otherState.LatestRemovedModelMigration() + if mErr != nil && !errors.IsNotFound(mErr) { + return nil, nil, errors.Trace(mErr) + } + + if mig == nil || mig.ModelUserAccess(st.user) == permission.NoAccess { + return nil, nil, errors.Trace(err) // return original NotFound error + } + + target, mErr := mig.TargetInfo() + if mErr != nil { + return nil, nil, errors.Trace(mErr) + } + + hps, mErr := network.ParseHostPorts(target.Addrs...) + if mErr != nil { + return nil, nil, errors.Trace(mErr) + } + + return nil, nil, &RedirectError{ + Servers: [][]network.HostPort{hps}, + CACert: target.CACert, + ControllerAlias: target.ControllerAlias, + } } - return modelManagerStateShim{otherState.State, otherModel, st.pool}, otherState.Release, nil + return modelManagerStateShim{otherState.State, otherModel, st.pool, st.user}, otherState.Release, nil } // GetModel implements ModelManagerBackend. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/unitstatus.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/unitstatus.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/common/unitstatus.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/common/unitstatus.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,7 +36,6 @@ func (c *ModelPresenceContext) UnitStatus(unit UnitStatusGetter) (agent StatusAndErr, workload StatusAndErr) { agent.Status, agent.Err = unit.AgentStatus() workload.Status, workload.Err = unit.Status() - if !canBeLost(agent.Status, workload.Status) { // The unit is allocating or installing - there's no point in // enquiring about the agent liveness. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/debuglog_db.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/debuglog_db.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/debuglog_db.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/debuglog_db.go 2019-06-28 17:10:43.000000000 +0000 @@ -78,7 +78,7 @@ func formatLogRecord(r *state.LogRecord) *params.LogMessage { return ¶ms.LogMessage{ - Entity: r.Entity.String(), + Entity: r.Entity, Timestamp: r.Time, Severity: r.Level.String(), Module: r.Module, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/debuglog_db_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/debuglog_db_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/debuglog_db_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/debuglog_db_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,7 +10,6 @@ "github.com/juju/loggo" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/state" @@ -96,7 +95,7 @@ tailer := newFakeLogTailer() tailer.logsCh <- &state.LogRecord{ Time: time.Date(2015, 6, 19, 15, 34, 37, 0, time.UTC), - Entity: names.NewMachineTag("99"), + Entity: "machine-99", Module: "some.where", Location: "code.go:42", Level: loggo.INFO, @@ -104,7 +103,7 @@ } tailer.logsCh <- &state.LogRecord{ Time: time.Date(2015, 6, 19, 15, 36, 40, 0, time.UTC), - Entity: names.NewUnitTag("foo/2"), + Entity: "unit-foo-2", Module: "else.where", Location: "go.go:22", Level: loggo.ERROR, @@ -146,7 +145,7 @@ for i := 0; i < 5; i++ { tailer.logsCh <- &state.LogRecord{ Time: time.Date(2015, 6, 19, 15, 34, 37, 0, time.UTC), - Entity: names.NewMachineTag("99"), + Entity: "machine-99", Module: "some.where", Location: "code.go:42", Level: loggo.INFO, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater.go 2019-06-28 17:10:43.000000000 +0000 @@ -16,7 +16,6 @@ "github.com/juju/juju/core/status" ) -//go:generate mockgen -package mocks -destination mocks/facade_mock.go github.com/juju/juju/apiserver/facade Context,Resources,Authorizer //go:generate mockgen -package mocks -destination mocks/instancemutater_mock.go github.com/juju/juju/apiserver/facades/agent/instancemutater InstanceMutaterState,Machine,LXDProfile //go:generate mockgen -package mocks -destination mocks/modelcache_mock.go github.com/juju/juju/apiserver/facades/agent/instancemutater ModelCache,ModelCacheMachine,ModelCacheApplication,ModelCacheUnit,ModelCacheCharm //go:generate mockgen -package mocks -destination mocks/state_mock.go github.com/juju/juju/state EntityFinder,Entity,Lifer @@ -35,6 +34,18 @@ WatchLXDProfileVerificationNeeded(args params.Entities) (params.NotifyWatchResults, error) } +// InstanceMutaterV2 defines the methods on the instance mutater API facade, version 2. +type InstanceMutaterV2 interface { + Life(args params.Entities) (params.LifeResults, error) + + CharmProfilingInfo(arg params.Entity) (params.CharmProfilingInfoResult, error) + ContainerType(arg params.Entity) (params.ContainerTypeResult, error) + SetCharmProfiles(args params.SetProfileArgs) (params.ErrorResults, error) + SetModificationStatus(args params.SetStatus) (params.ErrorResults, error) + WatchMachines() (params.StringsWatchResult, error) + WatchLXDProfileVerificationNeeded(args params.Entities) (params.NotifyWatchResults, error) +} + type InstanceMutaterAPI struct { *common.LifeGetter @@ -45,13 +56,18 @@ getAuthFunc common.GetAuthFunc } +type InstanceMutaterAPIV1 struct { + *InstanceMutaterAPI +} + // using apiserver/facades/client/cloud as an example. var ( - _ InstanceMutaterV1 = (*InstanceMutaterAPI)(nil) + _ InstanceMutaterV2 = (*InstanceMutaterAPI)(nil) + _ InstanceMutaterV1 = (*InstanceMutaterAPIV1)(nil) ) -// NewFacadeV1 is used for API registration. -func NewFacadeV1(ctx facade.Context) (*InstanceMutaterAPI, error) { +// NewFacadeV2 is used for API registration. +func NewFacadeV2(ctx facade.Context) (*InstanceMutaterAPI, error) { st := &instanceMutaterStateShim{State: ctx.State()} model, err := ctx.Controller().Model(st.ModelUUID()) @@ -63,6 +79,15 @@ return NewInstanceMutaterAPI(st, modelCache, ctx.Resources(), ctx.Auth()) } +// NewFacadeV1 is used for API registration. +func NewFacadeV1(ctx facade.Context) (*InstanceMutaterAPIV1, error) { + v2, err := NewFacadeV2(ctx) + if err != nil { + return nil, err + } + return &InstanceMutaterAPIV1{v2}, nil +} + // NewInstanceMutaterAPI creates a new API server endpoint for managing // charm profiles on juju lxd machines and containers. func NewInstanceMutaterAPI(st InstanceMutaterState, @@ -121,6 +146,27 @@ return result, nil } +// ContainerType returns the container type of a machine. +func (api *InstanceMutaterAPI) ContainerType(arg params.Entity) (params.ContainerTypeResult, error) { + result := params.ContainerTypeResult{} + canAccess, err := api.getAuthFunc() + if err != nil { + return result, errors.Trace(err) + } + tag, err := names.ParseMachineTag(arg.Tag) + if err != nil { + result.Error = common.ServerError(common.ErrPerm) + return result, nil + } + m, err := api.getCacheMachine(canAccess, tag) + if err != nil { + result.Error = common.ServerError(err) + return result, nil + } + result.Type = m.ContainerType() + return result, nil +} + // SetModificationStatus updates the instance whilst changes are occurring. This // is different from SetStatus and SetInstanceStatus, by the fact this holds // information about the ongoing changes that are happening to instances. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/instancemutater_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,6 +14,7 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/common" + facademocks "github.com/juju/juju/apiserver/facade/mocks" "github.com/juju/juju/apiserver/facades/agent/instancemutater" "github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks" "github.com/juju/juju/apiserver/params" @@ -27,12 +28,12 @@ type instanceMutaterAPISuite struct { coretesting.IsolationSuite - authorizer *mocks.MockAuthorizer + authorizer *facademocks.MockAuthorizer entity *mocks.MockEntity lifer *mocks.MockLifer state *mocks.MockInstanceMutaterState model *mocks.MockModelCache - resources *mocks.MockResources + resources *facademocks.MockResources machineTag names.Tag notifyDone chan struct{} @@ -50,12 +51,12 @@ func (s *instanceMutaterAPISuite) setup(c *gc.C) *gomock.Controller { ctrl := gomock.NewController(c) - s.authorizer = mocks.NewMockAuthorizer(ctrl) + s.authorizer = facademocks.NewMockAuthorizer(ctrl) s.entity = mocks.NewMockEntity(ctrl) s.lifer = mocks.NewMockLifer(ctrl) s.state = mocks.NewMockInstanceMutaterState(ctrl) s.model = mocks.NewMockModelCache(ctrl) - s.resources = mocks.NewMockResources(ctrl) + s.resources = facademocks.NewMockResources(ctrl) return ctrl } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/interface.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/interface.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/interface.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/interface.go 2019-06-28 17:10:43.000000000 +0000 @@ -53,6 +53,7 @@ type ModelCacheMachine interface { InstanceId() (instance.Id, error) CharmProfiles() []string + ContainerType() instance.ContainerType WatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error) WatchContainers() (cache.StringsWatcher, error) Units() ([]ModelCacheUnit, error) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/facade_mock.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/facade_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/facade_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/facade_mock.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,415 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/juju/juju/apiserver/facade (interfaces: Context,Resources,Authorizer) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - gomock "github.com/golang/mock/gomock" - facade "github.com/juju/juju/apiserver/facade" - cache "github.com/juju/juju/core/cache" - leadership "github.com/juju/juju/core/leadership" - lease "github.com/juju/juju/core/lease" - permission "github.com/juju/juju/permission" - state "github.com/juju/juju/state" - names_v2 "gopkg.in/juju/names.v2" - reflect "reflect" -) - -// MockContext is a mock of Context interface -type MockContext struct { - ctrl *gomock.Controller - recorder *MockContextMockRecorder -} - -// MockContextMockRecorder is the mock recorder for MockContext -type MockContextMockRecorder struct { - mock *MockContext -} - -// NewMockContext creates a new mock instance -func NewMockContext(ctrl *gomock.Controller) *MockContext { - mock := &MockContext{ctrl: ctrl} - mock.recorder = &MockContextMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockContext) EXPECT() *MockContextMockRecorder { - return m.recorder -} - -// Auth mocks base method -func (m *MockContext) Auth() facade.Authorizer { - ret := m.ctrl.Call(m, "Auth") - ret0, _ := ret[0].(facade.Authorizer) - return ret0 -} - -// Auth indicates an expected call of Auth -func (mr *MockContextMockRecorder) Auth() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Auth", reflect.TypeOf((*MockContext)(nil).Auth)) -} - -// Controller mocks base method -func (m *MockContext) Controller() *cache.Controller { - ret := m.ctrl.Call(m, "Controller") - ret0, _ := ret[0].(*cache.Controller) - return ret0 -} - -// Controller indicates an expected call of Controller -func (mr *MockContextMockRecorder) Controller() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Controller", reflect.TypeOf((*MockContext)(nil).Controller)) -} - -// Dispose mocks base method -func (m *MockContext) Dispose() { - m.ctrl.Call(m, "Dispose") -} - -// Dispose indicates an expected call of Dispose -func (mr *MockContextMockRecorder) Dispose() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dispose", reflect.TypeOf((*MockContext)(nil).Dispose)) -} - -// Hub mocks base method -func (m *MockContext) Hub() facade.Hub { - ret := m.ctrl.Call(m, "Hub") - ret0, _ := ret[0].(facade.Hub) - return ret0 -} - -// Hub indicates an expected call of Hub -func (mr *MockContextMockRecorder) Hub() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Hub", reflect.TypeOf((*MockContext)(nil).Hub)) -} - -// ID mocks base method -func (m *MockContext) ID() string { - ret := m.ctrl.Call(m, "ID") - ret0, _ := ret[0].(string) - return ret0 -} - -// ID indicates an expected call of ID -func (mr *MockContextMockRecorder) ID() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockContext)(nil).ID)) -} - -// LeadershipChecker mocks base method -func (m *MockContext) LeadershipChecker() (leadership.Checker, error) { - ret := m.ctrl.Call(m, "LeadershipChecker") - ret0, _ := ret[0].(leadership.Checker) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LeadershipChecker indicates an expected call of LeadershipChecker -func (mr *MockContextMockRecorder) LeadershipChecker() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeadershipChecker", reflect.TypeOf((*MockContext)(nil).LeadershipChecker)) -} - -// LeadershipClaimer mocks base method -func (m *MockContext) LeadershipClaimer(arg0 string) (leadership.Claimer, error) { - ret := m.ctrl.Call(m, "LeadershipClaimer", arg0) - ret0, _ := ret[0].(leadership.Claimer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LeadershipClaimer indicates an expected call of LeadershipClaimer -func (mr *MockContextMockRecorder) LeadershipClaimer(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeadershipClaimer", reflect.TypeOf((*MockContext)(nil).LeadershipClaimer), arg0) -} - -// LeadershipPinner mocks base method -func (m *MockContext) LeadershipPinner(arg0 string) (leadership.Pinner, error) { - ret := m.ctrl.Call(m, "LeadershipPinner", arg0) - ret0, _ := ret[0].(leadership.Pinner) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LeadershipPinner indicates an expected call of LeadershipPinner -func (mr *MockContextMockRecorder) LeadershipPinner(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeadershipPinner", reflect.TypeOf((*MockContext)(nil).LeadershipPinner), arg0) -} - -// LeadershipReader mocks base method -func (m *MockContext) LeadershipReader(arg0 string) (leadership.Reader, error) { - ret := m.ctrl.Call(m, "LeadershipReader", arg0) - ret0, _ := ret[0].(leadership.Reader) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LeadershipReader indicates an expected call of LeadershipReader -func (mr *MockContextMockRecorder) LeadershipReader(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeadershipReader", reflect.TypeOf((*MockContext)(nil).LeadershipReader), arg0) -} - -// Presence mocks base method -func (m *MockContext) Presence() facade.Presence { - ret := m.ctrl.Call(m, "Presence") - ret0, _ := ret[0].(facade.Presence) - return ret0 -} - -// Presence indicates an expected call of Presence -func (mr *MockContextMockRecorder) Presence() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Presence", reflect.TypeOf((*MockContext)(nil).Presence)) -} - -// Resources mocks base method -func (m *MockContext) Resources() facade.Resources { - ret := m.ctrl.Call(m, "Resources") - ret0, _ := ret[0].(facade.Resources) - return ret0 -} - -// Resources indicates an expected call of Resources -func (mr *MockContextMockRecorder) Resources() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resources", reflect.TypeOf((*MockContext)(nil).Resources)) -} - -// SingularClaimer mocks base method -func (m *MockContext) SingularClaimer() (lease.Claimer, error) { - ret := m.ctrl.Call(m, "SingularClaimer") - ret0, _ := ret[0].(lease.Claimer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SingularClaimer indicates an expected call of SingularClaimer -func (mr *MockContextMockRecorder) SingularClaimer() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SingularClaimer", reflect.TypeOf((*MockContext)(nil).SingularClaimer)) -} - -// State mocks base method -func (m *MockContext) State() *state.State { - ret := m.ctrl.Call(m, "State") - ret0, _ := ret[0].(*state.State) - return ret0 -} - -// State indicates an expected call of State -func (mr *MockContextMockRecorder) State() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "State", reflect.TypeOf((*MockContext)(nil).State)) -} - -// StatePool mocks base method -func (m *MockContext) StatePool() *state.StatePool { - ret := m.ctrl.Call(m, "StatePool") - ret0, _ := ret[0].(*state.StatePool) - return ret0 -} - -// StatePool indicates an expected call of StatePool -func (mr *MockContextMockRecorder) StatePool() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatePool", reflect.TypeOf((*MockContext)(nil).StatePool)) -} - -// MockResources is a mock of Resources interface -type MockResources struct { - ctrl *gomock.Controller - recorder *MockResourcesMockRecorder -} - -// MockResourcesMockRecorder is the mock recorder for MockResources -type MockResourcesMockRecorder struct { - mock *MockResources -} - -// NewMockResources creates a new mock instance -func NewMockResources(ctrl *gomock.Controller) *MockResources { - mock := &MockResources{ctrl: ctrl} - mock.recorder = &MockResourcesMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockResources) EXPECT() *MockResourcesMockRecorder { - return m.recorder -} - -// Get mocks base method -func (m *MockResources) Get(arg0 string) facade.Resource { - ret := m.ctrl.Call(m, "Get", arg0) - ret0, _ := ret[0].(facade.Resource) - return ret0 -} - -// Get indicates an expected call of Get -func (mr *MockResourcesMockRecorder) Get(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockResources)(nil).Get), arg0) -} - -// Register mocks base method -func (m *MockResources) Register(arg0 facade.Resource) string { - ret := m.ctrl.Call(m, "Register", arg0) - ret0, _ := ret[0].(string) - return ret0 -} - -// Register indicates an expected call of Register -func (mr *MockResourcesMockRecorder) Register(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockResources)(nil).Register), arg0) -} - -// Stop mocks base method -func (m *MockResources) Stop(arg0 string) error { - ret := m.ctrl.Call(m, "Stop", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Stop indicates an expected call of Stop -func (mr *MockResourcesMockRecorder) Stop(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockResources)(nil).Stop), arg0) -} - -// MockAuthorizer is a mock of Authorizer interface -type MockAuthorizer struct { - ctrl *gomock.Controller - recorder *MockAuthorizerMockRecorder -} - -// MockAuthorizerMockRecorder is the mock recorder for MockAuthorizer -type MockAuthorizerMockRecorder struct { - mock *MockAuthorizer -} - -// NewMockAuthorizer creates a new mock instance -func NewMockAuthorizer(ctrl *gomock.Controller) *MockAuthorizer { - mock := &MockAuthorizer{ctrl: ctrl} - mock.recorder = &MockAuthorizerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockAuthorizer) EXPECT() *MockAuthorizerMockRecorder { - return m.recorder -} - -// AuthApplicationAgent mocks base method -func (m *MockAuthorizer) AuthApplicationAgent() bool { - ret := m.ctrl.Call(m, "AuthApplicationAgent") - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthApplicationAgent indicates an expected call of AuthApplicationAgent -func (mr *MockAuthorizerMockRecorder) AuthApplicationAgent() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthApplicationAgent", reflect.TypeOf((*MockAuthorizer)(nil).AuthApplicationAgent)) -} - -// AuthClient mocks base method -func (m *MockAuthorizer) AuthClient() bool { - ret := m.ctrl.Call(m, "AuthClient") - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthClient indicates an expected call of AuthClient -func (mr *MockAuthorizerMockRecorder) AuthClient() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthClient", reflect.TypeOf((*MockAuthorizer)(nil).AuthClient)) -} - -// AuthController mocks base method -func (m *MockAuthorizer) AuthController() bool { - ret := m.ctrl.Call(m, "AuthController") - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthController indicates an expected call of AuthController -func (mr *MockAuthorizerMockRecorder) AuthController() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthController", reflect.TypeOf((*MockAuthorizer)(nil).AuthController)) -} - -// AuthMachineAgent mocks base method -func (m *MockAuthorizer) AuthMachineAgent() bool { - ret := m.ctrl.Call(m, "AuthMachineAgent") - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthMachineAgent indicates an expected call of AuthMachineAgent -func (mr *MockAuthorizerMockRecorder) AuthMachineAgent() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthMachineAgent", reflect.TypeOf((*MockAuthorizer)(nil).AuthMachineAgent)) -} - -// AuthOwner mocks base method -func (m *MockAuthorizer) AuthOwner(arg0 names_v2.Tag) bool { - ret := m.ctrl.Call(m, "AuthOwner", arg0) - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthOwner indicates an expected call of AuthOwner -func (mr *MockAuthorizerMockRecorder) AuthOwner(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthOwner", reflect.TypeOf((*MockAuthorizer)(nil).AuthOwner), arg0) -} - -// AuthUnitAgent mocks base method -func (m *MockAuthorizer) AuthUnitAgent() bool { - ret := m.ctrl.Call(m, "AuthUnitAgent") - ret0, _ := ret[0].(bool) - return ret0 -} - -// AuthUnitAgent indicates an expected call of AuthUnitAgent -func (mr *MockAuthorizerMockRecorder) AuthUnitAgent() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthUnitAgent", reflect.TypeOf((*MockAuthorizer)(nil).AuthUnitAgent)) -} - -// ConnectedModel mocks base method -func (m *MockAuthorizer) ConnectedModel() string { - ret := m.ctrl.Call(m, "ConnectedModel") - ret0, _ := ret[0].(string) - return ret0 -} - -// ConnectedModel indicates an expected call of ConnectedModel -func (mr *MockAuthorizerMockRecorder) ConnectedModel() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectedModel", reflect.TypeOf((*MockAuthorizer)(nil).ConnectedModel)) -} - -// GetAuthTag mocks base method -func (m *MockAuthorizer) GetAuthTag() names_v2.Tag { - ret := m.ctrl.Call(m, "GetAuthTag") - ret0, _ := ret[0].(names_v2.Tag) - return ret0 -} - -// GetAuthTag indicates an expected call of GetAuthTag -func (mr *MockAuthorizerMockRecorder) GetAuthTag() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthTag", reflect.TypeOf((*MockAuthorizer)(nil).GetAuthTag)) -} - -// HasPermission mocks base method -func (m *MockAuthorizer) HasPermission(arg0 permission.Access, arg1 names_v2.Tag) (bool, error) { - ret := m.ctrl.Call(m, "HasPermission", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// HasPermission indicates an expected call of HasPermission -func (mr *MockAuthorizerMockRecorder) HasPermission(arg0, arg1 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasPermission", reflect.TypeOf((*MockAuthorizer)(nil).HasPermission), arg0, arg1) -} - -// UserHasPermission mocks base method -func (m *MockAuthorizer) UserHasPermission(arg0 names_v2.UserTag, arg1 permission.Access, arg2 names_v2.Tag) (bool, error) { - ret := m.ctrl.Call(m, "UserHasPermission", arg0, arg1, arg2) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// UserHasPermission indicates an expected call of UserHasPermission -func (mr *MockAuthorizerMockRecorder) UserHasPermission(arg0, arg1, arg2 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserHasPermission", reflect.TypeOf((*MockAuthorizer)(nil).UserHasPermission), arg0, arg1, arg2) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/modelcache_mock.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/modelcache_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/modelcache_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/mocks/modelcache_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -135,6 +135,18 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CharmProfiles", reflect.TypeOf((*MockModelCacheMachine)(nil).CharmProfiles)) } +// ContainerType mocks base method +func (m *MockModelCacheMachine) ContainerType() instance.ContainerType { + ret := m.ctrl.Call(m, "ContainerType") + ret0, _ := ret[0].(instance.ContainerType) + return ret0 +} + +// ContainerType indicates an expected call of ContainerType +func (mr *MockModelCacheMachineMockRecorder) ContainerType() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerType", reflect.TypeOf((*MockModelCacheMachine)(nil).ContainerType)) +} + // InstanceId mocks base method func (m *MockModelCacheMachine) InstanceId() (instance.Id, error) { ret := m.ctrl.Call(m, "InstanceId") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/shim.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/shim.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/shim.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/instancemutater/shim.go 2019-06-28 17:10:43.000000000 +0000 @@ -28,7 +28,7 @@ return nil, err } return &modelCacheCharm{ - Charm: ch, + Charm: &ch, }, nil } @@ -53,7 +53,7 @@ } type modelCacheMachine struct { - *cache.Machine + cache.Machine } func (m *modelCacheMachine) WatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error) { @@ -83,9 +83,9 @@ } type modelCacheUnit struct { - *cache.Unit + cache.Unit } type modelCacheApplication struct { - *cache.Application + cache.Application } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/logger/logger_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/logger/logger_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/logger/logger_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/logger/logger_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,8 +4,6 @@ package logger_test import ( - "time" - jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" @@ -21,7 +19,6 @@ "github.com/juju/juju/core/cache/cachetest" "github.com/juju/juju/state" statetesting "github.com/juju/juju/state/testing" - "github.com/juju/juju/testing" ) type loggerSuite struct { @@ -34,11 +31,8 @@ resources *common.Resources authorizer apiservertesting.FakeAuthorizer - change cache.ModelChange - changes chan interface{} - controller *cache.Controller - events chan interface{} - capture func(change interface{}) + ctrl *cachetest.TestController + capture func(change interface{}) } var _ = gc.Suite(&loggerSuite{}) @@ -58,44 +52,17 @@ Tag: s.rawMachine.Tag(), } - s.events = make(chan interface{}) - notify := func(change interface{}) { - send := false - switch change.(type) { - case cache.ModelChange: - send = true - case cache.RemoveModel: - send = true - default: - // no-op - } - if send { - c.Logf("sending %#v", change) - select { - case s.events <- change: - case <-time.After(testing.LongWait): - c.Fatalf("change not processed by test") - } - } - } + s.ctrl = cachetest.NewTestController(cachetest.ModelEvents) + s.ctrl.Init(c) + s.AddCleanup(func(c *gc.C) { workertest.CleanKill(c, s.ctrl.Controller) }) - s.changes = make(chan interface{}) - controller, err := cache.NewController(cache.ControllerConfig{ - Changes: s.changes, - Notify: notify, - }) - c.Assert(err, jc.ErrorIsNil) - s.controller = controller - s.AddCleanup(func(c *gc.C) { workertest.CleanKill(c, s.controller) }) // Add the current model to the controller. - s.change = cachetest.ModelChangeFromState(c, s.State) - s.changes <- s.change - // Ensure it is processed before we create the logger api. - select { - case <-s.events: - case <-time.After(testing.LongWait): - c.Fatalf("change not processed by test") - } + m := cachetest.ModelChangeFromState(c, s.State) + s.ctrl.SendChange(m) + + // Ensure it is processed before we create the logger API. + _ = s.ctrl.NextChange(c) + s.logger, err = s.makeLoggerAPI(s.authorizer) c.Assert(err, jc.ErrorIsNil) } @@ -103,7 +70,7 @@ func (s *loggerSuite) makeLoggerAPI(auth facade.Authorizer) (*logger.LoggerAPI, error) { ctx := facadetest.Context{ Auth_: auth, - Controller_: s.controller, + Controller_: s.ctrl.Controller, Resources_: s.resources, State_: s.State, } @@ -143,13 +110,10 @@ } func (s *loggerSuite) setLoggingConfig(c *gc.C, loggingConfig string) { - s.change.Config["logging-config"] = loggingConfig - s.changes <- s.change - select { - case <-s.events: - case <-time.After(testing.LongWait): - c.Fatalf("change not processed by test") - } + m := cachetest.ModelChangeFromState(c, s.State) + m.Config["logging-config"] = loggingConfig + s.ctrl.SendChange(m) + _ = s.ctrl.NextChange(c) } func (s *loggerSuite) TestWatchLoggingConfig(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/access.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/access.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/access.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/access.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package uniter + +import ( + "github.com/juju/errors" + "github.com/juju/juju/apiserver/facades/client/application" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/state" +) + +// unitAccessor creates a accessUnit function for accessing a unit +func unitAccessor(authorizer facade.Authorizer, st *state.State) common.GetAuthFunc { + return func() (common.AuthFunc, error) { + switch tag := authorizer.GetAuthTag().(type) { + case names.ApplicationTag: + // If called by an application agent, any of the units + // belonging to that application can be accessed. + app, err := st.Application(tag.Name) + if err != nil { + return nil, errors.Trace(err) + } + allUnits, err := app.AllUnits() + if err != nil { + return nil, errors.Trace(err) + } + return func(tag names.Tag) bool { + for _, u := range allUnits { + if u.Tag() == tag { + return true + } + } + return false + }, nil + case names.UnitTag: + return func(tag names.Tag) bool { + return authorizer.AuthOwner(tag) + }, nil + default: + return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) + } + } +} + +func applicationAccessor(authorizer facade.Authorizer, st *state.State) common.GetAuthFunc { + return func() (common.AuthFunc, error) { + switch tag := authorizer.GetAuthTag().(type) { + case names.ApplicationTag: + return func(applicationTag names.Tag) bool { + return tag == applicationTag + }, nil + case names.UnitTag: + entity, err := st.Unit(tag.Id()) + if err != nil { + return nil, errors.Trace(err) + } + applicationName := entity.ApplicationName() + applicationTag := names.NewApplicationTag(applicationName) + return func(tag names.Tag) bool { + return tag == applicationTag + }, nil + default: + return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) + } + } +} + +func machineAccessor(authorizer facade.Authorizer, st *state.State) common.GetAuthFunc { + return func() (common.AuthFunc, error) { + switch tag := authorizer.GetAuthTag().(type) { + // Application agents can't access machines. + case names.ApplicationTag: + return func(tag names.Tag) bool { + return false + }, nil + case names.UnitTag: + entity, err := st.Unit(tag.Id()) + if err != nil { + return nil, errors.Trace(err) + } + machineId, err := entity.AssignedMachineId() + if err != nil { + return nil, errors.Trace(err) + } + machineTag := names.NewMachineTag(machineId) + return func(tag names.Tag) bool { + return tag == machineTag + }, nil + default: + return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) + } + } +} + +func cloudSpecAccessor(authorizer facade.Authorizer, st *state.State) func() (func() bool, error) { + return func() (func() bool, error) { + var appName string + var err error + + switch tag := authorizer.GetAuthTag().(type) { + case names.ApplicationTag: + appName = tag.Id() + case names.UnitTag: + entity, err := st.Unit(tag.Id()) + if err != nil { + return nil, errors.Trace(err) + } + appName = entity.ApplicationName() + default: + return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) + } + + app, err := st.Application(appName) + if err != nil { + return nil, errors.Trace(err) + } + config, err := app.ApplicationConfig() + if err != nil { + return nil, errors.Trace(err) + } + return func() bool { + return config.GetBool(application.TrustConfigOptionName, false) + }, nil + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/goal-state_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/goal-state_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/goal-state_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/goal-state_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,12 +12,10 @@ "gopkg.in/juju/charm.v6" "github.com/juju/juju/apiserver/common" - "github.com/juju/juju/apiserver/facade/facadetest" "github.com/juju/juju/apiserver/facades/agent/uniter" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" "github.com/juju/juju/core/status" - "github.com/juju/juju/juju/testing" "github.com/juju/juju/state" coretesting "github.com/juju/juju/testing" "github.com/juju/juju/testing/factory" @@ -27,21 +25,10 @@ // versions. It's not intended to be used directly or registered as a // suite, but embedded. type uniterGoalStateSuite struct { - testing.JujuConnSuite + uniterSuiteBase - authorizer apiservertesting.FakeAuthorizer - resources *common.Resources - uniter *uniter.UniterAPI - - machine0 *state.Machine - machine1 *state.Machine - machine2 *state.Machine - logging *state.Application - wordpress *state.Application - wpCharm *state.Charm - mysql *state.Application - wordpressUnit *state.Unit - mysqlUnit *state.Unit + machine2 *state.Machine + logging *state.Application } var _ = gc.Suite(&uniterGoalStateSuite{}) @@ -49,46 +36,13 @@ func (s *uniterGoalStateSuite) SetUpTest(c *gc.C) { s.JujuConnSuite.SetUpTest(c) - // Create two machines, two applications and add a unit to each application. - s.machine0 = s.Factory.MakeMachine(c, &factory.MachineParams{ - Series: "quantal", - Jobs: []state.MachineJob{state.JobHostUnits, state.JobManageModel}, - }) - s.machine1 = s.Factory.MakeMachine(c, &factory.MachineParams{ - Series: "quantal", - Jobs: []state.MachineJob{state.JobHostUnits}, - }) + s.setupState(c) + s.machine2 = s.Factory.MakeMachine(c, &factory.MachineParams{ Series: "quantal", Jobs: []state.MachineJob{state.JobHostUnits}, }) - mysqlCharm := s.Factory.MakeCharm(c, &factory.CharmParams{ - Name: "mysql", - }) - s.mysql = s.Factory.MakeApplication(c, &factory.ApplicationParams{ - Name: "mysql", - Charm: mysqlCharm, - }) - - s.mysqlUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ - Application: s.mysql, - Machine: s.machine1, - }) - - s.wpCharm = s.Factory.MakeCharm(c, &factory.CharmParams{ - Name: "wordpress", - URL: "cs:quantal/wordpress-0", - }) - s.wordpress = s.Factory.MakeApplication(c, &factory.ApplicationParams{ - Name: "wordpress", - Charm: s.wpCharm, - }) - s.wordpressUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ - Application: s.wordpress, - Machine: s.machine0, - }) - loggingCharm := s.Factory.MakeCharm(c, &factory.CharmParams{ Name: "logging", }) @@ -97,10 +51,13 @@ Charm: loggingCharm, }) + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + // Create a FakeAuthorizer so we can check permissions, - // set up assuming unit 0 has logged in. + // set up assuming the MySQL unit has logged in. s.authorizer = apiservertesting.FakeAuthorizer{ - Tag: s.mysql.Tag(), + Tag: s.mysqlUnit.Tag(), } // Create the resource registry separately to track invocations to @@ -108,14 +65,7 @@ s.resources = common.NewResources() s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() }) - uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) - s.uniter = uniterAPI + s.uniter = s.newUniterAPI(c, s.State, s.authorizer) } var ( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ import ( "fmt" "strings" + "time" "github.com/juju/collections/set" "github.com/juju/errors" @@ -14,6 +15,7 @@ "github.com/juju/loggo" "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" + k8score "k8s.io/api/core/v1" "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/common/cloudspec" @@ -21,9 +23,10 @@ "github.com/juju/juju/apiserver/facade" leadershipapiserver "github.com/juju/juju/apiserver/facades/agent/leadership" "github.com/juju/juju/apiserver/facades/agent/meterstatus" - "github.com/juju/juju/apiserver/facades/client/application" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/caas" + "github.com/juju/juju/caas/kubernetes/provider" + "github.com/juju/juju/core/cache" "github.com/juju/juju/core/leadership" corenetwork "github.com/juju/juju/core/network" "github.com/juju/juju/core/status" @@ -62,6 +65,11 @@ containerBrokerFunc caas.NewContainerBrokerFunc *StorageAPI + // cacheModel is used to access data from the cache in lieu of going + // to the database. + // TODO (manadart 2019-06-20): Use cache to watch and retrieve model config. + cacheModel *cache.Model + // A cloud spec can only be accessed for the model of the unit or // application that is authorised for this API facade. // We do not need to use an AuthFunc, because we do not need to pass a tag. @@ -125,39 +133,6 @@ UniterAPIV5 } -// unitAccessor creates a accessUnit function for accessing a unit -func unitAccessor(authorizer facade.Authorizer, st *state.State) common.GetAuthFunc { - return func() (common.AuthFunc, error) { - switch tag := authorizer.GetAuthTag().(type) { - case names.ApplicationTag: - // If called by an application agent, any of the units - // belonging to that application can be accessed. - app, err := st.Application(tag.Name) - if err != nil { - return nil, errors.Trace(err) - } - allUnits, err := app.AllUnits() - if err != nil { - return nil, errors.Trace(err) - } - return func(tag names.Tag) bool { - for _, u := range allUnits { - if u.Tag() == tag { - return true - } - } - return false - }, nil - case names.UnitTag: - return func(tag names.Tag) bool { - return authorizer.AuthOwner(tag) - }, nil - default: - return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) - } - } -} - // NewUniterAPI creates a new instance of the core Uniter API. func NewUniterAPI(context facade.Context) (*UniterAPI, error) { authorizer := context.Auth() @@ -166,84 +141,15 @@ } st := context.State() resources := context.Resources() - accessUnit := unitAccessor(authorizer, st) leadershipChecker, err := context.LeadershipChecker() if err != nil { return nil, errors.Trace(err) } - accessApplication := func() (common.AuthFunc, error) { - switch tag := authorizer.GetAuthTag().(type) { - case names.ApplicationTag: - return func(applicationTag names.Tag) bool { - return tag == applicationTag - }, nil - case names.UnitTag: - entity, err := st.Unit(tag.Id()) - if err != nil { - return nil, errors.Trace(err) - } - applicationName := entity.ApplicationName() - applicationTag := names.NewApplicationTag(applicationName) - return func(tag names.Tag) bool { - return tag == applicationTag - }, nil - default: - return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) - } - } - accessMachine := func() (common.AuthFunc, error) { - switch tag := authorizer.GetAuthTag().(type) { - // Application agents can't access machines. - case names.ApplicationTag: - return func(tag names.Tag) bool { - return false - }, nil - case names.UnitTag: - entity, err := st.Unit(tag.Id()) - if err != nil { - return nil, errors.Trace(err) - } - machineId, err := entity.AssignedMachineId() - if err != nil { - return nil, errors.Trace(err) - } - machineTag := names.NewMachineTag(machineId) - return func(tag names.Tag) bool { - return tag == machineTag - }, nil - default: - return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) - } - } - accessCloudSpec := func() (func() bool, error) { - var appName string - var err error - - switch tag := authorizer.GetAuthTag().(type) { - case names.ApplicationTag: - appName = tag.Id() - case names.UnitTag: - entity, err := st.Unit(tag.Id()) - if err != nil { - return nil, errors.Trace(err) - } - appName = entity.ApplicationName() - default: - return nil, errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag) - } - app, err := st.Application(appName) - if err != nil { - return nil, errors.Trace(err) - } - config, err := app.ApplicationConfig() - if err != nil { - return nil, errors.Trace(err) - } - return func() bool { - return config.GetBool(application.TrustConfigOptionName, false) - }, nil - } + accessUnit := unitAccessor(authorizer, st) + accessApplication := applicationAccessor(authorizer, st) + accessMachine := machineAccessor(authorizer, st) + accessCloudSpec := cloudSpecAccessor(authorizer, st) m, err := st.Model() if err != nil { @@ -273,6 +179,11 @@ common.AuthFuncForTag(m.ModelTag()), ) + cacheModel, err := context.Controller().Model(st.ModelUUID()) + if err != nil { + return nil, err + } + return &UniterAPI{ LifeGetter: common.NewLifeGetter(st, accessUnitOrApplication), DeadEnsurer: common.NewDeadEnsurer(st, accessUnit), @@ -289,6 +200,7 @@ st: st, m: m, + cacheModel: cacheModel, auth: authorizer, resources: resources, leadershipChecker: leadershipChecker, @@ -870,7 +782,7 @@ } // SetCharmURL sets the charm URL for each given unit. An error will -// be returned if a unit is dead, or the charm URL is not know. +// be returned if a unit is dead, or the charm URL is not known. func (u *UniterAPI) SetCharmURL(args params.EntitiesCharmURL) (params.ErrorResults, error) { result := params.ErrorResults{ Results: make([]params.ErrorResult, len(args.Entities)), @@ -894,6 +806,16 @@ curl, err = charm.ParseURL(entity.CharmURL) if err == nil { err = unit.SetCharmURL(curl) + if err == nil { + // The uniter sets the charm URL at installation. + // It can then watch or request the unit's + // configuration any time after. We must ensure that + // the change is reflected in the cache, or those + // operations can result in an error. + err = u.waitForCacheUnit( + tag, func(cu cache.Unit) bool { return cu.CharmURL() == entity.CharmURL }, + ) + } } } } @@ -902,6 +824,33 @@ return result, nil } +// waitForCacheUnit watches the cache for the input unit tag and returns with +// a nil error when the input condition is satisfied. +// If the cache is not up-to-date within a minute (this is quite generous), +// then an error is returned. +// TODO (manadart 2019-06-28): This is a temporary solution. +// A sufficiently generic approach should be arrived at in order to ensure +// cache synchronisation with DB writes where it is operationally critical. +func (u *UniterAPI) waitForCacheUnit(tag names.UnitTag, condition func(cu cache.Unit) bool) error { + timeout := time.After(time.Minute) + + for { + select { + case <-timeout: + return errors.New("timed out waiting for change to be reflected in cache") + default: + cu, err := u.getCacheUnit(tag) + if err != nil { + return err + } + if condition(cu) { + return nil + } + time.Sleep(100 * time.Millisecond) + } + } +} + // WorkloadVersion returns the workload version for all given units or applications. func (u *UniterAPI) WorkloadVersion(args params.Entities) (params.StringResults, error) { result := params.StringResults{ @@ -1113,8 +1062,8 @@ } err = common.ErrPerm if canAccess(tag) { - var unit *state.Unit - unit, err = u.getUnit(tag) + var unit cache.Unit + unit, err = u.getCacheUnit(tag) if err == nil { var settings charm.Settings settings, err = unit.ConfigSettings() @@ -1429,7 +1378,7 @@ } settings := map[string]interface{}{} - _, ingressAddresses, egressSubnets, err := state.NetworksForRelation(relUnit.Endpoint().Name, unit, rel, modelSubnets) + _, ingressAddresses, egressSubnets, err := state.NetworksForRelation(relUnit.Endpoint().Name, unit, rel, modelSubnets, false) if err == nil && len(ingressAddresses) > 0 { ingressAddress := ingressAddresses[0] // private-address is historically a cloud local address for the machine. @@ -1734,6 +1683,11 @@ return u.st.Unit(tag.Id()) } +func (u *UniterAPI) getCacheUnit(tag names.UnitTag) (cache.Unit, error) { + unit, err := u.cacheModel.Unit(tag.Id()) + return unit, errors.Trace(err) +} + func (u *UniterAPI) getApplication(tag names.ApplicationTag) (*state.Application, error) { return u.st.Application(tag.Id()) } @@ -2139,7 +2093,27 @@ if err != nil { return params.NetworkInfoResults{}, err } - boundSpace, ingress, egress, err := state.NetworksForRelation(endpoint.Name, unit, rel, modelCfg.EgressSubnets()) + + pollPublic := unit.ShouldBeAssigned() + // For k8s services which may have a public + // address, we want to poll in case it's not ready yet. + if !pollPublic { + app, err := unit.Application() + if err != nil { + return params.NetworkInfoResults{}, err + } + cfg, err := app.ApplicationConfig() + if err != nil { + return params.NetworkInfoResults{}, err + } + svcType := cfg.GetString(provider.ServiceTypeConfigKey, "") + switch k8score.ServiceType(svcType) { + case k8score.ServiceTypeLoadBalancer, k8score.ServiceTypeExternalName: + pollPublic = true + } + } + + boundSpace, ingress, egress, err := state.NetworksForRelation(endpoint.Name, unit, rel, modelCfg.EgressSubnets(), pollPublic) if err != nil { return params.NetworkInfoResults{}, err } @@ -2803,14 +2777,46 @@ // save this hash and use it to decide whether the config-changed hook // needs to be run (or whether this was just an agent restart with no // substantive config change). +// TODO (manadart 2019-06-24): When other hash watchers are moved from state +// over to the model cache, they can all share the `watchHashes` abstraction. func (u *UniterAPI) WatchConfigSettingsHash(args params.Entities) (params.StringsWatchResults, error) { - getWatcher := func(unit *state.Unit) (state.StringsWatcher, error) { - return unit.WatchConfigSettingsHash() + result := params.StringsWatchResults{ + Results: make([]params.StringsWatchResult, len(args.Entities)), } - result, err := u.watchHashes(args, getWatcher) + canAccess, err := u.accessUnit() if err != nil { - return params.StringsWatchResults{}, errors.Trace(err) + return params.StringsWatchResults{}, err } + for i, entity := range args.Entities { + tag, err := names.ParseUnitTag(entity.Tag) + if err != nil || !canAccess(tag) { + result.Results[i].Error = common.ServerError(common.ErrPerm) + continue + } + + unit, err := u.getCacheUnit(tag) + if err != nil { + result.Results[i].Error = common.ServerError(err) + continue + } + + w, err := unit.WatchConfigSettings() + if err != nil { + result.Results[i].Error = common.ServerError(err) + continue + } + + // Consume the initial event. + changes, ok := <-w.Changes() + if !ok { + result.Results[i].Error = common.ServerError(watcher.EnsureErr(w)) + continue + } + + result.Results[i].Changes = changes + result.Results[i].StringsWatcherId = u.resources.Register(w) + } + return result, nil } @@ -2836,7 +2842,11 @@ func (u *UniterAPI) WatchUnitAddressesHash(args params.Entities) (params.StringsWatchResults, error) { getWatcher := func(unit *state.Unit) (state.StringsWatcher, error) { if !unit.ShouldBeAssigned() { - return unit.WatchContainerAddressesHash(), nil + app, err := unit.Application() + if err != nil { + return nil, err + } + return app.WatchServiceAddressesHash(), nil } machineId, err := unit.AssignedMachineId() if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/uniter/uniter_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,6 +20,7 @@ apiuniter "github.com/juju/juju/api/uniter" "github.com/juju/juju/apiserver/common" commontesting "github.com/juju/juju/apiserver/common/testing" + "github.com/juju/juju/apiserver/facade" "github.com/juju/juju/apiserver/facade/facadetest" "github.com/juju/juju/apiserver/facades/agent/uniter" "github.com/juju/juju/apiserver/facades/client/application" @@ -54,21 +55,38 @@ machine0 *state.Machine machine1 *state.Machine - wordpress *state.Application wpCharm *state.Charm - mysql *state.Application + wordpress *state.Application wordpressUnit *state.Unit + mysqlCharm *state.Charm + mysql *state.Application mysqlUnit *state.Unit - - meteredApplication *state.Application - meteredCharm *state.Charm - meteredUnit *state.Unit } func (s *uniterSuiteBase) SetUpTest(c *gc.C) { s.JujuConnSuite.SetUpTest(c) - // Create two machines, two services and add a unit to each service. + s.setupState(c) + + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + + // Create a FakeAuthorizer so we can check permissions, + // set up assuming the wordpress unit has logged in. + s.authorizer = apiservertesting.FakeAuthorizer{ + Tag: s.wordpressUnit.Tag(), + } + + // Create the resource registry separately to track invocations to + // Register. + s.resources = common.NewResources() + s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() }) + + s.uniter = s.newUniterAPI(c, s.State, s.authorizer) +} + +// setupState creates 2 machines, 2 services and adds a unit to each service. +func (s *uniterSuiteBase) setupState(c *gc.C) { s.machine0 = s.Factory.MakeMachine(c, &factory.MachineParams{ Series: "quantal", Jobs: []state.MachineJob{state.JobHostUnits, state.JobManageModel}, @@ -77,6 +95,7 @@ Series: "quantal", Jobs: []state.MachineJob{state.JobHostUnits}, }) + s.wpCharm = s.Factory.MakeCharm(c, &factory.CharmParams{ Name: "wordpress", URL: "cs:quantal/wordpress-3", @@ -85,53 +104,34 @@ Name: "wordpress", Charm: s.wpCharm, }) - mysqlCharm := s.Factory.MakeCharm(c, &factory.CharmParams{ + s.wordpressUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ + Application: s.wordpress, + Machine: s.machine0, + }) + + s.mysqlCharm = s.Factory.MakeCharm(c, &factory.CharmParams{ Name: "mysql", }) s.mysql = s.Factory.MakeApplication(c, &factory.ApplicationParams{ Name: "mysql", - Charm: mysqlCharm, - }) - s.wordpressUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ - Application: s.wordpress, - Machine: s.machine0, + Charm: s.mysqlCharm, }) s.mysqlUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ Application: s.mysql, Machine: s.machine1, }) +} - s.meteredCharm = s.Factory.MakeCharm(c, &factory.CharmParams{ - Name: "metered", - URL: "cs:quantal/metered", - }) - s.meteredApplication = s.Factory.MakeApplication(c, &factory.ApplicationParams{ - Charm: s.meteredCharm, - }) - s.meteredUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ - Application: s.meteredApplication, - SetCharmURL: true, - }) - - // Create a FakeAuthorizer so we can check permissions, - // set up assuming unit 0 has logged in. - s.authorizer = apiservertesting.FakeAuthorizer{ - Tag: s.wordpressUnit.Tag(), - } - - // Create the resource registry separately to track invocations to - // Register. - s.resources = common.NewResources() - s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() }) - +func (s *uniterSuiteBase) newUniterAPI(c *gc.C, st *state.State, auth facade.Authorizer) *uniter.UniterAPI { uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, + Controller_: s.Controller, + State_: st, Resources_: s.resources, - Auth_: s.authorizer, + Auth_: auth, LeadershipChecker_: s.State.LeadershipChecker(), }) c.Assert(err, jc.ErrorIsNil) - s.uniter = uniterAPI + return uniterAPI } func (s *uniterSuiteBase) addRelation(c *gc.C, first, second string) *state.Relation { @@ -152,7 +152,8 @@ st := s.Factory.MakeCAASModel(c, nil) m, err := st.Model() c.Assert(err, jc.ErrorIsNil) - s.CleanupSuite.AddCleanup(func(*gc.C) { st.Close() }) + + s.CleanupSuite.AddCleanup(func(*gc.C) { _ = st.Close() }) cm, err := m.CAASModel() c.Assert(err, jc.ErrorIsNil) @@ -169,13 +170,23 @@ err = unit.SetPassword(password) c.Assert(err, jc.ErrorIsNil) - apiInfo, err := environs.APIInfo(context.NewCloudCallContext(), s.ControllerConfig.ControllerUUID(), st.ModelUUID(), coretesting.CACert, s.ControllerConfig.APIPort(), s.Environ) + s.State.StartSync() + s.WaitForModelWatchersIdle(c, m.UUID()) + + apiInfo, err := environs.APIInfo( + context.NewCloudCallContext(), + s.ControllerConfig.ControllerUUID(), + st.ModelUUID(), + coretesting.CACert, + s.ControllerConfig.APIPort(), + s.Environ, + ) c.Assert(err, jc.ErrorIsNil) apiInfo.Tag = unit.Tag() apiInfo.Password = password apiState, err := api.Open(apiInfo, api.DialOpts{}) c.Assert(err, jc.ErrorIsNil) - s.CleanupSuite.AddCleanup(func(*gc.C) { apiState.Close() }) + s.CleanupSuite.AddCleanup(func(*gc.C) { _ = apiState.Close() }) s.authorizer = apiservertesting.FakeAuthorizer{ Tag: unit.Tag(), @@ -713,13 +724,7 @@ // Now try as subordinate's agent. subAuthorizer := s.authorizer subAuthorizer.Tag = subordinate.Tag() - subUniter, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: subAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + subUniter := s.newUniterAPI(c, s.State, subAuthorizer) result, err = subUniter.GetPrincipal(args) c.Assert(err, jc.ErrorIsNil) @@ -1036,9 +1041,11 @@ c.Assert(err, jc.ErrorIsNil) err = s.wordpress.UpdateCharmConfig(model.GenerationMaster, charm.Settings{"blog-title": "sauceror central"}) c.Assert(err, jc.ErrorIsNil) - c.Assert(s.resources.Count(), gc.Equals, 0) + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + args := params.Entities{Entities: []params.Entity{ {Tag: "unit-mysql-0"}, {Tag: "unit-wordpress-0"}, @@ -1051,13 +1058,14 @@ {Error: apiservertesting.ErrUnauthorized}, { StringsWatcherId: "1", - Changes: []string{"af35e298300150f2c357b4a1c40c1109bde305841c6343113b634b9dada22d00"}, + // See core/cache/hash.go for the hash implementation. + Changes: []string{"754ed70cf17d2df2cc6a2dcb6cbfcb569a8357b97b5708e7a7ca0409505e1d0b"}, }, {Error: apiservertesting.ErrUnauthorized}, }, }) - // Verify the resource was registered and stop when done + // Verify the resource was registered and stop when done. c.Assert(s.resources.Count(), gc.Equals, 1) resource := s.resources.Get("1") defer statetesting.AssertStop(c, resource) @@ -1140,6 +1148,7 @@ wc.AssertNoChange() addedAction, err := s.wordpressUnit.AddAction("fakeaction", nil) + c.Assert(err, jc.ErrorIsNil) wc.AssertChange(addedAction.Id()) wc.AssertNoChange() @@ -1239,6 +1248,10 @@ func (s *uniterSuite) TestConfigSettings(c *gc.C) { err := s.wordpressUnit.SetCharmURL(s.wpCharm.URL()) c.Assert(err, jc.ErrorIsNil) + + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + settings, err := s.wordpressUnit.ConfigSettings() c.Assert(err, jc.ErrorIsNil) c.Assert(settings, gc.DeepEquals, charm.Settings{"blog-title": "My Title"}) @@ -1304,15 +1317,9 @@ subAuthorizer := s.authorizer subAuthorizer.Tag = mysqlLogUnit.Tag() - api, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: subAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + uniterAPI := s.newUniterAPI(c, s.State, subAuthorizer) - result, err := api.WatchUnitRelations(params.Entities{ + result, err := uniterAPI.WatchUnitRelations(params.Entities{ Entities: []params.Entity{{Tag: mysqlLogUnit.Tag().String()}}, }) c.Assert(err, jc.ErrorIsNil) @@ -1371,15 +1378,9 @@ subAuthorizer := s.authorizer subAuthorizer.Tag = mysqlLogUnit.Tag() - api, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: subAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + uniterAPI := s.newUniterAPI(c, s.State, subAuthorizer) - result, err := api.WatchUnitRelations(params.Entities{ + result, err := uniterAPI.WatchUnitRelations(params.Entities{ Entities: []params.Entity{{Tag: mysqlLogUnit.Tag().String()}}, }) c.Assert(err, jc.ErrorIsNil) @@ -1436,15 +1437,9 @@ subAuthorizer := s.authorizer subAuthorizer.Tag = monUnit.Tag() - api, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: subAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + uniterAPI := s.newUniterAPI(c, s.State, subAuthorizer) - result, err := api.WatchUnitRelations(params.Entities{ + result, err := uniterAPI.WatchUnitRelations(params.Entities{ Entities: []params.Entity{{Tag: monUnit.Tag().String()}}, }) c.Assert(err, jc.ErrorIsNil) @@ -1627,13 +1622,7 @@ mysqlUnitAuthorizer := apiservertesting.FakeAuthorizer{ Tag: s.mysqlUnit.Tag(), } - mysqlUnitFacade, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: mysqlUnitAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + mysqlUnitFacade := s.newUniterAPI(c, s.State, mysqlUnitAuthorizer) action, err := s.wordpressUnit.AddAction("fakeaction", nil) c.Assert(err, jc.ErrorIsNil) @@ -1973,13 +1962,7 @@ subAuthorizer := s.authorizer subAuthorizer.Tag = wpLoggingU.Tag() - api, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: subAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + uniterAPI := s.newUniterAPI(c, s.State, subAuthorizer) // Count how many relationscopes records there are beforehand. scopesBefore := countRelationScopes(c, s.State, mysqlRel) @@ -1995,7 +1978,7 @@ Relation: mysqlRel.Tag().String(), Unit: wpLoggingU.Tag().String(), }}} - result, err := api.EnterScope(args) + result, err := uniterAPI.EnterScope(args) c.Assert(err, jc.ErrorIsNil) c.Assert(result, gc.DeepEquals, params.ErrorResults{ Results: []params.ErrorResult{{Error: nil}}, @@ -2569,13 +2552,7 @@ {Tag: "application-gitlab"}, }} - uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: cm.State(), - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + uniterAPI := s.newUniterAPI(c, cm.State(), s.authorizer) result, err := uniterAPI.WatchUnitAddressesHash(args) c.Assert(err, jc.ErrorIsNil) @@ -3022,14 +2999,7 @@ func (s *uniterSuite) makeMysqlUniter(c *gc.C) *uniter.UniterAPI { authorizer := s.authorizer authorizer.Tag = s.mysqlUnit.Tag() - result, err := uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) - return result + return s.newUniterAPI(c, s.State, authorizer) } func (s *uniterSuite) makeRemoteWordpress(c *gc.C) { @@ -3062,6 +3032,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) result, err := apiV4.WatchApplicationRelations(args) @@ -3097,6 +3068,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) result, err := apiV5.Relation(args) @@ -3127,6 +3099,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) result, err := apiV5.RelationById(args) @@ -3191,6 +3164,7 @@ func (s *uniterSuite) TestSetPodSpec(c *gc.C) { u, cm, app, _ := s.setupCAASModel(c) + err := u.SetPodSpec(app.Name(), podSpec) c.Assert(err, jc.ErrorIsNil) spec, err := cm.PodSpec(app.ApplicationTag()) @@ -3202,6 +3176,10 @@ uniterSuiteBase *commontesting.ModelWatcherTest uniter *uniter.UniterAPI + + meteredApplication *state.Application + meteredCharm *state.Charm + meteredUnit *state.Unit } var _ = gc.Suite(&unitMetricBatchesSuite{}) @@ -3209,17 +3187,22 @@ func (s *unitMetricBatchesSuite) SetUpTest(c *gc.C) { s.uniterSuiteBase.SetUpTest(c) + s.meteredCharm = s.Factory.MakeCharm(c, &factory.CharmParams{ + Name: "metered", + URL: "cs:quantal/metered", + }) + s.meteredApplication = s.Factory.MakeApplication(c, &factory.ApplicationParams{ + Charm: s.meteredCharm, + }) + s.meteredUnit = s.Factory.MakeUnit(c, &factory.UnitParams{ + Application: s.meteredApplication, + SetCharmURL: true, + }) + meteredAuthorizer := apiservertesting.FakeAuthorizer{ Tag: s.meteredUnit.Tag(), } - var err error - s.uniter, err = uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: meteredAuthorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + s.uniter = s.newUniterAPI(c, s.State, meteredAuthorizer) s.ModelWatcherTest = commontesting.NewModelWatcherTest( s.uniter, @@ -3401,6 +3384,9 @@ Machine: s.machine1, }) + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + // Create the resource registry separately to track invocations to register. s.resources = common.NewResources() s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() }) @@ -3476,6 +3462,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) } @@ -3753,15 +3740,7 @@ s.authorizer = apiservertesting.FakeAuthorizer{ Tag: givenUnit.Tag(), } - - var err error - s.uniter, err = uniter.NewUniterAPI(facadetest.Context{ - State_: s.State, - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + s.uniter = s.newUniterAPI(c, s.State, s.authorizer) } func (s *uniterNetworkInfoSuite) addRelationAndAssertInScope(c *gc.C) { @@ -4134,6 +4113,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) @@ -4184,23 +4164,14 @@ expectedResult := params.NetworkInfoResult{ Info: []params.NetworkInfo{ { - Addresses: []params.InterfaceAddress{ - {Address: "10.0.0.1"}, - }, + Addresses: []params.InterfaceAddress{}, }, }, EgressSubnets: []string{"54.32.1.2/32"}, - IngressAddresses: []string{"54.32.1.2", "192.168.1.2", "10.0.0.1"}, + IngressAddresses: []string{"54.32.1.2", "192.168.1.2"}, } - uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: st, - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) - + uniterAPI := s.newUniterAPI(c, st, s.authorizer) result, err := uniterAPI.NetworkInfo(args) c.Assert(err, jc.ErrorIsNil) c.Check(result.Results["db"], jc.DeepEquals, expectedResult) @@ -4212,7 +4183,7 @@ st := cm.State() f := factory.NewFactory(st, s.StatePool) ch := f.MakeCharm(c, &factory.CharmParams{Name: "mariadb", Series: "kubernetes"}) - f.MakeApplication(c, &factory.ApplicationParams{Name: "mariadb", Charm: ch}) + _ = f.MakeApplication(c, &factory.ApplicationParams{Name: "mariadb", Charm: ch}) var updateUnits state.UpdateUnitsOperation addr := "10.0.0.1" @@ -4229,6 +4200,12 @@ }) c.Assert(err, jc.ErrorIsNil) + c.Assert(wp.Refresh(), jc.ErrorIsNil) + c.Assert(wpUnit.Refresh(), jc.ErrorIsNil) + + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + args := params.NetworkInfoParams{ Unit: wpUnit.Tag().String(), Bindings: []string{"db"}, @@ -4237,23 +4214,14 @@ expectedResult := params.NetworkInfoResult{ Info: []params.NetworkInfo{ { - Addresses: []params.InterfaceAddress{ - {Address: "10.0.0.1"}, - }, + Addresses: []params.InterfaceAddress{}, }, }, EgressSubnets: []string{"54.32.1.2/32"}, - IngressAddresses: []string{"54.32.1.2", "192.168.1.2", "10.0.0.1"}, + IngressAddresses: []string{"54.32.1.2", "192.168.1.2"}, } - uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: st, - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) - + uniterAPI := s.newUniterAPI(c, st, s.authorizer) result, err := uniterAPI.NetworkInfo(args) c.Assert(err, jc.ErrorIsNil) c.Check(result.Results["db"], jc.DeepEquals, expectedResult) @@ -4306,13 +4274,8 @@ func (s *cloudSpecUniterSuite) TestCloudAPIVersion(c *gc.C) { _, cm, _, _ := s.setupCAASModel(c) - uniterAPI, err := uniter.NewUniterAPI(facadetest.Context{ - State_: cm.State(), - Resources_: s.resources, - Auth_: s.authorizer, - LeadershipChecker_: s.State.LeadershipChecker(), - }) - c.Assert(err, jc.ErrorIsNil) + + uniterAPI := s.newUniterAPI(c, cm.State(), s.authorizer) uniter.SetNewContainerBrokerFunc(uniterAPI, func(environs.OpenParams) (caas.Broker, error) { return &fakeBroker{}, nil }) @@ -4339,6 +4302,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) s.uniterV8 = uniterV8 @@ -4411,6 +4375,7 @@ func (s *uniterV8Suite) TestWatchCAASUnitAddresses(c *gc.C) { _, cm, _, _ := s.setupCAASModel(c) + c.Assert(s.resources.Count(), gc.Equals, 0) args := params.Entities{Entities: []params.Entity{ @@ -4426,6 +4391,7 @@ Resources_: s.resources, Auth_: s.authorizer, LeadershipChecker_: s.State.LeadershipChecker(), + Controller_: s.Controller, }) c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/interface.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/interface.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/interface.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/interface.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps + +import ( + "github.com/juju/juju/core/instance" + "github.com/juju/juju/core/status" + "github.com/juju/juju/state" +) + +type UpgradeStepsState interface { + state.EntityFinder +} + +// Machine represents point of use methods from the state machine object +type Machine interface { + ContainerType() instance.ContainerType + ModificationStatus() (status.StatusInfo, error) + SetModificationStatus(status.StatusInfo) error +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/state_mock.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/state_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/state_mock.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/state_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,83 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/juju/state (interfaces: EntityFinder,Entity) + +// Package mocks is a generated GoMock package. +package mocks + +import ( + gomock "github.com/golang/mock/gomock" + state "github.com/juju/juju/state" + names_v2 "gopkg.in/juju/names.v2" + reflect "reflect" +) + +// MockEntityFinder is a mock of EntityFinder interface +type MockEntityFinder struct { + ctrl *gomock.Controller + recorder *MockEntityFinderMockRecorder +} + +// MockEntityFinderMockRecorder is the mock recorder for MockEntityFinder +type MockEntityFinderMockRecorder struct { + mock *MockEntityFinder +} + +// NewMockEntityFinder creates a new mock instance +func NewMockEntityFinder(ctrl *gomock.Controller) *MockEntityFinder { + mock := &MockEntityFinder{ctrl: ctrl} + mock.recorder = &MockEntityFinderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockEntityFinder) EXPECT() *MockEntityFinderMockRecorder { + return m.recorder +} + +// FindEntity mocks base method +func (m *MockEntityFinder) FindEntity(arg0 names_v2.Tag) (state.Entity, error) { + ret := m.ctrl.Call(m, "FindEntity", arg0) + ret0, _ := ret[0].(state.Entity) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindEntity indicates an expected call of FindEntity +func (mr *MockEntityFinderMockRecorder) FindEntity(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindEntity", reflect.TypeOf((*MockEntityFinder)(nil).FindEntity), arg0) +} + +// MockEntity is a mock of Entity interface +type MockEntity struct { + ctrl *gomock.Controller + recorder *MockEntityMockRecorder +} + +// MockEntityMockRecorder is the mock recorder for MockEntity +type MockEntityMockRecorder struct { + mock *MockEntity +} + +// NewMockEntity creates a new mock instance +func NewMockEntity(ctrl *gomock.Controller) *MockEntity { + mock := &MockEntity{ctrl: ctrl} + mock.recorder = &MockEntityMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockEntity) EXPECT() *MockEntityMockRecorder { + return m.recorder +} + +// Tag mocks base method +func (m *MockEntity) Tag() names_v2.Tag { + ret := m.ctrl.Call(m, "Tag") + ret0, _ := ret[0].(names_v2.Tag) + return ret0 +} + +// Tag indicates an expected call of Tag +func (mr *MockEntityMockRecorder) Tag() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tag", reflect.TypeOf((*MockEntity)(nil).Tag)) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/upgradesteps_mock.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/upgradesteps_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/upgradesteps_mock.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks/upgradesteps_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,110 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/juju/apiserver/facades/agent/upgradesteps (interfaces: UpgradeStepsState,Machine) + +// Package mocks is a generated GoMock package. +package mocks + +import ( + gomock "github.com/golang/mock/gomock" + instance "github.com/juju/juju/core/instance" + status "github.com/juju/juju/core/status" + state "github.com/juju/juju/state" + names_v2 "gopkg.in/juju/names.v2" + reflect "reflect" +) + +// MockUpgradeStepsState is a mock of UpgradeStepsState interface +type MockUpgradeStepsState struct { + ctrl *gomock.Controller + recorder *MockUpgradeStepsStateMockRecorder +} + +// MockUpgradeStepsStateMockRecorder is the mock recorder for MockUpgradeStepsState +type MockUpgradeStepsStateMockRecorder struct { + mock *MockUpgradeStepsState +} + +// NewMockUpgradeStepsState creates a new mock instance +func NewMockUpgradeStepsState(ctrl *gomock.Controller) *MockUpgradeStepsState { + mock := &MockUpgradeStepsState{ctrl: ctrl} + mock.recorder = &MockUpgradeStepsStateMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockUpgradeStepsState) EXPECT() *MockUpgradeStepsStateMockRecorder { + return m.recorder +} + +// FindEntity mocks base method +func (m *MockUpgradeStepsState) FindEntity(arg0 names_v2.Tag) (state.Entity, error) { + ret := m.ctrl.Call(m, "FindEntity", arg0) + ret0, _ := ret[0].(state.Entity) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindEntity indicates an expected call of FindEntity +func (mr *MockUpgradeStepsStateMockRecorder) FindEntity(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindEntity", reflect.TypeOf((*MockUpgradeStepsState)(nil).FindEntity), arg0) +} + +// MockMachine is a mock of Machine interface +type MockMachine struct { + ctrl *gomock.Controller + recorder *MockMachineMockRecorder +} + +// MockMachineMockRecorder is the mock recorder for MockMachine +type MockMachineMockRecorder struct { + mock *MockMachine +} + +// NewMockMachine creates a new mock instance +func NewMockMachine(ctrl *gomock.Controller) *MockMachine { + mock := &MockMachine{ctrl: ctrl} + mock.recorder = &MockMachineMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockMachine) EXPECT() *MockMachineMockRecorder { + return m.recorder +} + +// ContainerType mocks base method +func (m *MockMachine) ContainerType() instance.ContainerType { + ret := m.ctrl.Call(m, "ContainerType") + ret0, _ := ret[0].(instance.ContainerType) + return ret0 +} + +// ContainerType indicates an expected call of ContainerType +func (mr *MockMachineMockRecorder) ContainerType() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerType", reflect.TypeOf((*MockMachine)(nil).ContainerType)) +} + +// ModificationStatus mocks base method +func (m *MockMachine) ModificationStatus() (status.StatusInfo, error) { + ret := m.ctrl.Call(m, "ModificationStatus") + ret0, _ := ret[0].(status.StatusInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ModificationStatus indicates an expected call of ModificationStatus +func (mr *MockMachineMockRecorder) ModificationStatus() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModificationStatus", reflect.TypeOf((*MockMachine)(nil).ModificationStatus)) +} + +// SetModificationStatus mocks base method +func (m *MockMachine) SetModificationStatus(arg0 status.StatusInfo) error { + ret := m.ctrl.Call(m, "SetModificationStatus", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetModificationStatus indicates an expected call of SetModificationStatus +func (mr *MockMachineMockRecorder) SetModificationStatus(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModificationStatus", reflect.TypeOf((*MockMachine)(nil).SetModificationStatus), arg0) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/package_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/package_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/package_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps_test + +import ( + "testing" + + gc "gopkg.in/check.v1" +) + +func TestPackage(t *testing.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/shim.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/shim.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/shim.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/shim.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,10 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps + +import "github.com/juju/juju/state" + +type upgradeStepsStateShim struct { + *state.State +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,116 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps + +import ( + "github.com/juju/errors" + "github.com/juju/loggo" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/instance" + "github.com/juju/juju/core/status" +) + +//go:generate mockgen -package mocks -destination mocks/upgradesteps_mock.go github.com/juju/juju/apiserver/facades/agent/upgradesteps UpgradeStepsState,Machine +//go:generate mockgen -package mocks -destination mocks/state_mock.go github.com/juju/juju/state EntityFinder,Entity + +var logger = loggo.GetLogger("juju.apiserver.upgradesteps") + +type UpgradeStepsV1 interface { + ResetKVMMachineModificationStatusIdle(params.Entity) (params.ErrorResult, error) +} + +type UpgradeStepsAPI struct { + st UpgradeStepsState + resources facade.Resources + authorizer facade.Authorizer + getAuthFunc common.GetAuthFunc +} + +// using apiserver/facades/client/cloud as an example. +var ( + _ UpgradeStepsV1 = (*UpgradeStepsAPI)(nil) +) + +// NewFacadeV1 is used for API registration. +func NewFacadeV1(ctx facade.Context) (*UpgradeStepsAPI, error) { + st := &upgradeStepsStateShim{State: ctx.State()} + return NewUpgradeStepsAPI(st, ctx.Resources(), ctx.Auth()) +} + +func NewUpgradeStepsAPI(st UpgradeStepsState, + resources facade.Resources, + authorizer facade.Authorizer, +) (*UpgradeStepsAPI, error) { + if !authorizer.AuthMachineAgent() && !authorizer.AuthController() { + return nil, common.ErrPerm + } + + getAuthFunc := common.AuthFuncForMachineAgent(authorizer) + return &UpgradeStepsAPI{ + st: st, + resources: resources, + authorizer: authorizer, + getAuthFunc: getAuthFunc, + }, nil +} + +// ResetKVMMachineModificationStatusIdle sets the modification status +// of a kvm machine to idle if it is in an error state before upgrade. +// Related to lp:1829393. +func (api *UpgradeStepsAPI) ResetKVMMachineModificationStatusIdle(arg params.Entity) (params.ErrorResult, error) { + var result params.ErrorResult + canAccess, err := api.getAuthFunc() + if err != nil { + return result, errors.Trace(err) + } + + mTag, err := names.ParseMachineTag(arg.Tag) + if err != nil { + return result, errors.Trace(err) + } + m, err := api.getMachine(canAccess, mTag) + if err != nil { + return result, errors.Trace(err) + } + + if m.ContainerType() != instance.KVM { + // noop + return result, nil + } + + modStatus, err := m.ModificationStatus() + if err != nil { + result.Error = common.ServerError(err) + return result, nil + } + + if modStatus.Status == status.Error { + err = m.SetModificationStatus(status.StatusInfo{Status: status.Idle}) + result.Error = common.ServerError(err) + } + + return result, nil +} + +func (api *UpgradeStepsAPI) getMachine(canAccess common.AuthFunc, tag names.MachineTag) (Machine, error) { + if !canAccess(tag) { + return nil, common.ErrPerm + } + entity, err := api.st.FindEntity(tag) + if err != nil { + return nil, err + } + // The authorization function guarantees that the tag represents a + // machine. + var machine Machine + var ok bool + if machine, ok = entity.(Machine); !ok { + return nil, errors.NotValidf("machine entity") + } + return machine, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/agent/upgradesteps/upgradesteps_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,164 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgradesteps_test + +import ( + "github.com/golang/mock/gomock" + "github.com/juju/errors" + jujutesting "github.com/juju/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + facademocks "github.com/juju/juju/apiserver/facade/mocks" + "github.com/juju/juju/apiserver/facades/agent/upgradesteps" + "github.com/juju/juju/apiserver/facades/agent/upgradesteps/mocks" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/instance" + "github.com/juju/juju/core/status" + "github.com/juju/juju/state" +) + +type upgradeStepsSuite struct { + jujutesting.BaseSuite + + tag names.Tag + arg params.Entity + + api *upgradesteps.UpgradeStepsAPI + authorizer *facademocks.MockAuthorizer + entity *mocks.MockEntity + machine *mocks.MockMachine + resources *facademocks.MockResources + state *mocks.MockUpgradeStepsState +} + +var _ = gc.Suite(&upgradeStepsSuite{}) + +func (s *upgradeStepsSuite) SetUpTest(c *gc.C) { + s.tag = names.NewMachineTag("0/kvm/0") + s.arg = params.Entity{Tag: s.tag.String()} + s.BaseSuite.SetUpTest(c) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdle(c *gc.C) { + defer s.setup(c).Finish() + + s.expectAuthCalls() + s.expectFindEntity() + s.expectContainerType(instance.KVM) + s.expectModificationStatus(status.Error) + s.expectSetModificationStatus(nil) + + s.setupFacadeAPI(c) + + result, err := s.api.ResetKVMMachineModificationStatusIdle(s.arg) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.DeepEquals, params.ErrorResult{}) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdleSetError(c *gc.C) { + defer s.setup(c).Finish() + + s.expectAuthCalls() + s.expectFindEntity() + s.expectContainerType(instance.KVM) + s.expectModificationStatus(status.Error) + s.expectSetModificationStatus(errors.NotFoundf("testing")) + + s.setupFacadeAPI(c) + + result, err := s.api.ResetKVMMachineModificationStatusIdle(s.arg) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.DeepEquals, params.ErrorResult{ + Error: ¶ms.Error{ + Message: "testing not found", + Code: "not found", + }, + }) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdleKVMIdle(c *gc.C) { + defer s.setup(c).Finish() + + s.expectAuthCalls() + s.expectFindEntity() + s.expectContainerType(instance.KVM) + s.expectModificationStatus(status.Idle) + + s.setupFacadeAPI(c) + + _, err := s.api.ResetKVMMachineModificationStatusIdle(s.arg) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *upgradeStepsSuite) TestResetKVMMachineModificationStatusIdleLXD(c *gc.C) { + defer s.setup(c).Finish() + + s.expectAuthCalls() + s.expectFindEntity() + s.expectContainerType(instance.LXD) + + s.setupFacadeAPI(c) + + _, err := s.api.ResetKVMMachineModificationStatusIdle(s.arg) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *upgradeStepsSuite) setup(c *gc.C) *gomock.Controller { + ctrl := gomock.NewController(c) + + s.authorizer = facademocks.NewMockAuthorizer(ctrl) + s.entity = mocks.NewMockEntity(ctrl) + s.machine = mocks.NewMockMachine(ctrl) + s.state = mocks.NewMockUpgradeStepsState(ctrl) + s.resources = facademocks.NewMockResources(ctrl) + + return ctrl +} + +func (s *upgradeStepsSuite) setupFacadeAPI(c *gc.C) { + api, err := upgradesteps.NewUpgradeStepsAPI(s.state, s.resources, s.authorizer) + c.Assert(err, gc.IsNil) + s.api = api +} + +func (s *upgradeStepsSuite) expectFindEntity() { + mEntity := machineEntityShim{ + Machine: s.machine, + Entity: s.entity, + } + s.state.EXPECT().FindEntity(s.tag.(names.MachineTag)).Return(mEntity, nil) +} + +func (s *upgradeStepsSuite) expectAuthCalls() { + aExp := s.authorizer.EXPECT() + aExp.AuthMachineAgent().Return(true).AnyTimes() + aExp.AuthController().Return(true).AnyTimes() + aExp.GetAuthTag().Return(s.tag).AnyTimes() +} + +func (s *upgradeStepsSuite) expectContainerType(cType instance.ContainerType) { + mExp := s.machine.EXPECT() + mExp.ContainerType().Return(cType) +} + +func (s *upgradeStepsSuite) expectModificationStatus(sValue status.Status) { + mExp := s.machine.EXPECT() + mExp.ModificationStatus().Return(status.StatusInfo{Status: sValue}, nil) +} + +func (s *upgradeStepsSuite) expectSetModificationStatus(err error) { + mExp := s.machine.EXPECT() + mExp.SetModificationStatus(status.StatusInfo{ + Status: status.Idle, + Message: "", + Data: nil, + }).Return(err) +} + +type machineEntityShim struct { + upgradesteps.Machine + state.Entity +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application.go 2019-06-28 17:10:43.000000000 +0000 @@ -165,7 +165,7 @@ } func newFacadeBase(ctx facade.Context) (*APIBase, error) { - model, err := ctx.State().Model() + facadeModel, err := ctx.State().Model() if err != nil { return nil, errors.Annotate(err, "getting model") } @@ -181,7 +181,7 @@ registry storage.ProviderRegistry storageValidator caas.Broker ) - if model.Type() == state.ModelTypeCAAS { + if facadeModel.Type() == state.ModelTypeCAAS { storageValidator, err = stateenvirons.GetNewCAASBrokerFunc(caas.New)(ctx.State()) if err != nil { return nil, errors.Annotate(err, "getting caas client") @@ -197,7 +197,7 @@ storageAccess, ctx.Auth(), blockChecker, - model, + facadeModel, stateCharm, DeployApplication, storagePoolManager, @@ -271,12 +271,12 @@ return result, nil } for i, a := range args.Creds { - application, err := api.backend.Application(a.ApplicationName) + oneApplication, err := api.backend.Application(a.ApplicationName) if err != nil { result.Results[i].Error = common.ServerError(err) continue } - err = application.SetMetricCredentials(a.MetricCredentials) + err = oneApplication.SetMetricCredentials(a.MetricCredentials) if err != nil { result.Results[i].Error = common.ServerError(err) } @@ -383,11 +383,11 @@ } // TODO(caas) - get the schema from the provider defaults := caas.ConfigDefaults(k8s.ConfigDefaults()) - schema, err := caas.ConfigSchema(k8s.ConfigSchema()) + configSchema, err := caas.ConfigSchema(k8s.ConfigSchema()) if err != nil { return nil, nil, err } - return AddTrustSchemaAndDefaults(schema, defaults) + return AddTrustSchemaAndDefaults(configSchema, defaults) } func splitApplicationAndCharmConfig(modelType state.ModelType, inConfig map[string]string) ( @@ -572,11 +572,11 @@ } var applicationConfig *application.Config - schema, defaults, err := applicationConfigSchema(modelType) + configSchema, defaults, err := applicationConfigSchema(modelType) if err != nil { return errors.Trace(err) } - applicationConfig, err = application.NewConfig(appSettings, schema, defaults) + applicationConfig, err = application.NewConfig(appSettings, configSchema, defaults) if err != nil { return errors.Trace(err) } @@ -786,6 +786,13 @@ } } + // We need a guard on the API server-side for direct API callers such as + // python-libjuju, and for older clients. + // Always default to the master branch. + if args.Generation == "" { + args.Generation = model.GenerationMaster + } + // Set up application's settings. // If the config change is generational, add the app to the generation. configChange := false @@ -825,11 +832,11 @@ if err != nil { return errors.Trace(err) } - charm, err := api.backend.Charm(curl) + aCharm, err := api.backend.Charm(curl) if err != nil { return errors.Trace(err) } - return api.applicationSetCharm(params, charm) + return api.applicationSetCharm(params, aCharm) } // UpdateApplicationSeries updates the application series. Series for @@ -889,7 +896,7 @@ return errors.Trace(err) } } - application, err := api.backend.Application(args.ApplicationName) + oneApplication, err := api.backend.Application(args.ApplicationName) if err != nil { return errors.Trace(err) } @@ -897,7 +904,7 @@ return api.setCharmWithAgentValidation( setCharmParams{ AppName: args.ApplicationName, - Application: application, + Application: oneApplication, Channel: channel, ConfigSettingsStrings: args.ConfigSettings, ConfigSettingsYAML: args.ConfigSettingsYAML, @@ -934,7 +941,7 @@ return api.applicationSetCharm(params, newCharm) } - application := params.Application + oneApplication := params.Application // Check if the controller agent tools version is greater than the // version we support for the new LXD profiles. // Then check all the units, to see what their agent tools versions is @@ -952,13 +959,13 @@ // machines what profiles they currently have and matching with the // incoming update. This could be very costly when you have lots of // machines. - currentCharm, _, err := application.Charm() + currentCharm, _, err := oneApplication.Charm() if err != nil { logger.Debugf("Unable to locate current charm: %v", err) } if lxdprofile.NotEmpty(lxdCharmProfiler{Charm: currentCharm}) || lxdprofile.NotEmpty(lxdCharmProfiler{Charm: newCharm}) { - if err := validateAgentVersions(application, api.model); err != nil { + if err := validateAgentVersions(oneApplication, api.model); err != nil { return errors.Trace(err) } } @@ -1074,11 +1081,11 @@ if err := api.checkCanWrite(); err != nil { return params.StringResult{}, errors.Trace(err) } - application, err := api.backend.Application(args.ApplicationName) + oneApplication, err := api.backend.Application(args.ApplicationName) if err != nil { return params.StringResult{}, errors.Trace(err) } - charmURL, _ := application.CharmURL() + charmURL, _ := oneApplication.CharmURL() return params.StringResult{Result: charmURL.String()}, nil } @@ -1271,12 +1278,12 @@ } attachStorage[i] = tag } - application, err := backend.Application(args.ApplicationName) + oneApplication, err := backend.Application(args.ApplicationName) if err != nil { return nil, errors.Trace(err) } return addUnits( - application, + oneApplication, args.ApplicationName, args.NumUnits, args.Placement, @@ -1361,13 +1368,13 @@ return nil, errors.Errorf("unit %q is a subordinate", name) } var info params.DestroyUnitInfo - storage, err := storagecommon.UnitStorage(api.storageAccess, unit.UnitTag()) + unitStorage, err := storagecommon.UnitStorage(api.storageAccess, unit.UnitTag()) if err != nil { return nil, errors.Trace(err) } if arg.DestroyStorage { - for _, s := range storage { + for _, s := range unitStorage { info.DestroyedStorage = append( info.DestroyedStorage, params.Entity{Tag: s.StorageTag().String()}, @@ -1375,7 +1382,7 @@ } } else { info.DestroyedStorage, info.DetachedStorage, err = storagecommon.ClassifyDetachedStorage( - api.storageAccess.VolumeAccess(), api.storageAccess.FilesystemAccess(), storage, + api.storageAccess.VolumeAccess(), api.storageAccess.FilesystemAccess(), unitStorage, ) if err != nil { return nil, errors.Trace(err) @@ -1390,12 +1397,9 @@ if err := api.backend.ApplyOperation(op); err != nil { return nil, errors.Trace(err) } - // TODO (anastasiamac 2019-03-29) we want to return errors and info when forced.. - // maybe always, so that we can report how many errors we are getting/got. - // At the moment, this only returns the intent not the actual result. - // However, there is a provision for this functionality for the near-future: destroy operation itself - // contains Errors that have been encountered during its application. - logger.Warningf("operational errors destroying unit %v: %v", unit.Name(), op.Errors) + if len(op.Errors) != 0 { + logger.Warningf("operational errors destroying unit %v: %v", unit.Name(), op.Errors) + } return &info, nil } results := make([]params.DestroyUnitResult, len(args.Units)) @@ -1480,7 +1484,7 @@ info.DestroyedUnits, params.Entity{unit.UnitTag().String()}, ) - storage, err := storagecommon.UnitStorage(api.storageAccess, unit.UnitTag()) + unitStorage, err := storagecommon.UnitStorage(api.storageAccess, unit.UnitTag()) if err != nil { return nil, err } @@ -1488,7 +1492,7 @@ // Filter out storage we've already seen. Shared // storage may be attached to multiple units. var unseen []state.StorageInstance - for _, stor := range storage { + for _, stor := range unitStorage { storageTag := stor.StorageTag() if storageSeen.Contains(storageTag) { continue @@ -1496,10 +1500,10 @@ storageSeen.Add(storageTag) unseen = append(unseen, stor) } - storage = unseen + unitStorage = unseen if arg.DestroyStorage { - for _, s := range storage { + for _, s := range unitStorage { info.DestroyedStorage = append( info.DestroyedStorage, params.Entity{s.StorageTag().String()}, @@ -1507,7 +1511,7 @@ } } else { destroyed, detached, err := storagecommon.ClassifyDetachedStorage( - api.storageAccess.VolumeAccess(), api.storageAccess.FilesystemAccess(), storage, + api.storageAccess.VolumeAccess(), api.storageAccess.FilesystemAccess(), unitStorage, ) if err != nil { return nil, err @@ -1525,12 +1529,9 @@ if err := api.backend.ApplyOperation(op); err != nil { return nil, err } - // TODO (anastasiamac 2019-03-29) we want to return errors and info when forced.. - // maybe always, so that we can report how many errors we are getting/got. - // At the moment, this only returns the intent not the actual result. - // However, there is a provision for this functionality for the near-future: destroy operation itself - // contains Errors that have been encountered during its application. - logger.Warningf("operational errors destroying application %v: %v", tag.Id(), op.Errors) + if len(op.Errors) != 0 { + logger.Warningf("operational errors destroying application %v: %v", tag.Id(), op.Errors) + } return &info, nil } results := make([]params.DestroyApplicationResult, len(args.Applications)) @@ -1587,6 +1588,9 @@ if err := api.checkCanWrite(); err != nil { return params.ScaleApplicationResults{}, errors.Trace(err) } + if err := api.check.ChangeAllowed(); err != nil { + return params.ScaleApplicationResults{}, errors.Trace(err) + } scaleApplication := func(arg params.ScaleApplicationParams) (*params.ScaleApplicationInfo, error) { if arg.Scale < 0 && arg.ScaleChange == 0 { return nil, errors.NotValidf("scale < 0") @@ -1613,7 +1617,7 @@ } info.Scale = newScale } else { - if err := app.SetScale(arg.Scale); err != nil { + if err := app.SetScale(arg.Scale, 0, true); err != nil { return nil, errors.Trace(err) } info.Scale = arg.Scale @@ -1762,7 +1766,12 @@ if err != nil { return err } - return rel.Destroy() + force := args.Force != nil && *args.Force + errs, err := rel.DestroyWithForce(force, common.MaxWait(args.MaxWait)) + if len(errs) != 0 { + logger.Warningf("operational errors destroying relation %v: %v", rel.Tag().Id(), errs) + } + return err } // SetRelationsSuspended sets the suspended status of the specified relations. @@ -2126,13 +2135,13 @@ if err != nil { return errors.Trace(err) } - schema, defaults, err := applicationConfigSchema(api.modelType) + configSchema, defaults, err := applicationConfigSchema(api.modelType) if err != nil { return errors.Trace(err) } if len(appConfigAttrs) > 0 { - if err := app.UpdateApplicationConfig(appConfigAttrs, nil, schema, defaults); err != nil { + if err := app.UpdateApplicationConfig(appConfigAttrs, nil, configSchema, defaults); err != nil { return errors.Annotate(err, "updating application config values") } } @@ -2146,6 +2155,13 @@ if err != nil { return errors.Trace(err) } + + // We need a guard on the API server-side for direct API callers such as + // python-libjuju, and for older clients. + // Always default to the master branch. + if arg.Generation == "" { + arg.Generation = model.GenerationMaster + } if err := app.UpdateCharmConfig(arg.Generation, charmConfigChanges); err != nil { return errors.Annotate(err, "updating application charm settings") } @@ -2193,11 +2209,11 @@ return errors.Trace(err) } - schema, defaults, err := applicationConfigSchema(api.modelType) + configSchema, defaults, err := applicationConfigSchema(api.modelType) if err != nil { return errors.Trace(err) } - appConfigFields := application.KnownConfigKeys(schema) + appConfigFields := application.KnownConfigKeys(configSchema) var appConfigKeys []string charmSettings := make(charm.Settings) @@ -2210,14 +2226,15 @@ } if len(appConfigKeys) > 0 { - if err := app.UpdateApplicationConfig(nil, appConfigKeys, schema, defaults); err != nil { + if err := app.UpdateApplicationConfig(nil, appConfigKeys, configSchema, defaults); err != nil { return errors.Annotate(err, "updating application config values") } } if len(charmSettings) > 0 { // We need a guard on the API server-side for direct API callers such as - // python-libjuju. Always default to the master branch. + // python-libjuju, and for older clients. + // Always default to the master branch. if arg.BranchName == "" { arg.BranchName = model.GenerationMaster } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1812,7 +1812,15 @@ c.Assert(app.MinUnits(), gc.Equals, 0) } -func (s *applicationSuite) TestApplicationUpdateSetSettingsStrings(c *gc.C) { +func (s *applicationSuite) TestApplicationUpdateSetSettingsStringsExplicitMaster(c *gc.C) { + s.testApplicationUpdateSetSettingsStrings(c, model.GenerationMaster) +} + +func (s *applicationSuite) TestApplicationUpdateSetSettingsStringsEmptyBranchUsesMaster(c *gc.C) { + s.testApplicationUpdateSetSettingsStrings(c, "") +} + +func (s *applicationSuite) testApplicationUpdateSetSettingsStrings(c *gc.C, branchName string) { ch := s.AddTestingCharm(c, "dummy") app := s.AddTestingApplication(c, "dummy", ch) @@ -1820,7 +1828,7 @@ args := params.ApplicationUpdate{ ApplicationName: "dummy", SettingsStrings: map[string]string{"title": "s-title", "username": "s-user"}, - Generation: model.GenerationMaster, + Generation: branchName, } err := s.applicationAPI.Update(args) c.Assert(err, jc.ErrorIsNil) @@ -1860,7 +1868,15 @@ c.Check(gen.AssignedUnits(), jc.DeepEquals, map[string][]string{"dummy": {}}) } -func (s *applicationSuite) TestApplicationUpdateSetSettingsYAML(c *gc.C) { +func (s *applicationSuite) TestApplicationUpdateSetSettingsYAMLExplicitMaster(c *gc.C) { + s.testApplicationUpdateSetSettingsYAML(c, model.GenerationMaster) +} + +func (s *applicationSuite) TestApplicationUpdateSetSettingsYAMLEmptyBranchUsesMaster(c *gc.C) { + s.testApplicationUpdateSetSettingsYAML(c, "") +} + +func (s *applicationSuite) testApplicationUpdateSetSettingsYAML(c *gc.C, branchName string) { ch := s.AddTestingCharm(c, "dummy") app := s.AddTestingApplication(c, "dummy", ch) @@ -1868,7 +1884,7 @@ args := params.ApplicationUpdate{ ApplicationName: "dummy", SettingsYAML: "dummy:\n title: y-title\n username: y-user", - Generation: model.GenerationMaster, + Generation: branchName, } err := s.applicationAPI.Update(args) c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application_unit_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application_unit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/application_unit_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/application_unit_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -408,7 +408,7 @@ s.blockChecker.CheckCallNames(c, "RemoveAllowed") s.backend.CheckCallNames(c, "InferEndpoints", "EndpointsRelation") s.backend.CheckCall(c, 0, "InferEndpoints", []string{"a", "b"}) - s.relation.CheckCallNames(c, "Destroy") + s.relation.CheckCallNames(c, "DestroyWithForce") } func (s *ApplicationSuite) TestDestroyRelationNoRelationsFound(c *gc.C) { @@ -438,7 +438,7 @@ s.blockChecker.CheckCallNames(c, "RemoveAllowed") s.backend.CheckCallNames(c, "Relation") s.backend.CheckCall(c, 0, "Relation", 123) - s.relation.CheckCallNames(c, "Destroy") + s.relation.CheckCallNames(c, "DestroyWithForce") } func (s *ApplicationSuite) TestDestroyRelationIdRelationNotFound(c *gc.C) { @@ -863,6 +863,18 @@ app.CheckCall(c, 0, "Scale", 5) } +func (s *ApplicationSuite) TestScaleApplicationsBlocked(c *gc.C) { + application.SetModelType(s.api, state.ModelTypeCAAS) + s.blockChecker.SetErrors(common.ServerError(common.OperationBlockedError("test block"))) + _, err := s.api.ScaleApplications(params.ScaleApplicationsParams{ + Applications: []params.ScaleApplicationParams{{ + ApplicationTag: "application-postgresql", + Scale: 5, + }}}) + c.Assert(err, gc.ErrorMatches, "test block") + c.Assert(err, jc.Satisfies, params.IsCodeOperationBlocked) +} + func (s *ApplicationSuite) TestScaleApplicationsCAASModelScaleChange(c *gc.C) { application.SetModelType(s.api, state.ModelTypeCAAS) s.backend.applications["postgresql"].scale = 2 @@ -1416,7 +1428,15 @@ c.Assert(err, gc.ErrorMatches, `CIDR "0.0.0.0/0" not allowed`) } -func (s *ApplicationSuite) TestSetApplicationConfig(c *gc.C) { +func (s *ApplicationSuite) TestSetApplicationConfigExplicitMaster(c *gc.C) { + s.testSetApplicationConfig(c, model.GenerationMaster) +} + +func (s *ApplicationSuite) TestSetApplicationConfigEmptyUsesMaster(c *gc.C) { + s.testSetApplicationConfig(c, "") +} + +func (s *ApplicationSuite) testSetApplicationConfig(c *gc.C, branchName string) { application.SetModelType(s.api, state.ModelTypeCAAS) result, err := s.api.SetApplicationsConfig(params.ApplicationConfigSetArgs{ Args: []params.ApplicationConfigSet{{ @@ -1425,7 +1445,7 @@ "juju-external-hostname": "value", "stringOption": "stringVal", }, - Generation: model.GenerationMaster, + Generation: branchName, }}}) c.Assert(err, jc.ErrorIsNil) c.Assert(result.OneError(), jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/backend.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/backend.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/backend.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/backend.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,8 @@ package application import ( + "time" + "github.com/juju/schema" "github.com/juju/version" "gopkg.in/juju/charm.v6" @@ -87,7 +89,7 @@ UpdateApplicationSeries(string, bool) error UpdateCharmConfig(string, charm.Settings) error UpdateApplicationConfig(application.ConfigAttributes, []string, environschema.Fields, schema.Defaults) error - SetScale(int) error + SetScale(int, int64, bool) error ChangeScale(int) (int, error) AgentTools() (*tools.Tools, error) } @@ -117,6 +119,7 @@ status.StatusSetter Tag() names.Tag Destroy() error + DestroyWithForce(bool, time.Duration) ([]error, error) Endpoint(string) (state.Endpoint, error) SetSuspended(bool, string) error Suspended() bool diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/application/mock_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/application/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "io" "strings" "sync" + "time" "github.com/juju/collections/set" "github.com/juju/errors" @@ -186,7 +187,7 @@ return a.scale + scaleChange, nil } -func (a *mockApplication) SetScale(scale int) error { +func (a *mockApplication) SetScale(scale int, generation int64, force bool) error { a.MethodCall(a, "Scale", scale) if err := a.NextErr(); err != nil { return err @@ -720,6 +721,11 @@ return r.NextErr() } +func (r *mockRelation) DestroyWithForce(force bool, maxWait time.Duration) ([]error, error) { + r.MethodCall(r, "DestroyWithForce", force, maxWait) + return nil, r.NextErr() +} + type mockUnit struct { application.Unit jtesting.Stub diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/applicationoffers.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/applicationoffers.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/applicationoffers.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/applicationoffers.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/txn" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/common" @@ -241,7 +242,7 @@ return errors.Annotate(err, "could not modify offer access") } - url, err := jujucrossmodel.ParseOfferURL(arg.OfferURL) + url, err := charm.ParseOfferURL(arg.OfferURL) if err != nil { return errors.Trace(err) } @@ -362,7 +363,7 @@ fullURLs []string ) for i, urlStr := range urls.OfferURLs { - url, err := jujucrossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { results.Results[i].Error = common.ServerError(err) continue @@ -495,7 +496,7 @@ return params.RemoteApplicationInfoResults{results}, nil } -func (api *OffersAPI) filterFromURL(url *jujucrossmodel.OfferURL) params.OfferFilter { +func (api *OffersAPI) filterFromURL(url *charm.OfferURL) params.OfferFilter { f := params.OfferFilter{ OwnerName: url.User, ModelName: url.ModelName, @@ -505,7 +506,7 @@ } func (api *OffersAPI) oneRemoteApplicationInfo(urlStr string) (*params.RemoteApplicationInfo, error) { - url, err := jujucrossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { return nil, errors.Trace(err) } @@ -558,7 +559,7 @@ } for i, one := range offerURLs { - url, err := jujucrossmodel.ParseOfferURL(one) + url, err := charm.ParseOfferURL(one) if err != nil { result[i].Error = common.ServerError(err) continue diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/base.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/base.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/base.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/applicationoffers/base.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/collections/set" "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/common" @@ -269,7 +270,7 @@ // Cache the models found so far so we don't look them up more than once. modelsCache := make(map[string]Model) oneModel := func(offerURL string) (Model, error) { - url, err := jujucrossmodel.ParseOfferURL(offerURL) + url, err := charm.ParseOfferURL(offerURL) if err != nil { return nil, errors.Trace(err) } @@ -383,7 +384,7 @@ model := models[modelUUID] for _, offerDetails := range offers { - offerDetails.OfferURL = jujucrossmodel.MakeURL(model.Owner().Name(), model.Name(), offerDetails.OfferName, "") + offerDetails.OfferURL = charm.MakeURL(model.Owner().Name(), model.Name(), offerDetails.OfferName, "") result = append(result, offerDetails) } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,15 +15,18 @@ "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/os/series" + "github.com/juju/utils/featureflag" "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "gopkg.in/yaml.v2" "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/facade" + appFacade "github.com/juju/juju/apiserver/facades/client/application" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/core/constraints" "github.com/juju/juju/core/devices" + "github.com/juju/juju/feature" "github.com/juju/juju/permission" "github.com/juju/juju/storage" ) @@ -40,6 +43,13 @@ *BundleAPI } +// APIv3 provides the Bundle API facade for version 3. It is otherwise +// identical to V2 with the exception that the V3 ExportBundle implementation +// also exposes the the current trust status for each application. +type APIv3 struct { + *BundleAPI +} + // BundleAPI implements the Bundle interface and is the concrete implementation // of the API end point. type BundleAPI struct { @@ -69,6 +79,16 @@ return &APIv2{api}, nil } +// NewFacadeV3 provides the signature required for facade registration +// for version 3. +func NewFacadeV3(ctx facade.Context) (*APIv3, error) { + api, err := newFacade(ctx) + if err != nil { + return nil, errors.Trace(err) + } + return &APIv3{api}, nil +} + // NewFacade provides the required signature for facade registration. func newFacade(ctx facade.Context) (*BundleAPI, error) { authorizer := ctx.Auth() @@ -371,6 +391,23 @@ } } + // If this application has been trusted by the operator, set the + // Trust field of the ApplicationSpec to true + if appConfig := application.ApplicationConfig(); appConfig != nil { + newApplication.RequiresTrust = appConfig[appFacade.TrustConfigOptionName] == true + } + + // Populate offer list + if offerList := application.Offers(); offerList != nil && featureflag.Enabled(feature.CMRAwareBundles) { + newApplication.Offers = make(map[string]*charm.OfferSpec) + for _, offer := range offerList { + newApplication.Offers[offer.OfferName()] = &charm.OfferSpec{ + Endpoints: offer.Endpoints(), + ACL: b.filterOfferACL(offer.ACL()), + } + } + } + data.Applications[application.Name()] = newApplication } @@ -436,6 +473,13 @@ return data, nil } +// filterOfferACL prunes the input offer ACL to remove internal juju users that +// we shouldn't export as part of the bundle. +func (b *BundleAPI) filterOfferACL(in map[string]string) map[string]string { + delete(in, common.EveryoneTagName) + return in +} + func (b *BundleAPI) constraints(cons description.Constraints) []string { if cons == nil { return []string{} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/bundle/bundle_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,9 +11,11 @@ gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" + appFacade "github.com/juju/juju/apiserver/facades/client/application" "github.com/juju/juju/apiserver/facades/client/bundle" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" + "github.com/juju/juju/feature" coretesting "github.com/juju/juju/testing" ) @@ -495,6 +497,111 @@ `[1:]} c.Assert(result, gc.Equals, expectedResult) + s.st.CheckCall(c, 0, "ExportPartial", s.st.GetExportConfig()) +} + +func (s *bundleSuite) TestExportBundleWithTrustedApplication(c *gc.C) { + s.st.model = description.NewModel(description.ModelArgs{Owner: names.NewUserTag("magic"), + Config: map[string]interface{}{ + "name": "awesome", + "uuid": "some-uuid", + }, + CloudRegion: "some-region"}) + + appArgs := s.minimalApplicationArgs(description.IAAS) + appArgs.ApplicationConfig = map[string]interface{}{ + appFacade.TrustConfigOptionName: true, + } + + app := s.st.model.AddApplication(appArgs) + app.SetStatus(minimalStatusArgs()) + + u := app.AddUnit(minimalUnitArgs(app.Type())) + u.SetAgentStatus(minimalStatusArgs()) + + s.st.model.SetStatus(description.StatusArgs{Value: "available"}) + + result, err := s.facade.ExportBundle() + c.Assert(err, jc.ErrorIsNil) + expectedResult := params.StringResult{nil, ` +series: trusty +applications: + ubuntu: + charm: cs:trusty/ubuntu + num_units: 1 + to: + - "0" + options: + key: value + bindings: + juju-info: vlan2 + trust: true +`[1:]} + + c.Assert(result, gc.Equals, expectedResult) + s.st.CheckCall(c, 0, "ExportPartial", s.st.GetExportConfig()) +} + +func (s *bundleSuite) TestExportBundleWithApplicationOffers(c *gc.C) { + s.SetFeatureFlags(feature.CMRAwareBundles) + s.st.model = description.NewModel(description.ModelArgs{Owner: names.NewUserTag("magic"), + Config: map[string]interface{}{ + "name": "awesome", + "uuid": "some-uuid", + }, + CloudRegion: "some-region"}) + + app := s.st.model.AddApplication(s.minimalApplicationArgs(description.IAAS)) + app.SetStatus(minimalStatusArgs()) + + u := app.AddUnit(minimalUnitArgs(app.Type())) + u.SetAgentStatus(minimalStatusArgs()) + + s.st.model.SetStatus(description.StatusArgs{Value: "available"}) + + _ = app.AddOffer(description.ApplicationOfferArgs{ + OfferName: "my-offer", + Endpoints: []string{"endpoint-1", "endpoint-2"}, + ACL: map[string]string{ + "admin": "admin", + "foo": "consume", + }, + }) + + _ = app.AddOffer(description.ApplicationOfferArgs{ + OfferName: "my-other-offer", + Endpoints: []string{"endpoint-1", "endpoint-2"}, + }) + + result, err := s.facade.ExportBundle() + c.Assert(err, jc.ErrorIsNil) + expectedResult := params.StringResult{nil, ` +series: trusty +applications: + ubuntu: + charm: cs:trusty/ubuntu + num_units: 1 + to: + - "0" + options: + key: value + bindings: + juju-info: vlan2 + offers: + my-offer: + endpoints: + - endpoint-1 + - endpoint-2 + acl: + admin: admin + foo: consume + my-other-offer: + endpoints: + - endpoint-1 + - endpoint-2 +`[1:]} + + c.Assert(result, gc.Equals, expectedResult) s.st.CheckCall(c, 0, "ExportPartial", s.st.GetExportConfig()) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/client/status.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/client/status.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/client/status.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/client/status.go 2019-06-28 17:10:43.000000000 +0000 @@ -1126,9 +1126,7 @@ } processedStatus.Scale = application.GetScale() } - processedStatus.EndpointBindings = context.allAppsUnitsCharmBindings.endpointBindings[application.Name()] - return processedStatus } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/highavailability/highavailability.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/highavailability/highavailability.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/highavailability/highavailability.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/highavailability/highavailability.go 2019-06-28 17:10:43.000000000 +0000 @@ -170,11 +170,11 @@ controllerId := controllerIds[0] // Load the controller machine and get its constraints. - controller, err := st.Machine(strconv.Itoa(controllerId)) + cm, err := st.Machine(strconv.Itoa(controllerId)) if err != nil { return nil, errors.Annotatef(err, "reading controller id %v", controllerId) } - return controller, nil + return cm, nil } // validateCurrentControllers checks for a scenario where there is no HA space @@ -189,11 +189,11 @@ var badIds []string for _, id := range machineIds { - controller, err := st.Machine(id) + cm, err := st.Machine(id) if err != nil { return errors.Annotatef(err, "reading controller id %v", id) } - addresses := controller.Addresses() + addresses := cm.Addresses() if len(addresses) == 0 { // machines without any address are essentially not started yet continue diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/interface.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/interface.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/interface.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/interface.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,10 +7,11 @@ "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" + "github.com/juju/juju/core/cache" "github.com/juju/juju/core/settings" ) -//go:generate mockgen -package mocks -destination mocks/package_mock.go github.com/juju/juju/apiserver/facades/client/modelgeneration State,Model,Generation,Application +//go:generate mockgen -package mocks -destination mocks/package_mock.go github.com/juju/juju/apiserver/facades/client/modelgeneration State,Model,Generation,Application,ModelCache // State represents the state of a model required by the model generation API. type State interface { @@ -27,6 +28,11 @@ Branches() ([]Generation, error) } +// ModelCache describes a cached model used by the model generation API. +type ModelCache interface { + Branch(string) (cache.Branch, error) +} + // Generation defines the methods used by a generation. type Generation interface { BranchName() string @@ -36,6 +42,7 @@ AssignUnit(string) error AssignedUnits() map[string][]string Commit(string) (int, error) + Abort(string) error Config() map[string]settings.ItemChanges } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/mocks/package_mock.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/mocks/package_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/mocks/package_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/mocks/package_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/juju/juju/apiserver/facades/client/modelgeneration (interfaces: State,Model,Generation,Application) +// Source: github.com/juju/juju/apiserver/facades/client/modelgeneration (interfaces: State,Model,Generation,Application,ModelCache) // Package mocks is a generated GoMock package. package mocks @@ -7,6 +7,7 @@ import ( gomock "github.com/golang/mock/gomock" modelgeneration "github.com/juju/juju/apiserver/facades/client/modelgeneration" + cache "github.com/juju/juju/core/cache" settings "github.com/juju/juju/core/settings" charm_v6 "gopkg.in/juju/charm.v6" names_v2 "gopkg.in/juju/names.v2" @@ -170,6 +171,18 @@ return m.recorder } +// Abort mocks base method +func (m *MockGeneration) Abort(arg0 string) error { + ret := m.ctrl.Call(m, "Abort", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Abort indicates an expected call of Abort +func (mr *MockGenerationMockRecorder) Abort(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Abort", reflect.TypeOf((*MockGeneration)(nil).Abort), arg0) +} + // AssignAllUnits mocks base method func (m *MockGeneration) AssignAllUnits(arg0 string) error { ret := m.ctrl.Call(m, "AssignAllUnits", arg0) @@ -315,3 +328,39 @@ func (mr *MockApplicationMockRecorder) UnitNames() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnitNames", reflect.TypeOf((*MockApplication)(nil).UnitNames)) } + +// MockModelCache is a mock of ModelCache interface +type MockModelCache struct { + ctrl *gomock.Controller + recorder *MockModelCacheMockRecorder +} + +// MockModelCacheMockRecorder is the mock recorder for MockModelCache +type MockModelCacheMockRecorder struct { + mock *MockModelCache +} + +// NewMockModelCache creates a new mock instance +func NewMockModelCache(ctrl *gomock.Controller) *MockModelCache { + mock := &MockModelCache{ctrl: ctrl} + mock.recorder = &MockModelCacheMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockModelCache) EXPECT() *MockModelCacheMockRecorder { + return m.recorder +} + +// Branch mocks base method +func (m *MockModelCache) Branch(arg0 string) (cache.Branch, error) { + ret := m.ctrl.Call(m, "Branch", arg0) + ret0, _ := ret[0].(cache.Branch) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Branch indicates an expected call of Branch +func (mr *MockModelCacheMockRecorder) Branch(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Branch", reflect.TypeOf((*MockModelCache)(nil).Branch), arg0) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,8 +20,7 @@ var logger = loggo.GetLogger("juju.apiserver.modelgeneration") -// API implements the ModelGenerationAPI interface and is the concrete implementation -// of the API endpoint. +// API is the concrete implementation of the API endpoint. type API struct { check *common.BlockChecker authorizer facade.Authorizer @@ -29,17 +28,35 @@ isControllerAdmin bool st State model Model + modelCache ModelCache } -// NewModelGenerationFacade provides the signature required for facade registration. -func NewModelGenerationFacade(ctx facade.Context) (*API, error) { +type APIV1 struct { + *API +} + +// NewModelGenerationFacadeV2 provides the signature required for facade registration. +func NewModelGenerationFacadeV2(ctx facade.Context) (*API, error) { authorizer := ctx.Auth() st := &stateShim{State: ctx.State()} m, err := st.Model() if err != nil { return nil, errors.Trace(err) } - return NewModelGenerationAPI(st, authorizer, m) + mc, err := ctx.Controller().Model(st.ModelUUID()) + if err != nil { + return nil, errors.Trace(err) + } + return NewModelGenerationAPI(st, authorizer, m, &modelCacheShim{Model: mc}) +} + +// NewModelGenerationFacade provides the signature required for facade registration. +func NewModelGenerationFacade(ctx facade.Context) (*APIV1, error) { + v2, err := NewModelGenerationFacadeV2(ctx) + if err != nil { + return nil, err + } + return &APIV1{v2}, nil } // NewModelGenerationAPI creates a new API endpoint for dealing with model generations. @@ -47,6 +64,7 @@ st State, authorizer facade.Authorizer, m Model, + mc ModelCache, ) (*API, error) { if !authorizer.AuthClient() { return nil, common.ErrPerm @@ -67,6 +85,7 @@ apiUser: apiUser, st: st, model: m, + modelCache: mc, }, nil } @@ -148,12 +167,12 @@ return result, common.ErrPerm } - generation, err := api.model.Branch(arg.BranchName) + branch, err := api.model.Branch(arg.BranchName) if err != nil { - return result, errors.Trace(err) + return intResultsError(err) } - if genId, err := generation.Commit(api.apiUser.Name()); err != nil { + if genId, err := branch.Commit(api.apiUser.Name()); err != nil { result.Error = common.ServerError(err) } else { result.Result = genId @@ -161,6 +180,32 @@ return result, nil } +// AbortBranch aborts the input branch, marking it complete. However no +// changes are made applicable to the whole model. No units may be assigned +// to the branch when aborting. +func (api *API) AbortBranch(arg params.BranchArg) (params.ErrorResult, error) { + result := params.ErrorResult{} + + isModelAdmin, err := api.hasAdminAccess() + if err != nil { + return result, errors.Trace(err) + } + if !isModelAdmin && !api.isControllerAdmin { + return result, common.ErrPerm + } + + branch, err := api.model.Branch(arg.BranchName) + if err != nil { + result.Error = common.ServerError(err) + return result, nil + } + + if err := branch.Abort(api.apiUser.Name()); err != nil { + result.Error = common.ServerError(err) + } + return result, nil +} + // BranchInfo will return details of branch identified by the input argument, // including units on the branch and the configuration disjoint with the // master generation. @@ -184,19 +229,19 @@ branches = make([]Generation, len(args.BranchNames)) for i, name := range args.BranchNames { if branches[i], err = api.model.Branch(name); err != nil { - return generationInfoError(err) + return generationResultsError(err) } } } else { if branches, err = api.model.Branches(); err != nil { - return generationInfoError(err) + return generationResultsError(err) } } results := make([]params.Generation, len(branches)) for i, b := range branches { if results[i], err = api.oneBranchInfo(b, args.Detailed); err != nil { - return generationInfoError(err) + return generationResultsError(err) } } result.Generations = results @@ -204,7 +249,7 @@ } func (api *API) oneBranchInfo(branch Generation, detailed bool) (params.Generation, error) { - delta := branch.Config() + deltas := branch.Config() var apps []params.GenerationApplication for appName, tracking := range branch.AssignedUnits() { @@ -227,7 +272,7 @@ if err != nil { return params.Generation{}, errors.Trace(err) } - branchApp.ConfigChanges = delta[appName].CurrentSettings(defaults) + branchApp.ConfigChanges = deltas[appName].EffectiveChanges(defaults) // TODO (manadart 2019-04-12): Charm URL. @@ -263,7 +308,7 @@ return result, common.ErrPerm } - if _, err := api.model.Branch(arg.BranchName); err != nil { + if _, err := api.modelCache.Branch(arg.BranchName); err != nil { if errors.IsNotFound(err) { result.Result = false } else { @@ -275,6 +320,10 @@ return result, nil } -func generationInfoError(err error) (params.GenerationResults, error) { +func generationResultsError(err error) (params.GenerationResults, error) { return params.GenerationResults{Error: common.ServerError(err)}, nil } + +func intResultsError(err error) (params.IntResult, error) { + return params.IntResult{Error: common.ServerError(err)}, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/modelgeneration_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "github.com/golang/mock/gomock" "github.com/juju/errors" + "github.com/juju/juju/core/cache" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" @@ -24,6 +25,11 @@ apiUser string api *modelgeneration.API + + mockState *mocks.MockState + mockModel *mocks.MockModel + mockGen *mocks.MockGeneration + mockModelCache *mocks.MockModelCache } var _ = gc.Suite(&modelGenerationSuite{}) @@ -42,7 +48,7 @@ // Add more explicit permissions tests once that requirement is ironed out. func (s *modelGenerationSuite) TestAddBranchInvalidNameError(c *gc.C) { - defer s.setupModelGenerationAPI(c, nil).Finish() + defer s.setupModelGenerationAPI(c).Finish() arg := params.BranchArg{BranchName: model.GenerationMaster} result, err := s.api.AddBranch(arg) @@ -52,9 +58,8 @@ } func (s *modelGenerationSuite) TestAddBranchSuccess(c *gc.C) { - defer s.setupModelGenerationAPI(c, func(_ *gomock.Controller, _ *mocks.MockState, mod *mocks.MockModel) { - mod.EXPECT().AddBranch(s.newBranchName, s.apiUser).Return(nil) - }).Finish() + defer s.setupModelGenerationAPI(c).Finish() + s.expectAddBranch() result, err := s.api.AddBranch(s.newBranchArg()) c.Assert(err, jc.ErrorIsNil) @@ -62,6 +67,11 @@ } func (s *modelGenerationSuite) TestTrackBranchEntityTypeError(c *gc.C) { + defer s.setupModelGenerationAPI(c).Finish() + s.expectAssignAllUnits("ghost") + s.expectAssignUnit("mysql/0") + s.expectBranch() + arg := params.BranchTrackArg{ BranchName: s.newBranchName, Entities: []params.Entity{ @@ -70,16 +80,6 @@ {Tag: names.NewMachineTag("7").String()}, }, } - - defer s.setupModelGenerationAPI(c, func(ctrl *gomock.Controller, _ *mocks.MockState, mod *mocks.MockModel) { - gen := mocks.NewMockGeneration(ctrl) - gExp := gen.EXPECT() - gExp.AssignAllUnits("ghost").Return(nil) - gExp.AssignUnit("mysql/0").Return(nil) - - mod.EXPECT().Branch(s.newBranchName).Return(gen, nil) - }).Finish() - result, err := s.api.TrackBranch(arg) c.Assert(err, jc.ErrorIsNil) c.Check(result.Results, gc.DeepEquals, []params.ErrorResult{ @@ -90,6 +90,11 @@ } func (s *modelGenerationSuite) TestTrackBranchSuccess(c *gc.C) { + defer s.setupModelGenerationAPI(c).Finish() + s.expectAssignAllUnits("ghost") + s.expectAssignUnit("mysql/0") + s.expectBranch() + arg := params.BranchTrackArg{ BranchName: s.newBranchName, Entities: []params.Entity{ @@ -97,16 +102,6 @@ {Tag: names.NewApplicationTag("ghost").String()}, }, } - - defer s.setupModelGenerationAPI(c, func(ctrl *gomock.Controller, _ *mocks.MockState, mod *mocks.MockModel) { - gen := mocks.NewMockGeneration(ctrl) - gExp := gen.EXPECT() - gExp.AssignAllUnits("ghost").Return(nil) - gExp.AssignUnit("mysql/0").Return(nil) - - mod.EXPECT().Branch(s.newBranchName).Return(gen, nil) - }).Finish() - result, err := s.api.TrackBranch(arg) c.Assert(err, jc.ErrorIsNil) c.Check(result.Results, gc.DeepEquals, []params.ErrorResult{ @@ -115,22 +110,29 @@ }) } -func (s *modelGenerationSuite) TestCommitGeneration(c *gc.C) { - defer s.setupModelGenerationAPI(c, func(ctrl *gomock.Controller, _ *mocks.MockState, mod *mocks.MockModel) { - gen := mocks.NewMockGeneration(ctrl) - gen.EXPECT().Commit(s.apiUser).Return(3, nil) - mod.EXPECT().Branch(s.newBranchName).Return(gen, nil) - }).Finish() +func (s *modelGenerationSuite) TestCommitBranchSuccess(c *gc.C) { + defer s.setupModelGenerationAPI(c).Finish() + s.expectCommit() + s.expectBranch() result, err := s.api.CommitBranch(s.newBranchArg()) c.Assert(err, jc.ErrorIsNil) c.Assert(result, gc.DeepEquals, params.IntResult{Result: 3, Error: nil}) } +func (s *modelGenerationSuite) TestAbortBranchSuccess(c *gc.C) { + defer s.setupModelGenerationAPI(c).Finish() + s.expectAbort() + s.expectBranch() + + result, err := s.api.AbortBranch(s.newBranchArg()) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.DeepEquals, params.ErrorResult{Error: nil}) +} + func (s *modelGenerationSuite) TestHasActiveBranchTrue(c *gc.C) { - defer s.setupModelGenerationAPI(c, func(_ *gomock.Controller, _ *mocks.MockState, mockModel *mocks.MockModel) { - mockModel.EXPECT().Branch(s.newBranchName).Return(nil, nil) - }).Finish() + defer s.setupModelGenerationAPI(c).Finish() + s.expectHasActiveBranch(nil) result, err := s.api.HasActiveBranch(s.newBranchArg()) c.Assert(err, jc.ErrorIsNil) @@ -139,9 +141,8 @@ } func (s *modelGenerationSuite) TestHasActiveBranchFalse(c *gc.C) { - defer s.setupModelGenerationAPI(c, func(_ *gomock.Controller, _ *mocks.MockState, mockModel *mocks.MockModel) { - mockModel.EXPECT().Branch(s.newBranchName).Return(nil, errors.NotFoundf(s.newBranchName)) - }).Finish() + defer s.setupModelGenerationAPI(c).Finish() + s.expectHasActiveBranch(errors.NotFoundf(s.newBranchName)) result, err := s.api.HasActiveBranch(s.newBranchArg()) c.Assert(err, jc.ErrorIsNil) @@ -158,38 +159,26 @@ } func (s *modelGenerationSuite) testBranchInfo(c *gc.C, branchNames []string, detailed bool) { + ctrl := s.setupModelGenerationAPI(c) + defer ctrl.Finish() + units := []string{"redis/0", "redis/1", "redis/2"} - defer s.setupModelGenerationAPI(c, func(ctrl *gomock.Controller, st *mocks.MockState, mod *mocks.MockModel) { - gen := mocks.NewMockGeneration(ctrl) - gExp := gen.EXPECT() - gExp.Config().Return(map[string]settings.ItemChanges{"redis": { - settings.MakeAddition("password", "added-pass"), - settings.MakeDeletion("databases", 100), - settings.MakeModification("ignored-key", "unchanged", "unchanged"), - }}) - gExp.BranchName().Return(s.newBranchName) - gExp.AssignedUnits().Return(map[string][]string{"redis": units[:2]}) - gExp.Created().Return(int64(666)) - gExp.CreatedBy().Return(s.apiUser) - - // Flex the code path based on whether we are getting all branches - // or a sub-set. - if len(branchNames) > 0 { - mod.EXPECT().Branch(s.newBranchName).Return(gen, nil) - } else { - mod.EXPECT().Branches().Return([]modelgeneration.Generation{gen}, nil) - } - - app := mocks.NewMockApplication(ctrl) - app.EXPECT().DefaultCharmConfig().Return(map[string]interface{}{ - "databases": 16, - "password": "", - }, nil) - app.EXPECT().UnitNames().Return(units, nil) + s.expectConfig() + s.expectBranchName() + s.expectAssignedUnits(units[:2]) + s.expectCreated() + s.expectCreatedBy() + + // Flex the code path based on whether we are getting all branches + // or a sub-set. + if len(branchNames) > 0 { + s.expectBranch() + } else { + s.expectBranches() + } - st.EXPECT().Application("redis").Return(app, nil) - }).Finish() + s.setupMockApp(ctrl, units) result, err := s.api.BranchInfo(params.BranchInfoArgs{ BranchNames: branchNames, @@ -205,35 +194,35 @@ c.Assert(gen.CreatedBy, gc.Equals, s.apiUser) c.Assert(gen.Applications, gc.HasLen, 1) - app := gen.Applications[0] - c.Check(app.ApplicationName, gc.Equals, "redis") - c.Check(app.UnitProgress, gc.Equals, "2/3") - c.Check(app.ConfigChanges, gc.DeepEquals, map[string]interface{}{ + genApp := gen.Applications[0] + c.Check(genApp.ApplicationName, gc.Equals, "redis") + c.Check(genApp.UnitProgress, gc.Equals, "2/3") + c.Check(genApp.ConfigChanges, gc.DeepEquals, map[string]interface{}{ "password": "added-pass", "databases": 16, + "port": 8000, }) // Unit lists are only populated when detailed is true. if detailed { - c.Check(app.UnitsTracking, jc.SameContents, units[:2]) - c.Check(app.UnitsPending, jc.SameContents, units[2:]) + c.Check(genApp.UnitsTracking, jc.SameContents, units[:2]) + c.Check(genApp.UnitsPending, jc.SameContents, units[2:]) } else { - c.Check(app.UnitsTracking, gc.IsNil) - c.Check(app.UnitsPending, gc.IsNil) + c.Check(genApp.UnitsTracking, gc.IsNil) + c.Check(genApp.UnitsPending, gc.IsNil) } } -type setupFunc func(*gomock.Controller, *mocks.MockState, *mocks.MockModel) - -func (s *modelGenerationSuite) setupModelGenerationAPI(c *gc.C, fn setupFunc) *gomock.Controller { +func (s *modelGenerationSuite) setupModelGenerationAPI(c *gc.C) *gomock.Controller { ctrl := gomock.NewController(c) - mockState := mocks.NewMockState(ctrl) - sExp := mockState.EXPECT() - sExp.ControllerTag().Return(names.NewControllerTag(s.modelUUID)) + s.mockGen = mocks.NewMockGeneration(ctrl) + + s.mockState = mocks.NewMockState(ctrl) + s.mockState.EXPECT().ControllerTag().Return(names.NewControllerTag(s.modelUUID)) - mockModel := mocks.NewMockModel(ctrl) - mockModel.EXPECT().ModelTag().Return(names.NewModelTag(s.modelUUID)) + s.mockModel = mocks.NewMockModel(ctrl) + s.mockModel.EXPECT().ModelTag().Return(names.NewModelTag(s.modelUUID)) mockAuthorizer := facademocks.NewMockAuthorizer(ctrl) aExp := mockAuthorizer.EXPECT() @@ -241,12 +230,10 @@ aExp.GetAuthTag().Return(names.NewUserTag("test-user")) aExp.AuthClient().Return(true) - if fn != nil { - fn(ctrl, mockState, mockModel) - } + s.mockModelCache = mocks.NewMockModelCache(ctrl) var err error - s.api, err = modelgeneration.NewModelGenerationAPI(mockState, mockAuthorizer, mockModel) + s.api, err = modelgeneration.NewModelGenerationAPI(s.mockState, mockAuthorizer, s.mockModel, s.mockModelCache) c.Assert(err, jc.ErrorIsNil) return ctrl @@ -255,3 +242,70 @@ func (s *modelGenerationSuite) newBranchArg() params.BranchArg { return params.BranchArg{BranchName: s.newBranchName} } + +func (s *modelGenerationSuite) expectAddBranch() { + s.mockModel.EXPECT().AddBranch(s.newBranchName, s.apiUser).Return(nil) +} + +func (s *modelGenerationSuite) expectBranches() { + s.mockModel.EXPECT().Branches().Return([]modelgeneration.Generation{s.mockGen}, nil) +} + +func (s *modelGenerationSuite) expectBranch() { + s.mockModel.EXPECT().Branch(s.newBranchName).Return(s.mockGen, nil) +} + +func (s *modelGenerationSuite) expectHasActiveBranch(err error) { + s.mockModelCache.EXPECT().Branch(s.newBranchName).Return(cache.Branch{}, err) +} + +func (s *modelGenerationSuite) expectAssignAllUnits(appName string) { + s.mockGen.EXPECT().AssignAllUnits(appName).Return(nil) +} + +func (s *modelGenerationSuite) expectAssignUnit(unitName string) { + s.mockGen.EXPECT().AssignUnit(unitName).Return(nil) +} + +func (s *modelGenerationSuite) expectAbort() { + s.mockGen.EXPECT().Abort(s.apiUser).Return(nil) +} + +func (s *modelGenerationSuite) expectCommit() { + s.mockGen.EXPECT().Commit(s.apiUser).Return(3, nil) +} + +func (s *modelGenerationSuite) expectAssignedUnits(units []string) { + s.mockGen.EXPECT().AssignedUnits().Return(map[string][]string{"redis": units}) +} + +func (s *modelGenerationSuite) expectBranchName() { + s.mockGen.EXPECT().BranchName().Return(s.newBranchName) +} + +func (s *modelGenerationSuite) expectCreated() { + s.mockGen.EXPECT().Created().Return(int64(666)) +} + +func (s *modelGenerationSuite) expectCreatedBy() { + s.mockGen.EXPECT().CreatedBy().Return(s.apiUser) +} + +func (s *modelGenerationSuite) expectConfig() { + s.mockGen.EXPECT().Config().Return(map[string]settings.ItemChanges{"redis": { + settings.MakeAddition("password", "added-pass"), + settings.MakeDeletion("databases", 100), + settings.MakeModification("port", 7000, 8000), + }}) +} + +func (s *modelGenerationSuite) setupMockApp(ctrl *gomock.Controller, units []string) { + mockApp := mocks.NewMockApplication(ctrl) + mockApp.EXPECT().DefaultCharmConfig().Return(map[string]interface{}{ + "databases": 16, + "password": "", + }, nil) + mockApp.EXPECT().UnitNames().Return(units, nil) + + s.mockState.EXPECT().Application("redis").Return(mockApp, nil) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/shim.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/shim.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/shim.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelgeneration/shim.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,6 +5,7 @@ import ( "github.com/juju/errors" + "github.com/juju/juju/core/cache" "gopkg.in/juju/charm.v6" "github.com/juju/juju/state" @@ -69,3 +70,7 @@ } return &applicationShim{Application: app}, nil } + +type modelCacheShim struct { + *cache.Model +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager.go 2019-06-28 17:10:43.000000000 +0000 @@ -180,8 +180,15 @@ return nil, err } + // Since we know this is a user tag (because AuthClient is true), + // we just do the type assertion to the UserTag. + if !auth.AuthClient() { + return nil, common.ErrPerm + } + apiUser, _ := auth.GetAuthTag().(names.UserTag) + return NewModelManagerAPI( - common.NewModelManagerBackend(model, pool), + common.NewUserAwareModelManagerBackend(model, pool, apiUser), common.NewModelManagerBackend(ctrlModel, pool), configGetter, caas.New, @@ -522,6 +529,7 @@ cloudSpec, args, cloudTag, + cloudRegionName, cloudCredentialTag, ownerTag) } else { @@ -543,6 +551,7 @@ func (m *ModelManagerAPI) newCAASModel(cloudSpec environs.CloudSpec, createArgs params.ModelCreateArgs, cloudTag names.CloudTag, + cloudRegionName string, cloudCredentialTag names.CloudCredentialTag, ownerTag names.UserTag, ) (common.Model, error) { @@ -585,6 +594,7 @@ model, st, err := m.state.NewModel(state.ModelArgs{ Type: state.ModelTypeCAAS, CloudName: cloudTag.Id(), + CloudRegion: cloudRegionName, CloudCredential: cloudCredentialTag, Config: newConfig, Owner: ownerTag, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/modelmanager/modelmanager_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/loggo" gitjujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" + "github.com/juju/utils" gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" @@ -21,11 +22,13 @@ apiservertesting "github.com/juju/juju/apiserver/testing" "github.com/juju/juju/caas" "github.com/juju/juju/cloud" + "github.com/juju/juju/core/migration" "github.com/juju/juju/core/status" "github.com/juju/juju/environs" "github.com/juju/juju/environs/config" "github.com/juju/juju/environs/context" jujutesting "github.com/juju/juju/juju/testing" + "github.com/juju/juju/network" "github.com/juju/juju/permission" _ "github.com/juju/juju/provider/azure" "github.com/juju/juju/provider/dummy" @@ -866,6 +869,7 @@ destroyStorage := true s.st.model.CheckCalls(c, []gitjujutesting.StubCall{ {"UUID", nil}, + {"Status", nil}, {"Destroy", []interface{}{state.DestroyModelParams{ DestroyStorage: &destroyStorage, MaxWait: common.MaxWait(nil), @@ -1605,6 +1609,70 @@ c.Assert(result.OneError(), gc.ErrorMatches, expectedErr) } +func (s *modelManagerStateSuite) TestModelInfoForMigratedModel(c *gc.C) { + user := names.NewUserTag("admin") + + modelState := s.Factory.MakeModel(c, &factory.ModelParams{ + Owner: user, + }) + defer modelState.Close() + model, err := modelState.Model() + + // Migrate the model and delete it from the state + mig, err := modelState.CreateMigration(state.MigrationSpec{ + InitiatedBy: user, + TargetInfo: migration.TargetInfo{ + ControllerTag: names.NewControllerTag(utils.MustNewUUID().String()), + ControllerAlias: "target", + Addrs: []string{"1.2.3.4:5555"}, + CACert: coretesting.CACert, + AuthTag: names.NewUserTag("user2"), + Password: "secret", + }, + }) + c.Assert(err, jc.ErrorIsNil) + phases := []migration.Phase{migration.IMPORT, migration.VALIDATION, migration.SUCCESS, migration.LOGTRANSFER, migration.REAP, migration.DONE} + for _, phase := range phases { + c.Assert(mig.SetPhase(phase), jc.ErrorIsNil) + } + c.Assert(model.Destroy(state.DestroyModelParams{}), jc.ErrorIsNil) + c.Assert(modelState.RemoveDyingModel(), jc.ErrorIsNil) + + anAuthoriser := s.authoriser + anAuthoriser.Tag = user + endPoint, err := modelmanager.NewModelManagerAPI( + common.NewUserAwareModelManagerBackend(model, s.StatePool, user), + common.NewModelManagerBackend(s.Model, s.StatePool), + nil, nil, anAuthoriser, + s.Model, + s.callContext, + ) + c.Assert(err, jc.ErrorIsNil) + c.Assert(endPoint, gc.NotNil) + + res, err := endPoint.ModelInfo( + params.Entities{ + Entities: []params.Entity{ + {Tag: model.ModelTag().String()}, + }, + }, + ) + c.Assert(err, jc.ErrorIsNil) + c.Assert(res.Results, gc.HasLen, 1) + resErr0 := errors.Cause(res.Results[0].Error) + c.Assert(params.IsRedirect(resErr0), gc.Equals, true) + + pErr, ok := resErr0.(*params.Error) + c.Assert(ok, gc.Equals, true) + + var info params.RedirectErrorInfo + c.Assert(pErr.UnmarshalInfo(&info), jc.ErrorIsNil) + nhp := params.FromNetworkHostPorts(network.NewHostPorts(5555, "1.2.3.4")) + c.Assert(info.Servers, jc.DeepEquals, [][]params.HostPort{nhp}) + c.Assert(info.CACert, gc.Equals, coretesting.CACert) + c.Assert(info.ControllerAlias, gc.Equals, "target") +} + func (s *modelManagerSuite) TestModelStatusV2(c *gc.C) { api := &modelmanager.ModelManagerAPIV2{ &modelmanager.ModelManagerAPIV3{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces.go 2019-06-28 17:10:43.000000000 +0000 @@ -29,12 +29,22 @@ ListSpaces() (params.ListSpacesResults, error) } +// BlockChecker defines the block-checking functionality required by +// the application facade. This is implemented by +// apiserver/common.BlockChecker. +type BlockChecker interface { + ChangeAllowed() error + RemoveAllowed() error +} + // spacesAPI implements the API interface. type spacesAPI struct { backing networkingcommon.NetworkBacking resources facade.Resources authorizer facade.Authorizer context context.ProviderCallContext + + check BlockChecker } // NewAPI creates a new Space API server-side facade with a @@ -44,12 +54,12 @@ if err != nil { return nil, errors.Trace(err) } - return newAPIWithBacking(stateShim, state.CallContext(st), res, auth) + return newAPIWithBacking(stateShim, common.NewBlockChecker(st), state.CallContext(st), res, auth) } // newAPIWithBacking creates a new server-side Spaces API facade with // the given Backing. -func newAPIWithBacking(backing networkingcommon.NetworkBacking, ctx context.ProviderCallContext, resources facade.Resources, authorizer facade.Authorizer) (API, error) { +func newAPIWithBacking(backing networkingcommon.NetworkBacking, check BlockChecker, ctx context.ProviderCallContext, resources facade.Resources, authorizer facade.Authorizer) (API, error) { // Only clients can access the Spaces facade. if !authorizer.AuthClient() { return nil, common.ErrPerm @@ -59,6 +69,7 @@ resources: resources, authorizer: authorizer, context: ctx, + check: check, }, nil } @@ -77,6 +88,9 @@ if !isAdmin { return results, common.ServerError(common.ErrPerm) } + if err := api.check.ChangeAllowed(); err != nil { + return results, errors.Trace(err) + } return networkingcommon.CreateSpaces(api.backing, api.context, args) } @@ -132,6 +146,9 @@ if !canWrite { return common.ServerError(common.ErrPerm) } + if err := api.check.ChangeAllowed(); err != nil { + return errors.Trace(err) + } env, err := environs.GetEnviron(api.backing, environs.New) if err != nil { return errors.Trace(err) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/client/spaces/spaces_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "fmt" "github.com/juju/errors" + jtesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" @@ -28,7 +29,8 @@ authorizer apiservertesting.FakeAuthorizer facade spaces.API - callContext context.ProviderCallContext + callContext context.ProviderCallContext + blockChecker mockBlockChecker } var _ = gc.Suite(&SpacesSuite{}) @@ -53,9 +55,11 @@ } s.callContext = context.NewCloudCallContext() + s.blockChecker = mockBlockChecker{} var err error s.facade, err = spaces.NewAPIWithBacking( apiservertesting.BackingInstance, + &s.blockChecker, s.callContext, s.resources, s.authorizer, ) @@ -74,6 +78,7 @@ // Clients are allowed. facade, err := spaces.NewAPIWithBacking( apiservertesting.BackingInstance, + &s.blockChecker, s.callContext, s.resources, s.authorizer, ) @@ -87,6 +92,7 @@ agentAuthorizer.Tag = names.NewMachineTag("42") facade, err = spaces.NewAPIWithBacking( apiservertesting.BackingInstance, + &s.blockChecker, context.NewCloudCallContext(), s.resources, agentAuthorizer, @@ -380,11 +386,26 @@ c.Assert(err, gc.ErrorMatches, "spaces not supported") } +func (s *SpacesSuite) TestReloadSpacesBlocked(c *gc.C) { + s.blockChecker.SetErrors(common.ServerError(common.OperationBlockedError("test block"))) + err := s.facade.ReloadSpaces() + c.Assert(err, gc.ErrorMatches, "test block") + c.Assert(err, jc.Satisfies, params.IsCodeOperationBlocked) +} + +func (s *SpacesSuite) TestCreateSpacesBlocked(c *gc.C) { + s.blockChecker.SetErrors(common.ServerError(common.OperationBlockedError("test block"))) + _, err := s.facade.CreateSpaces(params.CreateSpacesParams{}) + c.Assert(err, gc.ErrorMatches, "test block") + c.Assert(err, jc.Satisfies, params.IsCodeOperationBlocked) +} + func (s *SpacesSuite) TestReloadSpacesUserDenied(c *gc.C) { agentAuthorizer := s.authorizer agentAuthorizer.Tag = names.NewUserTag("regular") facade, err := spaces.NewAPIWithBacking( apiservertesting.BackingInstance, + &s.blockChecker, context.NewCloudCallContext(), s.resources, agentAuthorizer, ) @@ -393,3 +414,17 @@ c.Check(err, gc.ErrorMatches, "permission denied") apiservertesting.CheckMethodCalls(c, apiservertesting.SharedStub) } + +type mockBlockChecker struct { + jtesting.Stub +} + +func (c *mockBlockChecker) ChangeAllowed() error { + c.MethodCall(c, "ChangeAllowed") + return c.NextErr() +} + +func (c *mockBlockChecker) RemoveAllowed() error { + c.MethodCall(c, "RemoveAllowed") + return c.NextErr() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/mock_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -156,7 +156,7 @@ return a.scale } -func (a *mockApplication) SetScale(scale int) error { +func (a *mockApplication) SetScale(scale int, generation int64, force bool) error { a.MethodCall(a, "SetScale", scale) a.scale = scale return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner.go 2019-06-28 17:10:43.000000000 +0000 @@ -476,7 +476,7 @@ continue } } - err = a.updateUnitsFromCloud(app, appUpdate.Scale, appUpdate.Units) + err = a.updateUnitsFromCloud(app, appUpdate.Scale, appUpdate.Generation, appUpdate.Units) if err != nil { // Mask any not found errors as the worker (caller) treats them specially // and they are not relevant here. @@ -535,17 +535,21 @@ // source (typically a cloud update event) and merges that with the existing unit // data model in state. The passed in units are the complete set for the cloud, so // any existing units in state with provider ids which aren't in the set will be removed. -func (a *Facade) updateUnitsFromCloud(app Application, scale *int, unitUpdates []params.ApplicationUnitParams) error { +func (a *Facade) updateUnitsFromCloud(app Application, scale *int, generation *int64, unitUpdates []params.ApplicationUnitParams) error { logger.Debugf("unit updates: %#v", unitUpdates) if scale != nil { logger.Debugf("application scale: %v", *scale) + if *scale > 0 && len(unitUpdates) == 0 { + // no ops for empty units because we can not determine if it's stateful or not in this case. + logger.Debugf("ignoring empty k8s event for %q", app.Tag().String()) + return nil + } } // Set up the initial data structures. existingStateUnits, err := app.AllUnits() if err != nil { return errors.Trace(err) } - stateUnitsById := make(map[string]stateUnit) cloudPodsById := make(map[string]params.ApplicationUnitParams) @@ -591,20 +595,20 @@ if !unitAlive { continue } - if providerId == "" { logger.Debugf("unit %q is not associated with any pod", u.Name()) unitInfo.unassociatedUnits = append(unitInfo.unassociatedUnits, u) continue } + stateUnitsById[providerId] = stateUnit{Unit: u} stateUnitInCloud := stateUnitExistsInCloud(providerId) aliveStateIds.Add(providerId) - if stateUnitInCloud { logger.Debugf("unit %q (%v) has changed in the cloud", u.Name(), providerId) unitInfo.stateUnitsInCloud[u.UnitTag().String()] = u } else { + logger.Debugf("unit %q (%v) has removed in the cloud", u.Name(), providerId) extraStateIds.Add(providerId) } } @@ -640,7 +644,7 @@ // First attempt to add any new cloud pod not yet represented in state // to a unit which does not yet have a provider id. if unassociatedUnitCount > 0 { - unassociatedUnitCount -= 1 + unassociatedUnitCount-- unitInfo.addedCloudPods = append(unitInfo.addedCloudPods, u) continue } @@ -664,7 +668,7 @@ if !u.delete && extraUnitsInStateCount > 0 { logger.Debugf("deleting %v because it exceeds the scale of %v", u.Name(), scale) u.delete = true - extraUnitsInStateCount = extraUnitsInStateCount - 1 + extraUnitsInStateCount-- } unitInfo.removedUnits = append(unitInfo.removedUnits, u) } @@ -679,8 +683,12 @@ // Update the scale last now that the state // model accurately reflects the cluster pods. currentScale := app.GetScale() + var gen int64 + if generation != nil { + gen = *generation + } if currentScale != *scale { - return app.SetScale(*scale) + return app.SetScale(*scale, gen, false) } return nil } @@ -907,7 +915,7 @@ updateProps := processUnitParams(unitParams) unitUpdate.Updates = append(unitUpdate.Updates, u.UpdateOperation(*updateProps)) - idx += 1 + idx++ if len(unitParams.FilesystemInfo) > 0 { unitParamsWithFilesystemInfo = append(unitParamsWithFilesystemInfo, unitParams) } @@ -1211,6 +1219,15 @@ if err := app.UpdateCloudService(appUpdate.ProviderId, params.NetworkAddresses(appUpdate.Addresses...)); err != nil { result.Results[i].Error = common.ServerError(err) } + if appUpdate.Scale != nil { + var generation int64 + if appUpdate.Generation != nil { + generation = *appUpdate.Generation + } + if err := app.SetScale(*appUpdate.Scale, generation, false); err != nil { + result.Results[i].Error = common.ServerError(err) + } + } } return result, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/provisioner_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -329,8 +329,19 @@ func intPtr(i int) *int { return &i } +func int64Ptr(i int64) *int64 { + return &i +} func (s *CAASProvisionerSuite) TestUpdateApplicationsStatelessUnits(c *gc.C) { + s.assertUpdateApplicationsStatelessUnits(c, true) +} + +func (s *CAASProvisionerSuite) TestUpdateApplicationsStatelessUnitsWithoutGeneration(c *gc.C) { + s.assertUpdateApplicationsStatelessUnits(c, false) +} + +func (s *CAASProvisionerSuite) assertUpdateApplicationsStatelessUnits(c *gc.C, withGeneration bool) { s.st.application.units = []caasunitprovisioner.Unit{ &mockUnit{name: "gitlab/0", containerInfo: &mockContainerInfo{providerId: "uuid"}, life: state.Alive}, &mockUnit{name: "gitlab/1", life: state.Alive}, @@ -349,18 +360,22 @@ {ProviderId: "really-new-uuid", Address: "really-new-address", Ports: []string{"really-new-port"}, Status: "running", Info: "really new message"}, } - args := params.UpdateApplicationUnitArgs{ - Args: []params.UpdateApplicationUnits{ - {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(4)}, - {ApplicationTag: "application-another", Units: []params.ApplicationUnitParams{}}, - }, + + args := []params.UpdateApplicationUnits{ + {ApplicationTag: "application-another", Units: []params.ApplicationUnitParams{}}, } - results, err := s.facade.UpdateApplicationsUnits(args) + gitlab := params.UpdateApplicationUnits{ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(4)} + if withGeneration { + gitlab.Generation = int64Ptr(1) + } + args = append(args, gitlab) + + results, err := s.facade.UpdateApplicationsUnits(params.UpdateApplicationUnitArgs{Args: args}) c.Assert(err, jc.ErrorIsNil) c.Assert(results, gc.DeepEquals, params.ErrorResults{ Results: []params.ErrorResult{ - {nil}, {¶ms.Error{Message: "application another not found", Code: "not found"}}, + {nil}, }, }) s.st.application.CheckCallNames(c, "Life", "AddOperation", "Name", "GetScale") @@ -416,9 +431,12 @@ } args := params.UpdateApplicationUnitArgs{ Args: []params.UpdateApplicationUnits{ - {ApplicationTag: "application-gitlab", - Units: units, Scale: intPtr(2), - Status: params.EntityStatus{Status: status.Active, Info: "working"}}, + { + ApplicationTag: "application-gitlab", + Units: units, + Scale: intPtr(2), + Generation: int64Ptr(1), + Status: params.EntityStatus{Status: status.Active, Info: "working"}}, }, } results, err := s.facade.UpdateApplicationsUnits(args) @@ -525,7 +543,7 @@ } args := params.UpdateApplicationUnitArgs{ Args: []params.UpdateApplicationUnits{ - {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(3)}, + {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(3), Generation: int64Ptr(1)}, }, } results, err := s.facade.UpdateApplicationsUnits(args) @@ -585,7 +603,7 @@ s.st.application.scale = 3 args := params.UpdateApplicationUnitArgs{ Args: []params.UpdateApplicationUnits{ - {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(3)}, + {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(3), Generation: int64Ptr(1)}, }, } results, err := s.facade.UpdateApplicationsUnits(args) @@ -716,7 +734,7 @@ s.st.application.scale = 1 args := params.UpdateApplicationUnitArgs{ Args: []params.UpdateApplicationUnits{ - {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(1)}, + {ApplicationTag: "application-gitlab", Units: units, Scale: intPtr(1), Generation: int64Ptr(1)}, }, } results, err := s.facade.UpdateApplicationsUnits(args) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/state.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/state.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/state.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/caasunitprovisioner/state.go 2019-06-28 17:10:43.000000000 +0000 @@ -70,7 +70,7 @@ // required by the CAAS unit provisioner facade. type Application interface { GetScale() int - SetScale(int) error + SetScale(int, int64, bool) error WatchScale() state.NotifyWatcher ApplicationConfig() (application.ConfigAttributes, error) AllUnits() (units []Unit, err error) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/mock_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -203,6 +203,11 @@ return st.remoteRelationsWatcher } +func (st *mockState) ApplyOperation(op state.ModelOperation) error { + st.MethodCall(st, "ApplyOperation", op) + return st.NextErr() +} + type mockControllerInfo struct { uuid string info crossmodel.ControllerInfo @@ -308,6 +313,7 @@ url string life state.Life status status.Status + terminated bool message string eps []charm.Relation consumerproxy bool @@ -371,6 +377,17 @@ return nil } +func (r *mockRemoteApplication) TerminateOperation(message string) state.ModelOperation { + r.MethodCall(r, "TerminateOperation", message) + r.terminated = true + return &mockOperation{message: message} +} + +type mockOperation struct { + state.ModelOperation + message string +} + type mockApplication struct { common.Application testing.Stub diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations.go 2019-06-28 17:10:43.000000000 +0000 @@ -411,10 +411,16 @@ result.Results[i].Error = common.ServerError(err) continue } - err = app.SetStatus(status.StatusInfo{ - Status: status.Status(entity.Status), - Message: entity.Info, - }) + statusValue := status.Status(entity.Status) + if statusValue == status.Terminated { + operation := app.TerminateOperation(entity.Info) + err = f.st.ApplyOperation(operation) + } else { + err = app.SetStatus(status.StatusInfo{ + Status: statusValue, + Message: entity.Info, + }) + } result.Results[i].Error = common.ServerError(err) } return result, nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/remoterelations/remoterelations_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -426,3 +426,21 @@ c.Assert(remoteApp.status, gc.Equals, status.Blocked) c.Assert(remoteApp.message, gc.Equals, "a message") } + +func (s *remoteRelationsSuite) TestSetRemoteApplicationsStatusTerminated(c *gc.C) { + remoteApp := newMockRemoteApplication("db2", "url") + s.st.remoteApplications["db2"] = remoteApp + entity := names.NewApplicationTag("db2") + result, err := s.api.SetRemoteApplicationsStatus( + params.SetStatus{Entities: []params.EntityStatusArgs{{ + Tag: entity.String(), + Status: "terminated", + Info: "killer whales", + }}}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result.Results, gc.HasLen, 1) + c.Assert(result.Results[0].Error, gc.IsNil) + c.Assert(remoteApp.terminated, gc.Equals, true) + s.st.CheckCallNames(c, "RemoteApplication", "ApplyOperation") + s.st.CheckCall(c, 1, "ApplyOperation", &mockOperation{message: "killer whales"}) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/mock_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -98,11 +98,12 @@ // mockModel implements Model interface and allows inspection of called // methods. type mockModel struct { - tod time.Time - owner names.UserTag - life state.Life - name string - uuid string + tod time.Time + owner names.UserTag + life state.Life + name string + uuid string + forced bool status status.Status statusInfo string @@ -119,6 +120,10 @@ return m.life } +func (m *mockModel) ForceDestroyed() bool { + return m.forced +} + func (m *mockModel) Tag() names.Tag { return names.NewModelTag(m.uuid) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/state.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/state.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/state.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/state.go 2019-06-28 17:10:43.000000000 +0000 @@ -68,6 +68,10 @@ // Life returns whether the model is Alive, Dying or Dead. Life() state.Life + // ForceDestroyed returns whether the dying/dead model was + // destroyed with --force. Always false for alive models. + ForceDestroyed() bool + // Name returns the human friendly name of the model. Name() string diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker.go 2019-06-28 17:10:43.000000000 +0000 @@ -69,11 +69,12 @@ } result.Result = params.UndertakerModelInfo{ - UUID: model.UUID(), - GlobalName: model.Owner().String() + "/" + model.Name(), - Name: model.Name(), - IsSystem: u.st.IsController(), - Life: params.Life(model.Life().String()), + UUID: model.UUID(), + GlobalName: model.Owner().String() + "/" + model.Name(), + Name: model.Name(), + IsSystem: u.st.IsController(), + Life: params.Life(model.Life().String()), + ForceDestroyed: model.ForceDestroyed(), } return result, nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/controller/undertaker/undertaker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -68,6 +68,7 @@ {st, api, true, "admin"}, } { test.st.model.life = state.Dying + test.st.model.forced = true result, err := test.api.ModelInfo() c.Assert(err, jc.ErrorIsNil) @@ -81,6 +82,7 @@ c.Assert(info.Name, gc.Equals, test.modelName) c.Assert(info.IsSystem, gc.Equals, test.isSystem) c.Assert(info.Life, gc.Equals, params.Dying) + c.Assert(info.ForceDestroyed, gc.Equals, true) } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/schema.json juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/schema.json --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/facades/schema.json 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/facades/schema.json 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,37654 @@ +[ + { + "Name": "Action", + "Version": 3, + "Schema": { + "type": "object", + "properties": { + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "ApplicationsCharmsActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationsCharmActionsResults" + } + } + }, + "Cancel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "Enqueue": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Actions" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "FindActionTagsByPrefix": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindTags" + }, + "Result": { + "$ref": "#/definitions/FindTagsResults" + } + } + }, + "FindActionsByNames": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindActionsByNames" + }, + "Result": { + "$ref": "#/definitions/ActionsByNames" + } + } + }, + "ListAll": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + } + }, + "ListCompleted": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + } + }, + "ListPending": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + } + }, + "ListRunning": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + } + }, + "Run": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RunParams" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "RunOnAllMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RunParams" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + } + }, + "definitions": { + "Action": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "ActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "Actions": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "ActionsByName": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionsByNames": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionsByName" + } + } + }, + "additionalProperties": false + }, + "ActionsByReceiver": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionsByReceivers": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionsByReceiver" + } + } + }, + "additionalProperties": false + }, + "ApplicationCharmActionsResult": { + "type": "object", + "properties": { + "actions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ActionSpec" + } + } + }, + "application-tag": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ApplicationsCharmActionsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCharmActionsResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "FindActionsByNames": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FindTags": { + "type": "object", + "properties": { + "prefixes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "prefixes" + ] + }, + "FindTagsResults": { + "type": "object", + "properties": { + "matches": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "matches" + ] + }, + "RunParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "type": "string" + } + }, + "commands": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + }, + "timeout": { + "type": "integer" + }, + "units": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "commands", + "timeout" + ] + } + } + } + }, + { + "Name": "ActionPruner", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "Prune": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionPruneArgs" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "ActionPruneArgs": { + "type": "object", + "properties": { + "max-history-mb": { + "type": "integer" + }, + "max-history-time": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "max-history-time", + "max-history-mb" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "Agent", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ClearReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "GetEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AgentGetEntitiesResults" + } + } + }, + "IsMaster": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/IsMasterResult" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "StateServingInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StateServingInfo" + } + } + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "AgentGetEntitiesResult": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life", + "jobs", + "container-type" + ] + }, + "AgentGetEntitiesResults": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/AgentGetEntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IsMasterResult": { + "type": "object", + "properties": { + "master": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "master" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StateServingInfo": { + "type": "object", + "properties": { + "api-port": { + "type": "integer" + }, + "ca-private-key": { + "type": "string" + }, + "cert": { + "type": "string" + }, + "controller-api-port": { + "type": "integer" + }, + "private-key": { + "type": "string" + }, + "shared-secret": { + "type": "string" + }, + "state-port": { + "type": "integer" + }, + "system-identity": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "api-port", + "state-port", + "cert", + "private-key", + "ca-private-key", + "shared-secret", + "system-identity" + ] + } + } + } + }, + { + "Name": "AgentTools", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "UpdateToolsAvailable": { + "type": "object" + } + } + } + }, + { + "Name": "AllModelWatcher", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherNextResults" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "AllWatcherNextResults": { + "type": "object", + "properties": { + "deltas": { + "type": "array", + "items": { + "$ref": "#/definitions/Delta" + } + } + }, + "additionalProperties": false, + "required": [ + "deltas" + ] + }, + "Delta": { + "type": "object", + "properties": { + "entity": { + "type": "object", + "additionalProperties": true + }, + "removed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "removed", + "entity" + ] + } + } + } + }, + { + "Name": "AllWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherNextResults" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "AllWatcherNextResults": { + "type": "object", + "properties": { + "deltas": { + "type": "array", + "items": { + "$ref": "#/definitions/Delta" + } + } + }, + "additionalProperties": false, + "required": [ + "deltas" + ] + }, + "Delta": { + "type": "object", + "properties": { + "entity": { + "type": "object", + "additionalProperties": true + }, + "removed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "removed", + "entity" + ] + } + } + } + }, + { + "Name": "Annotations", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Get": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AnnotationsGetResults" + } + } + }, + "Set": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AnnotationsSet" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "AnnotationsGetResult": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "entity": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/ErrorResult" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "annotations" + ] + }, + "AnnotationsGetResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AnnotationsGetResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "AnnotationsSet": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityAnnotations" + } + } + }, + "additionalProperties": false, + "required": [ + "annotations" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityAnnotations": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "entity": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "annotations" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Application", + "Version": 9, + "Schema": { + "type": "object", + "properties": { + "AddRelation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddRelation" + }, + "Result": { + "$ref": "#/definitions/AddRelationResults" + } + } + }, + "AddUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddApplicationUnits" + }, + "Result": { + "$ref": "#/definitions/AddApplicationUnitsResults" + } + } + }, + "ApplicationsInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationInfoResults" + } + } + }, + "CharmConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGetArgs" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + } + }, + "CharmRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationCharmRelations" + }, + "Result": { + "$ref": "#/definitions/ApplicationCharmRelationsResults" + } + } + }, + "Consume": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ConsumeApplicationArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Deploy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationsDeploy" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Destroy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationDestroy" + } + } + }, + "DestroyApplication": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/DestroyApplicationResults" + } + } + }, + "DestroyConsumedApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyConsumedApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DestroyRelation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyRelation" + } + } + }, + "DestroyUnit": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyUnitsParams" + }, + "Result": { + "$ref": "#/definitions/DestroyUnitResults" + } + } + }, + "DestroyUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationUnits" + } + } + }, + "Expose": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationExpose" + } + } + }, + "Get": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetResults" + } + } + }, + "GetCharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "GetConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + } + }, + "GetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConstraintsResults" + } + } + }, + "ResolveUnitErrors": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UnitsResolved" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ScaleApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ScaleApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/ScaleApplicationResults" + } + } + }, + "Set": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationSet" + } + } + }, + "SetApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationConfigSetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationSetCharm" + } + } + }, + "SetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + } + }, + "SetMetricCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationMetricCredentials" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetRelationsSuspended": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationSuspendedArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Unexpose": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationUnexpose" + } + } + }, + "Unset": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationUnset" + } + } + }, + "UnsetApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationConfigUnsetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Update": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationUpdate" + } + } + }, + "UpdateApplicationSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "AddApplicationUnits": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "attach-storage": { + "type": "array", + "items": { + "type": "string" + } + }, + "num-units": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "$ref": "#/definitions/Placement" + } + }, + "policy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "num-units", + "placement" + ] + }, + "AddApplicationUnitsResults": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "AddRelation": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "via-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "endpoints" + ] + }, + "AddRelationResults": { + "type": "object", + "properties": { + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + } + }, + "additionalProperties": false, + "required": [ + "endpoints" + ] + }, + "ApplicationCharmRelations": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationCharmRelationsResults": { + "type": "object", + "properties": { + "charm-relations": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "charm-relations" + ] + }, + "ApplicationConfigSet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "generation": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "generation", + "config" + ] + }, + "ApplicationConfigSetArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationConfigSet" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "ApplicationConfigUnsetArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnset" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "ApplicationConstraint": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "ApplicationDeploy": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "attach-storage": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "charm-url": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "config-yaml": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "num-units": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "$ref": "#/definitions/Placement" + } + }, + "policy": { + "type": "string" + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "series": { + "type": "string" + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "series", + "charm-url", + "channel", + "num-units", + "config-yaml", + "constraints" + ] + }, + "ApplicationDestroy": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationExpose": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationGet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch" + ] + }, + "ApplicationGetArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationGet" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ApplicationGetConstraintsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ApplicationGetResults": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "channel": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm", + "config", + "constraints", + "series", + "channel" + ] + }, + "ApplicationInfo": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "exposed": { + "type": "boolean" + }, + "principal": { + "type": "boolean" + }, + "remote": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "principal", + "exposed", + "remote" + ] + }, + "ApplicationInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationInfo" + } + }, + "additionalProperties": false + }, + "ApplicationInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ApplicationMetricCredential": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "metrics-credentials": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "metrics-credentials" + ] + }, + "ApplicationMetricCredentials": { + "type": "object", + "properties": { + "creds": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationMetricCredential" + } + } + }, + "additionalProperties": false, + "required": [ + "creds" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description" + ] + }, + "ApplicationSet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "options": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch", + "options" + ] + }, + "ApplicationSetCharm": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "charm-url": { + "type": "string" + }, + "config-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "config-settings-yaml": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "force-series": { + "type": "boolean" + }, + "force-units": { + "type": "boolean" + }, + "generation": { + "type": "string" + }, + "resource-ids": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "storage-constraints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StorageConstraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "generation", + "charm-url", + "channel", + "force", + "force-units", + "force-series" + ] + }, + "ApplicationUnexpose": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationUnset": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch", + "options" + ] + }, + "ApplicationUpdate": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "charm-url": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "force": { + "type": "boolean" + }, + "force-charm-url": { + "type": "boolean" + }, + "force-series": { + "type": "boolean" + }, + "generation": { + "type": "string" + }, + "min-units": { + "type": "integer" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "settings-yaml": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm-url", + "force-charm-url", + "force-series", + "force", + "settings-yaml", + "generation" + ] + }, + "ApplicationsDeploy": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationDeploy" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "ConsumeApplicationArg": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-alias": { + "type": "string" + }, + "external-controller": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + } + }, + "additionalProperties": false, + "required": [ + "ApplicationOfferDetails" + ] + }, + "ConsumeApplicationArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeApplicationArg" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "destroyed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "force" + ] + }, + "DestroyApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyApplicationInfo" + } + }, + "additionalProperties": false + }, + "DestroyApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyApplicationResult" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationUnits": { + "type": "object", + "properties": { + "unit-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "unit-names" + ] + }, + "DestroyApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "DestroyConsumedApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-tag" + ] + }, + "DestroyConsumedApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyConsumedApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "DestroyRelation": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "relation-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "relation-id" + ] + }, + "DestroyUnitInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitParams": { + "type": "object", + "properties": { + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "force" + ] + }, + "DestroyUnitResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyUnitInfo" + } + }, + "additionalProperties": false + }, + "DestroyUnitResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitResult" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitsParams": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "OfferUserDetails": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "RelationSuspendedArg": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "relation-id": { + "type": "integer" + }, + "suspended": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "relation-id", + "message", + "suspended" + ] + }, + "RelationSuspendedArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationSuspendedArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "ScaleApplicationInfo": { + "type": "object", + "properties": { + "num-units": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "num-units" + ] + }, + "ScaleApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "scale": { + "type": "integer" + }, + "scale-change": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "scale", + "force" + ] + }, + "ScaleApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/ScaleApplicationInfo" + } + }, + "additionalProperties": false + }, + "ScaleApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleApplicationResult" + } + } + }, + "additionalProperties": false + }, + "ScaleApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "SetConstraints": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "application", + "constraints" + ] + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "Subnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + }, + "UnitsResolved": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "retry": { + "type": "boolean" + }, + "tags": { + "$ref": "#/definitions/Entities" + } + }, + "additionalProperties": false + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "ApplicationOffers", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferURLs" + }, + "Result": { + "$ref": "#/definitions/ApplicationOffersResults" + } + } + }, + "DestroyOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationOffers" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "FindApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferFilters" + }, + "Result": { + "$ref": "#/definitions/QueryApplicationOffersResults" + } + } + }, + "GetConsumeDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferURLs" + }, + "Result": { + "$ref": "#/definitions/ConsumeOfferDetailsResults" + } + } + }, + "ListApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferFilters" + }, + "Result": { + "$ref": "#/definitions/QueryApplicationOffersResults" + } + } + }, + "ModifyOfferAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyOfferAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Offer": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddApplicationOffers" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoteApplicationInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferURLs" + }, + "Result": { + "$ref": "#/definitions/RemoteApplicationInfoResults" + } + } + } + }, + "definitions": { + "AddApplicationOffer": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "model-tag": { + "type": "string" + }, + "offer-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "offer-name", + "application-name", + "application-description", + "endpoints" + ] + }, + "AddApplicationOffers": { + "type": "object", + "properties": { + "Offers": { + "type": "array", + "items": { + "$ref": "#/definitions/AddApplicationOffer" + } + } + }, + "additionalProperties": false, + "required": [ + "Offers" + ] + }, + "ApplicationOfferAdminDetails": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-name": { + "type": "string" + }, + "charm-url": { + "type": "string" + }, + "connections": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferConnection" + } + } + }, + "additionalProperties": false, + "required": [ + "ApplicationOfferDetails", + "application-name", + "charm-url" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description" + ] + }, + "ApplicationOfferResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationOfferAdminDetails" + } + }, + "additionalProperties": false + }, + "ApplicationOffersResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferResult" + } + } + }, + "additionalProperties": false + }, + "ConsumeOfferDetails": { + "type": "object", + "properties": { + "external-controller": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "offer": { + "$ref": "#/definitions/ApplicationOfferDetails" + } + }, + "additionalProperties": false + }, + "ConsumeOfferDetailsResult": { + "type": "object", + "properties": { + "ConsumeOfferDetails": { + "$ref": "#/definitions/ConsumeOfferDetails" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "ConsumeOfferDetails" + ] + }, + "ConsumeOfferDetailsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeOfferDetailsResult" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationOffers": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "offer-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "offer-urls" + ] + }, + "EndpointFilterAttributes": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "role", + "interface", + "name" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "ModifyOfferAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access", + "offer-url" + ] + }, + "ModifyOfferAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyOfferAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "OfferConnection": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "ingress-subnets": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-id": { + "type": "integer" + }, + "source-model-tag": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "relation-id", + "username", + "endpoint", + "status", + "ingress-subnets" + ] + }, + "OfferFilter": { + "type": "object", + "properties": { + "allowed-users": { + "type": "array", + "items": { + "type": "string" + } + }, + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "application-user": { + "type": "string" + }, + "connected-users": { + "type": "array", + "items": { + "type": "string" + } + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/EndpointFilterAttributes" + } + }, + "model-name": { + "type": "string" + }, + "offer-name": { + "type": "string" + }, + "owner-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "owner-name", + "model-name", + "offer-name", + "application-name", + "application-description", + "application-user", + "endpoints", + "connected-users", + "allowed-users" + ] + }, + "OfferFilters": { + "type": "object", + "properties": { + "Filters": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferFilter" + } + } + }, + "additionalProperties": false, + "required": [ + "Filters" + ] + }, + "OfferURLs": { + "type": "object", + "properties": { + "offer-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "OfferUserDetails": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "QueryApplicationOffersResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferAdminDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteApplicationInfo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "icon-url-path": { + "type": "string" + }, + "model-tag": { + "type": "string" + }, + "name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "source-model-label": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "name", + "description", + "offer-url", + "endpoints", + "icon-url-path" + ] + }, + "RemoteApplicationInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteApplicationInfo" + } + }, + "additionalProperties": false + }, + "RemoteApplicationInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteApplicationInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "Subnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + } + } + } + }, + { + "Name": "ApplicationScaler", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Rescale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Backups", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Create": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsCreateArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsMetadataResult" + } + } + }, + "FinishRestore": { + "type": "object" + }, + "Info": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsInfoArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsMetadataResult" + } + } + }, + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsListArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsListResult" + } + } + }, + "PrepareRestore": { + "type": "object" + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsRemoveArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Restore": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RestoreArgs" + } + } + } + }, + "definitions": { + "BackupsCreateArgs": { + "type": "object", + "properties": { + "keep-copy": { + "type": "boolean" + }, + "no-download": { + "type": "boolean" + }, + "notes": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "notes", + "keep-copy", + "no-download" + ] + }, + "BackupsInfoArgs": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "BackupsListArgs": { + "type": "object", + "additionalProperties": false + }, + "BackupsListResult": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/BackupsMetadataResult" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "BackupsMetadataResult": { + "type": "object", + "properties": { + "ca-cert": { + "type": "string" + }, + "ca-private-key": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "checksum-format": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "finished": { + "type": "string", + "format": "date-time" + }, + "hostname": { + "type": "string" + }, + "id": { + "type": "string" + }, + "machine": { + "type": "string" + }, + "model": { + "type": "string" + }, + "notes": { + "type": "string" + }, + "series": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "started": { + "type": "string", + "format": "date-time" + }, + "stored": { + "type": "string", + "format": "date-time" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "id", + "checksum", + "checksum-format", + "size", + "stored", + "started", + "finished", + "notes", + "model", + "machine", + "hostname", + "version", + "series", + "ca-cert", + "ca-private-key", + "filename" + ] + }, + "BackupsRemoveArgs": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "RestoreArgs": { + "type": "object", + "properties": { + "backup-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backup-id" + ] + } + } + } + }, + { + "Name": "Block", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BlockResults" + } + } + }, + "SwitchBlockOff": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BlockSwitchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "SwitchBlockOn": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BlockSwitchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "definitions": { + "Block": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "tag", + "type" + ] + }, + "BlockResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Block" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BlockResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockResult" + } + } + }, + "additionalProperties": false + }, + "BlockSwitchParams": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Bundle", + "Version": 3, + "Schema": { + "type": "object", + "properties": { + "ExportBundle": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "GetChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BundleChangesParams" + }, + "Result": { + "$ref": "#/definitions/BundleChangesResults" + } + } + } + }, + "definitions": { + "BundleChange": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "requires": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "method", + "args", + "requires" + ] + }, + "BundleChangesParams": { + "type": "object", + "properties": { + "bundleURL": { + "type": "string" + }, + "yaml": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "yaml", + "bundleURL" + ] + }, + "BundleChangesResults": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/BundleChange" + } + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "CAASAgent", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "CAASFirewaller", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + } + }, + "IsExposed": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "CAASOperator", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "Charm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationCharmResults" + } + } + }, + "CurrentModel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelResult" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPodSpecParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesVersion" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationCharm": { + "type": "object", + "properties": { + "charm-modified-version": { + "type": "integer" + }, + "force-upgrade": { + "type": "boolean" + }, + "sha256": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "sha256", + "charm-modified-version" + ] + }, + "ApplicationCharmResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationCharm" + } + }, + "additionalProperties": false + }, + "ApplicationCharmResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCharmResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Number", + "Series", + "Arch" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesVersion": { + "type": "object", + "properties": { + "agent-tools": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "agent-tools" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "EntityString": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "value" + ] + }, + "EntityVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "tools": { + "$ref": "#/definitions/Version" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "tools" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SetPodSpecParams": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityString" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Version": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + } + } + } + }, + { + "Name": "CAASOperatorProvisioner", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "OperatorProvisioningInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/OperatorProvisioningInfo" + } + } + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "KubernetesFilesystemAttachmentParams": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesFilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesFilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "OperatorProvisioningInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-storage": { + "$ref": "#/definitions/KubernetesFilesystemParams" + }, + "image-path": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "image-path", + "version", + "api-addresses", + "charm-storage" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "CAASOperatorUpgrader", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "UpgradeOperator": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/KubernetesUpgradeArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "KubernetesUpgradeArg": { + "type": "object", + "properties": { + "agent-tag": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "agent-tag", + "version" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + } + } + } + }, + { + "Name": "CAASUnitProvisioner", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + } + }, + "ApplicationsScale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/KubernetesProvisioningInfoResults" + } + } + }, + "SetOperatorStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateApplicationsService": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateApplicationServiceArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateApplicationsUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateApplicationUnitArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "WatchApplicationsScale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ApplicationUnitParams": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-info": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemInfo" + } + }, + "info": { + "type": "string" + }, + "ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "stateful": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider-id", + "unit-tag", + "address", + "ports", + "status", + "info" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "KubernetesDeploymentInfo": { + "type": "object", + "properties": { + "deployment-type": { + "type": "string" + }, + "service-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "deployment-type", + "service-type" + ] + }, + "KubernetesDeviceParams": { + "type": "object", + "properties": { + "Attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "Count": { + "type": "integer" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Type", + "Count", + "Attributes" + ] + }, + "KubernetesFilesystemAttachmentParams": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesFilesystemInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "mount-point": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "read-only": { + "type": "boolean" + }, + "size": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "storagename": { + "type": "string" + }, + "volume": { + "$ref": "#/definitions/KubernetesVolumeInfo" + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "pool", + "size", + "filesystem-id", + "status", + "info", + "volume" + ] + }, + "KubernetesFilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesFilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "KubernetesProvisioningInfo": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "deployment-info": { + "$ref": "#/definitions/KubernetesDeploymentInfo" + }, + "devices": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesDeviceParams" + } + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemParams" + } + }, + "pod-spec": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesVolumeParams" + } + } + }, + "additionalProperties": false, + "required": [ + "pod-spec", + "constraints" + ] + }, + "KubernetesProvisioningInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/KubernetesProvisioningInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "KubernetesProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesProvisioningInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "KubernetesVolumeAttachmentParams": { + "type": "object", + "properties": { + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesVolumeInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "volume-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent", + "status", + "info" + ] + }, + "KubernetesVolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesVolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "UpdateApplicationServiceArg": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "application-tag": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "provider-id": { + "type": "string" + }, + "scale": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "provider-id", + "addresses" + ] + }, + "UpdateApplicationServiceArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationServiceArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpdateApplicationUnitArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationUnits" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpdateApplicationUnits": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "scale": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "units" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CharmRevisionUpdater", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "UpdateLatestRevisions": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Charms", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/CharmInfo" + } + } + }, + "IsMetered": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/IsMeteredResult" + } + } + }, + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmsList" + }, + "Result": { + "$ref": "#/definitions/CharmsListResult" + } + } + } + }, + "definitions": { + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmInfo": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmMeta": { + "type": "object", + "properties": { + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "CharmsList": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "names" + ] + }, + "CharmsListResult": { + "type": "object", + "properties": { + "charm-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "charm-urls" + ] + }, + "IsMeteredResult": { + "type": "object", + "properties": { + "metered": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "metered" + ] + } + } + } + }, + { + "Name": "Cleaner", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Cleanup": { + "type": "object" + }, + "WatchCleanups": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "Client", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "AbortCurrentUpgrade": { + "type": "object" + }, + "AddCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharm" + } + } + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharmWithAuthorization" + } + } + }, + "AddMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + } + }, + "AddMachinesV2": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + } + }, + "AgentVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AgentVersionResult" + } + } + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + } + }, + "DestroyMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyMachines" + } + } + }, + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + } + }, + "FullStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusParams" + }, + "Result": { + "$ref": "#/definitions/FullStatus" + } + } + }, + "GetBundleChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BundleChangesParams" + }, + "Result": { + "$ref": "#/definitions/BundleChangesResults" + } + } + }, + "GetModelConstraints": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/GetConstraintsResults" + } + } + }, + "InjectMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + } + }, + "ModelGet": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + } + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelInfo" + } + } + }, + "ModelSet": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSet" + } + } + }, + "ModelUnset": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelUnset" + } + } + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelUserInfoResults" + } + } + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PrivateAddress" + }, + "Result": { + "$ref": "#/definitions/PrivateAddressResults" + } + } + }, + "ProvisioningScript": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ProvisioningScriptParams" + }, + "Result": { + "$ref": "#/definitions/ProvisioningScriptResult" + } + } + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PublicAddress" + }, + "Result": { + "$ref": "#/definitions/PublicAddressResults" + } + } + }, + "ResolveCharms": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ResolveCharms" + }, + "Result": { + "$ref": "#/definitions/ResolveCharmResults" + } + } + }, + "Resolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Resolved" + } + } + }, + "RetryProvisioning": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "SetModelAgentVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelAgentVersion" + } + } + }, + "SetModelConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + } + }, + "SetSLALevel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSLA" + } + } + }, + "StatusHistory": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusHistoryRequests" + }, + "Result": { + "$ref": "#/definitions/StatusHistoryResults" + } + } + }, + "WatchAll": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherId" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "AddCharm": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "channel", + "force" + ] + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "channel", + "macaroon", + "force" + ] + }, + "AddMachineParams": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "container-type": { + "type": "string" + }, + "disks": { + "type": "array", + "items": { + "$ref": "#/definitions/Constraints" + } + }, + "hardware-characteristics": { + "$ref": "#/definitions/HardwareCharacteristics" + }, + "instance-id": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "nonce": { + "type": "string" + }, + "parent-id": { + "type": "string" + }, + "placement": { + "$ref": "#/definitions/Placement" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "series", + "constraints", + "jobs", + "parent-id", + "container-type", + "instance-id", + "nonce", + "hardware-characteristics", + "addresses" + ] + }, + "AddMachines": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachineParams" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "AddMachinesResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "machine": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine" + ] + }, + "AddMachinesResults": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachinesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "machines" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "AgentVersionResult": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "AllWatcherId": { + "type": "object", + "properties": { + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "ApplicationOfferStatus": { + "type": "object", + "properties": { + "active-connected-count": { + "type": "integer" + }, + "application-name": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/RemoteEndpoint" + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "offer-name": { + "type": "string" + }, + "total-connected-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "application-name", + "charm", + "endpoints", + "active-connected-count", + "total-connected-count" + ] + }, + "ApplicationStatus": { + "type": "object", + "properties": { + "can-upgrade-to": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "charm-profile": { + "type": "string" + }, + "charm-verion": { + "type": "string" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "exposed": { + "type": "boolean" + }, + "int": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "meter-statuses": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MeterStatus" + } + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "series": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + }, + "subordinate-to": { + "type": "array", + "items": { + "type": "string" + } + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitStatus" + } + } + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "charm", + "series", + "exposed", + "life", + "relations", + "can-upgrade-to", + "subordinate-to", + "units", + "meter-statuses", + "status", + "workload-version", + "charm-verion", + "charm-profile", + "endpoint-bindings", + "public-address" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Number", + "Series", + "Arch" + ] + }, + "BundleChange": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "requires": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "method", + "args", + "requires" + ] + }, + "BundleChangesParams": { + "type": "object", + "properties": { + "bundleURL": { + "type": "string" + }, + "yaml": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "yaml", + "bundleURL" + ] + }, + "BundleChangesResults": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/BundleChange" + } + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "DestroyMachines": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "machine-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-names", + "force" + ] + }, + "DetailedStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "data", + "since", + "kind", + "version", + "life" + ] + }, + "EndpointStatus": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "subordinate": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "role", + "subordinate" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "arch", + "series", + "agentstream" + ] + }, + "FindToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "FullStatus": { + "type": "object", + "properties": { + "applications": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ApplicationStatus" + } + } + }, + "controller-timestamp": { + "type": "string", + "format": "date-time" + }, + "machines": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MachineStatus" + } + } + }, + "model": { + "$ref": "#/definitions/ModelStatusInfo" + }, + "offers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ApplicationOfferStatus" + } + } + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationStatus" + } + }, + "remote-applications": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/RemoteApplicationStatus" + } + } + } + }, + "additionalProperties": false, + "required": [ + "model", + "machines", + "applications", + "remote-applications", + "offers", + "relations", + "controller-timestamp" + ] + }, + "GetConstraintsResults": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "HardwareCharacteristics": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cpu-cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "History": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/DetailedStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "statuses" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "LXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "MachineHardware": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "MachineStatus": { + "type": "object", + "properties": { + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "constraints": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MachineStatus" + } + } + }, + "display-name": { + "type": "string" + }, + "dns-name": { + "type": "string" + }, + "hardware": { + "type": "string" + }, + "has-vote": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "instance-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "ip-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "lxd-profiles": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/LXDProfile" + } + } + }, + "modification-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "network-interfaces": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/NetworkInterface" + } + } + }, + "series": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "instance-status", + "modification-status", + "dns-name", + "instance-id", + "display-name", + "series", + "id", + "containers", + "constraints", + "hardware", + "jobs", + "has-vote", + "wants-vote" + ] + }, + "MeterStatus": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "message" + ] + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "cloud-credential-tag": { + "type": "string" + }, + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "default-series": { + "type": "string" + }, + "is-controller": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "migration": { + "$ref": "#/definitions/ModelMigrationStatus" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "provider-type": { + "type": "string" + }, + "sla": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "type": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUserInfo" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "uuid", + "controller-uuid", + "is-controller", + "cloud-tag", + "owner-tag", + "life", + "users", + "machines", + "sla", + "agent-version" + ] + }, + "ModelMachineInfo": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "hardware": { + "$ref": "#/definitions/MachineHardware" + }, + "has-vote": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelMigrationStatus": { + "type": "object", + "properties": { + "end": { + "type": "string", + "format": "date-time" + }, + "start": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "start" + ] + }, + "ModelSLA": { + "type": "object", + "properties": { + "ModelSLAInfo": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "creds": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "ModelSLAInfo", + "creds" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelStatusInfo": { + "type": "object", + "properties": { + "available-version": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "meter-status": { + "$ref": "#/definitions/MeterStatus" + }, + "model-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "sla": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "cloud-tag", + "version", + "available-version", + "model-status", + "meter-status", + "sla" + ] + }, + "ModelUnset": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "last-connection", + "access" + ] + }, + "ModelUserInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelUserInfo" + } + }, + "additionalProperties": false + }, + "ModelUserInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUserInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NetworkInterface": { + "type": "object", + "properties": { + "dns-nameservers": { + "type": "array", + "items": { + "type": "string" + } + }, + "gateway": { + "type": "string" + }, + "ip-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "is-up": { + "type": "boolean" + }, + "mac-address": { + "type": "string" + }, + "space": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ip-addresses", + "mac-address", + "is-up" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "PrivateAddress": { + "type": "object", + "properties": { + "target": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target" + ] + }, + "PrivateAddressResults": { + "type": "object", + "properties": { + "private-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "private-address" + ] + }, + "ProvisioningScriptParams": { + "type": "object", + "properties": { + "data-dir": { + "type": "string" + }, + "disable-package-commands": { + "type": "boolean" + }, + "machine-id": { + "type": "string" + }, + "nonce": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-id", + "nonce", + "data-dir", + "disable-package-commands" + ] + }, + "ProvisioningScriptResult": { + "type": "object", + "properties": { + "script": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "script" + ] + }, + "PublicAddress": { + "type": "object", + "properties": { + "target": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target" + ] + }, + "PublicAddressResults": { + "type": "object", + "properties": { + "public-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "public-address" + ] + }, + "RelationStatus": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/EndpointStatus" + } + }, + "id": { + "type": "integer" + }, + "interface": { + "type": "string" + }, + "key": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + } + }, + "additionalProperties": false, + "required": [ + "id", + "key", + "interface", + "scope", + "endpoints", + "status" + ] + }, + "RemoteApplicationStatus": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-url", + "offer-name", + "endpoints", + "life", + "relations", + "status" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "ResolveCharmResult": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ResolveCharmResults": { + "type": "object", + "properties": { + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolveCharmResult" + } + } + }, + "additionalProperties": false, + "required": [ + "urls" + ] + }, + "ResolveCharms": { + "type": "object", + "properties": { + "references": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "references" + ] + }, + "Resolved": { + "type": "object", + "properties": { + "retry": { + "type": "boolean" + }, + "unit-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-name", + "retry" + ] + }, + "SetConstraints": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "application", + "constraints" + ] + }, + "SetModelAgentVersion": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "StatusHistoryFilter": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "delta": { + "type": "integer" + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "size", + "date", + "delta", + "exclude" + ] + }, + "StatusHistoryRequest": { + "type": "object", + "properties": { + "filter": { + "$ref": "#/definitions/StatusHistoryFilter" + }, + "historyKind": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "historyKind", + "size", + "filter", + "tag" + ] + }, + "StatusHistoryRequests": { + "type": "object", + "properties": { + "requests": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusHistoryRequest" + } + } + }, + "additionalProperties": false, + "required": [ + "requests" + ] + }, + "StatusHistoryResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "history": { + "$ref": "#/definitions/History" + } + }, + "additionalProperties": false, + "required": [ + "history" + ] + }, + "StatusHistoryResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusHistoryResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StatusParams": { + "type": "object", + "properties": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "UnitStatus": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "charm": { + "type": "string" + }, + "leader": { + "type": "boolean" + }, + "machine": { + "type": "string" + }, + "opened-ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "subordinates": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitStatus" + } + } + }, + "workload-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "workload-status", + "workload-version", + "machine", + "opened-ports", + "public-address", + "charm", + "subordinates" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Cloud", + "Version": 5, + "Schema": { + "type": "object", + "properties": { + "AddCloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCloudArgs" + } + } + }, + "AddCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TaggedCredentials" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CheckCredentialsModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TaggedCredentials" + }, + "Result": { + "$ref": "#/definitions/UpdateCredentialResults" + } + } + }, + "Cloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudResults" + } + } + }, + "CloudInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudInfoResults" + } + } + }, + "Clouds": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CloudsResult" + } + } + }, + "Credential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudCredentialResults" + } + } + }, + "CredentialContents": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CloudCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/CredentialContentResults" + } + } + }, + "InstanceTypes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CloudInstanceTypesConstraints" + }, + "Result": { + "$ref": "#/definitions/InstanceTypesResults" + } + } + }, + "ListCloudInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListCloudsRequest" + }, + "Result": { + "$ref": "#/definitions/ListCloudInfoResults" + } + } + }, + "ModifyCloudAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyCloudAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveClouds": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RevokeCredentialsCheckModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RevokeCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateCloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateCloudArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateCredentialsCheckModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/UpdateCredentialResults" + } + } + }, + "UserCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UserClouds" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + } + }, + "definitions": { + "AddCloudArgs": { + "type": "object", + "properties": { + "cloud": { + "$ref": "#/definitions/Cloud" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud", + "name" + ] + }, + "Cloud": { + "type": "object", + "properties": { + "auth-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-certificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "endpoint": { + "type": "string" + }, + "host-cloud-region": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "region-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudRegion" + } + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudCredentialArg": { + "type": "object", + "properties": { + "cloud-name": { + "type": "string" + }, + "credential-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud-name", + "credential-name" + ] + }, + "CloudCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudCredentialArg" + } + }, + "include-secrets": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "include-secrets" + ] + }, + "CloudCredentialResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudCredential" + } + }, + "additionalProperties": false + }, + "CloudCredentialResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudCredentialResult" + } + } + }, + "additionalProperties": false + }, + "CloudDetails": { + "type": "object", + "properties": { + "auth-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudRegion" + } + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CloudInfo": { + "type": "object", + "properties": { + "CloudDetails": { + "$ref": "#/definitions/CloudDetails" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudUserInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "CloudDetails", + "users" + ] + }, + "CloudInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudInfo" + } + }, + "additionalProperties": false + }, + "CloudInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CloudInstanceTypesConstraint": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "region": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud-tag", + "region" + ] + }, + "CloudInstanceTypesConstraints": { + "type": "object", + "properties": { + "constraints": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudInstanceTypesConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "CloudRegion": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "CloudResult": { + "type": "object", + "properties": { + "cloud": { + "$ref": "#/definitions/Cloud" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "CloudResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudResult" + } + } + }, + "additionalProperties": false + }, + "CloudUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "CloudsResult": { + "type": "object", + "properties": { + "clouds": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Cloud" + } + } + } + }, + "additionalProperties": false + }, + "ControllerCredentialInfo": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/CredentialContent" + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelAccess" + } + } + }, + "additionalProperties": false + }, + "CredentialContent": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "cloud": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "cloud", + "auth-type" + ] + }, + "CredentialContentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ControllerCredentialInfo" + } + }, + "additionalProperties": false + }, + "CredentialContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CredentialContentResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "deprecated": { + "type": "boolean" + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "root-disk": { + "type": "integer" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "arches", + "cpu-cores", + "memory" + ] + }, + "InstanceTypesResult": { + "type": "object", + "properties": { + "cost-currency": { + "type": "string" + }, + "cost-divisor": { + "type": "integer" + }, + "cost-unit": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-types": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceType" + } + } + }, + "additionalProperties": false + }, + "InstanceTypesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTypesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListCloudInfo": { + "type": "object", + "properties": { + "CloudDetails": { + "$ref": "#/definitions/CloudDetails" + }, + "user-access": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "CloudDetails", + "user-access" + ] + }, + "ListCloudInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ListCloudInfo" + } + }, + "additionalProperties": false + }, + "ListCloudInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListCloudInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListCloudsRequest": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag" + ] + }, + "ModelAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "model": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ModifyCloudAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "cloud-tag", + "action", + "access" + ] + }, + "ModifyCloudAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyCloudAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "RevokeCredentialArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force" + ] + }, + "RevokeCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/RevokeCredentialArg" + } + } + }, + "additionalProperties": false, + "required": [ + "credentials" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "TaggedCredential": { + "type": "object", + "properties": { + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "credential" + ] + }, + "TaggedCredentials": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/TaggedCredential" + } + } + }, + "additionalProperties": false + }, + "UpdateCloudArgs": { + "type": "object", + "properties": { + "clouds": { + "type": "array", + "items": { + "$ref": "#/definitions/AddCloudArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "clouds" + ] + }, + "UpdateCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/TaggedCredential" + } + }, + "force": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "credentials", + "force" + ] + }, + "UpdateCredentialModelResult": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + }, + "name": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name" + ] + }, + "UpdateCredentialResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateCredentialModelResult" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "UpdateCredentialResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateCredentialResult" + } + } + }, + "additionalProperties": false + }, + "UserCloud": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "cloud-tag" + ] + }, + "UserClouds": { + "type": "object", + "properties": { + "user-clouds": { + "type": "array", + "items": { + "$ref": "#/definitions/UserCloud" + } + } + }, + "additionalProperties": false + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Controller", + "Version": 7, + "Schema": { + "type": "object", + "properties": { + "AllModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/UserModelList" + } + } + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + } + }, + "ConfigSet": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ControllerConfigSet" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "DestroyController": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyControllerArgs" + } + } + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "GetControllerAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UserAccessResults" + } + } + }, + "HostedModelConfigs": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/HostedModelConfigsResults" + } + } + }, + "IdentityProviderURL": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "InitiateMigration": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InitiateMigrationArgs" + }, + "Result": { + "$ref": "#/definitions/InitiateMigrationResults" + } + } + }, + "ListBlockedModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelBlockInfoList" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + } + }, + "ModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelStatusResults" + } + } + }, + "ModifyControllerAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyControllerAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "MongoVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "RemoveBlocks": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveBlocksArgs" + } + } + }, + "WatchAllModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherId" + } + } + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "AllWatcherId": { + "type": "object", + "properties": { + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ControllerConfigSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "DestroyControllerArgs": { + "type": "object", + "properties": { + "destroy-models": { + "type": "boolean" + }, + "destroy-storage": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "destroy-models" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostedModelConfig": { + "type": "object", + "properties": { + "cloud-spec": { + "$ref": "#/definitions/CloudSpec" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "owner" + ] + }, + "HostedModelConfigsResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/HostedModelConfig" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "InitiateMigrationArgs": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/MigrationSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "InitiateMigrationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "migration-id": { + "type": "string" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "migration-id" + ] + }, + "InitiateMigrationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InitiateMigrationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineHardware": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "MigrationSpec": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "target-info": { + "$ref": "#/definitions/MigrationTargetInfo" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-info" + ] + }, + "MigrationTargetInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "auth-tag": { + "type": "string" + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "macaroons": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "addrs", + "ca-cert", + "auth-tag" + ] + }, + "Model": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "owner-tag" + ] + }, + "ModelBlockInfo": { + "type": "object", + "properties": { + "blocks": { + "type": "array", + "items": { + "type": "string" + } + }, + "model-uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "model-uuid", + "owner-tag", + "blocks" + ] + }, + "ModelBlockInfoList": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelBlockInfo" + } + } + }, + "additionalProperties": false + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelFilesystemInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelMachineInfo": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "hardware": { + "$ref": "#/definitions/MachineHardware" + }, + "has-vote": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelStatus": { + "type": "object", + "properties": { + "application-count": { + "type": "integer" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelFilesystemInfo" + } + }, + "hosted-machine-count": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "model-tag": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit-count": { + "type": "integer" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVolumeInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "life", + "type", + "hosted-machine-count", + "application-count", + "unit-count", + "owner-tag" + ] + }, + "ModelStatusResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "ModelVolumeInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModifyControllerAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access" + ] + }, + "ModifyControllerAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyControllerAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveBlocksArgs": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "UserAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "access" + ] + }, + "UserAccessResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UserAccess" + } + }, + "additionalProperties": false + }, + "UserAccessResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccessResult" + } + } + }, + "additionalProperties": false + }, + "UserModel": { + "type": "object", + "properties": { + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model": { + "$ref": "#/definitions/Model" + } + }, + "additionalProperties": false, + "required": [ + "model", + "last-connection" + ] + }, + "UserModelList": { + "type": "object", + "properties": { + "user-models": { + "type": "array", + "items": { + "$ref": "#/definitions/UserModel" + } + } + }, + "additionalProperties": false, + "required": [ + "user-models" + ] + } + } + } + }, + { + "Name": "CredentialManager", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "InvalidateModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InvalidateCredentialArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "InvalidateCredentialArg": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CredentialValidator", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "InvalidateModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InvalidateCredentialArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "ModelCredential": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelCredential" + } + } + }, + "WatchCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchModelCredential": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "InvalidateCredentialArg": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ModelCredential": { + "type": "object", + "properties": { + "credential-tag": { + "type": "string" + }, + "exists": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "credential-tag" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "CrossController", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ControllerInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "WatchControllerInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "CrossModelRelations", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "PublishIngressNetworkChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/IngressNetworksChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "PublishRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteRelationsChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RegisterRemoteRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RegisterRemoteRelationArgs" + }, + "Result": { + "$ref": "#/definitions/RegisterRemoteRelationResults" + } + } + }, + "RelationUnitSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteRelationUnits" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + } + }, + "WatchEgressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchOfferStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferArgs" + }, + "Result": { + "$ref": "#/definitions/OfferStatusWatchResults" + } + } + }, + "WatchRelationUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResults" + } + } + }, + "WatchRelationsSuspendedStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/RelationStatusWatchResults" + } + } + } + }, + "definitions": { + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IngressNetworksChangeEvent": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "ingress-required": { + "type": "boolean" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "networks": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "ingress-required" + ] + }, + "IngressNetworksChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/IngressNetworksChangeEvent" + } + } + }, + "additionalProperties": false + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "OfferArg": { + "type": "object", + "properties": { + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "offer-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "offer-uuid" + ] + }, + "OfferArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "OfferStatusChange": { + "type": "object", + "properties": { + "offer-name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "status" + ] + }, + "OfferStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "OfferStatusWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RegisterRemoteRelationArg": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "local-endpoint-name": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "offer-uuid": { + "type": "string" + }, + "relation-token": { + "type": "string" + }, + "remote-endpoint": { + "$ref": "#/definitions/RemoteEndpoint" + }, + "remote-space": { + "$ref": "#/definitions/RemoteSpace" + }, + "source-model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "source-model-tag", + "relation-token", + "remote-endpoint", + "remote-space", + "offer-uuid", + "local-endpoint-name" + ] + }, + "RegisterRemoteRelationArgs": { + "type": "object", + "properties": { + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/RegisterRemoteRelationArg" + } + } + }, + "additionalProperties": false, + "required": [ + "relations" + ] + }, + "RegisterRemoteRelationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteRelationDetails" + } + }, + "additionalProperties": false + }, + "RegisterRemoteRelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RegisterRemoteRelationResult" + } + } + }, + "additionalProperties": false + }, + "RelationLifeSuspendedStatusChange": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "life", + "suspended", + "suspended-reason" + ] + }, + "RelationLifeSuspendedStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationStatusWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationUnitsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteEntityArg": { + "type": "object", + "properties": { + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token" + ] + }, + "RemoteEntityArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEntityArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RemoteRelationChangeEvent": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "changed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnitChange" + } + }, + "departed-units": { + "type": "array", + "items": { + "type": "integer" + } + }, + "force-cleanup": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "life" + ] + }, + "RemoteRelationDetails": { + "type": "object", + "properties": { + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token" + ] + }, + "RemoteRelationUnit": { + "type": "object", + "properties": { + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "unit" + ] + }, + "RemoteRelationUnitChange": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "unit-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "unit-id" + ] + }, + "RemoteRelationUnits": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnit" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "RemoteRelationsChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + } + } + }, + "additionalProperties": false + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "SettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "SettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Subnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + } + } + } + }, + { + "Name": "Deployer", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "ConnectionInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/DeployerConnectionValues" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "DeployerConnectionValues": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "api-addresses" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "DiskManager", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "SetMachineBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineBlockDevices" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "BlockDevice": { + "type": "object", + "properties": { + "BusAddress": { + "type": "string" + }, + "DeviceLinks": { + "type": "array", + "items": { + "type": "string" + } + }, + "DeviceName": { + "type": "string" + }, + "FilesystemType": { + "type": "string" + }, + "HardwareId": { + "type": "string" + }, + "InUse": { + "type": "boolean" + }, + "Label": { + "type": "string" + }, + "MountPoint": { + "type": "string" + }, + "Size": { + "type": "integer" + }, + "UUID": { + "type": "string" + }, + "WWN": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "DeviceName", + "DeviceLinks", + "Label", + "UUID", + "HardwareId", + "WWN", + "BusAddress", + "Size", + "FilesystemType", + "InUse", + "MountPoint" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineBlockDevices": { + "type": "object", + "properties": { + "block-devices": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockDevice" + } + }, + "machine": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine" + ] + }, + "SetMachineBlockDevices": { + "type": "object", + "properties": { + "machine-block-devices": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineBlockDevices" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-block-devices" + ] + } + } + } + }, + { + "Name": "EntityWatcher", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/EntitiesWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "EntitiesWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + } + } + } + }, + { + "Name": "ExternalControllerUpdater", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ExternalControllerInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ExternalControllerInfoResults" + } + } + }, + "SetExternalControllerInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetExternalControllersInfoParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchExternalControllers": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "ExternalControllerInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ExternalControllerInfo" + } + }, + "additionalProperties": false, + "required": [ + "result", + "error" + ] + }, + "ExternalControllerInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalControllerInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetExternalControllerInfoParams": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/ExternalControllerInfo" + } + }, + "additionalProperties": false, + "required": [ + "info" + ] + }, + "SetExternalControllersInfoParams": { + "type": "object", + "properties": { + "controllers": { + "type": "array", + "items": { + "$ref": "#/definitions/SetExternalControllerInfoParams" + } + } + }, + "additionalProperties": false, + "required": [ + "controllers" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "FanConfigurer", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "FanConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/FanConfigResult" + } + } + }, + "WatchForFanConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "FanConfigEntry": { + "type": "object", + "properties": { + "overlay": { + "type": "string" + }, + "underlay": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "underlay", + "overlay" + ] + }, + "FanConfigResult": { + "type": "object", + "properties": { + "fans": { + "type": "array", + "items": { + "$ref": "#/definitions/FanConfigEntry" + } + } + }, + "additionalProperties": false, + "required": [ + "fans" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "FilesystemAttachmentsWatcher", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "FirewallRules", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ListFirewallRules": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + } + }, + "SetFirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FirewallRuleArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "FirewallRuleArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + } + } + } + }, + { + "Name": "Firewaller", + "Version": 5, + "Schema": { + "type": "object", + "properties": { + "AreManuallyProvisioned": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "FirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/KnownServiceArgs" + }, + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + } + }, + "GetAssignedMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "GetExposed": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "GetMachineActiveSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + }, + "GetMachinePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachinePortsParams" + }, + "Result": { + "$ref": "#/definitions/MachinePortsResults" + } + } + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "MacaroonForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MacaroonResults" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "SetRelationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchEgressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchIngressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "WatchOpenedPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "KnownServiceArgs": { + "type": "object", + "properties": { + "known-services": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-services" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "MacaroonResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Macaroon" + } + }, + "additionalProperties": false + }, + "MacaroonResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MacaroonResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachinePortRange": { + "type": "object", + "properties": { + "port-range": { + "$ref": "#/definitions/PortRange" + }, + "relation-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "relation-tag", + "port-range" + ] + }, + "MachinePorts": { + "type": "object", + "properties": { + "machine-tag": { + "type": "string" + }, + "subnet-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "subnet-tag" + ] + }, + "MachinePortsParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePorts" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "MachinePortsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "ports" + ] + }, + "MachinePortsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "from-port", + "to-port", + "protocol" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "HighAvailability", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "EnableHA": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ControllersSpecs" + }, + "Result": { + "$ref": "#/definitions/ControllersChangeResults" + } + } + }, + "ResumeHAReplicationAfterUpgrade": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ResumeReplicationParams" + } + } + }, + "StopHAReplicationForUpgrade": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeMongoParams" + }, + "Result": { + "$ref": "#/definitions/MongoUpgradeResults" + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "Scope": { + "type": "string" + }, + "SpaceName": { + "type": "string" + }, + "SpaceProviderId": { + "type": "string" + }, + "Type": { + "type": "string" + }, + "Value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Value", + "Type", + "Scope", + "SpaceName", + "SpaceProviderId" + ] + }, + "ControllersChangeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ControllersChanges" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ControllersChangeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllersChangeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllersChanges": { + "type": "object", + "properties": { + "added": { + "type": "array", + "items": { + "type": "string" + } + }, + "converted": { + "type": "array", + "items": { + "type": "string" + } + }, + "demoted": { + "type": "array", + "items": { + "type": "string" + } + }, + "maintained": { + "type": "array", + "items": { + "type": "string" + } + }, + "promoted": { + "type": "array", + "items": { + "type": "string" + } + }, + "removed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ControllersSpec": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "num-controllers": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "type": "string" + } + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "num-controllers" + ] + }, + "ControllersSpecs": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllersSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "HAMember": { + "type": "object", + "properties": { + "public-address": { + "$ref": "#/definitions/Address" + }, + "series": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "public-address", + "series" + ] + }, + "Member": { + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "Arbiter": { + "type": "boolean" + }, + "BuildIndexes": { + "type": "boolean" + }, + "Hidden": { + "type": "boolean" + }, + "Id": { + "type": "integer" + }, + "Priority": { + "type": "number" + }, + "SlaveDelay": { + "type": "integer" + }, + "Tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "Votes": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Id", + "Address", + "Arbiter", + "BuildIndexes", + "Hidden", + "Priority", + "Tags", + "SlaveDelay", + "Votes" + ] + }, + "MongoUpgradeResults": { + "type": "object", + "properties": { + "ha-members": { + "type": "array", + "items": { + "$ref": "#/definitions/HAMember" + } + }, + "master": { + "$ref": "#/definitions/HAMember" + }, + "rs-members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + } + }, + "additionalProperties": false, + "required": [ + "rs-members", + "master", + "ha-members" + ] + }, + "MongoVersion": { + "type": "object", + "properties": { + "engine": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "major", + "minor", + "patch", + "engine" + ] + }, + "ResumeReplicationParams": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + } + }, + "additionalProperties": false, + "required": [ + "members" + ] + }, + "UpgradeMongoParams": { + "type": "object", + "properties": { + "target": { + "$ref": "#/definitions/MongoVersion" + } + }, + "additionalProperties": false, + "required": [ + "target" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "HostKeyReporter", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ReportKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SSHHostKeySet" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHHostKeySet": { + "type": "object", + "properties": { + "entity-keys": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHHostKeys" + } + } + }, + "additionalProperties": false, + "required": [ + "entity-keys" + ] + }, + "SSHHostKeys": { + "type": "object", + "properties": { + "public-keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "public-keys" + ] + } + } + } + }, + { + "Name": "ImageManager", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "DeleteImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ListImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ListImageResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ImageFilterParams": { + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "images" + ] + }, + "ImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series", + "url", + "created" + ] + }, + "ImageSpec": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series" + ] + }, + "ListImageResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageMetadata" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "ImageMetadata", + "Version": 3, + "Schema": { + "type": "object", + "properties": { + "UpdateFromPublishedImages": { + "type": "object" + } + } + } + }, + { + "Name": "InstanceMutater", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "CharmProfilingInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/CharmProfilingInfoResult" + } + } + }, + "ContainerType": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/ContainerTypeResult" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "SetCharmProfiles": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetProfileArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetModificationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "WatchLXDProfileVerificationNeeded": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmProfilingInfoResult": { + "type": "object", + "properties": { + "current-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-id": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "profile-changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ProfileInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "instance-id", + "model-name", + "profile-changes", + "current-profiles", + "error" + ] + }, + "ContainerTypeResult": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "container-type", + "error" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProfileInfoResult": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "SetProfileArg": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "profiles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "entity", + "profiles" + ] + }, + "SetProfileArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetProfileArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "InstancePoller", + "Version": 3, + "Schema": { + "type": "object", + "properties": { + "AreManuallyProvisioned": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "InstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "ProviderAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineAddressesResults" + } + } + }, + "SetInstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetProviderAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachinesAddresses" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Status": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineAddresses": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "addresses" + ] + }, + "MachineAddressesResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses" + ] + }, + "MachineAddressesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddressesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "SetMachinesAddresses": { + "type": "object", + "properties": { + "machine-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddresses" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-addresses" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "KeyManager", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AddKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DeleteKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ImportKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ListKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListSSHKeys" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSSHKeys": { + "type": "object", + "properties": { + "entities": { + "$ref": "#/definitions/Entities" + }, + "mode": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "mode" + ] + }, + "ModifyUserSSHKeys": { + "type": "object", + "properties": { + "ssh-keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "ssh-keys" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "KeyUpdater", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AuthorisedKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + }, + "WatchAuthorisedKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "LeadershipService", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "BlockUntilLeadershipReleased": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationTag" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "ClaimLeadership": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ClaimLeadershipBulkParams" + }, + "Result": { + "$ref": "#/definitions/ClaimLeadershipBulkResults" + } + } + } + }, + "definitions": { + "ApplicationTag": { + "type": "object", + "properties": { + "Name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name" + ] + }, + "ClaimLeadershipBulkParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/ClaimLeadershipParams" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "ClaimLeadershipBulkResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ClaimLeadershipParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "duration": { + "type": "number" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "unit-tag", + "duration" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "LifeFlag", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "LogForwarding", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "GetLastSent": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LogForwardingGetLastSentParams" + }, + "Result": { + "$ref": "#/definitions/LogForwardingGetLastSentResults" + } + } + }, + "SetLastSent": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LogForwardingSetLastSentParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LogForwardingGetLastSentParams": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingID" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "LogForwardingGetLastSentResult": { + "type": "object", + "properties": { + "err": { + "$ref": "#/definitions/Error" + }, + "record-id": { + "type": "integer" + }, + "record-timestamp": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "record-id", + "record-timestamp", + "err" + ] + }, + "LogForwardingGetLastSentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingGetLastSentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LogForwardingID": { + "type": "object", + "properties": { + "model": { + "type": "string" + }, + "sink": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model", + "sink" + ] + }, + "LogForwardingSetLastSentParam": { + "type": "object", + "properties": { + "LogForwardingID": { + "$ref": "#/definitions/LogForwardingID" + }, + "record-id": { + "type": "integer" + }, + "record-timestamp": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "LogForwardingID", + "record-id", + "record-timestamp" + ] + }, + "LogForwardingSetLastSentParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingSetLastSentParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + } + } + } + }, + { + "Name": "Logger", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "LoggingConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "WatchLoggingConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MachineActions", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "BeginActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "FinishActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionExecutionResults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RunningActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + } + }, + "WatchActionNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "Action": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionExecutionResult": { + "type": "object", + "properties": { + "action-tag": { + "type": "string" + }, + "message": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "action-tag", + "status" + ] + }, + "ActionExecutionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionExecutionResult" + } + } + }, + "additionalProperties": false + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "ActionsByReceiver": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionsByReceivers": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionsByReceiver" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MachineManager", + "Version": 6, + "Schema": { + "type": "object", + "properties": { + "AddMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + } + }, + "DestroyMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + } + }, + "DestroyMachineWithParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyMachinesParams" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + } + }, + "ForceDestroyMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + } + }, + "GetUpgradeSeriesMessages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesNotificationParams" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + }, + "InstanceTypes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelInstanceTypesConstraints" + }, + "Result": { + "$ref": "#/definitions/InstanceTypesResults" + } + } + }, + "UpgradeSeriesComplete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "UpgradeSeriesPrepare": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "UpgradeSeriesValidate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesUnitsResults" + } + } + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "AddMachineParams": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "container-type": { + "type": "string" + }, + "disks": { + "type": "array", + "items": { + "$ref": "#/definitions/Constraints" + } + }, + "hardware-characteristics": { + "$ref": "#/definitions/HardwareCharacteristics" + }, + "instance-id": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "nonce": { + "type": "string" + }, + "parent-id": { + "type": "string" + }, + "placement": { + "$ref": "#/definitions/Placement" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "series", + "constraints", + "jobs", + "parent-id", + "container-type", + "instance-id", + "nonce", + "hardware-characteristics", + "addresses" + ] + }, + "AddMachines": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachineParams" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "AddMachinesResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "machine": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine" + ] + }, + "AddMachinesResults": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachinesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "machines" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "DestroyMachineInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "destroyed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyMachineResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyMachineInfo" + } + }, + "additionalProperties": false + }, + "DestroyMachineResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyMachineResult" + } + } + }, + "additionalProperties": false + }, + "DestroyMachinesParams": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "keep": { + "type": "boolean" + }, + "machine-tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "machine-tags" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "HardwareCharacteristics": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cpu-cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "deprecated": { + "type": "boolean" + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "root-disk": { + "type": "integer" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "arches", + "cpu-cores", + "memory" + ] + }, + "InstanceTypesResult": { + "type": "object", + "properties": { + "cost-currency": { + "type": "string" + }, + "cost-divisor": { + "type": "integer" + }, + "cost-unit": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-types": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceType" + } + } + }, + "additionalProperties": false + }, + "InstanceTypesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTypesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelInstanceTypesConstraint": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false + }, + "ModelInstanceTypesConstraints": { + "type": "object", + "properties": { + "constraints": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelInstanceTypesConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpgradeSeriesNotificationParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "watcher-id" + ] + }, + "UpgradeSeriesNotificationParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesNotificationParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesUnitsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "unit-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "unit-names" + ] + }, + "UpgradeSeriesUnitsResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesUnitsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "MachineUndertaker", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AllMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + } + }, + "CompleteMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + } + } + }, + "GetMachineProviderInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProviderInterfaceInfoResults" + } + } + }, + "WatchMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResult": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProviderInterfaceInfo": { + "type": "object", + "properties": { + "interface-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + }, + "provider-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "interface-name", + "mac-address", + "provider-id" + ] + }, + "ProviderInterfaceInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderInterfaceInfo" + } + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "interfaces" + ] + }, + "ProviderInterfaceInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderInterfaceInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Machiner", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Jobs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/JobsResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "SetMachineAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachinesAddresses" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetObservedNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + } + }, + "SetProviderNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "JobsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "jobs" + ] + }, + "JobsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/JobsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineAddresses": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "addresses" + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "device-index": { + "type": "integer" + }, + "disabled": { + "type": "boolean" + }, + "dns-search-domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dns-servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "gateway-address": { + "type": "string" + }, + "interface-name": { + "type": "string" + }, + "interface-type": { + "type": "string" + }, + "is-default-gateway": { + "type": "boolean" + }, + "mac-address": { + "type": "string" + }, + "mtu": { + "type": "integer" + }, + "no-auto-start": { + "type": "boolean" + }, + "parent-interface-name": { + "type": "string" + }, + "provider-address-id": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "provider-subnet-id": { + "type": "string" + }, + "provider-vlan-id": { + "type": "string" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkRoute" + } + }, + "vlan-tag": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "device-index", + "mac-address", + "cidr", + "mtu", + "provider-id", + "provider-subnet-id", + "provider-space-id", + "provider-address-id", + "provider-vlan-id", + "vlan-tag", + "interface-name", + "parent-interface-name", + "interface-type", + "disabled" + ] + }, + "NetworkRoute": { + "type": "object", + "properties": { + "destination-cidr": { + "type": "string" + }, + "gateway-ip": { + "type": "string" + }, + "metric": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destination-cidr", + "gateway-ip", + "metric" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetMachineNetworkConfig": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "config" + ] + }, + "SetMachinesAddresses": { + "type": "object", + "properties": { + "machine-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddresses" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-addresses" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "MeterStatus", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "GetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MeterStatusResults" + } + } + }, + "WatchMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MeterStatusResult": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "info" + ] + }, + "MeterStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MetricsAdder", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "AddMetricBatches": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetricBatchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Metric": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "value", + "time" + ] + }, + "MetricBatch": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "charm-url", + "created", + "metrics" + ] + }, + "MetricBatchParam": { + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/MetricBatch" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "batch" + ] + }, + "MetricBatchParams": { + "type": "object", + "properties": { + "batches": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricBatchParam" + } + } + }, + "additionalProperties": false, + "required": [ + "batches" + ] + } + } + } + }, + { + "Name": "MetricsDebug", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "GetMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MetricResults" + } + } + }, + "SetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MeterStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityMetrics": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricResult" + } + } + }, + "additionalProperties": false + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MeterStatusParam": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "code" + ] + }, + "MeterStatusParams": { + "type": "object", + "properties": { + "statues": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "statues" + ] + }, + "MetricResult": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "unit": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "time", + "key", + "value", + "unit", + "labels" + ] + }, + "MetricResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityMetrics" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MetricsManager", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AddJujuMachineMetrics": { + "type": "object" + }, + "CleanupOldMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SendMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MigrationFlag", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Phase": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PhaseResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PhaseResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "phase": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PhaseResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PhaseResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MigrationMaster", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Export": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SerializedModel" + } + } + }, + "MigrationStatus": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MasterMigrationStatus" + } + } + }, + "MinionReports": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MinionReports" + } + } + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MigrationModelInfo" + } + } + }, + "Prechecks": { + "type": "object" + }, + "Reap": { + "type": "object" + }, + "SetPhase": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMigrationPhaseArgs" + } + } + }, + "SetStatusMessage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMigrationStatusMessageArgs" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchMinionReports": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MasterMigrationStatus": { + "type": "object", + "properties": { + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "phase-changed-time": { + "type": "string", + "format": "date-time" + }, + "spec": { + "$ref": "#/definitions/MigrationSpec" + } + }, + "additionalProperties": false, + "required": [ + "spec", + "migration-id", + "phase", + "phase-changed-time" + ] + }, + "MigrationModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "controller-agent-version": { + "$ref": "#/definitions/Number" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "MigrationSpec": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "target-info": { + "$ref": "#/definitions/MigrationTargetInfo" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-info" + ] + }, + "MigrationTargetInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "auth-tag": { + "type": "string" + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "macaroons": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "addrs", + "ca-cert", + "auth-tag" + ] + }, + "MinionReports": { + "type": "object", + "properties": { + "failed": { + "type": "array", + "items": { + "type": "string" + } + }, + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "success-count": { + "type": "integer" + }, + "unknown-count": { + "type": "integer" + }, + "unknown-sample": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "phase", + "success-count", + "unknown-count", + "unknown-sample", + "failed" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SerializedModel": { + "type": "object", + "properties": { + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + }, + "charms": { + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelResource" + } + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelTools" + } + } + }, + "additionalProperties": false, + "required": [ + "bytes", + "charms", + "tools", + "resources" + ] + }, + "SerializedModelResource": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "charmstore-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "name": { + "type": "string" + }, + "unit-revisions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SerializedModelResourceRevision" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "application-revision", + "charmstore-revision", + "unit-revisions" + ] + }, + "SerializedModelResourceRevision": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "type", + "path", + "description", + "origin", + "fingerprint", + "size", + "timestamp" + ] + }, + "SerializedModelTools": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "version", + "uri" + ] + }, + "SetMigrationPhaseArgs": { + "type": "object", + "properties": { + "phase": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "phase" + ] + }, + "SetMigrationStatusMessageArgs": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message" + ] + } + } + } + }, + { + "Name": "MigrationMinion", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Report": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MinionReport" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MinionReport": { + "type": "object", + "properties": { + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "success": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "phase", + "success" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "MigrationStatusWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MigrationStatus" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "MigrationStatus": { + "type": "object", + "properties": { + "attempt": { + "type": "integer" + }, + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "source-api-addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "source-ca-cert": { + "type": "string" + }, + "target-api-addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "target-ca-cert": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "attempt", + "phase", + "source-api-addrs", + "source-ca-cert", + "target-api-addrs", + "target-ca-cert" + ] + } + } + } + }, + { + "Name": "MigrationTarget", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Abort": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + } + } + }, + "Activate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + } + } + }, + "AdoptResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AdoptResourcesArgs" + } + } + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + } + }, + "CheckMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Import": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SerializedModel" + } + } + }, + "LatestLogTime": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + }, + "Result": { + "type": "string", + "format": "date-time" + } + } + }, + "Prechecks": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MigrationModelInfo" + } + } + } + }, + "definitions": { + "AdoptResourcesArgs": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "source-controller-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "source-controller-version" + ] + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MigrationModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "controller-agent-version": { + "$ref": "#/definitions/Number" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "ModelArgs": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SerializedModel": { + "type": "object", + "properties": { + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + }, + "charms": { + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelResource" + } + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelTools" + } + } + }, + "additionalProperties": false, + "required": [ + "bytes", + "charms", + "tools", + "resources" + ] + }, + "SerializedModelResource": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "charmstore-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "name": { + "type": "string" + }, + "unit-revisions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SerializedModelResourceRevision" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "application-revision", + "charmstore-revision", + "unit-revisions" + ] + }, + "SerializedModelResourceRevision": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "type", + "path", + "description", + "origin", + "fingerprint", + "size", + "timestamp" + ] + }, + "SerializedModelTools": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "version", + "uri" + ] + } + } + } + }, + { + "Name": "ModelConfig", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ModelGet": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + } + }, + "ModelSet": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSet" + } + } + }, + "ModelUnset": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelUnset" + } + } + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "Sequences": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelSequencesResult" + } + } + }, + "SetSLALevel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSLA" + } + } + } + }, + "definitions": { + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelSLA": { + "type": "object", + "properties": { + "ModelSLAInfo": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "creds": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "ModelSLAInfo", + "creds" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelSequencesResult": { + "type": "object", + "properties": { + "sequences": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + } + }, + "additionalProperties": false, + "required": [ + "sequences" + ] + }, + "ModelSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelUnset": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "ModelGeneration", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "AbortBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "AddBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "BranchInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchInfoArgs" + }, + "Result": { + "$ref": "#/definitions/GenerationResults" + } + } + }, + "CommitBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/IntResult" + } + } + }, + "HasActiveBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "TrackBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchTrackArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BranchArg": { + "type": "object", + "properties": { + "branch": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "branch" + ] + }, + "BranchInfoArgs": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "type": "string" + } + }, + "detailed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "branches", + "detailed" + ] + }, + "BranchTrackArg": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "branch", + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Generation": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/GenerationApplication" + } + }, + "branch": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "created-by": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "branch", + "created", + "created-by", + "applications" + ] + }, + "GenerationApplication": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "pending": { + "type": "array", + "items": { + "type": "string" + } + }, + "progress": { + "type": "string" + }, + "tracking": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "progress", + "config" + ] + }, + "GenerationResults": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "generations": { + "type": "array", + "items": { + "$ref": "#/definitions/Generation" + } + } + }, + "additionalProperties": false, + "required": [ + "generations" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "ModelManager", + "Version": 7, + "Schema": { + "type": "object", + "properties": { + "ChangeModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ChangeModelCredentialsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CreateModel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelCreateArgs" + }, + "Result": { + "$ref": "#/definitions/ModelInfo" + } + } + }, + "DestroyModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyModelsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DumpModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DumpModelRequest" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "DumpModelsDB": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MapResults" + } + } + }, + "ListModelSummaries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSummariesRequest" + }, + "Result": { + "$ref": "#/definitions/ModelSummaryResults" + } + } + }, + "ListModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/UserModelList" + } + } + }, + "ModelDefaultsForClouds": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelDefaultsResults" + } + } + }, + "ModelInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelInfoResults" + } + } + }, + "ModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelStatusResults" + } + } + }, + "ModifyModelAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyModelAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetModelDefaults": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelDefaults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UnsetModelDefaults": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UnsetModelDefaults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "ChangeModelCredentialParams": { + "type": "object", + "properties": { + "credential-tag": { + "type": "string" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "credential-tag" + ] + }, + "ChangeModelCredentialsParams": { + "type": "object", + "properties": { + "model-credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/ChangeModelCredentialParams" + } + } + }, + "additionalProperties": false, + "required": [ + "model-credentials" + ] + }, + "DestroyModelParams": { + "type": "object", + "properties": { + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "DestroyModelsParams": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyModelParams" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "DumpModelRequest": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "simplified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "simplified" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineHardware": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "MapResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "MapResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MapResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Model": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "owner-tag" + ] + }, + "ModelCreateArgs": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "region": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "owner-tag" + ] + }, + "ModelDefaultValues": { + "type": "object", + "properties": { + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelDefaults": { + "type": "object", + "properties": { + "controller": { + "type": "object", + "additionalProperties": true + }, + "default": { + "type": "object", + "additionalProperties": true + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionDefaults" + } + } + }, + "additionalProperties": false + }, + "ModelDefaultsResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ModelDefaults" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelDefaultsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelDefaultsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelEntityCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "entity": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "count" + ] + }, + "ModelFilesystemInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "cloud-credential-tag": { + "type": "string" + }, + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "default-series": { + "type": "string" + }, + "is-controller": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "migration": { + "$ref": "#/definitions/ModelMigrationStatus" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "provider-type": { + "type": "string" + }, + "sla": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "type": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUserInfo" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "uuid", + "controller-uuid", + "is-controller", + "cloud-tag", + "owner-tag", + "life", + "users", + "machines", + "sla", + "agent-version" + ] + }, + "ModelInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelInfo" + } + }, + "additionalProperties": false + }, + "ModelInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelMachineInfo": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "hardware": { + "$ref": "#/definitions/MachineHardware" + }, + "has-vote": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelMigrationStatus": { + "type": "object", + "properties": { + "end": { + "type": "string", + "format": "date-time" + }, + "start": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "start" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelStatus": { + "type": "object", + "properties": { + "application-count": { + "type": "integer" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelFilesystemInfo" + } + }, + "hosted-machine-count": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "model-tag": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit-count": { + "type": "integer" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVolumeInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "life", + "type", + "hosted-machine-count", + "application-count", + "unit-count", + "owner-tag" + ] + }, + "ModelStatusResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "ModelSummariesRequest": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag" + ] + }, + "ModelSummary": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "cloud-credential-tag": { + "type": "string" + }, + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelEntityCount" + } + }, + "default-series": { + "type": "string" + }, + "is-controller": { + "type": "boolean" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "life": { + "type": "string" + }, + "migration": { + "$ref": "#/definitions/ModelMigrationStatus" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "provider-type": { + "type": "string" + }, + "sla": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "type": { + "type": "string" + }, + "user-access": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "controller-uuid", + "is-controller", + "cloud-tag", + "owner-tag", + "life", + "user-access", + "last-connection", + "counts", + "sla", + "agent-version" + ] + }, + "ModelSummaryResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelSummary" + } + }, + "additionalProperties": false + }, + "ModelSummaryResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelSummaryResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelUnsetKeys": { + "type": "object", + "properties": { + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "last-connection", + "access" + ] + }, + "ModelVolumeInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModifyModelAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "model-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access", + "model-tag" + ] + }, + "ModifyModelAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyModelAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "RegionDefaults": { + "type": "object", + "properties": { + "region-name": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "region-name", + "value" + ] + }, + "SetModelDefaults": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelDefaultValues" + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnsetModelDefaults": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUnsetKeys" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "UserModel": { + "type": "object", + "properties": { + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model": { + "$ref": "#/definitions/Model" + } + }, + "additionalProperties": false, + "required": [ + "model", + "last-connection" + ] + }, + "UserModelList": { + "type": "object", + "properties": { + "user-models": { + "type": "array", + "items": { + "$ref": "#/definitions/UserModel" + } + } + }, + "additionalProperties": false, + "required": [ + "user-models" + ] + } + } + } + }, + { + "Name": "ModelUpgrader", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + } + }, + "ModelTargetEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + } + }, + "SetModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelEnvironVersions" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetModelEnvironVersion": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "version" + ] + }, + "SetModelEnvironVersions": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/SetModelEnvironVersion" + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + } + } + } + }, + { + "Name": "NotifyWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object" + }, + "Stop": { + "type": "object" + } + } + } + }, + { + "Name": "OfferStatusWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/OfferStatusWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "OfferStatusChange": { + "type": "object", + "properties": { + "offer-name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "status" + ] + }, + "OfferStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Payloads", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PayloadListArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadListResults" + } + } + } + }, + "definitions": { + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadListArgs": { + "type": "object", + "properties": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "PayloadListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "PayloadsHookContext", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + } + }, + "LookUp": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LookUpPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPayloadStatusArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + } + }, + "Track": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TrackPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + } + }, + "Untrack": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LookUpPayloadArg": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "id" + ] + }, + "LookUpPayloadArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/LookUpPayloadArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadResult": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "not-found": { + "type": "boolean" + }, + "payload": { + "$ref": "#/definitions/Payload" + } + }, + "additionalProperties": false, + "required": [ + "Entity", + "payload", + "not-found" + ] + }, + "PayloadResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PayloadResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetPayloadStatusArg": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Entity", + "status" + ] + }, + "SetPayloadStatusArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetPayloadStatusArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "TrackPayloadArgs": { + "type": "object", + "properties": { + "payloads": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "payloads" + ] + } + } + } + }, + { + "Name": "Pinger", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Ping": { + "type": "object" + }, + "Stop": { + "type": "object" + } + } + } + }, + { + "Name": "Provisioner", + "Version": 9, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "AvailabilityZone": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + } + }, + "Constraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ConstraintsResults" + } + } + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ContainerConfig" + } + } + }, + "ContainerManagerConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ContainerManagerConfigParams" + }, + "Result": { + "$ref": "#/definitions/ContainerManagerConfig" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "DistributionGroup": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DistributionGroupResults" + } + } + }, + "DistributionGroupByMachineId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + } + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + } + }, + "GetContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + } + }, + "GetContainerProfileInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ContainerProfileResults" + } + } + }, + "HostChangesForContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/HostNetworkChangeResults" + } + } + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "InstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "KeepInstance": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "MachinesWithTransientErrors": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "MarkMachinesForRemoval": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "PrepareContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + } + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProvisioningInfoResults" + } + } + }, + "ReleaseContainerAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Series": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "SetCharmProfiles": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetProfileArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetHostMachineNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + } + }, + "SetInstanceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InstancesInfo" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetInstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetModificationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetObservedNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + } + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetProviderNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetSupportedContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineContainersParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "StateAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "Status": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "SupportedContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineContainerResults" + } + } + }, + "Tools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ToolsResults" + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchAllContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchContainers" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchContainers" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchMachineErrorRetry": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Number", + "Series", + "Arch" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CloudImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "image-id": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "region": { + "type": "string" + }, + "root-storage-size": { + "type": "integer" + }, + "root-storage-type": { + "type": "string" + }, + "series": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "series", + "arch", + "source", + "priority" + ] + }, + "ConstraintsResult": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "ConstraintsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConstraintsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "UpdateBehavior": { + "$ref": "#/definitions/UpdateBehavior" + }, + "apt-mirror": { + "type": "string" + }, + "apt-proxy": { + "$ref": "#/definitions/Settings" + }, + "authorized-keys": { + "type": "string" + }, + "cloudinit-userdata": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "container-inherit-properties": { + "type": "string" + }, + "juju-proxy": { + "$ref": "#/definitions/Settings" + }, + "legacy-proxy": { + "$ref": "#/definitions/Settings" + }, + "provider-type": { + "type": "string" + }, + "snap-proxy": { + "$ref": "#/definitions/Settings" + }, + "ssl-hostname-verification": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider-type", + "authorized-keys", + "ssl-hostname-verification", + "legacy-proxy", + "juju-proxy", + "apt-proxy", + "snap-proxy", + "apt-mirror", + "UpdateBehavior" + ] + }, + "ContainerLXDProfile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "profile": { + "$ref": "#/definitions/CharmLXDProfile" + } + }, + "additionalProperties": false, + "required": [ + "profile", + "name" + ] + }, + "ContainerManagerConfig": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ContainerManagerConfigParams": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "ContainerProfileResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "lxd-profiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ContainerLXDProfile" + } + } + }, + "additionalProperties": false + }, + "ContainerProfileResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ContainerProfileResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "DeviceBridgeInfo": { + "type": "object", + "properties": { + "bridge-name": { + "type": "string" + }, + "host-device-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "host-device-name", + "bridge-name", + "mac-address" + ] + }, + "DistributionGroupResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "DistributionGroupResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DistributionGroupResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "arch", + "series", + "agentstream" + ] + }, + "FindToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "HardwareCharacteristics": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cpu-cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "HostNetworkChange": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "new-bridges": { + "type": "array", + "items": { + "$ref": "#/definitions/DeviceBridgeInfo" + } + }, + "reconfigure-delay": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "new-bridges", + "reconfigure-delay" + ] + }, + "HostNetworkChangeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/HostNetworkChange" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "InstanceInfo": { + "type": "object", + "properties": { + "characteristics": { + "$ref": "#/definitions/HardwareCharacteristics" + }, + "charm-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "display-name": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "network-config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "nonce": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "volume-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentInfo" + } + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/Volume" + } + } + }, + "additionalProperties": false, + "required": [ + "tag", + "instance-id", + "display-name", + "nonce", + "characteristics", + "volumes", + "volume-attachments", + "network-config", + "charm-profiles" + ] + }, + "InstancesInfo": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "machines" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineContainerResult": { + "type": "object", + "properties": { + "container-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "determined": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "container-types", + "determined" + ] + }, + "MachineContainerResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineContainerResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineContainers": { + "type": "object", + "properties": { + "container-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "container-types" + ] + }, + "MachineContainersParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineContainers" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "MachineNetworkConfigResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + } + }, + "additionalProperties": false, + "required": [ + "info" + ] + }, + "MachineNetworkConfigResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineNetworkConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "device-index": { + "type": "integer" + }, + "disabled": { + "type": "boolean" + }, + "dns-search-domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dns-servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "gateway-address": { + "type": "string" + }, + "interface-name": { + "type": "string" + }, + "interface-type": { + "type": "string" + }, + "is-default-gateway": { + "type": "boolean" + }, + "mac-address": { + "type": "string" + }, + "mtu": { + "type": "integer" + }, + "no-auto-start": { + "type": "boolean" + }, + "parent-interface-name": { + "type": "string" + }, + "provider-address-id": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "provider-subnet-id": { + "type": "string" + }, + "provider-vlan-id": { + "type": "string" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkRoute" + } + }, + "vlan-tag": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "device-index", + "mac-address", + "cidr", + "mtu", + "provider-id", + "provider-subnet-id", + "provider-space-id", + "provider-address-id", + "provider-vlan-id", + "vlan-tag", + "interface-name", + "parent-interface-name", + "interface-type", + "disabled" + ] + }, + "NetworkRoute": { + "type": "object", + "properties": { + "destination-cidr": { + "type": "string" + }, + "gateway-ip": { + "type": "string" + }, + "metric": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destination-cidr", + "gateway-ip", + "metric" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "charm-lxd-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "cloudinit-userdata": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "controller-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "image-metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudImageMetadata" + } + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "placement": { + "type": "string" + }, + "series": { + "type": "string" + }, + "subnets-to-zones": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentParams" + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeParams" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints", + "series", + "placement", + "jobs" + ] + }, + "ProvisioningInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ProvisioningInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProvisioningInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetMachineNetworkConfig": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "config" + ] + }, + "SetProfileArg": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "profiles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "entity", + "profiles" + ] + }, + "SetProfileArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetProfileArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Settings": { + "type": "object", + "properties": { + "AutoNoProxy": { + "type": "string" + }, + "Ftp": { + "type": "string" + }, + "Http": { + "type": "string" + }, + "Https": { + "type": "string" + }, + "NoProxy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Http", + "Https", + "Ftp", + "NoProxy", + "AutoNoProxy" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "ToolsResult": { + "type": "object", + "properties": { + "disable-ssl-hostname-verification": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "tools", + "disable-ssl-hostname-verification" + ] + }, + "ToolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateBehavior": { + "type": "object", + "properties": { + "enable-os-refresh-update": { + "type": "boolean" + }, + "enable-os-upgrade": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "enable-os-refresh-update", + "enable-os-upgrade" + ] + }, + "Value": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "Volume": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + }, + "volume-id": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "provider" + ] + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + }, + "VolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/VolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "size", + "provider" + ] + }, + "WatchContainer": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "container-type" + ] + }, + "WatchContainers": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/WatchContainer" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + } + } + } + }, + { + "Name": "ProxyUpdater", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ProxyConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProxyConfigResults" + } + } + }, + "WatchForProxyConfigAndAPIHostPortChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProxyConfig": { + "type": "object", + "properties": { + "ftp": { + "type": "string" + }, + "http": { + "type": "string" + }, + "https": { + "type": "string" + }, + "no-proxy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "http", + "https", + "ftp", + "no-proxy" + ] + }, + "ProxyConfigResult": { + "type": "object", + "properties": { + "apt-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "juju-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "legacy-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "snap-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "snap-store-assertions": { + "type": "string" + }, + "snap-store-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "legacy-proxy-settings", + "juju-proxy-settings" + ] + }, + "ProxyConfigResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProxyConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Reboot", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ClearReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "GetRebootAction": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RebootActionResults" + } + } + }, + "RequestReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchForRebootEvent": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "RebootActionResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RebootActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RebootActionResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "RelationStatusWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RelationLifeSuspendedStatusWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "RelationLifeSuspendedStatusChange": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "life", + "suspended", + "suspended-reason" + ] + }, + "RelationLifeSuspendedStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "RelationUnitsWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + } + } + } + }, + { + "Name": "RemoteRelations", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ConsumeRemoteRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteRelationsChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + } + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "ExportEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/TokenResults" + } + } + }, + "GetTokens": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetTokenArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "ImportRemoteEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityTokenArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RelationUnitSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + } + }, + "Relations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoteRelationResults" + } + } + }, + "RemoteApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoteApplicationResults" + } + } + }, + "SaveMacaroons": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityMacaroonArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetRemoteApplicationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchLocalRelationUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResults" + } + } + }, + "WatchRemoteApplicationRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchRemoteApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "WatchRemoteRelations": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityMacaroonArg": { + "type": "object", + "properties": { + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "macaroon", + "tag" + ] + }, + "EntityMacaroonArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityMacaroonArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetTokenArg": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "GetTokenArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetTokenArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "RelationUnit": { + "type": "object", + "properties": { + "relation": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "unit" + ] + }, + "RelationUnits": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnit" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationUnitsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteApplication": { + "type": "object", + "properties": { + "is-consumer-proxy": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "model-uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "offer-uuid", + "model-uuid", + "is-consumer-proxy" + ] + }, + "RemoteApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteApplication" + } + }, + "additionalProperties": false + }, + "RemoteApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteApplicationResult" + } + } + }, + "additionalProperties": false + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteEntityTokenArg": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "RemoteEntityTokenArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEntityTokenArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "RemoteRelation": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "endpoint": { + "$ref": "#/definitions/RemoteEndpoint" + }, + "id": { + "type": "integer" + }, + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "remote-application-name": { + "type": "string" + }, + "remote-endpoint-name": { + "type": "string" + }, + "source-model-uuid": { + "type": "string" + }, + "suspended": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "life", + "suspended", + "id", + "key", + "application-name", + "endpoint", + "remote-application-name", + "remote-endpoint-name", + "source-model-uuid" + ] + }, + "RemoteRelationChangeEvent": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "changed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnitChange" + } + }, + "departed-units": { + "type": "array", + "items": { + "type": "integer" + } + }, + "force-cleanup": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "life" + ] + }, + "RemoteRelationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteRelation" + } + }, + "additionalProperties": false + }, + "RemoteRelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteRelationUnitChange": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "unit-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "unit-id" + ] + }, + "RemoteRelationsChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "SettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "SettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "TokenResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TokenResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/TokenResult" + } + } + }, + "additionalProperties": false + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + } + } + } + }, + { + "Name": "Resources", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AddPendingResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddPendingResourcesArgs" + }, + "Result": { + "$ref": "#/definitions/AddPendingResourcesResult" + } + } + }, + "ListResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListResourcesArgs" + }, + "Result": { + "$ref": "#/definitions/ResourcesResults" + } + } + } + }, + "definitions": { + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "channel", + "macaroon", + "force" + ] + }, + "AddPendingResourcesArgs": { + "type": "object", + "properties": { + "AddCharmWithAuthorization": { + "$ref": "#/definitions/AddCharmWithAuthorization" + }, + "Entity": { + "$ref": "#/definitions/Entity" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmResource" + } + } + }, + "additionalProperties": false, + "required": [ + "Entity", + "AddCharmWithAuthorization", + "resources" + ] + }, + "AddPendingResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "pending-ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "pending-ids" + ] + }, + "CharmResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ListResourcesArgs": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "Resource": { + "type": "object", + "properties": { + "CharmResource": { + "$ref": "#/definitions/CharmResource" + }, + "application": { + "type": "string" + }, + "id": { + "type": "string" + }, + "pending-id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "CharmResource", + "id", + "pending-id", + "application", + "username", + "timestamp" + ] + }, + "ResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "charm-store-resources": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmResource" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "unit-resources": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitResources" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resources", + "charm-store-resources", + "unit-resources" + ] + }, + "ResourcesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourcesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitResources": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "download-progress": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + } + }, + "additionalProperties": false, + "required": [ + "Entity", + "resources", + "download-progress" + ] + } + } + } + }, + { + "Name": "ResourcesHookContext", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "GetResourceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListUnitResourcesArgs" + }, + "Result": { + "$ref": "#/definitions/UnitResourcesResult" + } + } + } + }, + "definitions": { + "CharmResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ListUnitResourcesArgs": { + "type": "object", + "properties": { + "resource-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "resource-names" + ] + }, + "Resource": { + "type": "object", + "properties": { + "CharmResource": { + "$ref": "#/definitions/CharmResource" + }, + "application": { + "type": "string" + }, + "id": { + "type": "string" + }, + "pending-id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "CharmResource", + "id", + "pending-id", + "application", + "username", + "timestamp" + ] + }, + "UnitResourceResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "resource": { + "$ref": "#/definitions/Resource" + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resource" + ] + }, + "UnitResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitResourceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resources" + ] + } + } + } + }, + { + "Name": "Resumer", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ResumeTransactions": { + "type": "object" + } + } + } + }, + { + "Name": "RetryStrategy", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "RetryStrategy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RetryStrategyResults" + } + } + }, + "WatchRetryStrategy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RetryStrategy": { + "type": "object", + "properties": { + "jitter-retry-time": { + "type": "boolean" + }, + "max-retry-time": { + "type": "integer" + }, + "min-retry-time": { + "type": "integer" + }, + "retry-time-factor": { + "type": "integer" + }, + "should-retry": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "should-retry", + "min-retry-time", + "max-retry-time", + "jitter-retry-time", + "retry-time-factor" + ] + }, + "RetryStrategyResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RetryStrategy" + } + }, + "additionalProperties": false + }, + "RetryStrategyResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RetryStrategyResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "SSHClient", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "AllAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressesResults" + } + } + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressResults" + } + } + }, + "Proxy": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SSHProxyResult" + } + } + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressResults" + } + } + }, + "PublicKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHPublicKeysResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "SSHAddressResult": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "SSHAddressResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHAddressResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHAddressesResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses" + ] + }, + "SSHAddressesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHAddressesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHProxyResult": { + "type": "object", + "properties": { + "use-proxy": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "use-proxy" + ] + }, + "SSHPublicKeysResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "public-keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "SSHPublicKeysResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHPublicKeysResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Singular", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Claim": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SingularClaims" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Wait": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SingularClaim": { + "type": "object", + "properties": { + "claimant-tag": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "entity-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity-tag", + "claimant-tag", + "duration" + ] + }, + "SingularClaims": { + "type": "object", + "properties": { + "claims": { + "type": "array", + "items": { + "$ref": "#/definitions/SingularClaim" + } + } + }, + "additionalProperties": false, + "required": [ + "claims" + ] + } + } + } + }, + { + "Name": "Spaces", + "Version": 3, + "Schema": { + "type": "object", + "properties": { + "CreateSpaces": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSpacesParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ListSpaces": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSpacesResults" + } + } + }, + "ReloadSpaces": { + "type": "object" + } + }, + "definitions": { + "CreateSpaceParams": { + "type": "object", + "properties": { + "provider-id": { + "type": "string" + }, + "public": { + "type": "boolean" + }, + "space-tag": { + "type": "string" + }, + "subnet-tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "subnet-tags", + "space-tag", + "public" + ] + }, + "CreateSpacesParams": { + "type": "object", + "properties": { + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSpaceParams" + } + } + }, + "additionalProperties": false, + "required": [ + "spaces" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSpacesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Space" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Space": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "subnets" + ] + }, + "Subnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + } + } + } + }, + { + "Name": "StatusHistory", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "Prune": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusHistoryPruneArgs" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "StatusHistoryPruneArgs": { + "type": "object", + "properties": { + "max-history-mb": { + "type": "integer" + }, + "max-history-time": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "max-history-time", + "max-history-mb" + ] + } + } + } + }, + { + "Name": "Storage", + "Version": 6, + "Schema": { + "type": "object", + "properties": { + "AddToUnit": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragesAddParams" + }, + "Result": { + "$ref": "#/definitions/AddStorageResults" + } + } + }, + "Attach": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CreatePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DetachStorage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageDetachmentParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Import": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BulkImportStorageParams" + }, + "Result": { + "$ref": "#/definitions/ImportStorageResults" + } + } + }, + "ListFilesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FilesystemFilters" + }, + "Result": { + "$ref": "#/definitions/FilesystemDetailsListResults" + } + } + }, + "ListPools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolFilters" + }, + "Result": { + "$ref": "#/definitions/StoragePoolsResults" + } + } + }, + "ListStorageDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageFilters" + }, + "Result": { + "$ref": "#/definitions/StorageDetailsListResults" + } + } + }, + "ListVolumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeFilters" + }, + "Result": { + "$ref": "#/definitions/VolumeDetailsListResults" + } + } + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveStorage" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemovePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolDeleteArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "StorageDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StorageDetailsResults" + } + } + }, + "UpdatePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "AddStorageDetails": { + "type": "object", + "properties": { + "storage-tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "storage-tags" + ] + }, + "AddStorageResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/AddStorageDetails" + } + }, + "additionalProperties": false + }, + "AddStorageResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AddStorageResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BulkImportStorageParams": { + "type": "object", + "properties": { + "storage": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportStorageParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storage" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FilesystemAttachmentDetails": { + "type": "object", + "properties": { + "FilesystemAttachmentInfo": { + "$ref": "#/definitions/FilesystemAttachmentInfo" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "FilesystemAttachmentInfo" + ] + }, + "FilesystemAttachmentInfo": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FilesystemDetails": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "info", + "status" + ] + }, + "FilesystemDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemDetails" + } + } + }, + "additionalProperties": false + }, + "FilesystemDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemFilter": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FilesystemFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemFilter" + } + } + }, + "additionalProperties": false + }, + "FilesystemInfo": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-id", + "pool", + "size" + ] + }, + "ImportStorageDetails": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag" + ] + }, + "ImportStorageParams": { + "type": "object", + "properties": { + "kind": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "storage-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "pool", + "provider-id", + "storage-name" + ] + }, + "ImportStorageResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ImportStorageDetails" + } + }, + "additionalProperties": false + }, + "ImportStorageResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportStorageResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveStorage": { + "type": "object", + "properties": { + "storage": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveStorageInstance" + } + } + }, + "additionalProperties": false, + "required": [ + "storage" + ] + }, + "RemoveStorageInstance": { + "type": "object", + "properties": { + "destroy-attachments": { + "type": "boolean" + }, + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "StorageAddParams": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "storage": { + "$ref": "#/definitions/StorageConstraints" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "name", + "storage" + ] + }, + "StorageAttachmentDetails": { + "type": "object", + "properties": { + "life": { + "type": "string" + }, + "location": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag", + "machine-tag" + ] + }, + "StorageAttachmentId": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag" + ] + }, + "StorageAttachmentIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StorageDetachmentParams": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "ids": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageDetails": { + "type": "object", + "properties": { + "attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StorageAttachmentDetails" + } + } + }, + "kind": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "owner-tag", + "kind", + "status", + "persistent" + ] + }, + "StorageDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetails" + } + } + }, + "additionalProperties": false + }, + "StorageDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "StorageDetailsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageDetails" + } + }, + "additionalProperties": false + }, + "StorageDetailsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetailsResult" + } + } + }, + "additionalProperties": false + }, + "StorageFilter": { + "type": "object", + "additionalProperties": false + }, + "StorageFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageFilter" + } + } + }, + "additionalProperties": false + }, + "StoragePool": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "provider", + "attrs" + ] + }, + "StoragePoolArgs": { + "type": "object", + "properties": { + "pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePool" + } + } + }, + "additionalProperties": false, + "required": [ + "pools" + ] + }, + "StoragePoolDeleteArg": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "StoragePoolDeleteArgs": { + "type": "object", + "properties": { + "pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolDeleteArg" + } + } + }, + "additionalProperties": false, + "required": [ + "pools" + ] + }, + "StoragePoolFilter": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + }, + "providers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StoragePoolFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolFilter" + } + } + }, + "additionalProperties": false + }, + "StoragePoolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "storage-pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePool" + } + } + }, + "additionalProperties": false + }, + "StoragePoolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolsResult" + } + } + }, + "additionalProperties": false + }, + "StoragesAddParams": { + "type": "object", + "properties": { + "storages": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storages" + ] + }, + "VolumeAttachmentDetails": { + "type": "object", + "properties": { + "VolumeAttachmentInfo": { + "$ref": "#/definitions/VolumeAttachmentInfo" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "VolumeAttachmentInfo" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeDetails": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info", + "status" + ] + }, + "VolumeDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeDetails" + } + } + }, + "additionalProperties": false + }, + "VolumeDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "VolumeFilter": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "VolumeFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeFilter" + } + } + }, + "additionalProperties": false + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + } + } + } + }, + { + "Name": "StorageProvisioner", + "Version": 4, + "Schema": { + "type": "object", + "properties": { + "AttachmentLife": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "CreateVolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachmentPlans" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "FilesystemAttachmentParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/FilesystemAttachmentParamsResults" + } + } + }, + "FilesystemAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/FilesystemAttachmentResults" + } + } + }, + "FilesystemParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/FilesystemParamsResults" + } + } + }, + "Filesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/FilesystemResults" + } + } + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveAttachment": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveFilesystemParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoveFilesystemParamsResults" + } + } + }, + "RemoveVolumeAttachmentPlan": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveVolumeParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoveVolumeParamsResults" + } + } + }, + "SetFilesystemAttachmentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FilesystemAttachments" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetFilesystemInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Filesystems" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetVolumeAttachmentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachments" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetVolumeAttachmentPlanBlockInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachmentPlans" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetVolumeInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Volumes" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentParamsResults" + } + } + }, + "VolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentPlanResults" + } + } + }, + "VolumeAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentResults" + } + } + }, + "VolumeBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/BlockDeviceResults" + } + } + }, + "VolumeParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VolumeParamsResults" + } + } + }, + "Volumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VolumeResults" + } + } + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "WatchBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchFilesystemAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + } + }, + "WatchFilesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchVolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + } + }, + "WatchVolumeAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + } + }, + "WatchVolumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + } + }, + "definitions": { + "BlockDevice": { + "type": "object", + "properties": { + "BusAddress": { + "type": "string" + }, + "DeviceLinks": { + "type": "array", + "items": { + "type": "string" + } + }, + "DeviceName": { + "type": "string" + }, + "FilesystemType": { + "type": "string" + }, + "HardwareId": { + "type": "string" + }, + "InUse": { + "type": "boolean" + }, + "Label": { + "type": "string" + }, + "MountPoint": { + "type": "string" + }, + "Size": { + "type": "integer" + }, + "UUID": { + "type": "string" + }, + "WWN": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "DeviceName", + "DeviceLinks", + "Label", + "UUID", + "HardwareId", + "WWN", + "BusAddress", + "Size", + "FilesystemType", + "InUse", + "MountPoint" + ] + }, + "BlockDeviceResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/BlockDevice" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BlockDeviceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockDeviceResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Filesystem": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "info" + ] + }, + "FilesystemAttachment": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemAttachmentInfo" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "machine-tag", + "info" + ] + }, + "FilesystemAttachmentInfo": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FilesystemAttachmentParams": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "filesystem-tag": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "machine-tag", + "provider" + ] + }, + "FilesystemAttachmentParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemAttachmentParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemAttachmentParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachmentParamsResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemAttachments": { + "type": "object", + "properties": { + "filesystem-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachment" + } + } + }, + "additionalProperties": false, + "required": [ + "filesystem-attachments" + ] + }, + "FilesystemInfo": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-id", + "pool", + "size" + ] + }, + "FilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/FilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "size", + "provider" + ] + }, + "FilesystemParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemParamsResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Filesystem" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemResult" + } + } + }, + "additionalProperties": false + }, + "Filesystems": { + "type": "object", + "properties": { + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/Filesystem" + } + } + }, + "additionalProperties": false, + "required": [ + "filesystems" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "MachineStorageIdsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveFilesystemParams": { + "type": "object", + "properties": { + "destroy": { + "type": "boolean" + }, + "filesystem-id": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider", + "filesystem-id" + ] + }, + "RemoveFilesystemParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoveFilesystemParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "RemoveFilesystemParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveFilesystemParamsResult" + } + } + }, + "additionalProperties": false + }, + "RemoveVolumeParams": { + "type": "object", + "properties": { + "destroy": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "volume-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider", + "volume-id" + ] + }, + "RemoveVolumeParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoveVolumeParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "RemoveVolumeParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveVolumeParamsResult" + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Volume": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info" + ] + }, + "VolumeAttachment": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeAttachmentInfo" + }, + "machine-tag": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "info" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + }, + "volume-id": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "provider" + ] + }, + "VolumeAttachmentParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachmentParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentParamsResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlan": { + "type": "object", + "properties": { + "block-device": { + "$ref": "#/definitions/BlockDevice" + }, + "life": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "plan-info" + ] + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlanResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachmentPlan" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentPlanResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentPlanResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlans": { + "type": "object", + "properties": { + "volume-plans": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentPlan" + } + } + }, + "additionalProperties": false, + "required": [ + "volume-plans" + ] + }, + "VolumeAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachments": { + "type": "object", + "properties": { + "volume-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachment" + } + } + }, + "additionalProperties": false, + "required": [ + "volume-attachments" + ] + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + }, + "VolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/VolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "size", + "provider" + ] + }, + "VolumeParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeParamsResult" + } + } + }, + "additionalProperties": false + }, + "VolumeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Volume" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeResult" + } + } + }, + "additionalProperties": false + }, + "Volumes": { + "type": "object", + "properties": { + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/Volume" + } + } + }, + "additionalProperties": false, + "required": [ + "volumes" + ] + } + } + } + }, + { + "Name": "StringsWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Subnets", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "AddSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddSubnetsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "AllSpaces": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SpaceResults" + } + } + }, + "AllZones": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ZoneResults" + } + } + }, + "ListSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SubnetsFilters" + }, + "Result": { + "$ref": "#/definitions/ListSubnetsResults" + } + } + } + }, + "definitions": { + "AddSubnetParams": { + "type": "object", + "properties": { + "provider-network-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "subnet-provider-id": { + "type": "string" + }, + "subnet-tag": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "space-tag" + ] + }, + "AddSubnetsParams": { + "type": "object", + "properties": { + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/AddSubnetParams" + } + } + }, + "additionalProperties": false, + "required": [ + "subnets" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSubnetsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SpaceResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "SpaceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SpaceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Subnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + }, + "SubnetsFilters": { + "type": "object", + "properties": { + "space-tag": { + "type": "string" + }, + "zone": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ZoneResult": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "available" + ] + }, + "ZoneResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZoneResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Undertaker", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/UndertakerModelInfoResult" + } + } + }, + "ProcessDyingModel": { + "type": "object" + }, + "RemoveModel": { + "type": "object" + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchModelResources": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "UndertakerModelInfo": { + "type": "object", + "properties": { + "force-destroyed": { + "type": "boolean" + }, + "global-name": { + "type": "string" + }, + "is-system": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "global-name", + "is-system", + "life", + "force-destroyed" + ] + }, + "UndertakerModelInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UndertakerModelInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "UnitAssigner", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "AssignUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetAgentStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "WatchUnitAssignments": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Uniter", + "Version": 12, + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + } + }, + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + } + }, + "AddMetricBatches": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetricBatchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "AddUnitStorage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragesAddParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "AllMachinePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachinePortsResults" + } + } + }, + "ApplicationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationStatusResults" + } + } + }, + "AssignedMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "AvailabilityZone": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "BeginActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CharmArchiveSha256": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURLs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "CharmModifiedVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + } + }, + "CharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringBoolResults" + } + } + }, + "ClearResolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ClosePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "CloudAPIVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "CloudSpec": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "ConfigSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ConfigSettingsResults" + } + } + }, + "CurrentModel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelResult" + } + } + }, + "Destroy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DestroyAllSubordinates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "DestroyUnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "EnterScope": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "FinishActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionExecutionResults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "GetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MeterStatusResults" + } + } + }, + "GetPrincipal": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringBoolResults" + } + } + }, + "GoalStates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/GoalStateResults" + } + } + }, + "HasSubordinates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + } + }, + "LeaveScope": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "Merge": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MergeLeadershipSettingsBulkParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + } + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "NetworkInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/NetworkInfoParams" + }, + "Result": { + "$ref": "#/definitions/NetworkInfoResults" + } + } + }, + "OpenPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "ProviderType": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "Read": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/GetLeadershipSettingsBulkResults" + } + } + }, + "ReadRemoteSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnitPairs" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + } + }, + "ReadSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + } + }, + "Refresh": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UnitRefreshResults" + } + } + }, + "Relation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/RelationResults" + } + } + }, + "RelationById": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationIds" + }, + "Result": { + "$ref": "#/definitions/RelationResults" + } + } + }, + "RelationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RelationUnitStatusResults" + } + } + }, + "RemoveStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RequestReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Resolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ResolvedModeResults" + } + } + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + } + }, + "SetAgentStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetApplicationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetCharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesCharmURL" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPodSpecParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetRelationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationStatusArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetUpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetWorkloadVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityWorkloadVersions" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "StorageAttachmentLife": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + } + }, + "StorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/StorageAttachmentResults" + } + } + }, + "UnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + } + }, + "UnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StorageAttachmentIdsResults" + } + } + }, + "UpdateSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnitsSettings" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + } + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchActionNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchConfigSettingsHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "WatchLeadershipSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchRelationUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResults" + } + } + }, + "WatchStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchTrustConfigSettingsHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchUnitAddressesHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchUnitRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchUnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + } + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WorkloadVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Action": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionExecutionResult": { + "type": "object", + "properties": { + "action-tag": { + "type": "string" + }, + "message": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "action-tag", + "status" + ] + }, + "ActionExecutionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionExecutionResult" + } + } + }, + "additionalProperties": false + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "Address": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationStatusResult": { + "type": "object", + "properties": { + "application": { + "$ref": "#/definitions/StatusResult" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StatusResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "units" + ] + }, + "ApplicationStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "CharmURLs": { + "type": "object", + "properties": { + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmURL" + } + } + }, + "additionalProperties": false, + "required": [ + "urls" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "ConfigSettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "ConfigSettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigSettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Endpoint": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "relation": { + "$ref": "#/definitions/CharmRelation" + } + }, + "additionalProperties": false, + "required": [ + "application-name", + "relation" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesCharmURL": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityCharmURL" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesPortRanges": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityCharmURL": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "charm-url" + ] + }, + "EntityPortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "protocol", + "from-port", + "to-port" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "EntityString": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "value" + ] + }, + "EntityWorkloadVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "workload-version" + ] + }, + "EntityWorkloadVersions": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityWorkloadVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetLeadershipSettingsBulkResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/GetLeadershipSettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetLeadershipSettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "GoalState": { + "type": "object", + "properties": { + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/GoalStateStatus" + } + } + } + } + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/GoalStateStatus" + } + } + } + }, + "additionalProperties": false, + "required": [ + "units", + "relations" + ] + }, + "GoalStateResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/GoalState" + } + }, + "additionalProperties": false, + "required": [ + "result", + "error" + ] + }, + "GoalStateResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/GoalStateResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GoalStateStatus": { + "type": "object", + "properties": { + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "since" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Address", + "port" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "InterfaceAddress": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "hostname", + "value", + "cidr" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachinePortRange": { + "type": "object", + "properties": { + "port-range": { + "$ref": "#/definitions/PortRange" + }, + "relation-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "relation-tag", + "port-range" + ] + }, + "MachinePortsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "ports" + ] + }, + "MachinePortsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MergeLeadershipSettingsBulkParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/MergeLeadershipSettingsParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "MergeLeadershipSettingsParam": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "MeterStatusResult": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "info" + ] + }, + "MeterStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Metric": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "value", + "time" + ] + }, + "MetricBatch": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "charm-url", + "created", + "metrics" + ] + }, + "MetricBatchParam": { + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/MetricBatch" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "batch" + ] + }, + "MetricBatchParams": { + "type": "object", + "properties": { + "batches": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricBatchParam" + } + } + }, + "additionalProperties": false, + "required": [ + "batches" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type" + ] + }, + "NetworkInfo": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceAddress" + } + }, + "interface-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "mac-address", + "interface-name", + "addresses" + ] + }, + "NetworkInfoParams": { + "type": "object", + "properties": { + "bindings": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-id": { + "type": "integer" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "bindings" + ] + }, + "NetworkInfoResult": { + "type": "object", + "properties": { + "bind-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkInfo" + } + }, + "egress-subnets": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "ingress-addresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "NetworkInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/NetworkInfoResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "from-port", + "to-port", + "protocol" + ] + }, + "RelationIds": { + "type": "object", + "properties": { + "relation-ids": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-ids" + ] + }, + "RelationResult": { + "type": "object", + "properties": { + "bool": { + "type": "boolean" + }, + "endpoint": { + "$ref": "#/definitions/Endpoint" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "integer" + }, + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "other-application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life", + "id", + "key", + "endpoint" + ] + }, + "RelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationStatusArg": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "relation-id": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "relation-id", + "status", + "message" + ] + }, + "RelationStatusArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationStatusArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RelationUnit": { + "type": "object", + "properties": { + "relation": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "unit" + ] + }, + "RelationUnitPair": { + "type": "object", + "properties": { + "local-unit": { + "type": "string" + }, + "relation": { + "type": "string" + }, + "remote-unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "local-unit", + "remote-unit" + ] + }, + "RelationUnitPairs": { + "type": "object", + "properties": { + "relation-unit-pairs": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitPair" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-unit-pairs" + ] + }, + "RelationUnitSettings": { + "type": "object", + "properties": { + "relation": { + "type": "string" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "unit", + "settings" + ] + }, + "RelationUnitStatus": { + "type": "object", + "properties": { + "in-scope": { + "type": "boolean" + }, + "relation-tag": { + "type": "string" + }, + "suspended": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "relation-tag", + "in-scope", + "suspended" + ] + }, + "RelationUnitStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationUnitStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationUnits": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnit" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsSettings": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitSettings" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationUnitsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ResolvedModeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "mode": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "mode" + ] + }, + "ResolvedModeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolvedModeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetPodSpecParams": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityString" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "SettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "SettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StorageAddParams": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "storage": { + "$ref": "#/definitions/StorageConstraints" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "name", + "storage" + ] + }, + "StorageAttachment": { + "type": "object", + "properties": { + "kind": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "location": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "owner-tag", + "unit-tag", + "kind", + "location", + "life" + ] + }, + "StorageAttachmentId": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag" + ] + }, + "StorageAttachmentIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageAttachmentIdsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageAttachmentIds" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StorageAttachmentIdsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentIdsResult" + } + } + }, + "additionalProperties": false + }, + "StorageAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StorageAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StoragesAddParams": { + "type": "object", + "properties": { + "storages": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storages" + ] + }, + "StringBoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "ok": { + "type": "boolean" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result", + "ok" + ] + }, + "StringBoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringBoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitRefreshResult": { + "type": "object", + "properties": { + "Error": { + "$ref": "#/definitions/Error" + }, + "Life": { + "type": "string" + }, + "Resolved": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Life", + "Resolved", + "Error" + ] + }, + "UnitRefreshResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitRefreshResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "UpgradeSeriesStatusParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "status", + "message" + ] + }, + "UpgradeSeriesStatusParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UpgradeSeriesStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "UpgradeSeries", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "FinishUpgradeSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "MachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + } + }, + "PinMachineApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinApplicationsResults" + } + } + }, + "PinnedLeadership": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinnedLeadershipResult" + } + } + }, + "SetMachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetUpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "StartUnitCompletion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStartUnitCompletionParam" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "TargetSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + } + }, + "UnitsCompleted": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + } + }, + "UnitsPrepared": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + } + }, + "UnpinMachineApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinApplicationsResults" + } + } + }, + "UpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + } + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResult": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PinApplicationResult": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "application-name" + ] + }, + "PinApplicationsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PinApplicationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PinnedLeadershipResult": { + "type": "object", + "properties": { + "result": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpgradeSeriesStartUnitCompletionParam": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "message" + ] + }, + "UpgradeSeriesStatusParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "status", + "message" + ] + }, + "UpgradeSeriesStatusParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UpgradeSeriesStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "UpgradeSteps", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "ResetKVMMachineModificationStatusIdle": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "definitions": { + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Upgrader", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "DesiredVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VersionResults" + } + } + }, + "SetTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesVersion" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Tools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ToolsResults" + } + } + }, + "WatchAPIVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Number", + "Series", + "Arch" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesVersion": { + "type": "object", + "properties": { + "agent-tools": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "agent-tools" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "tools": { + "$ref": "#/definitions/Version" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "tools" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "ToolsResult": { + "type": "object", + "properties": { + "disable-ssl-hostname-verification": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "tools", + "disable-ssl-hostname-verification" + ] + }, + "ToolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Version": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "VersionResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false + }, + "VersionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VersionResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "UserManager", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "AddUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddUsers" + }, + "Result": { + "$ref": "#/definitions/AddUserResults" + } + } + }, + "DisableUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "EnableUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "ResetPassword": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AddUserResults" + } + } + }, + "SetPassword": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "UserInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UserInfoRequest" + }, + "Result": { + "$ref": "#/definitions/UserInfoResults" + } + } + } + }, + "definitions": { + "AddUser": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "username", + "display-name" + ] + }, + "AddUserResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "secret-key": { + "type": "array", + "items": { + "type": "integer" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false + }, + "AddUserResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AddUserResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "AddUsers": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/AddUser" + } + } + }, + "additionalProperties": false, + "required": [ + "users" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "created-by": { + "type": "string" + }, + "date-created": { + "type": "string", + "format": "date-time" + }, + "disabled": { + "type": "boolean" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "username", + "display-name", + "access", + "created-by", + "date-created", + "disabled" + ] + }, + "UserInfoRequest": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "include-disabled": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "include-disabled" + ] + }, + "UserInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UserInfo" + } + }, + "additionalProperties": false + }, + "UserInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "VolumeAttachmentPlansWatcher", + "Version": 1, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "VolumeAttachmentsWatcher", + "Version": 2, + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + } + }, + "Stop": { + "type": "object" + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + } +] \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/logsink.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/logsink.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/logsink.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/logsink.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,7 +14,6 @@ "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/version" - "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/logsink" "github.com/juju/juju/apiserver/params" @@ -34,7 +33,7 @@ dblogger recordLogger releaser func() version version.Number - entity names.Tag + entity string filePrefix string } @@ -142,7 +141,7 @@ return errors.Trace(err) } s.version = ver - s.entity = entity.Tag() + s.entity = entity.Tag().String() s.filePrefix = st.ModelUUID() + ":" s.dblogger = s.dbloggers.get(st.State) s.releaser = func() { @@ -176,7 +175,7 @@ Message: m.Message, }}), "logging to DB failed") - m.Entity = s.entity.String() + m.Entity = s.entity fileErr := errors.Annotate( logToFile(s.fileLogger, s.filePrefix, m), "logging to logsink.log failed", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/logstream.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/logstream.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/logstream.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/logstream.go 2019-06-28 17:10:43.000000000 +0000 @@ -231,7 +231,7 @@ ID: rec.ID, ModelUUID: rec.ModelUUID, Version: rec.Version.String(), - Entity: rec.Entity.String(), + Entity: rec.Entity, Timestamp: rec.Time, Module: rec.Module, Location: rec.Location, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/logstream_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/logstream_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/logstream_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/logstream_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,7 +18,6 @@ "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" @@ -105,7 +104,7 @@ ModelUUID: "deadbeef-...", Version: version.Current, Time: time.Date(2015, 6, 19, 15, 34, 37, 0, time.UTC), - Entity: names.NewMachineTag("99"), + Entity: "machine-99", Module: "some.where", Location: "code.go:42", Level: loggo.INFO, @@ -115,7 +114,7 @@ ModelUUID: "deadbeef-...", Version: version.Current, Time: time.Date(2015, 6, 19, 15, 36, 40, 0, time.UTC), - Entity: names.NewUnitTag("foo/2"), + Entity: "unit-foo-2", Module: "else.where", Location: "go.go:22", Level: loggo.ERROR, @@ -132,7 +131,7 @@ Records: []params.LogStreamRecord{{ ID: rec.ID, ModelUUID: rec.ModelUUID, - Entity: rec.Entity.String(), + Entity: rec.Entity, Version: version.Current.String(), Timestamp: rec.Time, Module: rec.Module, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/logtransfer.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/logtransfer.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/logtransfer.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/logtransfer.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,7 +9,6 @@ "github.com/juju/errors" "github.com/juju/loggo" - "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/logsink" "github.com/juju/juju/apiserver/params" @@ -80,17 +79,9 @@ // WriteLog is part of the logsink.LogWriteCloser interface. func (s *migrationLoggingStrategy) WriteLog(m params.LogRecord) error { level, _ := loggo.ParseLevel(m.Level) - var entity names.Tag - if m.Entity != "" { - var err error - entity, err = names.ParseTag(m.Entity) - if err != nil { - return errors.Annotate(err, "parsing entity from log record") - } - } err := s.dblogger.Log([]state.LogRecord{{ Time: m.Time, - Entity: entity, + Entity: m.Entity, Module: m.Module, Location: m.Location, Level: level, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/applications.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/applications.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/applications.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/applications.go 2019-06-28 17:10:43.000000000 +0000 @@ -270,6 +270,9 @@ ApplicationTag string `json:"application-tag"` ProviderId string `json:"provider-id"` Addresses []Address `json:"addresses"` + + Scale *int `json:"scale,omitempty"` + Generation *int64 `json:"generation,omitempty"` } // ApplicationDestroy holds the parameters for making the deprecated diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/internal.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/internal.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/internal.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/internal.go 2019-06-28 17:10:43.000000000 +0000 @@ -885,3 +885,9 @@ Units UnitsGoalState `json:"units"` Relations map[string]UnitsGoalState `json:"relations"` } + +// ContainerTypeResult holds the result of a machine's ContainerType. +type ContainerTypeResult struct { + Type instance.ContainerType `json:"container-type"` + Error *Error `json:"error"` +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/network.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/network.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/network.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/network.go 2019-06-28 17:10:43.000000000 +0000 @@ -283,20 +283,22 @@ // the API requests/responses. See also network.Address, from/to // which this is transformed. type Address struct { - Value string `json:"value"` - Type string `json:"type"` - Scope string `json:"scope"` - SpaceName string `json:"space-name,omitempty"` + Value string `json:"value"` + Type string `json:"type"` + Scope string `json:"scope"` + SpaceName string `json:"space-name,omitempty"` + SpaceProviderId string `json:"space-id,omitempty"` } // FromNetworkAddress is a convenience helper to create a parameter // out of the network type, here for Address. func FromNetworkAddress(naddr network.Address) Address { return Address{ - Value: naddr.Value, - Type: string(naddr.Type), - Scope: string(naddr.Scope), - SpaceName: string(naddr.SpaceName), + Value: naddr.Value, + Type: string(naddr.Type), + Scope: string(naddr.Scope), + SpaceName: string(naddr.SpaceName), + SpaceProviderId: string(naddr.SpaceProviderId), } } @@ -304,10 +306,11 @@ // as network type, here for Address. func (addr Address) NetworkAddress() network.Address { return network.Address{ - Value: addr.Value, - Type: network.AddressType(addr.Type), - Scope: network.Scope(addr.Scope), - SpaceName: network.SpaceName(addr.SpaceName), + Value: addr.Value, + Type: network.AddressType(addr.Type), + Scope: network.Scope(addr.Scope), + SpaceName: network.SpaceName(addr.SpaceName), + SpaceProviderId: network.Id(addr.SpaceProviderId), } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/network_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/network_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/network_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/network_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -276,6 +276,11 @@ } paramsAddress := params.FromNetworkAddress(networkAddress) c.Assert(networkAddress, jc.DeepEquals, paramsAddress.NetworkAddress()) + + networkAddress.SpaceName = "test-space" + networkAddress.SpaceProviderId = "666" + paramsAddress = params.FromNetworkAddress(networkAddress) + c.Assert(networkAddress, jc.DeepEquals, paramsAddress.NetworkAddress()) } func (s *NetworkSuite) TestHostPortConvenience(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/params.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/params.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/params.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/params.go 2019-06-28 17:10:43.000000000 +0000 @@ -389,6 +389,7 @@ type UpdateApplicationUnits struct { ApplicationTag string `json:"application-tag"` Scale *int `json:"scale,omitempty"` + Generation *int64 `json:"generation,omitempty"` Status EntityStatus `json:"status,omitempty"` Units []ApplicationUnitParams `json:"units"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/params_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/params_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/params_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/params_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -57,7 +57,7 @@ HardwareCharacteristics: &instance.HardwareCharacteristics{}, }, }, - json: `["machine","change",{"model-uuid":"uuid","id":"Benji","instance-id":"Shazam","agent-status":{"current":"error","message":"foo","version":""},"instance-status":{"current":"pending","message":"","version":""},"life":"alive","series":"trusty","supported-containers":["lxd"],"supported-containers-known":false,"hardware-characteristics":{},"jobs":["JobManageModel"],"addresses":[],"has-vote":false,"wants-vote":false}]`, + json: `["machine","change",{"model-uuid":"uuid","id":"Benji","instance-id":"Shazam","container-type":"","agent-status":{"current":"error","message":"foo","version":""},"instance-status":{"current":"pending","message":"","version":""},"life":"alive","series":"trusty","supported-containers":["lxd"],"supported-containers-known":false,"hardware-characteristics":{},"jobs":["JobManageModel"],"addresses":[],"has-vote":false,"wants-vote":false}]`, }, { about: "ApplicationInfo Delta", value: multiwatcher.Delta{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/undertaker.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/undertaker.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/params/undertaker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/params/undertaker.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,11 +5,12 @@ // UndertakerModelInfo returns information on an model needed by the undertaker worker. type UndertakerModelInfo struct { - UUID string `json:"uuid"` - Name string `json:"name"` - GlobalName string `json:"global-name"` - IsSystem bool `json:"is-system"` - Life Life `json:"life"` + UUID string `json:"uuid"` + Name string `json:"name"` + GlobalName string `json:"global-name"` + IsSystem bool `json:"is-system"` + Life Life `json:"life"` + ForceDestroyed bool `json:"force-destroyed"` } // UndertakerModelInfoResult holds the result of an API call that returns an diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/resources.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/resources.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/resources.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/resources.go 2019-06-28 17:10:43.000000000 +0000 @@ -42,7 +42,8 @@ // ResourcesHandler is the HTTP handler for client downloads and // uploads of resources. type ResourcesHandler struct { - StateAuthFunc func(*http.Request, ...string) (ResourcesBackend, state.PoolHelper, names.Tag, error) + StateAuthFunc func(*http.Request, ...string) (ResourcesBackend, state.PoolHelper, names.Tag, error) + ChangeAllowedFunc func(*http.Request) error } // ServeHTTP implements http.Handler. @@ -70,6 +71,10 @@ logger.Errorf("resource download failed: %v", err) } case "PUT": + if err := h.ChangeAllowedFunc(req); err != nil { + api.SendHTTPError(resp, err) + return + } response, err := h.upload(backend, req, tagToUsername(tag)) if err != nil { api.SendHTTPError(resp, err) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/apiserver/resources_test.go juju-core-2.6.5/src/github.com/juju/juju/apiserver/resources_test.go --- juju-core-2.6.2/src/github.com/juju/juju/apiserver/resources_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/apiserver/resources_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -22,6 +22,7 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver" + "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" "github.com/juju/juju/resource" @@ -59,7 +60,8 @@ s.req = req s.recorder = httptest.NewRecorder() s.handler = &apiserver.ResourcesHandler{ - StateAuthFunc: s.authState, + StateAuthFunc: s.authState, + ChangeAllowedFunc: func(*http.Request) error { return nil }, } } @@ -115,6 +117,25 @@ s.checkResp(c, http.StatusOK, "application/json", string(expected)) } +func (s *ResourcesHandlerSuite) TestPutChangeBlocked(c *gc.C) { + uploadContent := "" + res, _ := newResource(c, "spam", "a-user", content) + stored, _ := newResource(c, "spam", "", "") + s.backend.ReturnGetResource = stored + s.backend.ReturnSetResource = res + + expectedError := common.OperationBlockedError("test block") + s.handler.ChangeAllowedFunc = func(*http.Request) error { + return expectedError + } + + req, _ := newUploadRequest(c, "spam", "a-application", uploadContent) + s.handler.ServeHTTP(s.recorder, req) + + expected := mustMarshalJSON(¶ms.ErrorResult{common.ServerError(expectedError)}) + s.checkResp(c, http.StatusBadRequest, "application/json", string(expected)) +} + func (s *ResourcesHandlerSuite) TestPutSuccessDockerResource(c *gc.C) { uploadContent := "" res := newDockerResource(c, "spam", "a-user", content) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/broker.go juju-core-2.6.5/src/github.com/juju/juju/caas/broker.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -261,10 +261,11 @@ // Service represents information about the status of a caas service entity. type Service struct { - Id string - Addresses []network.Address - Scale *int - Status status.StatusInfo + Id string + Addresses []network.Address + Scale *int + Generation *int64 + Status status.StatusInfo } // FilesystemInfo represents information about a filesystem diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/base_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/base_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/base_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/base_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -63,7 +63,7 @@ mockApiextensionsClient *mocks.MockApiExtensionsClientInterface mockCustomResourceDefinition *mocks.MockCustomResourceDefinitionInterface - watcher *provider.KubernetesWatcher + watchers []*provider.KubernetesWatcher } func (s *BaseSuite) SetUpTest(c *gc.C) { @@ -117,19 +117,21 @@ func (s *BaseSuite) setupController(c *gc.C) *gomock.Controller { ctrl := gomock.NewController(c) newK8sRestClientFunc := s.setupK8sRestClient(c, ctrl, s.getNamespace()) - return s.setupBroker(c, ctrl, newK8sRestClientFunc) -} - -func (s *BaseSuite) setupBroker(c *gc.C, ctrl *gomock.Controller, newK8sRestClientFunc provider.NewK8sClientFunc) *gomock.Controller { - s.clock = testclock.NewClock(time.Time{}) newK8sWatcherForTest := func(wi watch.Interface, name string, clock jujuclock.Clock) (*provider.KubernetesWatcher, error) { w, err := provider.NewKubernetesWatcher(wi, name, clock) c.Assert(err, jc.ErrorIsNil) - s.watcher = w - return s.watcher, err + s.watchers = append(s.watchers, w) + return w, err } + return s.setupBroker(c, ctrl, newK8sRestClientFunc, newK8sWatcherForTest) +} + +func (s *BaseSuite) setupBroker(c *gc.C, ctrl *gomock.Controller, + newK8sRestClientFunc provider.NewK8sClientFunc, + newK8sWatcherFunc provider.NewK8sWatcherFunc) *gomock.Controller { + s.clock = testclock.NewClock(time.Time{}) var err error - s.broker, err = provider.NewK8sBroker(s.controllerUUID, s.k8sRestConfig, s.cfg, newK8sRestClientFunc, newK8sWatcherForTest, s.clock) + s.broker, err = provider.NewK8sBroker(s.controllerUUID, s.k8sRestConfig, s.cfg, newK8sRestClientFunc, newK8sWatcherFunc, s.clock) c.Assert(err, jc.ErrorIsNil) return ctrl } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap.go 2019-06-28 17:10:43.000000000 +0000 @@ -44,6 +44,11 @@ TemplateFileNameAgentConf = "template-" + agent.AgentConfigFilename ) +const ( + mongoDBContainerName = "mongodb" + apiServerContainerName = "api-server" +) + type controllerServiceSpec struct { // ServiceType is required. ServiceType core.ServiceType @@ -337,9 +342,9 @@ spec, ok := controllerServiceSpecs[cloudType] if !ok { logger.Debugf("fallback to default svc spec for %q", cloudType) - spec, _ = controllerServiceSpecs[caas.K8sCloudOther] + spec = controllerServiceSpecs[caas.K8sCloudOther] } - if spec.ServiceType == "" { + if spec == nil || spec.ServiceType == "" { // ServiceType is required. return nil, errors.NotValidf("service type is empty for %q", cloudType) } @@ -349,7 +354,7 @@ func (c *controllerStack) createControllerService() error { svcName := c.resourceNameService - cloudType := cloud.SplitHostCloudRegion(c.pcfg.Bootstrap.ControllerCloud.HostCloudRegion)[0] + cloudType, _, _ := cloud.SplitHostCloudRegion(c.pcfg.Bootstrap.ControllerCloud.HostCloudRegion) controllerSvcSpec, err := c.getControllerSvcSpec(cloudType) if err != nil { return errors.Trace(err) @@ -523,7 +528,7 @@ Template: core.PodTemplateSpec{ ObjectMeta: v1.ObjectMeta{ Labels: c.stackLabels, - Name: c.pcfg.GetPodName(), + Name: c.pcfg.GetPodName(), // This really should not be set. Namespace: c.broker.GetCurrentNamespace(), }, Spec: core.PodSpec{ @@ -554,16 +559,31 @@ if err = c.broker.createStatefulSet(spec); err != nil { return errors.Trace(err) } - if err = c.syncPodStatus(w); err != nil { - return errors.Annotate(err, "fetching pods' status for controller") + + for i := int32(0); i < numberOfPods; i++ { + podName := c.pcfg.GetPodName() // TODO(caas): HA mode! + if err = c.waitForPod(w, podName); err != nil { + return errors.Trace(err) + } } return nil } -func (c *controllerStack) syncPodStatus(w watcher.NotifyWatcher) error { +func (c *controllerStack) waitForPod(podWatcher watcher.NotifyWatcher, podName string) error { + timeout := c.broker.clock.NewTimer(c.pcfg.Bootstrap.Timeout) + + podEventWatcher, err := c.broker.watchEvents(podName, "Pod") + if err != nil { + return errors.Trace(err) + } + defer podEventWatcher.Kill() + printedMsg := set.NewStrings() - checkContainerEvents := func(events []core.Event, reason string, eventCount int) bool { - count := 0 + printPodEvents := func() error { + events, err := c.broker.getEvents(podName, "Pod") + if err != nil { + return errors.Trace(err) + } for _, evt := range events { // clean the messages to prevent duplicated records. // we don't care which image is been pulling/pulled and this reason should be printed once only. @@ -572,8 +592,12 @@ evt.Message = "Downloading images" case PulledImage: evt.Message = "Pulled images" - case reason: - count++ + case StartedContainer: + if evt.InvolvedObject.FieldPath == fmt.Sprintf("spec.containers{%s}", mongoDBContainerName) { + evt.Message = "Started mongodb container" + } else if evt.InvolvedObject.FieldPath == fmt.Sprintf("spec.containers{%s}", apiServerContainerName) { + evt.Message = "Started controller container" + } } if evt.Type == core.EventTypeNormal && !printedMsg.Contains(evt.Message) { printedMsg.Add(evt.Message) @@ -581,25 +605,97 @@ if evt.Reason == PullingImage { c.ctx.Infof(evt.Message) } - if evt.Reason == PulledImage { - // starting pod after images are pulled. - c.ctx.Infof("Starting controller pod") + } + } + return nil + } + + unschedulableReason := func(pod *core.Pod) error { + // TODO: handle reason for unschedulable state such as node taints (HA) + // Volumes + for _, volume := range pod.Spec.Volumes { + if pvcSource := volume.PersistentVolumeClaim; pvcSource != nil { + pvc, err := c.broker.getPVC(pvcSource.ClaimName) + if err != nil { + return errors.Annotatef(err, "failed to get pvc %s", pvcSource.ClaimName) + } + if pvc.Status.Phase == core.ClaimPending { + events, err := c.broker.getEvents(pvc.Name, "PersistentVolumeClaim") + if err != nil { + return errors.Annotate(err, "failed to get pvc events") + } + numEvents := len(events) + if numEvents > 0 { + lastEvent := events[numEvents-1] + return errors.Errorf("pvc %s pending due to %s - %s", + pvc.Name, lastEvent.Reason, lastEvent.Message) + } } } } - return count >= eventCount + return nil + } + + pendingReason := func() error { + pod, err := c.broker.getPod(podName) + if err != nil { + return errors.Trace(err) + } + for _, cond := range pod.Status.Conditions { + switch cond.Type { + case core.PodScheduled: + if cond.Reason == core.PodReasonUnschedulable { + err := unschedulableReason(pod) + if err != nil { + return errors.Annotate(err, "unschedulable") + } + return errors.Errorf("unschedulable: %v", cond.Message) + } + } + } + if pod.Status.Phase == core.PodPending { + return errors.Errorf("pending: %v - %v", pod.Status.Reason, pod.Status.Message) + } + return nil } + + checkStatus := func(pod *core.Pod) (bool, error) { + switch pod.Status.Phase { + case core.PodRunning: + return true, nil + case core.PodFailed: + return false, errors.Annotate(pendingReason(), "controller pod failed") + case core.PodSucceeded: + return false, errors.Errorf("controller pod terminated unexpectedly") + } + return false, nil + } + + printPodEvents() for { select { - case <-w.Changes(): - events, err := c.broker.getEvents(c.pcfg.GetPodName()) + case <-podWatcher.Changes(): + printPodEvents() + pod, err := c.broker.getPod(podName) + if err != nil { + return errors.Annotate(err, "fetching pods' status for controller") + } + done, err := checkStatus(pod) if err != nil { return errors.Trace(err) } - if checkContainerEvents(events, StartedContainer, c.containerCount) { - // all containers are created. + if done { + c.ctx.Infof("Starting controller pod") return nil } + case <-podEventWatcher.Changes(): + printPodEvents() + case <-timeout.Chan(): + err := pendingReason() + if err != nil { + return errors.Annotatef(err, "timed out waiting for controller pod") + } + return errors.Timeoutf("timed out waiting for controller pod") } } } @@ -745,7 +841,7 @@ args = append(args, fmt.Sprintf("--wiredTigerCacheSizeGB=%v", wiredTigerCacheSize)) } containerSpec = append(containerSpec, core.Container{ - Name: "mongodb", + Name: mongoDBContainerName, ImagePullPolicy: core.PullIfNotPresent, Image: c.pcfg.GetJujuDbOCIImagePath(), Command: []string{ @@ -806,7 +902,7 @@ // add container API server. containerSpec = append(containerSpec, core.Container{ - Name: "api-server", + Name: apiServerContainerName, ImagePullPolicy: core.PullIfNotPresent, Image: c.pcfg.GetControllerImagePath(), Command: []string{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/bootstrap_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,7 +8,7 @@ "time" "github.com/golang/mock/gomock" - "github.com/juju/clock/testclock" + jujuclock "github.com/juju/clock" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/worker.v1/workertest" @@ -17,7 +17,7 @@ k8sstorage "k8s.io/api/storage/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/watch" + watch "k8s.io/apimachinery/pkg/watch" "github.com/juju/juju/api" "github.com/juju/juju/apiserver/params" @@ -185,8 +185,14 @@ // Eventually the namespace wil be set to controllerName. // So we have to specify the final namespace(controllerName) for later use. newK8sRestClientFunc := s.setupK8sRestClient(c, ctrl, s.pcfg.ControllerName) - - s.setupBroker(c, ctrl, newK8sRestClientFunc) + newK8sWatcherForTest := func(wi watch.Interface, name string, clock jujuclock.Clock) (*provider.KubernetesWatcher, error) { + w, err := provider.NewKubernetesWatcher(wi, name, clock) + c.Assert(err, jc.ErrorIsNil) + <-w.Changes() // Consume initial event for testing. + s.watchers = append(s.watchers, w) + return w, err + } + s.setupBroker(c, ctrl, newK8sRestClientFunc, newK8sWatcherForTest) // Broker's namespace is "controller" now - controllerModelConfig.Name() c.Assert(s.broker.GetCurrentNamespace(), jc.DeepEquals, "controller") c.Assert( @@ -201,6 +207,8 @@ s.broker.SetNamespace("controller-1") s.broker.GetAnnotations().Add("juju.io/is-controller", "true") + s.pcfg.Bootstrap.Timeout = 10 * time.Minute + controllerStacker := s.controllerStackerGetter() // Broker's namespace should be set to controller name now. c.Assert(s.broker.GetCurrentNamespace(), jc.DeepEquals, "controller-1") @@ -543,7 +551,7 @@ mkdir -p $JUJU_TOOLS_DIR cp /opt/jujud $JUJU_TOOLS_DIR/jujud -test -e $JUJU_DATA_DIR/agents/machine-0/agent.conf || $JUJU_TOOLS_DIR/jujud bootstrap-state $JUJU_DATA_DIR/bootstrap-params --data-dir $JUJU_DATA_DIR --debug --timeout 0s +test -e $JUJU_DATA_DIR/agents/machine-0/agent.conf || $JUJU_TOOLS_DIR/jujud bootstrap-state $JUJU_DATA_DIR/bootstrap-params --data-dir $JUJU_DATA_DIR --debug --timeout 10m0s $JUJU_TOOLS_DIR/jujud machine --data-dir $JUJU_DATA_DIR --machine-id 0 --debug `[1:], }, @@ -581,15 +589,53 @@ } podWatcher := s.k8sNewFakeWatcher() + eventWatcher := s.k8sNewFakeWatcher() eventsPartial := &core.EventList{ Items: []core.Event{ - {Type: core.EventTypeNormal, Reason: provider.StartedContainer, Message: "Started container mongodb"}, + { + Type: core.EventTypeNormal, + Reason: provider.PullingImage, + }, + { + Type: core.EventTypeNormal, + Reason: provider.PulledImage, + }, + { + InvolvedObject: core.ObjectReference{FieldPath: "spec.containers{mongodb}"}, + Type: core.EventTypeNormal, + Reason: provider.StartedContainer, + Message: "Started container mongodb", + }, }, } eventsDone := &core.EventList{ Items: []core.Event{ - {Type: core.EventTypeNormal, Reason: provider.StartedContainer, Message: "Started container mongodb"}, - {Type: core.EventTypeNormal, Reason: provider.StartedContainer, Message: "Started container api-server"}, + { + Type: core.EventTypeNormal, + Reason: provider.PullingImage, + }, + { + Type: core.EventTypeNormal, + Reason: provider.PulledImage, + }, + { + InvolvedObject: core.ObjectReference{FieldPath: "spec.containers{mongodb}"}, + Type: core.EventTypeNormal, + Reason: provider.StartedContainer, + Message: "Started container mongodb", + }, + { + InvolvedObject: core.ObjectReference{FieldPath: "spec.containers{api-server}"}, + Type: core.EventTypeNormal, + Reason: provider.StartedContainer, + Message: "Started container api-server", + }, + }, + } + + podReady := &core.Pod{ + Status: core.PodStatus{ + Phase: core.PodRunning, }, } @@ -677,20 +723,45 @@ Return(podWatcher, nil), s.mockStatefulSets.EXPECT().Create(statefulSetSpec).Times(1). Return(statefulSetSpec, nil), + s.mockEvents.EXPECT().Watch( + v1.ListOptions{ + FieldSelector: "involvedObject.name=controller-0,involvedObject.kind=Pod", + Watch: true, + }, + ). + Return(eventWatcher, nil), + s.mockEvents.EXPECT().List( + v1.ListOptions{ + IncludeUninitialized: true, + FieldSelector: "involvedObject.name=controller-0,involvedObject.kind=Pod", + }, + ). + DoAndReturn(func(...interface{}) (*core.EventList, error) { + eventWatcher.Action(provider.StartedContainer, nil) + s.clock.WaitAdvance(time.Second, testing.ShortWait, 2) + return eventsPartial, nil + }), + s.mockEvents.EXPECT().List( v1.ListOptions{ IncludeUninitialized: true, - FieldSelector: "involvedObject.name=controller-0", + FieldSelector: "involvedObject.name=controller-0,involvedObject.kind=Pod", }, ). - Return(eventsPartial, nil), + DoAndReturn(func(...interface{}) (*core.EventList, error) { + podWatcher.Action("PodStarted", nil) + s.clock.WaitAdvance(time.Second, testing.ShortWait, 2) + return eventsDone, nil + }), s.mockEvents.EXPECT().List( v1.ListOptions{ IncludeUninitialized: true, - FieldSelector: "involvedObject.name=controller-0", + FieldSelector: "involvedObject.name=controller-0,involvedObject.kind=Pod", }, ). Return(eventsDone, nil), + s.mockPods.EXPECT().Get("controller-0", v1.GetOptions{IncludeUninitialized: true}). + Return(podReady, nil), ) errChan := make(chan error) @@ -698,26 +769,17 @@ errChan <- controllerStacker.Deploy() }() - go func(w *watch.RaceFreeFakeWatcher, clk *testclock.Clock) { - err := clk.WaitAdvance(3*time.Second, testing.ShortWait, 1) - c.Assert(err, jc.ErrorIsNil) - - for _, evt := range []watch.EventType{ - provider.StartedContainer, // mongodb started. - provider.StartedContainer, // api-server started. - } { - if !w.IsStopped() { - clk.WaitAdvance(time.Second, testing.ShortWait, 1) - w.Action(evt, nil) - } - } - }(podWatcher, s.clock) + err = s.clock.WaitAdvance(3*time.Second, testing.ShortWait, 1) + c.Assert(err, jc.ErrorIsNil) select { case err := <-errChan: c.Assert(err, jc.ErrorIsNil) - c.Assert(workertest.CheckKilled(c, s.watcher), jc.ErrorIsNil) + c.Assert(s.watchers, gc.HasLen, 2) + c.Assert(workertest.CheckKilled(c, s.watchers[0]), jc.ErrorIsNil) + c.Assert(workertest.CheckKilled(c, s.watchers[1]), jc.ErrorIsNil) c.Assert(podWatcher.IsStopped(), jc.IsTrue) + c.Assert(eventWatcher.IsStopped(), jc.IsTrue) case <-time.After(coretesting.LongWait): c.Fatalf("timed out waiting for deploy return") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/cloud.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/cloud.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/cloud.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/cloud.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,7 +7,6 @@ "fmt" "io" "reflect" - "strings" "github.com/juju/errors" "github.com/juju/utils" @@ -25,7 +24,7 @@ type ClientConfigFuncGetter func(string) (clientconfig.ClientConfigFunc, error) // GetClusterMetadataFunc returns the ClusterMetadata using the provided ClusterMetadataChecker -type GetClusterMetadataFunc func(caas.ClusterMetadataChecker) (*caas.ClusterMetadata, error) +type GetClusterMetadataFunc func(KubeCloudStorageParams) (*caas.ClusterMetadata, error) // KubeCloudParams defines the parameters used to extract a k8s cluster definition from kubeconfig data. type KubeCloudParams struct { @@ -91,14 +90,46 @@ return newCloud, credential, context.CredentialName, nil } -// UpdateKubeCloudWithStorage updates the passed Cloud with storage details retrieved from the clouds' cluster. -func UpdateKubeCloudWithStorage(k8sCloud *cloud.Cloud, storageParams KubeCloudStorageParams) (string, error) { - fail := func(e error) (string, error) { - return "", e +func updateK8sCloud(k8sCloud *cloud.Cloud, clusterMetadata *caas.ClusterMetadata, storageMsg string) string { + var workloadSC, operatorSC string + // Record the operator storage to use. + if clusterMetadata.OperatorStorageClass != nil { + operatorSC = clusterMetadata.OperatorStorageClass.Name + storageMsg += "." + } else { + if storageMsg == "" { + storageMsg += "\nwith " + } else { + storageMsg += "\nand " + } + storageMsg += fmt.Sprintf("operator storage provisioned by the workload storage class.") + } + + if clusterMetadata.NominatedStorageClass != nil { + workloadSC = clusterMetadata.NominatedStorageClass.Name } + if k8sCloud.Config == nil { + k8sCloud.Config = make(map[string]interface{}) + } + if _, ok := k8sCloud.Config[WorkloadStorageKey]; !ok { + k8sCloud.Config[WorkloadStorageKey] = workloadSC + } + if _, ok := k8sCloud.Config[OperatorStorageKey]; !ok { + k8sCloud.Config[OperatorStorageKey] = operatorSC + } + return storageMsg +} + +// UpdateKubeCloudWithStorage updates the passed Cloud with storage details retrieved from the clouds' cluster. +func UpdateKubeCloudWithStorage(k8sCloud *cloud.Cloud, storageParams KubeCloudStorageParams) (storageMsg string, err error) { // Get the cluster metadata so we can see if there's suitable storage available. - clusterMetadata, err := storageParams.GetClusterMetadataFunc(storageParams.MetadataChecker) + clusterMetadata, err := storageParams.GetClusterMetadataFunc(storageParams) + defer func() { + if err == nil { + storageMsg = updateK8sCloud(k8sCloud, clusterMetadata, storageMsg) + } + }() if err != nil || clusterMetadata == nil { // err will be nil if user hit Ctrl+C. @@ -106,114 +137,93 @@ if err != nil { msg = err.Error() } - return fail(ClusterQueryError{Message: msg}) + return "", ClusterQueryError{Message: msg} } - if storageParams.HostCloudRegion == "" && clusterMetadata.Regions != nil && clusterMetadata.Regions.Size() > 0 { - storageParams.HostCloudRegion = cloud.BuildHostCloudRegion( - clusterMetadata.Cloud, - clusterMetadata.Regions.SortedValues()[0], - ) - } - if storageParams.HostCloudRegion == "" { - return fail(ClusterQueryError{}) + if storageParams.HostCloudRegion == "" && clusterMetadata.Cloud != "" { + var region string + if clusterMetadata.Regions != nil && clusterMetadata.Regions.Size() > 0 { + region = clusterMetadata.Regions.SortedValues()[0] + } + storageParams.HostCloudRegion = cloud.BuildHostCloudRegion(clusterMetadata.Cloud, region) } - _, region, err := ParseCloudRegion(storageParams.HostCloudRegion) + k8sCloud.HostCloudRegion = storageParams.HostCloudRegion + + cloudType, region, err := cloud.SplitHostCloudRegion(k8sCloud.HostCloudRegion) if err != nil { - return fail(errors.Annotatef(err, "validating cloud region %q", storageParams.HostCloudRegion)) + // Region is optional, but cloudType is required for next step. + return "", ClusterQueryError{} + } + if region != "" { + k8sCloud.Regions = []cloud.Region{{ + Name: region, + Endpoint: k8sCloud.Endpoint, + }} } - k8sCloud.HostCloudRegion = storageParams.HostCloudRegion - k8sCloud.Regions = []cloud.Region{{ - Name: region, - }} - - // If the user has not specified storage, check that the cluster has Juju's opinionated defaults. - cloudType := cloud.SplitHostCloudRegion(storageParams.HostCloudRegion)[0] - err = storageParams.MetadataChecker.CheckDefaultWorkloadStorage(cloudType, clusterMetadata.NominatedStorageClass) + // If the user has not specified storage and cloudType is usable, check Juju's opinionated defaults. + err = storageParams.MetadataChecker.CheckDefaultWorkloadStorage( + cloudType, clusterMetadata.NominatedStorageClass, + ) if storageParams.WorkloadStorage == "" { - if errors.IsNotFound(err) { - return fail(UnknownClusterError{CloudName: cloudType}) + if err == nil { + return } if caas.IsNonPreferredStorageError(err) { npse := err.(*caas.NonPreferredStorageError) - return fail(NoRecommendedStorageError{Message: err.Error(), ProviderName: npse.Name}) + return "", NoRecommendedStorageError{Message: err.Error(), ProviderName: npse.Name} } - if err != nil { - return fail(errors.Trace(err)) - } - } - // If no storage class exists, we need to create one with the opinionated defaults, - // or use an existing one. - var storageMsg string - if storageParams.WorkloadStorage != "" { - var ( - provisioner string - params map[string]string - ) - nonPreferredStorageErr, ok := errors.Cause(err).(*caas.NonPreferredStorageError) - if ok { - provisioner = nonPreferredStorageErr.Provisioner - params = nonPreferredStorageErr.Parameters - } - sp, err := storageParams.MetadataChecker.EnsureStorageProvisioner(caas.StorageProvisioner{ - Name: storageParams.WorkloadStorage, - Provisioner: provisioner, - Parameters: params, - }) if errors.IsNotFound(err) { - return fail(errors.Wrap(err, errors.NotFoundf("storage class %q", storageParams.WorkloadStorage))) - } - if err != nil { - return fail(errors.Annotatef(err, "creating storage class %q", storageParams.WorkloadStorage)) - } - if nonPreferredStorageErr != nil && sp.Provisioner == provisioner { - storageMsg = fmt.Sprintf(" with %s default storage", nonPreferredStorageErr.Name) - if storageParams.WorkloadStorage != "" { - storageMsg = fmt.Sprintf("%s provisioned\nby the existing %q storage class", storageMsg, storageParams.WorkloadStorage) + // No juju preferred storage config in jujuPreferredWorkloadStorage, for example, maas. + if clusterMetadata.NominatedStorageClass == nil { + // And no preferred storage classes with expected annotations found. + // - workloadStorageClassAnnotationKey + // - operatorStorageClassAnnotationKey + return "", UnknownClusterError{CloudName: cloudType} } - } else { - storageMsg = fmt.Sprintf(" with storage provisioned\nby the existing %q storage class", storageParams.WorkloadStorage) - } - } - if storageParams.WorkloadStorage == "" && clusterMetadata.NominatedStorageClass != nil { - storageParams.WorkloadStorage = clusterMetadata.NominatedStorageClass.Name - } - - // Record the operator storage to use. - var operatorStorageName string - if clusterMetadata.OperatorStorageClass != nil { - operatorStorageName = clusterMetadata.OperatorStorageClass.Name - storageMsg += "." - } else { - operatorStorageName = storageParams.WorkloadStorage - if storageMsg == "" { - storageMsg += "\nwith " - } else { - storageMsg += "\n" + // Do further EnsureStorageProvisioner if preferred storage found via juju preferred/default annotations. + } else if err != nil { + return "", errors.Trace(err) } - storageMsg += fmt.Sprintf("operator storage provisioned by the workload storage class.") } - if k8sCloud.Config == nil { - k8sCloud.Config = make(map[string]interface{}) - } - if _, ok := k8sCloud.Config[WorkloadStorageKey]; !ok { - k8sCloud.Config[WorkloadStorageKey] = storageParams.WorkloadStorage + // we need to create storage class with the opinionated defaults, or use an existing one if + // --storage provided or nominated storage found but Juju does not have preferred storage config to + // compare with for the cloudType(like maas for example); + var ( + provisioner string + params map[string]string + ) + scName := storageParams.WorkloadStorage + nonPreferredStorageErr, ok := errors.Cause(err).(*caas.NonPreferredStorageError) + if ok { + provisioner = nonPreferredStorageErr.Provisioner + params = nonPreferredStorageErr.Parameters + } else if clusterMetadata.NominatedStorageClass != nil { + // no preferred storage class config but nominated storage found. + scName = clusterMetadata.NominatedStorageClass.Name + } + var sp *caas.StorageProvisioner + sp, err = storageParams.MetadataChecker.EnsureStorageProvisioner(caas.StorageProvisioner{ + Name: scName, + Provisioner: provisioner, + Parameters: params, + }) + if errors.IsNotFound(err) { + return "", errors.Wrap(err, errors.NotFoundf("storage class %q", scName)) } - if _, ok := k8sCloud.Config[OperatorStorageKey]; !ok { - k8sCloud.Config[OperatorStorageKey] = operatorStorageName + if err != nil { + return "", errors.Annotatef(err, "creating storage class %q", scName) } - return storageMsg, nil -} - -// ParseCloudRegion breaks apart a clusters cloud region. -func ParseCloudRegion(cloudRegion string) (string, string, error) { - fields := strings.SplitN(cloudRegion, "/", 2) - if len(fields) != 2 || fields[0] == "" || fields[1] == "" { - return "", "", errors.NotValidf("cloud region %q", cloudRegion) + if nonPreferredStorageErr != nil && sp.Provisioner == provisioner { + storageMsg = fmt.Sprintf(" with %s default storage provisioned", nonPreferredStorageErr.Name) + } else { + storageMsg = " with storage provisioned" } - return fields[0], fields[1], nil + storageMsg += fmt.Sprintf("\nby the existing %q storage class", scName) + clusterMetadata.NominatedStorageClass = sp + clusterMetadata.OperatorStorageClass = sp + return } // BaseKubeCloudOpenParams provides a basic OpenParams for a cluster @@ -277,8 +287,8 @@ } storageUpdateParams := KubeCloudStorageParams{ MetadataChecker: broker, - GetClusterMetadataFunc: func(broker caas.ClusterMetadataChecker) (*caas.ClusterMetadata, error) { - clusterMetadata, err := broker.GetClusterMetadata("") + GetClusterMetadataFunc: func(storageParams KubeCloudStorageParams) (*caas.ClusterMetadata, error) { + clusterMetadata, err := storageParams.MetadataChecker.GetClusterMetadata("") if err != nil { return nil, errors.Trace(err) } @@ -289,11 +299,6 @@ if err != nil { return cloud.Cloud{}, errors.Trace(err) } - for i := range mk8sCloud.Regions { - if mk8sCloud.Regions[i].Endpoint == "" { - mk8sCloud.Regions[i].Endpoint = mk8sCloud.Endpoint - } - } return mk8sCloud, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/config.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/config.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/config.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/config.go 2019-06-28 17:10:43.000000000 +0000 @@ -16,7 +16,7 @@ defaultIngressSSLPassthrough = false defaultIngressAllowHTTPKey = false - serviceTypeConfigKey = "kubernetes-service-type" + ServiceTypeConfigKey = "kubernetes-service-type" serviceExternalIPsConfigKey = "kubernetes-service-external-ips" serviceTargetPortConfigKey = "kubernetes-service-target-port" serviceLoadBalancerIPKey = "kubernetes-service-loadbalancer-ip" @@ -31,7 +31,7 @@ ) var configFields = environschema.Fields{ - serviceTypeConfigKey: { + ServiceTypeConfigKey: { Description: "determines how the Service is exposed", Type: environschema.Tstring, Group: environschema.ProviderGroup, @@ -89,7 +89,7 @@ } var schemaDefaults = schema.Defaults{ - serviceTypeConfigKey: schema.Omit, + ServiceTypeConfigKey: schema.Omit, serviceAnnotationsKey: schema.Omit, ingressClassKey: defaultIngressClass, ingressSSLRedirectKey: defaultIngressSSLRedirect, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/events.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/events.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/events.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/events.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,9 +5,12 @@ import ( "github.com/juju/errors" + core "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" + + "github.com/juju/juju/core/watcher" ) // Constants below are copied from "k8s.io/kubernetes/pkg/kubelet/events" @@ -39,8 +42,11 @@ BackOffPullImage = "BackOff" ) -func (k *kubernetesClient) getEvents(ObjName string) ([]core.Event, error) { - selector := fields.OneTermEqualSelector("involvedObject.name", ObjName).String() +func (k *kubernetesClient) getEvents(objName string, objKind string) ([]core.Event, error) { + selector := fields.AndSelectors( + fields.OneTermEqualSelector("involvedObject.name", objName), + fields.OneTermEqualSelector("involvedObject.kind", objKind), + ).String() logger.Debugf("getting the latest event for %q", selector) eventList, err := k.client().CoreV1().Events(k.namespace).List(v1.ListOptions{ IncludeUninitialized: true, @@ -51,3 +57,19 @@ } return eventList.Items, nil } + +func (k *kubernetesClient) watchEvents(objName string, objKind string) (watcher.NotifyWatcher, error) { + selector := fields.AndSelectors( + fields.OneTermEqualSelector("involvedObject.name", objName), + fields.OneTermEqualSelector("involvedObject.kind", objKind), + ).String() + events := k.client().CoreV1().Events(k.namespace) + w, err := events.Watch(v1.ListOptions{ + FieldSelector: selector, + Watch: true, + }) + if err != nil { + return nil, errors.Trace(err) + } + return k.newWatcher(w, objName, k.clock) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/export_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -33,6 +33,9 @@ GetLocalMicroK8sConfig = getLocalMicroK8sConfig AttemptMicroK8sCloud = attemptMicroK8sCloud EnsureMicroK8sSuitable = ensureMicroK8sSuitable + NewK8sBroker = newK8sBroker + ToYaml = toYaml + Indent = indent ) type ( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/init.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/init.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/init.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/init.go 2019-06-28 17:10:43.000000000 +0000 @@ -40,6 +40,10 @@ Name: "EBS Volume", Provisioner: "kubernetes.io/aws-ebs", }, + caas.K8sCloudOpenStack: { + Name: "Cinder Disk", + Provisioner: "csi-cinderplugin", + }, } // jujuPreferredOperatorStorage defines the opinionated storage @@ -54,6 +58,11 @@ // cloud provider from node labels. func compileK8sCloudCheckers() map[string][]k8slabels.Selector { return map[string][]k8slabels.Selector{ + caas.K8sCloudMicrok8s: { + newLabelRequirements( + requirementParams{"microk8s.io/cluster", selection.Exists, nil}, + ), + }, caas.K8sCloudGCE: { // GKE. newLabelRequirements( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8s.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8s.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8s.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8s.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,7 +15,6 @@ "strconv" "strings" "sync" - "text/template" "time" jujuclock "github.com/juju/clock" @@ -34,7 +33,7 @@ "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/yaml" + k8syaml "k8s.io/apimachinery/pkg/util/yaml" apimachineryversion "k8s.io/apimachinery/pkg/version" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes" @@ -119,8 +118,8 @@ // NewK8sWatcherFunc defines a function which returns a k8s watcher based on the supplied config. type NewK8sWatcherFunc func(wi watch.Interface, name string, clock jujuclock.Clock) (*kubernetesWatcher, error) -// NewK8sBroker returns a kubernetes client for the specified k8s cluster. -func NewK8sBroker( +// newK8sBroker returns a kubernetes client for the specified k8s cluster. +func newK8sBroker( controllerUUID string, k8sRestConfig *rest.Config, cfg *config.Config, @@ -154,7 +153,6 @@ annotations: k8sannotations.New(nil). Add(annotationModelUUIDKey, modelUUID), } - if controllerUUID != "" { // controllerUUID could be empty in add-k8s without -c because there might be no controller yet. client.annotations.Add(annotationControllerUUIDKey, controllerUUID) @@ -376,7 +374,13 @@ } // Destroy is part of the Broker interface. -func (k *kubernetesClient) Destroy(callbacks context.ProviderCallContext) error { +func (k *kubernetesClient) Destroy(callbacks context.ProviderCallContext) (err error) { + defer func() { + if err != nil && k8serrors.ReasonForError(err) == v1.StatusReasonUnknown { + logger.Warningf("k8s cluster is not accessible: %v", err) + err = nil + } + }() watcher, err := k.WatchNamespace() if err != nil { return errors.Trace(err) @@ -607,16 +611,16 @@ statefulset := &apps.StatefulSet{ ObjectMeta: v1.ObjectMeta{ Name: operatorName, - Labels: map[string]string{labelOperator: appName}, + Labels: operatorLabels(appName), Annotations: annotations.ToMap()}, Spec: apps.StatefulSetSpec{ Replicas: &numPods, Selector: &v1.LabelSelector{ - MatchLabels: map[string]string{labelOperator: appName}, + MatchLabels: operatorLabels(appName), }, Template: core.PodTemplateSpec{ ObjectMeta: v1.ObjectMeta{ - Labels: map[string]string{labelOperator: appName}, + Labels: operatorLabels(appName), Annotations: pod.Annotations, }, }, @@ -947,6 +951,8 @@ scale := int(*ss.Spec.Replicas) result.Scale = &scale } + gen := ss.GetGeneration() + result.Generation = &gen message, ssStatus, err := k.getStatefulSetStatus(ss) if err != nil { return nil, errors.Annotatef(err, "getting status for %s", ss.Name) @@ -971,6 +977,8 @@ scale := int(*deployment.Spec.Replicas) result.Scale = &scale } + gen := deployment.GetGeneration() + result.Generation = &gen message, ssStatus, err := k.getDeploymentStatus(deployment) if err != nil { return nil, errors.Annotatef(err, "getting status for %s", ss.Name) @@ -980,7 +988,6 @@ Message: message, } } - return &result, nil } @@ -995,6 +1002,9 @@ if err := k.deleteStatefulSet(deploymentName); err != nil { return errors.Trace(err) } + if err := k.deleteService(headlessServiceName(deploymentName)); err != nil { + return errors.Trace(err) + } if err := k.deleteDeployment(deploymentName); err != nil { return errors.Trace(err) } @@ -1250,45 +1260,53 @@ } } - numPods := int32(numUnits) - if useStatefulSet { - if err := k.configureStatefulSet(appName, deploymentName, randPrefix, annotations.Copy(), unitSpec, params.PodSpec.Containers, &numPods, params.Filesystems); err != nil { - return errors.Annotate(err, "creating or updating StatefulSet") - } - cleanups = append(cleanups, func() { k.deleteDeployment(appName) }) - } else { - if err := k.configureDeployment(appName, deploymentName, annotations.Copy(), unitSpec, params.PodSpec.Containers, &numPods); err != nil { - return errors.Annotate(err, "creating or updating DeploymentController") - } - cleanups = append(cleanups, func() { k.deleteDeployment(appName) }) - } - - var ports []core.ContainerPort - for _, c := range unitSpec.Pod.Containers { - for _, p := range c.Ports { - if p.ContainerPort == 0 { - continue + hasService := !params.PodSpec.OmitServiceFrontend + if hasService { + var ports []core.ContainerPort + for _, c := range unitSpec.Pod.Containers { + for _, p := range c.Ports { + if p.ContainerPort == 0 { + continue + } + ports = append(ports, p) } - ports = append(ports, p) } - } - if !params.PodSpec.OmitServiceFrontend { + + serviceAnnotations := annotations.Copy() // Merge any service annotations from the charm. if unitSpec.Service != nil { - annotations.Merge(k8sannotations.New(unitSpec.Service.Annotations)) + serviceAnnotations.Merge(k8sannotations.New(unitSpec.Service.Annotations)) } // Merge any service annotations from the CLI. deployAnnotations, err := config.GetStringMap(serviceAnnotationsKey, nil) if err != nil { return errors.Annotatef(err, "unexpected annotations: %#v", config.Get(serviceAnnotationsKey, nil)) } - annotations.Merge(k8sannotations.New(deployAnnotations)) + serviceAnnotations.Merge(k8sannotations.New(deployAnnotations)) - config[serviceAnnotationsKey] = annotations.ToMap() + config[serviceAnnotationsKey] = serviceAnnotations.ToMap() if err := k.configureService(appName, deploymentName, ports, params, config); err != nil { return errors.Annotatef(err, "creating or updating service for %v", appName) } } + + numPods := int32(numUnits) + if useStatefulSet { + if err := k.configureHeadlessService(appName, deploymentName, annotations.Copy()); err != nil { + return errors.Annotate(err, "creating or updating headless service") + } + cleanups = append(cleanups, func() { k.deleteService(headlessServiceName(deploymentName)) }) + if err := k.configureStatefulSet(appName, deploymentName, randPrefix, annotations.Copy(), unitSpec, params.PodSpec.Containers, &numPods, params.Filesystems); err != nil { + return errors.Annotate(err, "creating or updating StatefulSet") + } + cleanups = append(cleanups, func() { k.deleteDeployment(appName) }) + } else { + if err := k.configureDeployment(appName, deploymentName, annotations.Copy(), unitSpec, params.PodSpec.Containers, &numPods); err != nil { + return errors.Annotate(err, "creating or updating DeploymentController") + } + cleanups = append(cleanups, func() { k.deleteDeployment(appName) }) + } + return nil } @@ -1317,10 +1335,22 @@ if !podcfg.IsJujuOCIImage(c.Image) { continue } - tagSep := strings.LastIndex(c.Image, ":") - c.Image = fmt.Sprintf("%s:%s", c.Image[:tagSep], vers.String()) + c.Image = podcfg.RebuildOldOperatorImagePath(c.Image, vers) existingStatefulSet.Spec.Template.Spec.Containers[i] = c } + + // update juju-version annotation. + // TODO(caas): consider how to upgrade to current annotations format safely. + // just ensure juju-version to current version for now. + existingStatefulSet.SetAnnotations( + k8sannotations.New(existingStatefulSet.GetAnnotations()). + Add(labelVersion, vers.String()).ToMap(), + ) + existingStatefulSet.Spec.Template.SetAnnotations( + k8sannotations.New(existingStatefulSet.Spec.Template.GetAnnotations()). + Add(labelVersion, vers.String()).ToMap(), + ) + _, err = statefulsets.Update(existingStatefulSet) return errors.Trace(err) } @@ -1605,6 +1635,7 @@ }, }, PodManagementPolicy: apps.ParallelPodManagement, + ServiceName: headlessServiceName(deploymentName), }, } podSpec := unitSpec.Pod @@ -1640,9 +1671,9 @@ return errors.Trace(err) } // TODO(caas) - allow extra storage to be added - existing.Spec.Selector = spec.Spec.Selector existing.Spec.Replicas = spec.Spec.Replicas existing.Spec.Template.Spec.Containers = existingPodSpec.Containers + // NB: we can't update the Spec.ServiceName as it is immutable. _, err = statefulsets.Update(existing) return errors.Trace(err) } @@ -1734,7 +1765,7 @@ return errors.NotSupportedf("service type %q", params.Deployment.ServiceType) } } - serviceType = core.ServiceType(config.GetString(serviceTypeConfigKey, string(serviceType))) + serviceType = core.ServiceType(config.GetString(ServiceTypeConfigKey, string(serviceType))) annotations, err := config.GetStringMap(serviceAnnotationsKey, nil) if err != nil { return errors.Annotatef(err, "unexpected annotations: %#v", config.Get(serviceAnnotationsKey, nil)) @@ -1758,6 +1789,28 @@ return k.ensureK8sService(service) } +func (k *kubernetesClient) configureHeadlessService( + appName, deploymentName string, annotations k8sannotations.Annotation, +) error { + logger.Debugf("creating/updating headless service for %s", appName) + service := &core.Service{ + ObjectMeta: v1.ObjectMeta{ + Name: headlessServiceName(deploymentName), + Labels: map[string]string{labelApplication: appName}, + Annotations: k8sannotations.New(nil). + Merge(annotations). + Add("service.alpha.kubernetes.io/tolerate-unready-endpoints", "true").ToMap(), + }, + Spec: core.ServiceSpec{ + Selector: map[string]string{labelApplication: appName}, + Type: core.ServiceTypeClusterIP, + ClusterIP: "None", + PublishNotReadyAddresses: true, + }, + } + return k.ensureK8sService(service) +} + // ensureK8sService ensures a k8s service resource. func (k *kubernetesClient) ensureK8sService(spec *core.Service) error { services := k.client().CoreV1().Services(k.namespace) @@ -1775,9 +1828,9 @@ } // deleteService deletes a service resource. -func (k *kubernetesClient) deleteService(deploymentName string) error { +func (k *kubernetesClient) deleteService(serviceName string) error { services := k.client().CoreV1().Services(k.namespace) - err := services.Delete(deploymentName, &v1.DeleteOptions{ + err := services.Delete(serviceName, &v1.DeleteOptions{ PropagationPolicy: &defaultPropagationPolicy, }) if k8serrors.IsNotFound(err) { @@ -1873,6 +1926,10 @@ return fmt.Sprintf("%v==%v", labelOperator, appName) } +func operatorLabels(appName string) map[string]string { + return map[string]string{labelOperator: appName} +} + func applicationSelector(appName string) string { return fmt.Sprintf("%v==%v", labelApplication, appName) } @@ -2043,6 +2100,19 @@ return units, nil } +func (k *kubernetesClient) getPod(podName string) (*core.Pod, error) { + pods := k.client().CoreV1().Pods(k.namespace) + pod, err := pods.Get(podName, v1.GetOptions{ + IncludeUninitialized: true, + }) + if k8serrors.IsNotFound(err) { + return nil, errors.NotFoundf("pod not found") + } else if err != nil { + return nil, errors.Trace(err) + } + return pod, nil +} + func (k *kubernetesClient) volumeInfoForEmptyDir(vol core.Volume, volMount core.VolumeMount, now time.Time) (*caas.FilesystemInfo, error) { size := uint64(vol.EmptyDir.SizeLimit.Size()) return &caas.FilesystemInfo{ @@ -2066,6 +2136,17 @@ }, nil } +func (k *kubernetesClient) getPVC(claimName string) (*core.PersistentVolumeClaim, error) { + pvcs := k.client().CoreV1().PersistentVolumeClaims(k.namespace) + pvc, err := pvcs.Get(claimName, v1.GetOptions{}) + if k8serrors.IsNotFound(err) { + return nil, errors.NotFoundf("pvc not found") + } else if err != nil { + return nil, errors.Trace(err) + } + return pvc, nil +} + func (k *kubernetesClient) volumeInfoForPVC(vol core.Volume, volMount core.VolumeMount, claimName string, now time.Time) (*caas.FilesystemInfo, error) { pvClaims := k.client().CoreV1().PersistentVolumeClaims(k.namespace) pvc, err := pvClaims.Get(claimName, v1.GetOptions{}) @@ -2100,7 +2181,7 @@ if statusMessage == "" { // If there are any events for this pvc we can use the // most recent to set the status. - eventList, err := k.getEvents(pvc.Name) + eventList, err := k.getEvents(pvc.Name, "PersistentVolumeClaim") if err != nil { return nil, errors.Annotate(err, "unable to get events for PVC") } @@ -2191,7 +2272,7 @@ if statusMessage == "" { // If there are any events for this pod we can use the // most recent to set the status. - eventList, err := k.getEvents(pod.Name) + eventList, err := k.getEvents(pod.Name, "Pod") if err != nil { return "", "", time.Time{}, errors.Trace(err) } @@ -2213,7 +2294,7 @@ if ss.Status.ReadyReplicas == ss.Status.Replicas { jujuStatus = status.Active } - return k.getStatusFromEvents(ss.Name, jujuStatus) + return k.getStatusFromEvents(ss.Name, "StatefulSet", jujuStatus) } func (k *kubernetesClient) getDeploymentStatus(deployment *apps.Deployment) (string, status.Status, error) { @@ -2225,11 +2306,11 @@ if deployment.Status.ReadyReplicas == deployment.Status.Replicas { jujuStatus = status.Active } - return k.getStatusFromEvents(deployment.Name, jujuStatus) + return k.getStatusFromEvents(deployment.Name, "Deployment", jujuStatus) } -func (k *kubernetesClient) getStatusFromEvents(parentName string, jujuStatus status.Status) (string, status.Status, error) { - events, err := k.getEvents(parentName) +func (k *kubernetesClient) getStatusFromEvents(name, kind string, jujuStatus status.Status) (string, status.Status, error) { + events, err := k.getEvents(name, kind) if err != nil { return "", "", errors.Trace(err) } @@ -2366,7 +2447,7 @@ Name: podName, Annotations: podAnnotations(annotations.Copy()). Add(labelVersion, version).ToMap(), - Labels: map[string]string{labelOperator: appName}, + Labels: operatorLabels(appName), }, Spec: core.PodSpec{ Containers: []core.Container{{ @@ -2432,61 +2513,18 @@ Service *K8sServiceSpec } -var containerTemplate = ` - - name: {{.Name}} - {{if .Ports}} - ports: - {{- range .Ports }} - - containerPort: {{.ContainerPort}} - {{if .Name}}name: {{.Name}}{{end}} - {{if .Protocol}}protocol: {{.Protocol}}{{end}} - {{- end}} - {{end}} - {{if .Command}} - command: [{{- range $idx, $c := .Command -}}{{if ne $idx 0}},{{end}}"{{$c}}"{{- end -}}] - {{end}} - {{if .Args}} - args: [{{- range $idx, $a := .Args -}}{{if ne $idx 0}},{{end}}"{{$a}}"{{- end -}}] - {{end}} - {{if .WorkingDir}} - workingDir: {{.WorkingDir}} - {{end}} - {{if .Config}} - env: - {{- range $k, $v := .Config }} - - name: {{$k}} - value: {{$v}} - {{- end}} - {{end}} -` - -var defaultPodTemplate = fmt.Sprintf(` -pod: - containers: - {{- range .Containers }} -%s - {{- end}} - {{if .InitContainers}} - initContainers: - {{- range .InitContainers }} -%s - {{- end}} - {{end}} -`[1:], containerTemplate, containerTemplate) - func makeUnitSpec(appName, deploymentName string, podSpec *caas.PodSpec) (*unitSpec, error) { // Fill out the easy bits using a template. - tmpl := template.Must(template.New("").Parse(defaultPodTemplate)) var buf bytes.Buffer - if err := tmpl.Execute(&buf, podSpec); err != nil { + if err := defaultPodTemplate.Execute(&buf, podSpec); err != nil { return nil, errors.Trace(err) } unitSpecString := buf.String() var unitSpec unitSpec - decoder := yaml.NewYAMLOrJSONDecoder(strings.NewReader(unitSpecString), len(unitSpecString)) + decoder := k8syaml.NewYAMLOrJSONDecoder(strings.NewReader(unitSpecString), len(unitSpecString)) if err := decoder.Decode(&unitSpec); err != nil { - logger.Errorf("unable to parse %q pod spec: %+v\n%v", appName, *podSpec, unitSpecString) + logger.Errorf("unable to parse %q pod spec: \n%+v\nunit spec: \n%v", appName, *podSpec, unitSpecString) return nil, errors.Trace(err) } @@ -2678,3 +2716,7 @@ } return nodeSelector, nil } + +func headlessServiceName(deploymentName string) string { + return fmt.Sprintf("%s-endpoints", deploymentName) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8s_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8s_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8s_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8s_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -328,6 +328,20 @@ }, } +var basicHeadlessServiceArg = &core.Service{ + ObjectMeta: v1.ObjectMeta{ + Name: "app-name-endpoints", + Labels: map[string]string{"juju-app": "app-name"}, + Annotations: map[string]string{"service.alpha.kubernetes.io/tolerate-unready-endpoints": "true"}, + }, + Spec: core.ServiceSpec{ + Selector: map[string]string{"juju-app": "app-name"}, + Type: "ClusterIP", + ClusterIP: "None", + PublishNotReadyAddresses: true, + }, +} + func (s *K8sBrokerSuite) secretArg(c *gc.C, annotations map[string]string) *core.Secret { secretData, err := provider.CreateDockerConfigJSON(&basicPodspec.Containers[0].ImageDetails) c.Assert(err, jc.ErrorIsNil) @@ -659,7 +673,9 @@ }(namespaceWatcher, s.clock) c.Assert(destroyFunc(), jc.ErrorIsNil) - c.Assert(workertest.CheckKilled(c, s.watcher), jc.ErrorIsNil) + for _, watcher := range s.watchers { + c.Assert(workertest.CheckKilled(c, watcher), jc.ErrorIsNil) + } c.Assert(namespaceWatcher.IsStopped(), jc.IsTrue) } @@ -845,6 +861,7 @@ }, }}, PodManagementPolicy: apps.ParallelPodManagement, + ServiceName: "app-name-endpoints", }, } } @@ -956,6 +973,8 @@ Return(s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Delete("test", s.deleteOptions(v1.DeletePropagationForeground)).Times(1). Return(s.k8sNotFoundError()), + s.mockServices.EXPECT().Delete("test-endpoints", s.deleteOptions(v1.DeletePropagationForeground)).Times(1). + Return(s.k8sNotFoundError()), s.mockDeployments.EXPECT().Delete("test", s.deleteOptions(v1.DeletePropagationForeground)).Times(1). Return(s.k8sNotFoundError()), s.mockSecrets.EXPECT().List(v1.ListOptions{LabelSelector: "juju-app==test"}).Times(1). @@ -1060,16 +1079,16 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(nil, s.k8sNotFoundError()), - s.mockDeployments.EXPECT().Update(deploymentArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockDeployments.EXPECT().Create(deploymentArg).Times(1). - Return(nil, nil), s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Update(serviceArg).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Create(serviceArg).Times(1). Return(nil, nil), + s.mockDeployments.EXPECT().Update(deploymentArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockDeployments.EXPECT().Create(deploymentArg).Times(1). + Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1117,6 +1136,7 @@ Spec: podSpec, }, PodManagementPolicy: apps.ParallelPodManagement, + ServiceName: "app-name-endpoints", }, } @@ -1129,16 +1149,22 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), - s.mockStatefulSets.EXPECT().Update(statefulSetArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). - Return(nil, nil), s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Update(&serviceArg).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Create(&serviceArg).Times(1). Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), + s.mockStatefulSets.EXPECT().Update(statefulSetArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). + Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1408,6 +1434,18 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), + s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicServiceArg).Times(1). + Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), s.mockStorageClass.EXPECT().Get("test-workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockStorageClass.EXPECT().Get("workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). @@ -1416,12 +1454,6 @@ Return(nil, s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). Return(nil, nil), - s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Update(basicServiceArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Create(basicServiceArg).Times(1). - Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1504,16 +1536,16 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(nil, s.k8sNotFoundError()), - s.mockDeployments.EXPECT().Update(deploymentArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockDeployments.EXPECT().Create(deploymentArg).Times(1). - Return(nil, nil), s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Update(basicServiceArg).Times(1). Return(nil, s.k8sNotFoundError()), s.mockServices.EXPECT().Create(basicServiceArg).Times(1). Return(nil, nil), + s.mockDeployments.EXPECT().Update(deploymentArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockDeployments.EXPECT().Create(deploymentArg).Times(1). + Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1565,6 +1597,18 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), + s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicServiceArg).Times(1). + Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), s.mockStorageClass.EXPECT().Get("test-workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockStorageClass.EXPECT().Get("workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). @@ -1573,12 +1617,6 @@ Return(nil, s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). Return(nil, nil), - s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Update(basicServiceArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Create(basicServiceArg).Times(1). - Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1637,6 +1675,18 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), + s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicServiceArg).Times(1). + Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), s.mockStorageClass.EXPECT().Get("test-workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockStorageClass.EXPECT().Get("workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). @@ -1645,12 +1695,6 @@ Return(nil, s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). Return(nil, nil), - s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Update(basicServiceArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Create(basicServiceArg).Times(1). - Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1716,6 +1760,18 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), + s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicServiceArg).Times(1). + Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), s.mockStorageClass.EXPECT().Get("test-workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockStorageClass.EXPECT().Get("workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). @@ -1724,12 +1780,6 @@ Return(nil, s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). Return(nil, nil), - s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Update(basicServiceArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Create(basicServiceArg).Times(1). - Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1787,6 +1837,18 @@ Return(nil, nil), s.mockStatefulSets.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). Return(&appsv1.StatefulSet{ObjectMeta: v1.ObjectMeta{Annotations: map[string]string{"juju-app-uuid": "appuuid"}}}, nil), + s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicServiceArg).Times(1). + Return(nil, nil), + s.mockServices.EXPECT().Get("app-name-endpoints", v1.GetOptions{IncludeUninitialized: true}).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Update(basicHeadlessServiceArg).Times(1). + Return(nil, s.k8sNotFoundError()), + s.mockServices.EXPECT().Create(basicHeadlessServiceArg).Times(1). + Return(nil, nil), s.mockStorageClass.EXPECT().Get("test-workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). Return(nil, s.k8sNotFoundError()), s.mockStorageClass.EXPECT().Get("workload-storage", v1.GetOptions{IncludeUninitialized: false}).Times(1). @@ -1795,12 +1857,6 @@ Return(nil, s.k8sNotFoundError()), s.mockStatefulSets.EXPECT().Create(statefulSetArg).Times(1). Return(nil, nil), - s.mockServices.EXPECT().Get("app-name", v1.GetOptions{IncludeUninitialized: true}).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Update(basicServiceArg).Times(1). - Return(nil, s.k8sNotFoundError()), - s.mockServices.EXPECT().Create(basicServiceArg).Times(1). - Return(nil, nil), ) params := &caas.ServiceParams{ @@ -1906,9 +1962,20 @@ defer ctrl.Finish() ss := apps.StatefulSet{ - ObjectMeta: v1.ObjectMeta{Name: "controller"}, + ObjectMeta: v1.ObjectMeta{ + Name: "controller", + Annotations: map[string]string{ + "juju-version": "1.1.1", + }, + Labels: map[string]string{"juju-operator": "controller"}, + }, Spec: apps.StatefulSetSpec{ Template: core.PodTemplateSpec{ + ObjectMeta: v1.ObjectMeta{ + Annotations: map[string]string{ + "juju-version": "1.1.1", + }, + }, Spec: core.PodSpec{ Containers: []core.Container{ {Image: "foo"}, @@ -1919,6 +1986,8 @@ }, } updated := ss + updated.Annotations["juju-version"] = "6.6.6" + updated.Spec.Template.Annotations["juju-version"] = "6.6.6" updated.Spec.Template.Spec.Containers[1].Image = "juju-operator:6.6.6" gomock.InOrder( s.mockStatefulSets.EXPECT().Get("controller", v1.GetOptions{IncludeUninitialized: true}).Times(1). @@ -1936,9 +2005,20 @@ defer ctrl.Finish() ss := apps.StatefulSet{ - ObjectMeta: v1.ObjectMeta{Name: "test-app-operator"}, + ObjectMeta: v1.ObjectMeta{ + Name: "test-app-operator", + Annotations: map[string]string{ + "juju-version": "1.1.1", + }, + Labels: map[string]string{"juju-app": "test-app"}, + }, Spec: apps.StatefulSetSpec{ Template: core.PodTemplateSpec{ + ObjectMeta: v1.ObjectMeta{ + Annotations: map[string]string{ + "juju-version": "1.1.1", + }, + }, Spec: core.PodSpec{ Containers: []core.Container{ {Image: "foo"}, @@ -1949,6 +2029,8 @@ }, } updated := ss + updated.Annotations["juju-version"] = "6.6.6" + updated.Spec.Template.Annotations["juju-version"] = "6.6.6" updated.Spec.Template.Spec.Containers[1].Image = "juju-operator:6.6.6" gomock.InOrder( s.mockStatefulSets.EXPECT().Get("juju-operator-test-app", v1.GetOptions{IncludeUninitialized: true}).Times(1). diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8stypes_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8stypes_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/k8stypes_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/k8stypes_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -46,7 +46,12 @@ - name: gitlab image: gitlab/latest imagePullPolicy: Always - command: ["sh", "-c"] + command: + - sh + - -c + - | + set -ex + echo "do some stuff here for gitlab container" args: ["doIt", "--debug"] workingDir: "/path/to/here" ports: @@ -97,7 +102,12 @@ - name: gitlab-init image: gitlab-init/latest imagePullPolicy: Always - command: ["sh", "-c"] + command: + - sh + - -c + - | + set -ex + echo "do some stuff here for gitlab-init container" args: ["doIt", "--debug"] workingDir: "/path/to/here" ports: @@ -180,9 +190,12 @@ }, }, Containers: []caas.ContainerSpec{{ - Name: "gitlab", - Image: "gitlab/latest", - Command: []string{"sh", "-c"}, + Name: "gitlab", + Image: "gitlab/latest", + Command: []string{"sh", "-c", ` +set -ex +echo "do some stuff here for gitlab container" +`[1:]}, Args: []string{"doIt", "--debug"}, WorkingDir: "/path/to/here", Ports: []caas.ContainerPort{ @@ -249,9 +262,12 @@ }, }}, InitContainers: []caas.ContainerSpec{{ - Name: "gitlab-init", - Image: "gitlab-init/latest", - Command: []string{"sh", "-c"}, + Name: "gitlab-init", + Image: "gitlab-init/latest", + Command: []string{"sh", "-c", ` +set -ex +echo "do some stuff here for gitlab-init container" +`[1:]}, Args: []string{"doIt", "--debug"}, WorkingDir: "/path/to/here", Ports: []caas.ContainerPort{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/metadata.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/metadata.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/metadata.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/metadata.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,9 +4,6 @@ package provider import ( - "os" - "strings" - "github.com/juju/collections/set" "github.com/juju/errors" core "k8s.io/api/core/v1" @@ -17,6 +14,7 @@ "k8s.io/apimachinery/pkg/selection" "github.com/juju/juju/caas" + k8sannotations "github.com/juju/juju/core/annotations" ) // newLabelRequirements creates a list of k8s node label requirements. @@ -49,32 +47,41 @@ for _, checker := range checkers { if checker.Matches(k8slabels.Set(node.GetLabels())) { region := node.Labels[regionLabelName] + if region == "" && cloudType == caas.K8sCloudMicrok8s { + region = caas.Microk8sRegion + } return cloudType, region } } } - // TODO - add microk8s node label check when available - hostname, err := os.Hostname() - if err != nil { - return "", "" - } - hostname = strings.ToLower(hostname) - hostLabel, _ := node.Labels["kubernetes.io/hostname"] - if node.Name == hostname && hostLabel == hostname { - return caas.K8sCloudMicrok8s, caas.Microk8sRegion - } return "", "" } func isDefaultStorageClass(sc storage.StorageClass) bool { - if v, ok := sc.Annotations["storageclass.kubernetes.io/is-default-class"]; ok && v != "false" { - return true + return k8sannotations.New(sc.GetAnnotations()).HasAny( + map[string]string{ + "storageclass.kubernetes.io/is-default-class": "true", + // Older clusters still use the beta annotation. + "storageclass.beta.kubernetes.io/is-default-class": "true", + }, + ) +} + +const ( + operatorStorageClassAnnotationKey = "juju.io/operator-storage" + workloadStorageClassAnnotationKey = "juju.io/workload-storage" +) + +func caasStorageProvisioner(sc storage.StorageClass) *caas.StorageProvisioner { + caasSc := &caas.StorageProvisioner{ + Name: sc.Name, + Provisioner: sc.Provisioner, + Parameters: sc.Parameters, } - // Older clusters still use the beta annotation. - if v, ok := sc.Annotations["storageclass.beta.kubernetes.io/is-default-class"]; ok && v != "false" { - return true + if sc.ReclaimPolicy != nil { + caasSc.ReclaimPolicy = string(*sc.ReclaimPolicy) } - return false + return caasSc } // GetClusterMetadata implements ClusterMetadataChecker. @@ -92,82 +99,87 @@ return nil, errors.Trace(err) } if err == nil { - result.NominatedStorageClass = &caas.StorageProvisioner{ - Name: sc.Name, - Provisioner: sc.Provisioner, - Parameters: sc.Parameters, - } - if sc.ReclaimPolicy != nil { - result.NominatedStorageClass.ReclaimPolicy = string(*sc.ReclaimPolicy) - } + logger.Debugf("Use %q for nominated storage class", sc.Name) + result.NominatedStorageClass = caasStorageProvisioner(*sc) } } // We may have the workload storage but still need to look for operator storage. - preferredOperatorStorage, havePreferredOperatorStorage := jujuPreferredOperatorStorage[result.Cloud] storageClasses, err := k.client().StorageV1().StorageClasses().List(v1.ListOptions{}) if err != nil { return nil, errors.Annotate(err, "listing storage classes") } - var ( - possibleWorkloadStorage []storage.StorageClass - possibleOperatorStorage []*caas.StorageProvisioner - defaultOperatorStorage *caas.StorageProvisioner - ) - for _, sc := range storageClasses.Items { - if havePreferredOperatorStorage { - maybeOperatorStorage := &caas.StorageProvisioner{ - Name: sc.Name, - Provisioner: sc.Provisioner, - Parameters: sc.Parameters, - } - if sc.ReclaimPolicy != nil { - maybeOperatorStorage.ReclaimPolicy = string(*sc.ReclaimPolicy) + var possibleWorkloadStorage, possibleOperatorStorage []*caas.StorageProvisioner + preferredOperatorStorage, hasPreferredOperatorStorage := jujuPreferredOperatorStorage[result.Cloud] + + pickOperatorSC := func(sc storage.StorageClass, maybeStorage *caas.StorageProvisioner) { + if result.OperatorStorageClass != nil { + return + } + + if k8sannotations.New(sc.GetAnnotations()).Has(operatorStorageClassAnnotationKey, "true") { + logger.Debugf("Use %q with annotations %v for operator storage class", sc.Name, sc.GetAnnotations()) + result.OperatorStorageClass = maybeStorage + } else if hasPreferredOperatorStorage { + err := storageClassMatches(preferredOperatorStorage, maybeStorage) + if err != nil { + // not match. + return } - if err := storageClassMatches(preferredOperatorStorage, maybeOperatorStorage); err == nil { - possibleOperatorStorage = append(possibleOperatorStorage, maybeOperatorStorage) - if isDefaultStorageClass(sc) { - defaultOperatorStorage = maybeOperatorStorage - } + if isDefaultStorageClass(sc) { + // Prefer operator storage from the default storage class. + result.OperatorStorageClass = maybeStorage + logger.Debugf( + "Use the default Storage class %q for operator storage class because it also matches Juju preferred config %v", + maybeStorage.Name, preferredOperatorStorage, + ) + } else { + possibleOperatorStorage = append(possibleOperatorStorage, maybeStorage) } } + } + + pickWorkloadSC := func(sc storage.StorageClass, maybeStorage *caas.StorageProvisioner) { if result.NominatedStorageClass != nil { - continue + return } - if isDefaultStorageClass(sc) { - result.NominatedStorageClass = &caas.StorageProvisioner{ - Name: sc.Name, - Provisioner: sc.Provisioner, - Parameters: sc.Parameters, - } - if sc.ReclaimPolicy != nil { - result.NominatedStorageClass.ReclaimPolicy = string(*sc.ReclaimPolicy) - } + + if k8sannotations.New(sc.GetAnnotations()).Has(workloadStorageClassAnnotationKey, "true") { + logger.Debugf("Use %q with annotations %v for nominated storage class", sc.Name, sc.GetAnnotations()) + result.NominatedStorageClass = maybeStorage + } else if isDefaultStorageClass(sc) { + // no nominated storage class specified, so use the default one; + result.NominatedStorageClass = maybeStorage + logger.Debugf("Use the default Storage class %q for nominated storage class", maybeStorage.Name) + } else { + possibleWorkloadStorage = append(possibleWorkloadStorage, maybeStorage) + } + } + + for _, sc := range storageClasses.Items { + if result.OperatorStorageClass != nil && result.NominatedStorageClass != nil { break } - possibleWorkloadStorage = append(possibleWorkloadStorage, sc) + maybeStorage := caasStorageProvisioner(sc) + pickOperatorSC(sc, maybeStorage) + pickWorkloadSC(sc, maybeStorage) } - // Prefer operator storage from the default storage class. - if defaultOperatorStorage != nil { - result.OperatorStorageClass = defaultOperatorStorage - } else if len(possibleOperatorStorage) > 0 { + if result.OperatorStorageClass == nil && len(possibleOperatorStorage) > 0 { result.OperatorStorageClass = possibleOperatorStorage[0] + logger.Debugf("Use %q for operator storage class", possibleOperatorStorage[0].Name) } - // Even if no storage class was marked as default for the cluster, if there's only // one of them, use it for workload storage. if result.NominatedStorageClass == nil && len(possibleWorkloadStorage) == 1 { - sc := possibleWorkloadStorage[0] - result.NominatedStorageClass = &caas.StorageProvisioner{ - Name: sc.Name, - Provisioner: sc.Provisioner, - Parameters: sc.Parameters, - } - if sc.ReclaimPolicy != nil { - result.NominatedStorageClass.ReclaimPolicy = string(*sc.ReclaimPolicy) - } + result.NominatedStorageClass = possibleWorkloadStorage[0] + logger.Debugf("Use %q for nominated storage class", possibleWorkloadStorage[0].Name) + } + if result.OperatorStorageClass == nil && result.NominatedStorageClass != nil { + // use workload storage class if no operator storage class preference found. + result.OperatorStorageClass = result.NominatedStorageClass + logger.Debugf("Use nominated storage class %q for operator storage class", result.NominatedStorageClass.Name) } return &result, nil } @@ -194,10 +206,10 @@ } // CheckDefaultWorkloadStorage implements ClusterMetadataChecker. -func (k *kubernetesClient) CheckDefaultWorkloadStorage(cluster string, storageProvisioner *caas.StorageProvisioner) error { - preferredStorage, ok := jujuPreferredWorkloadStorage[cluster] +func (k *kubernetesClient) CheckDefaultWorkloadStorage(cloudType string, storageProvisioner *caas.StorageProvisioner) error { + preferredStorage, ok := jujuPreferredWorkloadStorage[cloudType] if !ok { - return errors.NotFoundf("cluster %q", cluster) + return errors.NotFoundf("preferred workload storage for cloudType %q", cloudType) } return storageClassMatches(preferredStorage, storageProvisioner) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/metadata_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/metadata_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/metadata_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/metadata_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,9 +4,6 @@ package provider_test import ( - "os" - "strings" - "github.com/golang/mock/gomock" "github.com/juju/collections/set" "github.com/juju/errors" @@ -33,13 +30,10 @@ } func (s *K8sMetadataSuite) TestMicrok8sFromNodeMeta(c *gc.C) { - hostname, err := os.Hostname() - c.Assert(err, jc.ErrorIsNil) - hostname = strings.ToLower(hostname) node := core.Node{ ObjectMeta: v1.ObjectMeta{ - Name: hostname, - Labels: map[string]string{"kubernetes.io/hostname": hostname}, + Name: "mynode", + Labels: map[string]string{"microk8s.io/cluster": "true"}, }, } cloud, region := provider.GetCloudProviderFromNodeMeta(node) @@ -47,6 +41,21 @@ c.Assert(region, gc.Equals, "localhost") } +func (s *K8sMetadataSuite) TestMicrok8sWithRegionFromNodeMeta(c *gc.C) { + node := core.Node{ + ObjectMeta: v1.ObjectMeta{ + Name: "mynode", + Labels: map[string]string{ + "microk8s.io/cluster": "true", + "failure-domain.beta.kubernetes.io/region": "somewhere", + }, + }, + } + cloud, region := provider.GetCloudProviderFromNodeMeta(node) + c.Assert(cloud, gc.Equals, "microk8s") + c.Assert(region, gc.Equals, "somewhere") +} + func (s *K8sMetadataSuite) TestK8sCloudCheckersValidationPass(c *gc.C) { // CompileK8sCloudCheckers will panic if there is invalid requirement definition so check it by calling it. cloudCheckers := provider.CompileK8sCloudCheckers() @@ -367,6 +376,88 @@ Provisioner: "kubernetes.io/aws-ebs", Parameters: map[string]string{"foo": "bar"}, }) +} + +func (s *K8sMetadataSuite) TestAnnotatedWorkloadStorageClass(c *gc.C) { + ctrl := s.setupController(c) + defer ctrl.Finish() + + gomock.InOrder( + s.mockNodes.EXPECT().List(v1.ListOptions{Limit: 5}).Times(1). + Return(&core.NodeList{Items: []core.Node{{ObjectMeta: v1.ObjectMeta{ + Labels: map[string]string{"manufacturer": "amazon_ec2"}, + }}}}, nil), + s.mockStorageClass.EXPECT().List(v1.ListOptions{}).Times(1). + Return(&storagev1.StorageClassList{Items: []storagev1.StorageClass{{ + ObjectMeta: v1.ObjectMeta{ + Name: "juju-preferred-workload-storage", + Annotations: map[string]string{ + "juju.io/workload-storage": "true", + }, + }, + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }}}, nil), + ) + metadata, err := s.broker.GetClusterMetadata("") + c.Check(err, jc.ErrorIsNil) + c.Check(metadata.NominatedStorageClass, jc.DeepEquals, &caas.StorageProvisioner{ + Name: "juju-preferred-workload-storage", + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }) + c.Check(metadata.OperatorStorageClass, jc.DeepEquals, &caas.StorageProvisioner{ + Name: "juju-preferred-workload-storage", + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }) +} + +func (s *K8sMetadataSuite) TestAnnotatedWorkloadAndOperatorStorageClass(c *gc.C) { + ctrl := s.setupController(c) + defer ctrl.Finish() + + gomock.InOrder( + s.mockNodes.EXPECT().List(v1.ListOptions{Limit: 5}).Times(1). + Return(&core.NodeList{Items: []core.Node{{ObjectMeta: v1.ObjectMeta{ + Labels: map[string]string{"manufacturer": "amazon_ec2"}, + }}}}, nil), + s.mockStorageClass.EXPECT().List(v1.ListOptions{}).Times(1). + Return(&storagev1.StorageClassList{Items: []storagev1.StorageClass{ + { + ObjectMeta: v1.ObjectMeta{ + Name: "juju-preferred-workload-storage", + Annotations: map[string]string{ + "juju.io/workload-storage": "true", + }, + }, + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }, + { + ObjectMeta: v1.ObjectMeta{ + Name: "juju-preferred-operator-storage", + Annotations: map[string]string{ + "juju.io/operator-storage": "true", + }, + }, + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }, + }}, nil), + ) + metadata, err := s.broker.GetClusterMetadata("") + c.Check(err, jc.ErrorIsNil) + c.Check(metadata.NominatedStorageClass, jc.DeepEquals, &caas.StorageProvisioner{ + Name: "juju-preferred-workload-storage", + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }) + c.Check(metadata.OperatorStorageClass, jc.DeepEquals, &caas.StorageProvisioner{ + Name: "juju-preferred-operator-storage", + Provisioner: "kubernetes.io/aws-ebs", + Parameters: map[string]string{"foo": "bar"}, + }) } func (s *K8sMetadataSuite) TestCheckDefaultWorkloadStorageUnknownCluster(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/provider.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/provider.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/provider.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/provider.go 2019-06-28 17:10:43.000000000 +0000 @@ -105,7 +105,7 @@ if err != nil { return nil, errors.Trace(err) } - broker, err := NewK8sBroker( + broker, err := newK8sBroker( args.ControllerUUID, k8sRestConfig, args.Config, newK8sClient, newKubernetesWatcher, jujuclock.WallClock, ) if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/template.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/template.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/template.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/template.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package provider + +import ( + "fmt" + "strings" + "text/template" + + "github.com/juju/errors" + "gopkg.in/yaml.v2" +) + +var containerTemplate = ` + - name: {{.Name}} + {{if .Ports}} + ports: + {{- range .Ports }} + - containerPort: {{.ContainerPort}} + {{if .Name}}name: {{.Name}}{{end}} + {{if .Protocol}}protocol: {{.Protocol}}{{end}} + {{- end}} + {{end}} + {{if .Command}} + command: +{{ toYaml .Command | indent 6 }} + {{end}} + {{if .Args}} + args: +{{ toYaml .Args | indent 6 }} + {{end}} + {{if .WorkingDir}} + workingDir: {{.WorkingDir}} + {{end}} + {{if .Config}} + env: + {{- range $k, $v := .Config }} + - name: {{$k}} + value: {{$v}} + {{- end}} + {{end}}`[1:] + +var defaultPodTemplateStr = fmt.Sprintf(` +pod: + containers: + {{- range .Containers }} +%s + {{- end}} + {{if .InitContainers}} + initContainers: + {{- range .InitContainers }} +%s + {{- end}} + {{end}} +`[1:], containerTemplate, containerTemplate) + +var defaultPodTemplate = template.Must(template.New("").Funcs(templateAddons).Parse(defaultPodTemplateStr)) + +func toYaml(val interface{}) (string, error) { + data, err := yaml.Marshal(val) + if err != nil { + return "", errors.Annotatef(err, "marshalling to yaml for %v", val) + } + return string(data), nil +} + +func indent(n int, str string) string { + out := "" + prefix := strings.Repeat(" ", n) + for _, line := range strings.Split(str, "\n") { + out += prefix + line + "\n" + } + return out +} + +var templateAddons = template.FuncMap{ + "toYaml": toYaml, + "indent": indent, +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/template_test.go juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/template_test.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/kubernetes/provider/template_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/kubernetes/provider/template_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package provider_test + +import ( + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/caas/kubernetes/provider" + "github.com/juju/juju/testing" +) + +type templateSuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&templateSuite{}) + +func (t *templateSuite) TestToYaml(c *gc.C) { + in := struct { + Command []string `yaml:"command,omitempty"` + }{ + Command: []string{"sh", "-c", ` +set -ex +echo "do some stuff here for gitlab container" +`[1:]}, + } + out, err := provider.ToYaml(in) + c.Assert(err, jc.ErrorIsNil) + c.Assert(out, jc.DeepEquals, ` +command: +- sh +- -c +- | + set -ex + echo "do some stuff here for gitlab container" +`[1:]) +} + +func (t *templateSuite) TestIndent(c *gc.C) { + out := provider.Indent(6, ` +line 1 +line 2 +line 3`[1:]) + c.Assert(out, jc.DeepEquals, ` + line 1 + line 2 + line 3 +`[1:]) + + out = provider.Indent(8, ` +line 1 +line 2 +line 3`[1:]) + c.Assert(out, jc.DeepEquals, ` + line 1 + line 2 + line 3 +`[1:]) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/caas/metadata.go juju-core-2.6.5/src/github.com/juju/juju/caas/metadata.go --- juju-core-2.6.2/src/github.com/juju/juju/caas/metadata.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/caas/metadata.go 2019-06-28 17:10:43.000000000 +0000 @@ -31,6 +31,9 @@ // K8sCloudLXD is the name used for LXD k8s clouds(Kubernetes Core). K8sCloudLXD = "lxd" + // K8sCloudRackspace is the name used for Rackspace k8s clouds(CDK). + K8sCloudRackspace = "rackspace" + // K8sCloudOther is the name used for any other k8s cloud is not listed above. K8sCloudOther = "other" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cloud/clouds.go juju-core-2.6.5/src/github.com/juju/juju/cloud/clouds.go --- juju-core-2.6.2/src/github.com/juju/juju/cloud/clouds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cloud/clouds.go 2019-06-28 17:10:43.000000000 +0000 @@ -168,12 +168,23 @@ } // SplitHostCloudRegion splits host cloud region to cloudType and region. -func SplitHostCloudRegion(hostCloudRegion string) []string { - return strings.Split(hostCloudRegion, "/") +func SplitHostCloudRegion(hostCloudRegion string) (string, string, error) { + fields := strings.SplitN(hostCloudRegion, "/", 2) + if len(fields) == 0 || fields[0] == "" { + return "", "", errors.NotValidf("host cloud region %q", hostCloudRegion) + } + region := "" + if len(fields) > 1 { + region = fields[1] + } + return fields[0], region, nil } // BuildHostCloudRegion combines cloudType with region to host cloud region. func BuildHostCloudRegion(cloudType, region string) string { + if region == "" { + return cloudType + } return cloudType + "/" + region } @@ -196,6 +207,11 @@ StorageEndpoint string } +// IsEmpty indicates if it's an empty region. +func (r Region) IsEmpty() bool { + return r.Endpoint == "" && r.IdentityEndpoint == "" && r.StorageEndpoint == "" +} + // cloudSet contains cloud definitions, used for marshalling and // unmarshalling. type cloudSet struct { @@ -533,7 +549,7 @@ type structTags map[reflect.Type]map[string]int -var tagsForType structTags = make(structTags) +var tagsForType = make(structTags) // RegisterStructTags ensures the yaml tags for the given structs are able to be used // when parsing cloud metadata. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cloudconfig/podcfg/image.go juju-core-2.6.5/src/github.com/juju/juju/cloudconfig/podcfg/image.go --- juju-core-2.6.2/src/github.com/juju/juju/cloudconfig/podcfg/image.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cloudconfig/podcfg/image.go 2019-06-28 17:10:43.000000000 +0000 @@ -41,7 +41,7 @@ // GetJujuOCIImagePath returns the jujud oci image path. func GetJujuOCIImagePath(controllerCfg controller.Config, ver version.Number) string { // First check the deprecated "caas-operator-image-path" config. - imagePath := rebuildOldOperatorImagePath( + imagePath := RebuildOldOperatorImagePath( controllerCfg.CAASOperatorImagePath(), ver, ) if imagePath != "" { @@ -50,7 +50,8 @@ return imageRepoToPath(controllerCfg.CAASImageRepo(), ver) } -func rebuildOldOperatorImagePath(imagePath string, ver version.Number) string { +// RebuildOldOperatorImagePath returns a updated image path for the specified juju version. +func RebuildOldOperatorImagePath(imagePath string, ver version.Number) string { if imagePath == "" { return "" } @@ -65,6 +66,7 @@ verString = splittedPath[1] } if ver != version.Zero { + ver.Build = 0 verString = ver.String() } if verString != "" { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/action/showoutput.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/action/showoutput.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/action/showoutput.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/action/showoutput.go 2019-06-28 17:10:43.000000000 +0000 @@ -153,8 +153,12 @@ // Block until a tick happens, or the timeout arrives. select { case _ = <-wait.C: - return result, nil - + switch result.Status { + case params.ActionRunning, params.ActionPending: + return result, errors.NewTimeout(err, "timeout reached") + default: + return result, nil + } case _ = <-tick.C: tick.Reset(2 * time.Second) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/action/showoutput_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/action/showoutput_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/action/showoutput_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/action/showoutput_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -80,6 +80,7 @@ withClientQueryID: validActionId, withTags: tagsForIdPrefix(validActionId, validActionTagString), withAPIResponse: []params.ActionResult{{}}, + expectedErr: "timeout reached", expectedOutput: ` status: pending timing: @@ -183,6 +184,7 @@ Enqueued: time.Date(2015, time.February, 14, 8, 13, 0, 0, time.UTC), Started: time.Date(2015, time.February, 14, 8, 15, 0, 0, time.UTC), }}, + expectedErr: "timeout reached", expectedOutput: ` results: foo: @@ -207,6 +209,7 @@ Completed: time.Date(2015, time.February, 14, 8, 15, 30, 0, time.UTC), Started: time.Date(2015, time.February, 14, 8, 15, 0, 0, time.UTC), }}, + expectedErr: "timeout reached", expectedOutput: ` results: foo: @@ -231,6 +234,7 @@ Enqueued: time.Date(2015, time.February, 14, 8, 13, 0, 0, time.UTC), Completed: time.Date(2015, time.February, 14, 8, 15, 30, 0, time.UTC), }}, + expectedErr: "timeout reached", expectedOutput: ` results: foo: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/addrelation.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/addrelation.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/addrelation.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/addrelation.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/api/application" @@ -49,7 +50,7 @@ where "wordpress" will be internally expanded to "wordpress:db" $ juju add-relation wordpress someone/prod.mysql --via 192.168.0.0/16 - + $ juju add-relation wordpress someone/prod.mysql --via 192.168.0.0/16,10.0.0.0/8 ` @@ -67,7 +68,7 @@ endpoints []string viaCIDRs []string viaValue string - remoteEndpoint *crossmodel.OfferURL + remoteEndpoint *charm.OfferURL addRelationAPI applicationAddRelationAPI consumeDetailsAPI applicationConsumeDetailsAPI } @@ -123,7 +124,7 @@ return application.NewClient(root), nil } -func (c *addRelationCommand) getOffersAPI(url *crossmodel.OfferURL) (applicationConsumeDetailsAPI, error) { +func (c *addRelationCommand) getOffersAPI(url *charm.OfferURL) (applicationConsumeDetailsAPI, error) { if c.consumeDetailsAPI != nil { return c.consumeDetailsAPI, nil } @@ -188,7 +189,7 @@ } // Parse the offer details URL and add the source controller so // things like status can show the original source of the offer. - offerURL, err := crossmodel.ParseOfferURL(consumeDetails.Offer.OfferURL) + offerURL, err := charm.ParseOfferURL(consumeDetails.Offer.OfferURL) if err != nil { return errors.Trace(err) } @@ -226,7 +227,7 @@ // We can only determine if this is a remote endpoint with 100%. // If we cannot parse it, it may still be a valid local endpoint... // so ignoring parsing error, - if url, err := crossmodel.ParseOfferURL(endpoint); err == nil { + if url, err := charm.ParseOfferURL(endpoint); err == nil { if c.remoteEndpoint != nil { return errors.NotSupportedf("providing more than one remote endpoints") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/bundle.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/bundle.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/bundle.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/bundle.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "os" "path/filepath" "reflect" + "strconv" "strings" "time" @@ -18,6 +19,7 @@ "github.com/juju/collections/set" "github.com/juju/errors" "github.com/juju/utils" + "github.com/juju/utils/featureflag" "github.com/kr/pretty" "gopkg.in/juju/charm.v6" "gopkg.in/juju/charm.v6/resource" @@ -29,14 +31,17 @@ "github.com/juju/juju/api" "github.com/juju/juju/api/application" + app "github.com/juju/juju/apiserver/facades/client/application" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/charmstore" "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/devices" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/lxdprofile" "github.com/juju/juju/core/model" "github.com/juju/juju/environs/config" + "github.com/juju/juju/feature" "github.com/juju/juju/resource/resourceadapters" "github.com/juju/juju/state/multiwatcher" "github.com/juju/juju/state/watcher" @@ -104,34 +109,46 @@ return errors.Trace(verifyError) } +type bundleDeploySpec struct { + ctx *cmd.Context + + dryRun bool + force bool + trust bool + + bundleData *charm.BundleData + bundleDir string + bundleURL *charm.URL + bundleOverlayFile []string + channel csparams.Channel + + apiRoot DeployAPI + + useExistingMachines bool + bundleMachines map[string]string + bundleStorage map[string]map[string]storage.Constraints + bundleDevices map[string]map[string]devices.Constraints + + targetModelName string + targetModelUUID string + controllerName string + accountUser string +} + // deployBundle deploys the given bundle data using the given API client and // charm store client. The deployment is not transactional, and its progress is // notified using the given deployment logger. -func deployBundle( - bundleDir string, - data *charm.BundleData, - bundleURL *charm.URL, - bundleOverlayFile []string, - channel csparams.Channel, - apiRoot DeployAPI, - ctx *cmd.Context, - bundleStorage map[string]map[string]storage.Constraints, - bundleDevices map[string]map[string]devices.Constraints, - dryRun bool, - useExistingMachines bool, - bundleMachines map[string]string, -) (map[*charm.URL]*macaroon.Macaroon, error) { - - if err := composeBundle(data, ctx, bundleDir, bundleOverlayFile); err != nil { +func deployBundle(spec bundleDeploySpec) (map[*charm.URL]*macaroon.Macaroon, error) { + if err := composeBundle(spec.bundleData, spec.ctx, spec.bundleDir, spec.bundleOverlayFile); err != nil { return nil, errors.Trace(err) } - if err := verifyBundle(data, bundleDir); err != nil { + if err := verifyBundle(spec.bundleData, spec.bundleDir); err != nil { return nil, errors.Trace(err) } // TODO: move bundle parsing and checking into the handler. - h := makeBundleHandler(dryRun, bundleDir, channel, apiRoot, ctx, data, bundleURL, bundleStorage, bundleDevices) - if err := h.makeModel(useExistingMachines, bundleMachines); err != nil { + h := makeBundleHandler(spec) + if err := h.makeModel(spec.useExistingMachines, spec.bundleMachines); err != nil { return nil, errors.Trace(err) } if err := h.resolveCharmsAndEndpoints(); err != nil { @@ -144,12 +161,13 @@ return nil, errors.Trace(err) } return h.macaroons, nil - } // bundleHandler provides helpers and the state required to deploy a bundle. type bundleHandler struct { dryRun bool + force bool + trust bool // bundleDir is the path where the bundle file is located for local bundles. bundleDir string @@ -224,38 +242,46 @@ // LXD. This flag keeps us from writing the warning more than once per // bundle. warnedLXC bool + + // The name and UUID of the model where the bundle is about to be deployed. + targetModelName string + targetModelUUID string + + // Controller name required for consuming a offer when deploying a bundle. + controllerName string + + // accountUser holds the user of the account associated with the + // current controller. + accountUser string } -func makeBundleHandler( - dryRun bool, - bundleDir string, - channel csparams.Channel, - api DeployAPI, - ctx *cmd.Context, - data *charm.BundleData, - bundleURL *charm.URL, - bundleStorage map[string]map[string]storage.Constraints, - bundleDevices map[string]map[string]devices.Constraints, -) *bundleHandler { +func makeBundleHandler(spec bundleDeploySpec) *bundleHandler { applications := set.NewStrings() - for name := range data.Applications { + for name := range spec.bundleData.Applications { applications.Add(name) } return &bundleHandler{ - dryRun: dryRun, - bundleDir: bundleDir, + dryRun: spec.dryRun, + force: spec.force, + trust: spec.trust, + bundleDir: spec.bundleDir, applications: applications, results: make(map[string]string), - channel: channel, - api: api, - bundleStorage: bundleStorage, - bundleDevices: bundleDevices, - ctx: ctx, - data: data, - bundleURL: bundleURL, + channel: spec.channel, + api: spec.apiRoot, + bundleStorage: spec.bundleStorage, + bundleDevices: spec.bundleDevices, + ctx: spec.ctx, + data: spec.bundleData, + bundleURL: spec.bundleURL, unitStatus: make(map[string]string), macaroons: make(map[*charm.URL]*macaroon.Macaroon), channels: make(map[*charm.URL]csparams.Channel), + + targetModelName: spec.targetModelName, + targetModelUUID: spec.targetModelUUID, + controllerName: spec.controllerName, + accountUser: spec.accountUser, } } @@ -365,6 +391,23 @@ return errors.Trace(err) } + // Filter cmr-related changes if the feature flag is not enabled. We + // need to do it here rather in handleChanges() as the bundle handler + // will also iterate the list to print out a changelog. + if !featureflag.Enabled(feature.CMRAwareBundles) { + var filtered []bundlechanges.Change + for _, ch := range changes { + if ch.Method() == "createOffer" || + ch.Method() == "consumeOffer" || + ch.Method() == "grantOfferAccess" { + continue + } + + filtered = append(filtered, ch) + } + changes = filtered + } + h.changes = changes return nil } @@ -416,6 +459,12 @@ err = h.setOptions(change) case *bundlechanges.SetConstraintsChange: err = h.setConstraints(change) + case *bundlechanges.CreateOfferChange: + err = h.createOffer(change) + case *bundlechanges.ConsumeOfferChange: + err = h.consumeOffer(change) + case *bundlechanges.GrantOfferAccessChange: + err = h.grantOfferAccess(change) default: return errors.Errorf("unknown change type: %T", change) } @@ -460,10 +509,10 @@ if err == nil { if err := lxdprofile.ValidateLXDProfile(lxdCharmProfiler{ Charm: ch, - }); err != nil { + }); err != nil && !h.force { return errors.Annotatef(err, "cannot deploy local charm at %q", charmPath) } - if curl, err = h.api.AddLocalCharm(curl, ch, false); err != nil { + if curl, err = h.api.AddLocalCharm(curl, ch, h.force); err != nil { return err } logger.Debugf("added charm %s", curl) @@ -486,7 +535,7 @@ return errors.Errorf("expected charm URL, got bundle URL %q", p.Charm) } var macaroon *macaroon.Macaroon - url, macaroon, err = addCharmFromURL(h.api, url, channel, false) + url, macaroon, err = addCharmFromURL(h.api, url, channel, h.force) if err != nil { return errors.Annotatef(err, "cannot add charm %q", p.Charm) } @@ -541,6 +590,17 @@ h.results[change.Id()] = p.Application ch := chID.URL.String() + // If this application requires trust and the operator consented to + // granting it, set the "trust" application option to true. This is + // equivalent to running 'juju trust $app'. + if h.trust && applicationRequiresTrust(h.data.Applications[p.Application]) { + if p.Options == nil { + p.Options = make(map[string]interface{}) + } + + p.Options[app.TrustConfigOptionName] = strconv.FormatBool(h.trust) + } + // Handle application configuration. configYAML := "" if len(p.Options) > 0 { @@ -600,7 +660,7 @@ if err := lxdprofile.ValidateLXDProfile(lxdCharmInfoProfiler{ CharmInfo: charmInfo, - }); err != nil { + }); err != nil && !h.force { return errors.Trace(err) } @@ -622,14 +682,16 @@ supportedSeries = []string{chID.URL.Series} } selector := seriesSelector{ - seriesFlag: p.Series, - charmURLSeries: chID.URL.Series, - supportedSeries: supportedSeries, - conf: h.modelConfig, - fromBundle: true, + seriesFlag: p.Series, + charmURLSeries: chID.URL.Series, + supportedSeries: supportedSeries, + supportedJujuSeries: supportedJujuSeries(), + conf: h.modelConfig, + force: h.force, + fromBundle: true, } series, err := selector.charmSeries() - if err != nil { + if err = charmValidationError(series, cURL.Name, errors.Trace(err)); err != nil { return errors.Trace(err) } @@ -918,6 +980,7 @@ ApplicationName: p.Application, CharmID: chID, ResourceIDs: resNames2IDs, + Force: h.force, } // Bundles only ever deal with the current generation. if err := h.api.SetCharm(model.GenerationMaster, cfg); err != nil { @@ -1020,6 +1083,99 @@ return nil } +// createOffer creates an offer targeting one or more application endpoints. +func (h *bundleHandler) createOffer(change *bundlechanges.CreateOfferChange) error { + if h.dryRun { + return nil + } + + p := change.Params + result, err := h.api.Offer(h.targetModelUUID, p.Application, p.Endpoints, p.OfferName, "") + if err == nil && len(result) > 0 && result[0].Error != nil { + err = result[0].Error + } + if err != nil { + return errors.Annotatef(err, "cannot create offer %s", p.OfferName) + } + return nil +} + +// consumeOffer consumes an existing offer +func (h *bundleHandler) consumeOffer(change *bundlechanges.ConsumeOfferChange) error { + if h.dryRun { + return nil + } + + p := change.Params + url, err := charm.ParseOfferURL(p.URL) + if err != nil { + return errors.Trace(err) + } + if url.HasEndpoint() { + return errors.Errorf("remote offer %q shouldn't include endpoint", p.URL) + } + if url.User == "" { + url.User = h.accountUser + } + if url.Source == "" { + url.Source = h.controllerName + } + consumeDetails, err := h.api.GetConsumeDetails(url.AsLocal().String()) + if err != nil { + return errors.Trace(err) + } + // Parse the offer details URL and add the source controller so + // things like status can show the original source of the offer. + offerURL, err := charm.ParseOfferURL(consumeDetails.Offer.OfferURL) + if err != nil { + return errors.Trace(err) + } + offerURL.Source = url.Source + consumeDetails.Offer.OfferURL = offerURL.String() + + // construct the cosume application arguments + arg := crossmodel.ConsumeApplicationArgs{ + Offer: *consumeDetails.Offer, + ApplicationAlias: p.ApplicationName, + Macaroon: consumeDetails.Macaroon, + } + if consumeDetails.ControllerInfo != nil { + controllerTag, err := names.ParseControllerTag(consumeDetails.ControllerInfo.ControllerTag) + if err != nil { + return errors.Trace(err) + } + arg.ControllerInfo = &crossmodel.ControllerInfo{ + ControllerTag: controllerTag, + Alias: consumeDetails.ControllerInfo.Alias, + Addrs: consumeDetails.ControllerInfo.Addrs, + CACert: consumeDetails.ControllerInfo.CACert, + } + } + localName, err := h.api.Consume(arg) + if err != nil { + return errors.Trace(err) + } + h.results[change.Id()] = localName + h.ctx.Infof("Added %s as %s", url.Path(), localName) + return nil +} + +// grantOfferAccess grants access to an offer. +func (h *bundleHandler) grantOfferAccess(change *bundlechanges.GrantOfferAccessChange) error { + if h.dryRun { + return nil + } + + p := change.Params + + offerURL := fmt.Sprintf("%s.%s", h.targetModelName, p.Offer) + if err := h.api.GrantOffer(p.User, p.Access, offerURL); err != nil && !isUserAlreadyHasAccessErr(err) { + + return errors.Annotatef(err, "cannot grant %s access to user %s on offer %s", p.Access, p.User, offerURL) + } + return nil +} + // applicationsForMachineChange returns the names of the applications for which an // "addMachine" change is required, as adding machines is required to place // units, and units belong to applications. @@ -1616,3 +1772,19 @@ } return value, nil } + +// applicationRequiresTrust returns true if this app requires the operator to +// explicitly trust it. Trust requirements may be either specified as an option +// or via the "trust" field at the application spec level +func applicationRequiresTrust(appSpec *charm.ApplicationSpec) bool { + optRequiresTrust := appSpec.Options != nil && appSpec.Options["trust"] == true + return appSpec.RequiresTrust || optRequiresTrust +} + +// isUserAlreadyHasAccessErr returns true if err indicates that the user +// already has access to an offer. Unfortunately, the server does not set a +// status code for this error so we need to fall back to a hacky string +// comparison to be compatible with older controllers. +func isUserAlreadyHasAccessErr(err error) bool { + return err != nil && strings.Contains(err.Error(), "user already has") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/bundle_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/bundle_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/bundle_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/bundle_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -55,9 +55,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidFlags(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") err := runDeploy(c, "bundle/wordpress-simple", "--config", "config.yaml") c.Assert(err, gc.ErrorMatches, "options provided but not supported when deploying a bundle: --config") err = runDeploy(c, "bundle/wordpress-simple", "-n", "2") @@ -67,9 +67,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleSuccess(c *gc.C) { - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") err := runDeploy(c, "bundle/wordpress-simple") c.Assert(err, jc.ErrorIsNil) s.assertCharmsUploaded(c, "cs:xenial/mysql-42", "cs:xenial/wordpress-47") @@ -84,6 +84,32 @@ }) } +func (s *BundleDeployCharmStoreSuite) TestDeployBundleWithInvalidSeries(c *gc.C) { + testcharms.UploadCharmWithSeries(c, s.client, "precise/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") + err := runDeploy(c, "bundle/wordpress-simple") + c.Assert(err, gc.ErrorMatches, "cannot deploy bundle: mysql is not available on the following series: precise not supported") +} + +func (s *BundleDeployCharmStoreSuite) TestDeployBundleWithInvalidSeriesWithForce(c *gc.C) { + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "precise/mysql-42", "mysql", "bionic") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") + err := runDeploy(c, "bundle/wordpress-simple", "--force") + c.Assert(err, jc.ErrorIsNil) + s.assertCharmsUploaded(c, "cs:precise/mysql-42", "cs:xenial/wordpress-47") + s.assertApplicationsDeployed(c, map[string]applicationInfo{ + "mysql": {charm: "cs:precise/mysql-42", config: mysqlch.Config().DefaultSettings()}, + "wordpress": {charm: "cs:xenial/wordpress-47", config: wpch.Config().DefaultSettings()}, + }) + s.assertRelationsEstablished(c, "wordpress:db mysql:server") + s.assertUnitsCreated(c, map[string]string{ + "mysql/0": "0", + "wordpress/0": "1", + }) +} + func (s *BundleDeployCharmStoreSuite) TestDeployKubernetesBundleSuccess(c *gc.C) { unregister := caas.RegisterContainerProvider("kubernetes-test", &fakeProvider{}) s.AddCleanup(func(_ *gc.C) { unregister() }) @@ -117,7 +143,7 @@ _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "kubernetes/mariadb-42", "mariadb", "kubernetes") _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "kubernetes/gitlab-47", "gitlab", "kubernetes") - testcharms.UploadBundle(c, s.client, "bundle/kubernetes-simple-1", "kubernetes-simple") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/kubernetes-simple-1", "kubernetes-simple", "kubernetes") // ??? settings := state.NewStateSettings(s.State) registry := storage.StaticProviderRegistry{ @@ -140,9 +166,9 @@ } func (s *BundleDeployCharmStoreSuite) TestAddMetricCredentials(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-plans-1", "wordpress-with-plans") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-with-plans-1", "wordpress-with-plans", "bionic") deploy := NewDeployCommandForTest( nil, @@ -186,9 +212,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleWithTermsSuccess(c *gc.C) { - _, ch1 := testcharms.UploadCharm(c, s.client, "xenial/terms1-17", "terms1") - _, ch2 := testcharms.UploadCharm(c, s.client, "xenial/terms2-42", "terms2") - testcharms.UploadBundle(c, s.client, "bundle/terms-simple-1", "terms-simple") + _, ch1 := testcharms.UploadCharmWithSeries(c, s.client, "xenial/terms1-17", "terms1", "bionic") + _, ch2 := testcharms.UploadCharmWithSeries(c, s.client, "xenial/terms2-42", "terms2", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/terms-simple-1", "terms-simple", "bionic") err := runDeploy(c, "bundle/terms-simple") c.Assert(err, jc.ErrorIsNil) s.assertCharmsUploaded(c, "cs:xenial/terms1-17", "cs:xenial/terms2-42") @@ -204,9 +230,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleStorage(c *gc.C) { - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql-storage") - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-mysql-storage-1", "wordpress-with-mysql-storage") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql-storage", "bionic") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-with-mysql-storage-1", "wordpress-with-mysql-storage", "bionic") err := runDeploy( c, "bundle/wordpress-with-mysql-storage", "--storage", "mysql:logs=tmpfs,10G", // override logs @@ -246,7 +272,7 @@ _, minerCharm := testcharms.UploadCharmWithSeries(c, s.client, "kubernetes/bitcoin-miner-1", "bitcoin-miner", "kubernetes") _, dashboardCharm := testcharms.UploadCharmWithSeries(c, s.client, "kubernetes/dashboard4miner-3", "dashboard4miner", "kubernetes") - testcharms.UploadBundle(c, s.client, "bundle/bitcoinminer-with-dashboard-1", "bitcoinminer-with-dashboard") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/bitcoinminer-with-dashboard-1", "bitcoinminer-with-dashboard", "kubernetes") // ??? err = runDeploy( c, "bundle/bitcoinminer-with-dashboard", "-m", m.Name(), @@ -272,9 +298,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleEndpointBindingsSpaceMissing(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-extra-bindings-47", "wordpress-extra-bindings") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-extra-bindings-47", "wordpress-extra-bindings", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings", "bionic") stdOut, stdErr, err := runDeployWithOutput(c, "bundle/wordpress-with-endpoint-bindings") c.Assert(err, gc.ErrorMatches, ""+ "cannot deploy bundle: cannot deploy application \"mysql\": "+ @@ -298,9 +324,9 @@ _, err = s.State.AddSpace("public", "", nil, false) c.Assert(err, jc.ErrorIsNil) - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-extra-bindings-47", "wordpress-extra-bindings") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-extra-bindings-47", "wordpress-extra-bindings", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings", "bionic") err = runDeploy(c, "bundle/wordpress-with-endpoint-bindings") c.Assert(err, jc.ErrorIsNil) s.assertCharmsUploaded(c, "cs:xenial/mysql-42", "cs:xenial/wordpress-extra-bindings-47") @@ -335,9 +361,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleTwice(c *gc.C) { - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") stdOut, stdErr, err := runDeployWithOutput(c, "bundle/wordpress-simple") c.Assert(err, jc.ErrorIsNil) c.Check(stdOut, gc.Equals, ""+ @@ -376,9 +402,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDryRunTwice(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") stdOut, _, err := runDeployWithOutput(c, "bundle/wordpress-simple", "--dry-run") c.Assert(err, jc.ErrorIsNil) expected := "" + @@ -405,10 +431,10 @@ } func (s *BundleDeployCharmStoreSuite) TestDryRunExistingModel(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadCharm(c, s.client, "trusty/multi-series-subordinate-13", "multi-series-subordinate") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/multi-series-subordinate-13", "multi-series-subordinate", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") // Start with a mysql that already has the right charm. ch := s.Factory.MakeCharm(c, &factory.CharmParams{ Name: "mysql", Series: "xenial", Revision: "42"}) @@ -439,10 +465,10 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleGatedCharm(c *gc.C) { - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - url, _ := testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + url, _ := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") s.changeReadPerm(c, url, clientUserName) - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") err := runDeploy(c, "bundle/wordpress-simple") c.Assert(err, jc.ErrorIsNil) s.assertCharmsUploaded(c, "cs:xenial/mysql-42", "cs:xenial/wordpress-47") @@ -456,7 +482,7 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalPath(c *gc.C) { dir := c.MkDir() - testcharms.Repo.ClonedDir(dir, "dummy") + testcharms.RepoWithSeries("bionic").ClonedDir(dir, "dummy") path := filepath.Join(dir, "mybundle") data := ` series: xenial @@ -480,34 +506,34 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalResources(c *gc.C) { data := ` - series: quantal + series: bionic applications: "dummy-resource": charm: ./dummy-resource - series: quantal + series: bionic num_units: 1 resources: dummy: ./dummy-resource.zip ` dir := s.makeBundleDir(c, data) - testcharms.Repo.ClonedDir(dir, "dummy-resource") + testcharms.RepoWithSeries("bionic").ClonedDir(dir, "dummy-resource") c.Assert( ioutil.WriteFile(filepath.Join(dir, "dummy-resource.zip"), []byte("zip file"), 0644), jc.ErrorIsNil) err := runDeploy(c, dir) c.Assert(err, jc.ErrorIsNil) - s.assertCharmsUploaded(c, "local:quantal/dummy-resource-0") - ch, err := s.State.Charm(charm.MustParseURL("local:quantal/dummy-resource-0")) + s.assertCharmsUploaded(c, "local:bionic/dummy-resource-0") + ch, err := s.State.Charm(charm.MustParseURL("local:bionic/dummy-resource-0")) c.Assert(err, jc.ErrorIsNil) s.assertApplicationsDeployed(c, map[string]applicationInfo{ - "dummy-resource": {charm: "local:quantal/dummy-resource-0", config: ch.Config().DefaultSettings()}, + "dummy-resource": {charm: "local:bionic/dummy-resource-0", config: ch.Config().DefaultSettings()}, }) } func (s *BundleDeployCharmStoreSuite) TestDeployBundleNoSeriesInCharmURL(c *gc.C) { - testcharms.UploadCharmMultiSeries(c, s.client, "~who/multi-series", "multi-series") + testcharms.UploadCharmMultiSeriesWithSeries(c, s.client, "~who/multi-series", "multi-series", "bionic") dir := c.MkDir() - testcharms.Repo.ClonedDir(dir, "dummy") + testcharms.RepoWithSeries("bionic").ClonedDir(dir, "dummy") path := filepath.Join(dir, "mybundle") data := ` series: trusty @@ -528,16 +554,16 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleGatedCharmUnauthorized(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - url, _ := testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + url, _ := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") s.changeReadPerm(c, url, "who") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") err := runDeploy(c, "bundle/wordpress-simple") c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: .*: access denied for user "client-username"`) } func (s *BundleDeployCharmStoreSuite) TestDeployBundleResources(c *gc.C) { - testcharms.UploadCharm(c, s.client, "trusty/starsay-42", "starsay") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/starsay-42", "starsay", "bionic") bundleMeta := ` applications: starsay: @@ -774,7 +800,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidOptions(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -787,7 +813,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidMachineContainerType(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -801,11 +827,11 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidSeries(c *gc.C) { - testcharms.UploadCharm(c, s.client, "vivid/django-0", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/django-0", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: - charm: vivid/django + charm: trusty/django num_units: 1 to: - 1 @@ -817,7 +843,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidBinding(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -830,7 +856,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleInvalidSpace(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -858,8 +884,8 @@ return watcher, nil }) - testcharms.UploadCharm(c, s.client, "xenial/django-0", "dummy") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-0", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") s.PatchValue(&updateUnitStatusPeriod, 0*time.Second) err := s.DeployBundleYAML(c, ` applications: @@ -876,8 +902,8 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeployment(c *gc.C) { charmsPath := c.MkDir() - mysqlPath := testcharms.Repo.ClonedDirPath(charmsPath, "mysql") - wordpressPath := testcharms.Repo.ClonedDirPath(charmsPath, "wordpress") + mysqlPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "mysql") + wordpressPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "wordpress") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: xenial applications: @@ -910,8 +936,8 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeploymentBadConfig(c *gc.C) { charmsPath := c.MkDir() - mysqlPath := testcharms.Repo.ClonedDirPath(charmsPath, "mysql") - wordpressPath := testcharms.Repo.ClonedDirPath(charmsPath, "wordpress") + mysqlPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "mysql") + wordpressPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "wordpress") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: xenial applications: @@ -930,7 +956,7 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeploymentLXDProfile(c *gc.C) { charmsPath := c.MkDir() - lxdProfilePath := testcharms.Repo.ClonedDirPath(charmsPath, "lxd-profile") + lxdProfilePath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "lxd-profile") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: bionic services: @@ -952,7 +978,7 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeploymentBadLXDProfile(c *gc.C) { charmsPath := c.MkDir() - lxdProfilePath := testcharms.Repo.ClonedDirPath(charmsPath, "lxd-profile-fail") + lxdProfilePath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "lxd-profile-fail") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: bionic services: @@ -963,6 +989,19 @@ c.Assert(err, gc.ErrorMatches, "cannot deploy bundle: cannot deploy local charm at .*: invalid lxd-profile.yaml: contains device type \"unix-disk\"") } +func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeploymentBadLXDProfileWithForce(c *gc.C) { + charmsPath := c.MkDir() + lxdProfilePath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "lxd-profile-fail") + err := s.DeployBundleYAML(c, fmt.Sprintf(` + series: bionic + services: + lxd-profile-fail: + charm: %s + num_units: 1 + `, lxdProfilePath), "--force") + c.Assert(err, jc.ErrorIsNil) +} + func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalDeploymentWithBundleOverlay(c *gc.C) { configDir := c.MkDir() configFile := filepath.Join(configDir, "config.yaml") @@ -981,8 +1020,8 @@ jc.ErrorIsNil) charmsPath := c.MkDir() - mysqlPath := testcharms.Repo.ClonedDirPath(charmsPath, "mysql") - wordpressPath := testcharms.Repo.ClonedDirPath(charmsPath, "wordpress") + mysqlPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "mysql") + wordpressPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "wordpress") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: xenial applications: @@ -1008,8 +1047,8 @@ func (s *BundleDeployCharmStoreSuite) TestDeployBundleLocalAndCharmStoreCharms(c *gc.C) { charmsPath := c.MkDir() - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") - mysqlPath := testcharms.Repo.ClonedDirPath(charmsPath, "mysql") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") + mysqlPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(charmsPath, "mysql") err := s.DeployBundleYAML(c, fmt.Sprintf(` series: xenial applications: @@ -1039,8 +1078,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleApplicationOptions(c *gc.C) { - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") - _, dch := testcharms.UploadCharm(c, s.client, "precise/dummy-0", "dummy") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") + _, dch := testcharms.UploadCharmWithSeries(c, s.client, "bionic/dummy-0", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: wordpress: @@ -1049,17 +1088,17 @@ options: blog-title: these are the voyages customized: - charm: precise/dummy-0 + charm: bionic/dummy-0 num_units: 1 options: username: who skill-level: 47 `) c.Assert(err, jc.ErrorIsNil) - s.assertCharmsUploaded(c, "cs:precise/dummy-0", "cs:xenial/wordpress-42") + s.assertCharmsUploaded(c, "cs:bionic/dummy-0", "cs:xenial/wordpress-42") s.assertApplicationsDeployed(c, map[string]applicationInfo{ "customized": { - charm: "cs:precise/dummy-0", + charm: "cs:bionic/dummy-0", config: s.combinedSettings(dch, charm.Settings{"username": "who", "skill-level": int64(47)}), }, "wordpress": { @@ -1074,23 +1113,23 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleApplicationConstraints(c *gc.C) { - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") - _, dch := testcharms.UploadCharm(c, s.client, "precise/dummy-0", "dummy") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") + _, dch := testcharms.UploadCharmWithSeries(c, s.client, "bionic/dummy-0", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: wordpress: charm: wordpress constraints: mem=4G cores=2 customized: - charm: precise/dummy-0 + charm: bionic/dummy-0 num_units: 1 constraints: arch=i386 `) c.Assert(err, jc.ErrorIsNil) - s.assertCharmsUploaded(c, "cs:precise/dummy-0", "cs:xenial/wordpress-42") + s.assertCharmsUploaded(c, "cs:bionic/dummy-0", "cs:xenial/wordpress-42") s.assertApplicationsDeployed(c, map[string]applicationInfo{ "customized": { - charm: "cs:precise/dummy-0", + charm: "cs:bionic/dummy-0", constraints: constraints.MustParse("arch=i386"), config: dch.Config().DefaultSettings(), }, @@ -1106,9 +1145,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleSetAnnotations(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/mysql-42", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-47", "wordpress") - testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-42", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-47", "wordpress", "bionic") + testcharms.UploadBundleWithSeries(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple", "bionic") err := runDeploy(c, "bundle/wordpress-simple") c.Assert(err, jc.ErrorIsNil) application, err := s.State.Application("wordpress") @@ -1124,9 +1163,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleApplicationUpgrade(c *gc.C) { - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") - testcharms.UploadCharm(c, s.client, "vivid/upgrade-1", "upgrade1") - _, ch := testcharms.UploadCharm(c, s.client, "vivid/upgrade-2", "upgrade2") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/upgrade-1", "upgrade1", "bionic") + _, ch := testcharms.UploadCharmWithSeries(c, s.client, "trusty/upgrade-2", "upgrade2", "bionic") // First deploy the bundle. err := s.DeployBundleYAML(c, ` @@ -1138,12 +1177,12 @@ blog-title: these are the voyages constraints: spaces=final,frontiers mem=8000M up: - charm: vivid/upgrade-1 + charm: trusty/upgrade-1 num_units: 1 constraints: mem=8G `) c.Assert(err, jc.ErrorIsNil) - s.assertCharmsUploaded(c, "cs:vivid/upgrade-1", "cs:xenial/wordpress-42") + s.assertCharmsUploaded(c, "cs:trusty/upgrade-1", "cs:xenial/wordpress-42") // Then deploy a new bundle with modified charm revision and options. stdOut, _, err := s.DeployBundleYAMLWithOutput(c, ` @@ -1155,23 +1194,23 @@ blog-title: new title constraints: spaces=new cores=8 up: - charm: vivid/upgrade-2 + charm: trusty/upgrade-2 num_units: 1 constraints: mem=8G `) c.Assert(err, jc.ErrorIsNil) c.Assert(stdOut, gc.Equals, ""+ "Executing changes:\n"+ - "- upload charm cs:vivid/upgrade-2 for series vivid\n"+ - "- upgrade up to use charm cs:vivid/upgrade-2 for series vivid\n"+ + "- upload charm cs:trusty/upgrade-2 for series trusty\n"+ + "- upgrade up to use charm cs:trusty/upgrade-2 for series trusty\n"+ "- set application options for wordpress\n"+ `- set constraints for wordpress to "spaces=new cores=8"`, ) - s.assertCharmsUploaded(c, "cs:vivid/upgrade-1", "cs:vivid/upgrade-2", "cs:xenial/wordpress-42") + s.assertCharmsUploaded(c, "cs:trusty/upgrade-1", "cs:trusty/upgrade-2", "cs:xenial/wordpress-42") s.assertApplicationsDeployed(c, map[string]applicationInfo{ "up": { - charm: "cs:vivid/upgrade-2", + charm: "cs:trusty/upgrade-2", config: ch.Config().DefaultSettings(), constraints: constraints.MustParse("mem=8G"), }, @@ -1188,7 +1227,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleExpose(c *gc.C) { - _, ch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-42", "wordpress") + _, ch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-42", "wordpress", "bionic") content := ` applications: wordpress: @@ -1238,7 +1277,7 @@ // otherwise we can't resolve the charm URL because the charm's // "base entity" is not marked as promulgated so the query by // promulgated will find it. - testcharms.UploadCharm(c, s.client, "vivid/wordpress-42", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "vivid/wordpress-42", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wordpress: @@ -1249,10 +1288,10 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleMultipleRelations(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") - testcharms.UploadCharm(c, s.client, "xenial/mysql-1", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/postgres-2", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/varnish-3", "varnish") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-1", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/postgres-2", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/varnish-3", "varnish", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -1283,10 +1322,10 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleNewRelations(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") - testcharms.UploadCharm(c, s.client, "xenial/mysql-1", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/postgres-2", "mysql") - testcharms.UploadCharm(c, s.client, "xenial/varnish-3", "varnish") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-1", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/postgres-2", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/varnish-3", "varnish", "bionic") err := s.DeployBundleYAML(c, ` applications: wp: @@ -1331,8 +1370,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleMachinesUnitsPlacement(c *gc.C) { - _, wpch := testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") - _, mysqlch := testcharms.UploadCharm(c, s.client, "xenial/mysql-2", "mysql") + _, wpch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") + _, mysqlch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/mysql-2", "mysql", "bionic") content := ` applications: @@ -1401,7 +1440,7 @@ } func (s *BundleDeployCharmStoreSuite) TestLXCTreatedAsLXD(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") // Note that we use lxc here, to represent a 1.x bundle that specifies lxc. content := ` @@ -1440,7 +1479,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleMachineAttributes(c *gc.C) { - _, ch := testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") + _, ch := testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: @@ -1479,7 +1518,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleTwiceScaleUp(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: @@ -1504,8 +1543,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleUnitPlacedInApplication(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") err := s.DeployBundleYAML(c, ` applications: wordpress: @@ -1527,8 +1566,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundlePeerContainer(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "xenial/wordpress-0", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/wordpress-0", "wordpress", "bionic") stdOut, _, err := s.DeployBundleYAMLWithOutput(c, ` applications: @@ -1567,9 +1606,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleUnitColocationWithUnit(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "xenial/mem-47", "dummy") - testcharms.UploadCharm(c, s.client, "xenial/rails-0", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/mem-47", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/rails-0", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: memcached: @@ -1610,7 +1649,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleUnitPlacedToMachines(c *gc.C) { - testcharms.UploadCharm(c, s.client, "bionic/django-42", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/django-42", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: @@ -1640,9 +1679,9 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleMassiveUnitColocation(c *gc.C) { - testcharms.UploadCharm(c, s.client, "bionic/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "bionic/mem-47", "dummy") - testcharms.UploadCharm(c, s.client, "bionic/rails-0", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/mem-47", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/rails-0", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: memcached: @@ -1733,8 +1772,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleWithAnnotations_OutputIsCorrect(c *gc.C) { - testcharms.UploadCharm(c, s.client, "bionic/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "bionic/mem-47", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/mem-47", "dummy", "bionic") stdOut, stdErr, err := s.DeployBundleYAMLWithOutput(c, ` applications: django: @@ -1773,8 +1812,8 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundleAnnotations(c *gc.C) { - testcharms.UploadCharm(c, s.client, "bionic/django-42", "dummy") - testcharms.UploadCharm(c, s.client, "bionic/mem-47", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/django-42", "dummy", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/mem-47", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: @@ -1841,7 +1880,7 @@ s.Factory.MakeMachine(c, xenialMachine) // machine-1 s.Factory.MakeMachine(c, xenialMachine) // machine-2 s.Factory.MakeMachine(c, xenialMachine) // machine-3 - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") err := s.DeployBundleYAML(c, ` applications: django: @@ -2062,6 +2101,10 @@ 1: annotations: {foo: bar}` + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) + baseDir := c.MkDir() bundleFile := filepath.Join(baseDir, "bundle.yaml") err := ioutil.WriteFile(bundleFile, []byte(baseBundle), 0644) @@ -2305,7 +2348,7 @@ } func (s *BundleDeployCharmStoreSuite) TestDeployBundlePassesSequences(c *gc.C) { - testcharms.UploadCharm(c, s.client, "xenial/django-42", "dummy") + testcharms.UploadCharmWithSeries(c, s.client, "xenial/django-42", "dummy", "bionic") // Deploy another django app with two units, this will bump the sequences // for machines and the django application. Then remove them both. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/consume.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/consume.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/consume.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/consume.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,12 +6,14 @@ import ( "github.com/juju/cmd" "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/api/application" "github.com/juju/juju/api/applicationoffers" "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/core/crossmodel" ) @@ -88,7 +90,7 @@ return application.NewClient(root), nil } -func (c *consumeCommand) getSourceAPI(url *crossmodel.OfferURL) (applicationConsumeDetailsAPI, error) { +func (c *consumeCommand) getSourceAPI(url *charm.OfferURL) (applicationConsumeDetailsAPI, error) { if c.sourceAPI != nil { return c.sourceAPI, nil } @@ -115,7 +117,7 @@ if err != nil { return errors.Trace(err) } - url, err := crossmodel.ParseOfferURL(c.remoteApplication) + url, err := charm.ParseOfferURL(c.remoteApplication) if err != nil { return errors.Trace(err) } @@ -138,7 +140,7 @@ } // Parse the offer details URL and add the source controller so // things like status can show the original source of the offer. - offerURL, err := crossmodel.ParseOfferURL(consumeDetails.Offer.OfferURL) + offerURL, err := charm.ParseOfferURL(consumeDetails.Offer.OfferURL) if err != nil { return errors.Trace(err) } @@ -170,7 +172,7 @@ } localName, err := targetClient.Consume(arg) if err != nil { - return errors.Trace(err) + return block.ProcessBlockedError(errors.Annotatef(err, "could not consume %v", url.AsLocal().String()), block.BlockChange) } ctx.Infof("Added %s as %s", c.remoteApplication, localName) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/consume_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/consume_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/consume_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/consume_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -84,6 +84,14 @@ c.Assert(err, gc.ErrorMatches, "infirmary") } +func (s *ConsumeSuite) TestConsumeBlocked(c *gc.C) { + s.mockAPI.SetErrors(nil, ¶ms.Error{Code: params.CodeOperationBlocked, Message: "nope"}) + _, err := s.runConsume(c, "model.application") + s.mockAPI.CheckCallNames(c, "GetConsumeDetails", "Consume", "Close", "Close") + c.Assert(err.Error(), jc.Contains, `could not consume bob/model.application: nope`) + c.Assert(err.Error(), jc.Contains, `All operations that change model have been disabled for the current model.`) +} + func (s *ConsumeSuite) assertSuccessModelDotApplication(c *gc.C, alias string) { s.mockAPI.localName = "mary-weep" var ( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/deploy.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/deploy.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/deploy.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/deploy.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,12 +8,15 @@ "io/ioutil" "os" "path/filepath" + "sort" "strconv" "strings" "github.com/juju/cmd" + "github.com/juju/collections/set" "github.com/juju/errors" "github.com/juju/gnuflag" + "github.com/juju/os/series" "github.com/juju/romulus" "gopkg.in/juju/charm.v6" "gopkg.in/juju/charm.v6/resource" @@ -28,6 +31,7 @@ "github.com/juju/juju/api" "github.com/juju/juju/api/annotations" "github.com/juju/juju/api/application" + "github.com/juju/juju/api/applicationoffers" apicharms "github.com/juju/juju/api/charms" "github.com/juju/juju/api/controller" "github.com/juju/juju/api/modelconfig" @@ -39,6 +43,7 @@ "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/devices" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/model" @@ -67,6 +72,7 @@ SetConstraints(application string, constraints constraints.Value) error Update(apiparams.ApplicationUpdate) error ScaleApplication(application.ScaleApplicationParams) (apiparams.ScaleApplicationResult, error) + Consume(arg crossmodel.ConsumeApplicationArgs) (string, error) } type ModelAPI interface { @@ -88,6 +94,28 @@ CharmInfo(string) (*apicharms.CharmInfo, error) } +// OfferAPI represents the methods of the API the deploy command needs +// for creating offers. +type OfferAPI interface { + Offer(modelUUID, application string, endpoints []string, offerName, descr string) ([]apiparams.ErrorResult, error) + GetConsumeDetails(url string) (apiparams.ConsumeOfferDetails, error) + GrantOffer(user, access string, offerURLs ...string) error +} + +var supportedJujuSeries = func() []string { + // We support all of the juju series AND all the ESM supported series. + // Juju is congruant with the Ubuntu release cycle for it's own series (not + // including centos and windows), so that should be reflected here. + // + // For non-LTS releases; they'll appear in juju/os as default available, but + // after reading the `/usr/share/distro-info/ubuntu.csv` on the Ubuntu distro + // the non-LTS should disapear if they're not in the release window for that + // series. + supportedJujuSeries := set.NewStrings(series.SupportedJujuSeries()...) + esmSupportedJujuSeries := set.NewStrings(series.ESMSupportedJujuSeries()...) + return supportedJujuSeries.Union(esmSupportedJujuSeries).Values() +} + // DeployAPI represents the methods of the API the deploy // command needs. type DeployAPI interface { @@ -99,6 +127,7 @@ CharmDeployAPI ApplicationAPI ModelAPI + OfferAPI // ApplicationClient Deploy(application.DeployArgs) error @@ -178,6 +207,10 @@ return c.planURL } +type offerClient struct { + *applicationoffers.Client +} + type deployAPIAdapter struct { api.Connection *apiClient @@ -188,6 +221,7 @@ *charmstoreClient *annotationsClient *plansClient + *offerClient } func (a *deployAPIAdapter) Client() *api.Client { @@ -277,6 +311,7 @@ annotationsClient: &annotationsClient{Client: annotations.NewClient(apiRoot)}, charmRepoClient: &charmRepoClient{charmrepo.NewCharmStoreFromClient(cstoreClient)}, plansClient: &plansClient{planURL: mURL}, + offerClient: &offerClient{Client: applicationoffers.NewClient(controllerAPIRoot)}, }, nil } @@ -302,7 +337,7 @@ // Series is the series of the charm to deploy. Series string - // Force is used to allow a charm to be deployed onto a machine + // Force is used to allow a charm/bundle to be deployed onto a machine // running an unsupported series. Force bool @@ -350,9 +385,12 @@ // NewAPIRoot stores a function which returns a new API root. NewAPIRoot func() (DeployAPI, error) - // Trust signifies that the charm should be deployed with access to - // trusted credentials. That is, hooks run by the charm can access - // cloud credentials and other trusted access credentials. + // When deploying a charm, Trust signifies that the charm should be + // deployed with access to trusted credentials. That is, hooks run by + // the charm can access cloud credentials and other trusted access + // credentials. On the other hand, when deploying a bundle, Trust + // signifies that each application from the bundle that requires access + // to trusted credentials will be granted access. Trust bool machineMap string @@ -361,26 +399,28 @@ unknownModel bool } +const kubernetesSeriesName = "kubernetes" + const deployDoc = ` A charm can be referred to by its simple name and a series can optionally be specified: juju deploy postgresql - juju deploy xenial/postgresql + juju deploy bionic/postgresql juju deploy cs:postgresql - juju deploy cs:xenial/postgresql - juju deploy postgresql --series xenial + juju deploy cs:bionic/postgresql + juju deploy postgresql --series bionic All the above deployments use remote charms found in the Charm Store (denoted by 'cs') and therefore also make use of "charm URLs". A versioned charm URL will be expanded as expected. For example, 'mysql-56' -becomes 'cs:xenial/mysql-56'. +becomes 'cs:bionic/mysql-56'. A local charm may be deployed by giving the path to its directory: juju deploy /path/to/charm - juju deploy /path/to/charm --series xenial + juju deploy /path/to/charm --series bionic You will need to be explicit if there is an ambiguity between a local and a remote charm: @@ -391,7 +431,7 @@ An error is emitted if the determined series is not supported by the charm. Use the '--force' option to override this check: - juju deploy charm --series xenial --force + juju deploy charm --series bionic --force A bundle can be expressed similarly to a charm, but not by series: @@ -646,12 +686,10 @@ // whether we are deploying a charm or a bundle. func charmOnlyFlags() []string { charmOnlyFlags := []string{ - "bind", "config", "constraints", "force", "n", "num-units", + "bind", "config", "constraints", "n", "num-units", "series", "to", "resource", "attach-storage", } - charmOnlyFlags = append(charmOnlyFlags, "trust") - return charmOnlyFlags } @@ -671,7 +709,7 @@ f.StringVar(&c.ConstraintsStr, "constraints", "", "Set application constraints") f.StringVar(&c.Series, "series", "", "The series on which to deploy") f.BoolVar(&c.DryRun, "dry-run", false, "Just show what the bundle deploy would do") - f.BoolVar(&c.Force, "force", false, "Allow a charm to be deployed which bypasses checks such as supported series or LXD profile allow list") + f.BoolVar(&c.Force, "force", false, "Allow a charm/bundle to be deployed which bypasses checks such as supported series or LXD profile allow list") f.Var(storageFlag{&c.Storage, &c.BundleStorage}, "storage", "Charm storage constraints") f.Var(devicesFlag{&c.Devices, &c.BundleDevices}, "device", "Charm device constraints") f.Var(stringMap{&c.Resources}, "resource", "Resource to be uploaded to the controller") @@ -813,26 +851,41 @@ return config.New(config.NoDefaults, attrs) } -func (c *DeployCommand) deployBundle( - ctx *cmd.Context, - filePath string, - data *charm.BundleData, - bundleURL *charm.URL, - channel params.Channel, - apiRoot DeployAPI, - bundleStorage map[string]map[string]storage.Constraints, - bundleDevices map[string]map[string]devices.Constraints, -) (rErr error) { +func (c *DeployCommand) deployBundle(spec bundleDeploySpec) (rErr error) { bakeryClient, err := c.BakeryClient() if err != nil { return errors.Trace(err) } - modelUUID, ok := apiRoot.ModelUUID() - if !ok { + + var ok bool + if spec.targetModelUUID, ok = spec.apiRoot.ModelUUID(); !ok { return errors.New("API connection is controller-only (should never happen)") } - for application, applicationSpec := range data.Applications { + if spec.targetModelName, _, err = c.ModelDetails(); err != nil { + return errors.Annotatef(err, "could not retrieve model name") + } + + spec.controllerName, err = c.ControllerName() + if err != nil { + return errors.Trace(err) + } + accountDetails, err := c.CurrentAccountDetails() + if err != nil { + return errors.Trace(err) + } + spec.accountUser = accountDetails.User + + // Short-circuit trust checks if the operator specifies '--force' + if !c.Trust { + if tl := appsRequiringTrust(spec.bundleData.Applications); len(tl) != 0 && !c.Force { + return errors.Errorf(`Bundle cannot be deployed without trusting applications with your cloud credentials. +Please repeat the deploy command with the --trust argument if you consent to trust the following application(s): + - %s`, strings.Join(tl, "\n - ")) + } + } + + for application, applicationSpec := range spec.bundleData.Applications { if applicationSpec.Plan != "" { for _, step := range c.Steps { s := step @@ -845,17 +898,17 @@ CharmID: charmstore.CharmID{URL: charmURL}, ApplicationName: application, ApplicationPlan: applicationSpec.Plan, - ModelUUID: modelUUID, + ModelUUID: spec.targetModelUUID, Force: c.Force, } - err = s.RunPre(apiRoot, bakeryClient, ctx, deployInfo) + err = s.RunPre(spec.apiRoot, bakeryClient, spec.ctx, deployInfo) if err != nil { return errors.Trace(err) } defer func() { - err = errors.Trace(s.RunPost(apiRoot, bakeryClient, ctx, deployInfo, rErr)) + err = errors.Trace(s.RunPost(spec.apiRoot, bakeryClient, spec.ctx, deployInfo, rErr)) if err != nil { rErr = err } @@ -867,20 +920,7 @@ // TODO(ericsnow) Do something with the CS macaroons that were returned? // Deploying bundles does not allow the use force, it's expected that the // bundle is correct and therefore the charms are also. - if _, err := deployBundle( - filePath, - data, - bundleURL, - c.BundleOverlayFile, - channel, - apiRoot, - ctx, - bundleStorage, - bundleDevices, - c.DryRun, - c.UseExisting, - c.BundleMachines, - ); err != nil { + if _, err := deployBundle(spec); err != nil { return errors.Annotate(err, "cannot deploy bundle") } return nil @@ -1174,12 +1214,25 @@ return nil } -func (c *DeployCommand) validateCharmSeries(series string) error { +func (c *DeployCommand) validateCharmSeries(seriesName string) error { + // attempt to locate the charm series from the list of known juju series + // that we currently support. + var found bool + for _, name := range supportedJujuSeries() { + if name == seriesName { + found = true + break + } + } + if !found && !c.Force { + return errors.NotSupportedf("series: %s", seriesName) + } + modelType, err := c.ModelType() if err != nil { return errors.Trace(err) } - return model.ValidateSeries(modelType, series) + return model.ValidateSeries(modelType, seriesName) } func (c *DeployCommand) validateResourcesNeededForLocalDeploy(charmMeta *charm.Meta) error { @@ -1217,7 +1270,7 @@ } // Avoid deploying charm if it's not valid for the model. - if err := c.validateCharmSeries(userCharmURL.Series); err != nil { + if err := c.validateCharmSeriesWithName(userCharmURL.Series, userCharmURL.Name); err != nil { return nil, errors.Trace(err) } @@ -1314,16 +1367,21 @@ } return func(ctx *cmd.Context, apiRoot DeployAPI) error { - return errors.Trace(c.deployBundle( - ctx, - bundleDir, - bundleData, - nil, - c.Channel, - apiRoot, - c.BundleStorage, - c.BundleDevices, - )) + return errors.Trace(c.deployBundle(bundleDeploySpec{ + ctx: ctx, + dryRun: c.DryRun, + force: c.Force, + trust: c.Trust, + bundleDir: bundleDir, + bundleData: bundleData, + bundleOverlayFile: c.BundleOverlayFile, + channel: c.Channel, + apiRoot: apiRoot, + useExistingMachines: c.UseExisting, + bundleMachines: c.BundleMachines, + bundleStorage: c.BundleStorage, + bundleDevices: c.BundleDevices, + })) }, nil } @@ -1342,7 +1400,7 @@ // needed for a more elegant fix. ch, err := charm.ReadCharm(c.CharmOrBundle) - series := c.Series + seriesName := c.Series if err == nil { modelCfg, err := getModelConfig(apiRoot) if err != nil { @@ -1350,21 +1408,26 @@ } seriesSelector := seriesSelector{ - seriesFlag: series, - supportedSeries: ch.Meta().Series, - force: c.Force, - conf: modelCfg, - fromBundle: false, + seriesFlag: seriesName, + supportedSeries: ch.Meta().Series, + supportedJujuSeries: supportedJujuSeries(), + force: c.Force, + conf: modelCfg, + fromBundle: false, } - series, err = seriesSelector.charmSeries() - if err != nil { + if len(ch.Meta().Series) == 0 { + logger.Warningf("%s does not declare supported series in metadata.yml", ch.Meta().Name) + } + + seriesName, err = seriesSelector.charmSeries() + if err = charmValidationError(seriesName, ch.Meta().Name, errors.Trace(err)); err != nil { return nil, errors.Trace(err) } } // Charm may have been supplied via a path reference. - ch, curl, err := charmrepo.NewCharmAtPathForceSeries(c.CharmOrBundle, series, c.Force) + ch, curl, err := charmrepo.NewCharmAtPathForceSeries(c.CharmOrBundle, seriesName, c.Force) // We check for several types of known error which indicate // that the supplied reference was indeed a path but there was // an issue reading the charm located there. @@ -1387,7 +1450,7 @@ } // Avoid deploying charm if it's not valid for the model. - if err := c.validateCharmSeries(series); err != nil { + if err := c.validateCharmSeriesWithName(seriesName, curl.Name); err != nil { return nil, errors.Trace(err) } if err := c.validateResourcesNeededForLocalDeploy(ch.Meta()); err != nil { @@ -1476,16 +1539,21 @@ ctx.Infof("Located bundle %q", bundleURL) data := bundle.Data() - return errors.Trace(c.deployBundle( - ctx, - "", // filepath - data, - bundleURL, - channel, - apiRoot, - c.BundleStorage, - c.BundleDevices, - )) + return errors.Trace(c.deployBundle(bundleDeploySpec{ + ctx: ctx, + dryRun: c.DryRun, + force: c.Force, + trust: c.Trust, + bundleData: data, + bundleURL: bundleURL, + bundleOverlayFile: c.BundleOverlayFile, + channel: channel, + apiRoot: apiRoot, + useExistingMachines: c.UseExisting, + bundleMachines: c.BundleMachines, + bundleStorage: c.BundleStorage, + bundleDevices: c.BundleDevices, + })) }, nil } } @@ -1530,12 +1598,13 @@ } selector := seriesSelector{ - charmURLSeries: userRequestedSeries, - seriesFlag: c.Series, - supportedSeries: supportedSeries, - force: c.Force, - conf: modelCfg, - fromBundle: false, + charmURLSeries: userRequestedSeries, + seriesFlag: c.Series, + supportedSeries: supportedSeries, + supportedJujuSeries: supportedJujuSeries(), + force: c.Force, + conf: modelCfg, + fromBundle: false, } // Get the series to use. @@ -1544,7 +1613,7 @@ // Avoid deploying charm if it's not valid for the model. // We check this first before possibly suggesting --force. if err == nil { - if err2 := c.validateCharmSeries(series); err2 != nil { + if err2 := c.validateCharmSeriesWithName(series, storeCharmOrBundleURL.Name); err2 != nil { return errors.Trace(err2) } } @@ -1552,6 +1621,15 @@ if charm.IsUnsupportedSeriesError(err) { return errors.Errorf("%v. Use --force to deploy the charm anyway.", err) } + // although we try and get the charmSeries from the charm series + // selector it will return an error and an empty string for the series. + // So we need to approximate what the seriesName should be when + // displaying an error to the user. We do this by getting the potential + // series name. + seriesName := getPotentialSeriesName(series, storeCharmOrBundleURL.Series, userRequestedSeries) + if validationErr := charmValidationError(seriesName, storeCharmOrBundleURL.Name, errors.Trace(err)); validationErr != nil { + return errors.Trace(validationErr) + } // Store the charm in the controller curl, csMac, err := addCharmFromURL(apiRoot, storeCharmOrBundleURL, channel, c.Force) @@ -1562,6 +1640,20 @@ return errors.Annotatef(err, "storing charm for URL %q", storeCharmOrBundleURL) } + // If the original series was empty, so we couldn't validate the original + // charm series, but the charm url wasn't nil, we can check and validate + // what that one says. + // + // Note: it's interesting that the charm url and the series can diverge and + // tell different things when deploying a charm and in sake of understanding + // what we deploy, we should converge the two so that both report identical + // values. + if curl != nil && series == "" { + if err := c.validateCharmSeriesWithName(curl.Series, storeCharmOrBundleURL.Name); err != nil { + return errors.Trace(err) + } + } + formattedCharmURL := curl.String() ctx.Infof("Located charm %q.", formattedCharmURL) ctx.Infof("Deploying charm %q.", formattedCharmURL) @@ -1579,6 +1671,48 @@ }, nil } +// Returns the first string that isn't empty. +// If all strings are empty, then return an empty string. +func getPotentialSeriesName(series ...string) string { + for _, s := range series { + if s != "" { + return s + } + } + return "" +} + +// validateCharmSeriesWithName calls the validateCharmSeries, but handles the +// error return value to check for NotSupported error and returns a custom error +// message if that's found. +func (c *DeployCommand) validateCharmSeriesWithName(series, name string) error { + err := c.validateCharmSeries(series) + return charmValidationError(series, name, errors.Trace(err)) +} + +// charmValidationError consumes an error along with a charmSeries and name +// to help provide better feedback to the user when somethings gone wrong around +// validating a charm validation +func charmValidationError(charmSeries, name string, err error) error { + if err != nil { + if errors.IsNotSupported(err) { + // output the warning information to help track down the error. + // see: lp:1833763 + if warningInfo := series.SeriesWarningInfo(charmSeries); len(warningInfo) > 0 { + logger.Warningf( + "Parsing issues occurred when extracting the distro-info.\n\n"+ + " - %s\n"+ + "\nYou may want to try updating your distro-info using `apt-get update distro-info`\n", + strings.Join(warningInfo, "\n - "), + ) + } + return errors.Errorf("%v is not available on the following %v", name, err) + } + return errors.Trace(err) + } + return nil +} + // getFlags returns the flags with the given names. Only flags that are set and // whose name is included in flagNames are included. func getFlags(flagSet *gnuflag.FlagSet, flagNames []string) []string { @@ -1599,3 +1733,17 @@ } return "-" + name } + +func appsRequiringTrust(appSpecList map[string]*charm.ApplicationSpec) []string { + var tl []string + for app, appSpec := range appSpecList { + if applicationRequiresTrust(appSpec) { + tl = append(tl, app) + } + } + + // Since map iterations are random we should sort the list to ensure + // consistent output in any errors containing the returned list contents. + sort.Strings(tl) + return tl +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/deploy_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/deploy_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/deploy_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/deploy_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,6 +18,7 @@ "github.com/juju/cmd" "github.com/juju/cmd/cmdtesting" + "github.com/juju/collections/set" "github.com/juju/errors" "github.com/juju/gnuflag" "github.com/juju/juju/caas" @@ -26,9 +27,11 @@ "github.com/juju/juju/environs" "github.com/juju/juju/environs/config" "github.com/juju/juju/environs/context" + "github.com/juju/juju/feature" "github.com/juju/juju/storage" "github.com/juju/juju/testing/factory" "github.com/juju/loggo" + "github.com/juju/os/series" jujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" "github.com/juju/utils" @@ -50,11 +53,13 @@ "github.com/juju/juju/api" "github.com/juju/juju/api/application" "github.com/juju/juju/api/charms" + apitesting "github.com/juju/juju/api/testing" "github.com/juju/juju/apiserver/params" jjcharmstore "github.com/juju/juju/charmstore" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/controller" "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/model" "github.com/juju/juju/juju/testing" @@ -66,6 +71,11 @@ coretesting "github.com/juju/juju/testing" ) +// defaultSupportedJujuSeries is used to return canned information about what +// juju supports in terms of the release cycle +// see juju/os and documentation https://www.ubuntu.com/about/release-cycle +var defaultSupportedJujuSeries = []string{"bionic", "xenial", "trusty", kubernetesSeriesName} + type DeploySuiteBase struct { testing.RepoSuite coretesting.CmdBlockHelper @@ -154,6 +164,9 @@ func (s *DeploySuiteBase) SetUpTest(c *gc.C) { s.RepoSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) s.CmdBlockHelper = coretesting.NewCmdBlockHelper(s.APIState) c.Assert(s.CmdBlockHelper, gc.NotNil) s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() }) @@ -230,8 +243,8 @@ func (s *DeploySuite) TestBlockDeploy(c *gc.C) { // Block operation s.BlockAllChanges(c, "TestBlockDeploy") - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") - err := s.runDeploy(c, ch, "some-application-name", "--series", "precise") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") + err := s.runDeploy(c, ch, "some-application-name", "--series", "bionic") s.AssertBlocked(c, err, ".*TestBlockDeploy.*") } @@ -256,7 +269,7 @@ } func (s *DeploySuite) TestCharmDir(c *gc.C) { - ch := testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") err := s.runDeploy(c, ch, "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -264,7 +277,7 @@ } func (s *DeploySuite) TestDeployFromPathRelativeDir(c *gc.C) { - testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") wd, err := os.Getwd() c.Assert(err, jc.ErrorIsNil) defer os.Chdir(wd) @@ -278,7 +291,7 @@ } func (s *DeploySuite) TestDeployFromPathOldCharm(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") err := s.runDeploy(c, path, "--series", "precise", "--force") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:precise/dummy-1") @@ -291,13 +304,13 @@ err := s.Model.UpdateModelConfig(updateAttrs, nil) c.Assert(err, jc.ErrorIsNil) - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") err = s.runDeploy(c, path) c.Assert(err, gc.ErrorMatches, "series not specified and charm does not define any") } func (s *DeploySuite) TestDeployFromPathOldCharmMissingSeriesUseDefaultSeries(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") err := s.runDeploy(c, path) c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL(fmt.Sprintf("local:%s/dummy-1", version.SupportedLTS())) @@ -311,7 +324,7 @@ updateAttrs := map[string]interface{}{"default-series": "trusty"} err := s.Model.UpdateModelConfig(updateAttrs, nil) c.Assert(err, jc.ErrorIsNil) - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") err = s.runDeploy(c, path) c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -319,7 +332,7 @@ } func (s *DeploySuite) TestDeployFromPath(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") err := s.runDeploy(c, path, "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -327,13 +340,13 @@ } func (s *DeploySuite) TestDeployFromPathUnsupportedSeries(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") err := s.runDeploy(c, path, "--series", "quantal") - c.Assert(err, gc.ErrorMatches, `series "quantal" not supported by charm, supported series are: precise,trusty,xenial,yakkety`) + c.Assert(err, gc.ErrorMatches, `series "quantal" not supported by charm, supported series are: precise,trusty,xenial,yakkety,bionic`) } func (s *DeploySuite) TestDeployFromPathUnsupportedSeriesForce(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "multi-series") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "multi-series") err := s.runDeploy(c, path, "--series", "quantal", "--force") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:quantal/multi-series-1") @@ -341,7 +354,7 @@ } func (s *DeploySuite) TestDeployFromPathUnsupportedLXDProfileForce(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "lxd-profile-fail") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "lxd-profile-fail") err := s.runDeploy(c, path, "--series", "quantal", "--force") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:quantal/lxd-profile-fail-0") @@ -351,10 +364,10 @@ func (s *DeploySuite) TestUpgradeCharmDir(c *gc.C) { // Add the charm, so the url will exist and a new revision will be // picked in application Deploy. - dummyCharm := s.AddTestingCharm(c, "dummy") + dummyCharm := s.AddTestingCharmForSeries(c, "dummy", "bionic") - dirPath := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") - err := s.runDeploy(c, dirPath, "--series", "quantal") + dirPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") + err := s.runDeploy(c, dirPath, "--series", "bionic") c.Assert(err, jc.ErrorIsNil) upgradedRev := dummyCharm.Revision() + 1 curl := dummyCharm.URL().WithRevision(upgradedRev) @@ -366,7 +379,7 @@ } func (s *DeploySuite) TestCharmBundle(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := s.runDeploy(c, ch, "some-application-name", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -374,7 +387,7 @@ } func (s *DeploySuite) TestSubordinateCharm(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "logging") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "logging") err := s.runDeploy(c, ch, "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/logging-1") @@ -390,9 +403,9 @@ } func (s *DeploySuite) TestSingleConfigFile(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") path := setupConfigFile(c, c.MkDir()) - err := s.runDeploy(c, ch, "dummy-application", "--config", path, "--series", "precise") + err := s.runDeploy(c, ch, "dummy-application", "--config", path, "--series", "bionic") c.Assert(err, jc.ErrorIsNil) app, err := s.State.Application("dummy-application") c.Assert(err, jc.ErrorIsNil) @@ -407,7 +420,7 @@ } func (s *DeploySuite) TestRelativeConfigPath(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") // Putting a config file in home is okay as $HOME is set to a tempdir setupConfigFile(c, utils.Home()) err := s.runDeploy(c, ch, "dummy-application", "--config", "~/testconfig.yaml") @@ -415,8 +428,8 @@ } func (s *DeploySuite) TestConfigValues(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") - err := s.runDeploy(c, ch, "dummy-application", "--config", "skill-level=9000", "--config", "outlook=good", "--series", "precise") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") + err := s.runDeploy(c, ch, "dummy-application", "--config", "skill-level=9000", "--config", "outlook=good", "--series", "bionic") c.Assert(err, jc.ErrorIsNil) app, err := s.State.Application("dummy-application") c.Assert(err, jc.ErrorIsNil) @@ -432,9 +445,9 @@ } func (s *DeploySuite) TestConfigValuesWithFile(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") path := setupConfigFile(c, c.MkDir()) - err := s.runDeploy(c, ch, "dummy-application", "--config", path, "--config", "outlook=good", "--config", "skill-level=8000", "--series", "precise") + err := s.runDeploy(c, ch, "dummy-application", "--config", path, "--config", "outlook=good", "--config", "skill-level=8000", "--series", "bionic") c.Assert(err, jc.ErrorIsNil) app, err := s.State.Application("dummy-application") c.Assert(err, jc.ErrorIsNil) @@ -450,13 +463,13 @@ } func (s *DeploySuite) TestSingleConfigMoreThanOneFile(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") - err := s.runDeploy(c, ch, "dummy-application", "--config", "one", "--config", "another", "--series", "precise") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") + err := s.runDeploy(c, ch, "dummy-application", "--config", "one", "--config", "another", "--series", "bionic") c.Assert(err, gc.ErrorMatches, "only a single config YAML file can be specified, got 2") } func (s *DeploySuite) TestConfigError(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") path := setupConfigFile(c, c.MkDir()) err := s.runDeploy(c, ch, "other-application", "--config", path) c.Assert(err, gc.ErrorMatches, `no settings found for "other-application"`) @@ -465,7 +478,7 @@ } func (s *DeploySuite) TestConstraints(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := s.runDeploy(c, ch, "--constraints", "mem=2G cores=2", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -476,7 +489,7 @@ } func (s *DeploySuite) TestResources(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") foopath := "/test/path/foo" barpath := "/test/path/var" @@ -496,7 +509,7 @@ } func (s *DeploySuite) TestLXDProfileLocalCharm(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "lxd-profile") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "lxd-profile") err := s.runDeploy(c, path) c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:bionic/lxd-profile-0") @@ -504,7 +517,7 @@ } func (s *DeploySuite) TestLXDProfileLocalCharmFails(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(s.CharmsPath, "lxd-profile-fail") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "lxd-profile-fail") err := s.runDeploy(c, path) c.Assert(errors.Cause(err), gc.ErrorMatches, `invalid lxd-profile.yaml: contains device type "unix-disk"`) } @@ -515,7 +528,7 @@ // TODO(wallyworld) - add another test that deploy with storage fails for older environments // (need deploy client to be refactored to use API stub) func (s *DeploySuite) TestStorage(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "storage-block") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "storage-block") err := s.runDeploy(c, ch, "--storage", "data=machinescoped,1G", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/storage-block-1") @@ -537,6 +550,264 @@ }) } +func (s *DeploySuite) TestErrorDeployingBundlesRequiringTrust(c *gc.C) { + specs := []struct { + descr string + bundle string + expAppList []string + }{ + { + descr: "bundle with a single app with the trust field set to true", + bundle: "aws-integrator-trust-single", + expAppList: []string{"aws-integrator"}, + }, + { + descr: "bundle with a multiple apps with the trust field set to true", + bundle: "aws-integrator-trust-multi", + expAppList: []string{"aws-integrator", "gcp-integrator"}, + }, + { + descr: "bundle with a single app with a 'trust: true' config option", + bundle: "aws-integrator-trust-conf-param", + expAppList: []string{"aws-integrator"}, + }, + } + + for specIndex, spec := range specs { + c.Logf("[spec %d] %s", specIndex, spec.descr) + + expErr := fmt.Sprintf(`Bundle cannot be deployed without trusting applications with your cloud credentials. +Please repeat the deploy command with the --trust argument if you consent to trust the following application(s): + - %s`, strings.Join(spec.expAppList, "\n - ")) + + bundlePath := testcharms.RepoWithSeries("bionic").ClonedBundleDirPath(c.MkDir(), spec.bundle) + err := s.runDeploy(c, bundlePath) + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, expErr) + } +} + +func (s *DeploySuite) TestDeployBundlesRequiringTrust(c *gc.C) { + cfgAttrs := map[string]interface{}{ + "name": "name", + "uuid": "deadbeef-0bad-400d-8000-4b1d0d06f00d", + "type": "foo", + } + fakeAPI := vanillaFakeModelAPI(cfgAttrs) + withAllWatcher(fakeAPI) + + inURL := charm.MustParseURL("cs:~containers/aws-integrator") + withCharmRepoResolvable(fakeAPI, inURL) + + // The aws-integrator charm requires trust and since the operator passes + // --trust we expect to see a "trust: true" config value in the yaml + // config passed to Deplly. + // + // As withCharmDeployable does not support passing a "ConfigYAML" + // it's easier to just invoke it to set up all other calls and then + // explicitly Deploy here. + withCharmDeployable( + fakeAPI, inURL, "bionic", + &charm.Meta{Name: "aws-integrator", Series: []string{"bionic"}}, + nil, false, false, 0, nil, nil, + ) + + fakeAPI.Call("Deploy", application.DeployArgs{ + CharmID: jjcharmstore.CharmID{URL: inURL}, + ApplicationName: inURL.Name, + Series: "bionic", + ConfigYAML: "aws-integrator:\n trust: \"true\"\n", + }).Returns(error(nil)) + fakeAPI.Call("Deploy", application.DeployArgs{ + CharmID: jjcharmstore.CharmID{URL: inURL}, + ApplicationName: inURL.Name, + Series: "bionic", + }).Returns(errors.New("expected Deploy for aws-integrator to be called with 'trust: true'")) + + fakeAPI.Call("AddUnits", application.AddUnitsParams{ + ApplicationName: "aws-integrator", + NumUnits: 1, + }).Returns([]string{"aws-integrator/0"}, error(nil)) + + // The second charm from the bundle does not require trust so no + // additional configuration should be injected + ubURL := charm.MustParseURL("cs:~jameinel/ubuntu-lite-7") + withCharmRepoResolvable(fakeAPI, ubURL) + withCharmDeployable( + fakeAPI, ubURL, "bionic", + &charm.Meta{Name: "ubuntu-lite", Series: []string{"bionic"}}, + nil, false, false, 0, nil, nil, + ) + + fakeAPI.Call("AddUnits", application.AddUnitsParams{ + ApplicationName: "ubuntu-lite", + NumUnits: 1, + }).Returns([]string{"ubuntu-lite/0"}, error(nil)) + + deploy := &DeployCommand{ + NewAPIRoot: func() (DeployAPI, error) { + return fakeAPI, nil + }, + } + + bundlePath := testcharms.RepoWithSeries("bionic").ClonedBundleDirPath(c.MkDir(), "aws-integrator-trust-single") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), bundlePath, "--trust") + c.Assert(err, jc.ErrorIsNil) +} + +func (s *DeploySuite) TestDeployBundleWithOffers(c *gc.C) { + cfgAttrs := map[string]interface{}{ + "name": "name", + "uuid": "deadbeef-0bad-400d-8000-4b1d0d06f00d", + "type": "foo", + } + fakeAPI := vanillaFakeModelAPI(cfgAttrs) + withAllWatcher(fakeAPI) + + inURL := charm.MustParseURL("cs:apache2-26") + withCharmRepoResolvable(fakeAPI, inURL) + + withCharmDeployable( + fakeAPI, inURL, "bionic", + &charm.Meta{Name: "apache2", Series: []string{"bionic"}}, + nil, false, false, 0, nil, nil, + ) + + fakeAPI.Call("AddUnits", application.AddUnitsParams{ + ApplicationName: "apache2", + NumUnits: 1, + }).Returns([]string{"apache2/0"}, error(nil)) + + fakeAPI.Call("Offer", + "deadbeef-0bad-400d-8000-4b1d0d06f00d", + "apache2", + []string{"apache-website", "website-cache"}, + "my-offer", + "", + ).Returns([]params.ErrorResult{}, nil) + + fakeAPI.Call("Offer", + "deadbeef-0bad-400d-8000-4b1d0d06f00d", + "apache2", + []string{"apache-website"}, + "my-other-offer", + "", + ).Returns([]params.ErrorResult{}, nil) + + fakeAPI.Call("GrantOffer", + "admin", + "admin", + []string{"controller.my-offer"}, + ).Returns(errors.New(`cannot grant admin access to user admin on offer admin/controller.my-offer: user already has "admin" access or greater`)) + fakeAPI.Call("GrantOffer", + "bar", + "consume", + []string{"controller.my-offer"}, + ).Returns(nil) + + deploy := &DeployCommand{ + NewAPIRoot: func() (DeployAPI, error) { + return fakeAPI, nil + }, + } + + s.SetFeatureFlags(feature.CMRAwareBundles) + bundlePath := testcharms.RepoWithSeries("bionic").ClonedBundleDirPath(c.MkDir(), "apache2-with-offers") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), bundlePath) + c.Assert(err, jc.ErrorIsNil) + + var offerCallCount int + var grantOfferCallCount int + for _, call := range fakeAPI.Calls() { + switch call.FuncName { + case "Offer": + offerCallCount++ + case "GrantOffer": + grantOfferCallCount++ + } + } + c.Assert(offerCallCount, gc.Equals, 2) + c.Assert(grantOfferCallCount, gc.Equals, 2) +} + +func (s *DeploySuite) TestDeployBundleWithSAAS(c *gc.C) { + cfgAttrs := map[string]interface{}{ + "name": "name", + "uuid": "deadbeef-0bad-400d-8000-4b1d0d06f00d", + "type": "foo", + } + fakeAPI := vanillaFakeModelAPI(cfgAttrs) + withAllWatcher(fakeAPI) + + inURL := charm.MustParseURL("wordpress") + withCharmRepoResolvable(fakeAPI, inURL) + + withCharmDeployable( + fakeAPI, inURL, "bionic", + &charm.Meta{Name: "wordpress", Series: []string{"bionic"}}, + nil, false, false, 0, nil, nil, + ) + + mac, err := apitesting.NewMacaroon("id") + c.Assert(err, jc.ErrorIsNil) + + fakeAPI.Call("AddUnits", application.AddUnitsParams{ + ApplicationName: "wordpress", + NumUnits: 1, + }).Returns([]string{"wordpress/0"}, error(nil)) + + fakeAPI.Call("GetConsumeDetails", + "admin/default.mysql", + ).Returns(params.ConsumeOfferDetails{ + Offer: ¶ms.ApplicationOfferDetails{ + OfferName: "mysql", + OfferURL: "admin/default.mysql", + }, + Macaroon: mac, + ControllerInfo: ¶ms.ExternalControllerInfo{ + ControllerTag: coretesting.ControllerTag.String(), + Addrs: []string{"192.168.1.0"}, + Alias: "controller-alias", + CACert: coretesting.CACert, + }, + }, nil) + + fakeAPI.Call("Consume", + crossmodel.ConsumeApplicationArgs{ + Offer: params.ApplicationOfferDetails{ + OfferName: "mysql", + OfferURL: "test:admin/default.mysql", + }, + ApplicationAlias: "mysql", + Macaroon: mac, + ControllerInfo: &crossmodel.ControllerInfo{ + ControllerTag: coretesting.ControllerTag, + Alias: "controller-alias", + Addrs: []string{"192.168.1.0"}, + CACert: coretesting.CACert, + }, + }, + ).Returns("mysql", nil) + + fakeAPI.Call("AddRelation", + []interface{}{"wordpress:db", "mysql:db"}, []interface{}{}, + ).Returns( + ¶ms.AddRelationResults{}, + error(nil), + ) + + deploy := &DeployCommand{ + NewAPIRoot: func() (DeployAPI, error) { + return fakeAPI, nil + }, + } + + s.SetFeatureFlags(feature.CMRAwareBundles) + bundlePath := testcharms.RepoWithSeries("bionic").ClonedBundleDirPath(c.MkDir(), "wordpress-with-saas") + _, err = cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), bundlePath) + c.Assert(err, jc.ErrorIsNil) +} + type fakeProvider struct { caas.ContainerEnvironProvider } @@ -697,7 +968,7 @@ err = s.ControllerStore.SetModels("kontroll", otherModels) c.Assert(err, jc.ErrorIsNil) - repo := testcharms.RepoForSeries("kubernetes") + repo := testcharms.RepoWithSeries("kubernetes") ch := repo.ClonedDirPath(s.CharmsPath, "mariadb") err = runDeploy(c, ch, "-m", m.Name()) c.Assert(err, gc.ErrorMatches, "local charm missing OCI images for: [a-z]+_image, [a-z]+_image") @@ -743,7 +1014,7 @@ } func (s *DeploySuite) TestDeployStorageFailContainer(c *gc.C) { - ch := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") machine, err := s.State.AddMachine(version.SupportedLTS(), state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) container := "lxd:" + machine.Id() @@ -752,12 +1023,12 @@ } func (s *DeploySuite) TestPlacement(c *gc.C) { - ch := testcharms.Repo.ClonedDirPath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "dummy") // Add a machine that will be ignored due to placement directive. machine, err := s.State.AddMachine(version.SupportedLTS(), state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) - err = s.runDeploy(c, ch, "-n", "1", "--to", "valid", "--series", "quantal") + err = s.runDeploy(c, ch, "-n", "1", "--to", "valid", "--series", "bionic") c.Assert(err, jc.ErrorIsNil) svc, err := s.State.Application("dummy") @@ -777,13 +1048,13 @@ } func (s *DeploySuite) TestSubordinateConstraints(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "logging") - err := s.runDeploy(c, ch, "--constraints", "mem=1G", "--series", "quantal") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "logging") + err := s.runDeploy(c, ch, "--constraints", "mem=1G", "--series", "bionic") c.Assert(err, gc.ErrorMatches, "cannot use --constraints with subordinate application") } func (s *DeploySuite) TestNumUnits(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := s.runDeploy(c, ch, "-n", "13", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:trusty/multi-series-1") @@ -791,8 +1062,8 @@ } func (s *DeploySuite) TestNumUnitsSubordinate(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "logging") - err := s.runDeploy(c, "--num-units", "3", ch, "--series", "quantal") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "logging") + err := s.runDeploy(c, "--num-units", "3", ch, "--series", "bionic") c.Assert(err, gc.ErrorMatches, "cannot use --num-units or --to with subordinate application") _, err = s.State.Application("dummy") c.Assert(err, gc.ErrorMatches, `application "dummy" not found`) @@ -817,7 +1088,7 @@ } func (s *DeploySuite) TestForceMachine(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") machine, err := s.State.AddMachine(version.SupportedLTS(), state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) err = s.runDeploy(c, "--to", machine.Id(), ch, "portlandia", "--series", version.SupportedLTS()) @@ -826,13 +1097,13 @@ } func (s *DeploySuite) TestInvalidSeriesForModel(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") err := s.runDeploy(c, ch, "portlandia", "--series", "kubernetes") c.Assert(err, gc.ErrorMatches, `series "kubernetes" in a non container model not valid`) } func (s *DeploySuite) TestForceMachineExistingContainer(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") template := state.MachineTemplate{ Series: version.SupportedLTS(), Jobs: []state.MachineJob{state.JobHostUnits}, @@ -848,7 +1119,7 @@ } func (s *DeploySuite) TestForceMachineNewContainer(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") machine, err := s.State.AddMachine(version.SupportedLTS(), state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) err = s.runDeploy(c, "--to", "lxd:"+machine.Id(), ch, "portlandia", "--series", version.SupportedLTS()) @@ -869,8 +1140,8 @@ } func (s *DeploySuite) TestForceMachineNotFound(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") - err := s.runDeploy(c, "--to", "42", ch, "portlandia", "--series", "precise") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") + err := s.runDeploy(c, "--to", "42", ch, "portlandia", "--series", "bionic") c.Assert(err, gc.ErrorMatches, `cannot deploy "portlandia" to machine 42: machine 42 not found`) _, err = s.State.Application("portlandia") c.Assert(err, gc.ErrorMatches, `application "portlandia" not found`) @@ -879,8 +1150,8 @@ func (s *DeploySuite) TestForceMachineSubordinate(c *gc.C) { machine, err := s.State.AddMachine(version.SupportedLTS(), state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "logging") - err = s.runDeploy(c, "--to", machine.Id(), ch, "--series", "quantal") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "logging") + err = s.runDeploy(c, "--to", machine.Id(), ch, "--series", "bionic") c.Assert(err, gc.ErrorMatches, "cannot use --num-units or --to with subordinate application") _, err = s.State.Application("dummy") @@ -893,7 +1164,7 @@ } func (s *DeploySuite) TestDeployLocalWithTerms(c *gc.C) { - ch := testcharms.Repo.ClonedDirPath(s.CharmsPath, "terms1") + ch := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "terms1") _, stdErr, err := s.runDeployWithOutput(c, ch, "--series", "trusty") c.Assert(err, jc.ErrorIsNil) @@ -910,7 +1181,7 @@ c.Assert(command.flagSet, jc.DeepEquals, flagSet) // Add to the slice below if a new flag is introduced which is valid for // both charms and bundles. - charmAndBundleFlags := []string{"channel", "storage", "device"} + charmAndBundleFlags := []string{"channel", "storage", "device", "force", "trust"} var allFlags []string flagSet.VisitAll(func(flag *gnuflag.Flag) { allFlags = append(allFlags, flag.Name) @@ -922,16 +1193,73 @@ c.Assert(declaredFlags, jc.DeepEquals, allFlags) } +func (s *DeploySuite) TestDeployLocalWithSeriesMismatchReturnsError(c *gc.C) { + ch := testcharms.RepoWithSeries("quantal").ClonedDirPath(s.CharmsPath, "terms1") + _, _, err := s.runDeployWithOutput(c, ch, "--series", "quantal") + + c.Check(err, gc.ErrorMatches, `terms1 is not available on the following series: quantal not supported`) +} + +func (s *DeploySuite) TestDeployLocalWithSeriesAndForce(c *gc.C) { + ch := testcharms.RepoWithSeries("quantal").ClonedDirPath(s.CharmsPath, "terms1") + _, stdErr, err := s.runDeployWithOutput(c, ch, "--series", "quantal", "--force") + + c.Assert(err, jc.ErrorIsNil) + c.Check(stdErr, gc.Equals, `Deploying charm "local:quantal/terms1-1".`) + + curl := charm.MustParseURL("local:quantal/terms1-1") + s.AssertApplication(c, "terms1", curl, 1, 0) +} + +func (s *DeploySuite) setupNonESMSeries(c *gc.C) (string, string) { + supported := set.NewStrings(series.SupportedJujuSeries()...) + // Allowing kubernetes as an option, can lead to an unrelated failure: + // series "kubernetes" in a non container model not valid + supported.Remove("kubernetes") + supportedNotEMS := supported.Difference(set.NewStrings(series.ESMSupportedJujuSeries()...)) + c.Assert(supportedNotEMS.Size(), jc.GreaterThan, 0) + + s.PatchValue(&supportedJujuSeries, func() []string { + return supported.Values() + }) + + nonEMSSeries := supportedNotEMS.Values()[0] + + loggingPath := testcharms.RepoWithSeries("bionic").RenamedClonedDirPath(s.CharmsPath, "logging", "series-logging") + metadataPath := filepath.Join(loggingPath, "metadata.yaml") + file, err := os.OpenFile(metadataPath, os.O_TRUNC|os.O_RDWR, 0666) + if err != nil { + c.Fatal(errors.Annotate(err, "cannot open metadata.yaml")) + } + defer file.Close() + + // Overwrite the metadata.yaml to contain a non EMS series. + newMetadata := strings.Join([]string{`name: logging`, `summary: ""`, `description: ""`, `series: `, ` - ` + nonEMSSeries, ` - artful`}, "\n") + if _, err := file.WriteString(newMetadata); err != nil { + c.Fatal("cannot write to metadata.yaml") + } + + return nonEMSSeries, loggingPath +} + +func (s *DeploySuite) TestDeployLocalWithSupportedNonESMSeries(c *gc.C) { + nonEMSSeries, loggingPath := s.setupNonESMSeries(c) + _, _, err := s.runDeployWithOutput(c, loggingPath, "--series", nonEMSSeries) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *DeploySuite) TestDeployLocalWithNotSupportedNonESMSeries(c *gc.C) { + _, loggingPath := s.setupNonESMSeries(c) + _, _, err := s.runDeployWithOutput(c, loggingPath, "--series", "artful") + c.Assert(err, gc.ErrorMatches, "logging is not available on the following series: artful not supported") +} + type DeployLocalSuite struct { testing.RepoSuite } var _ = gc.Suite(&DeployLocalSuite{}) -func (s *DeployLocalSuite) SetUpTest(c *gc.C) { - s.RepoSuite.SetUpTest(c) -} - // setupConfigFile creates a configuration file for testing set // with the --config argument specifying a configuration file. func setupConfigFile(c *gc.C, dir string) string { @@ -957,6 +1285,10 @@ func (s *charmstoreSuite) SetUpTest(c *gc.C) { s.JujuConnSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) + repo := jjcharmstore.NewRepository() client := jjcharmstore.NewFakeClient(repo).WithChannel(csparams.StableChannel) s.charmrepo = repo @@ -1112,8 +1444,8 @@ func (s *DeployCharmStoreSuite) TestDeployAuthorization(c *gc.C) { // Upload the two charms required to upload the bundle. - testcharms.UploadCharm(c, s.client, "trusty/mysql-0", "mysql") - testcharms.UploadCharm(c, s.client, "trusty/wordpress-1", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/mysql-0", "mysql", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/wordpress-1", "wordpress", "bionic") // Run the tests. for i, test := range deployAuthorizationTests { @@ -1122,9 +1454,9 @@ // Upload the charm or bundle under test. url := charm.MustParseURL(test.uploadURL) if url.Series == "bundle" { - url, _ = testcharms.UploadBundle(c, s.client, test.uploadURL, "wordpress-simple") + url, _ = testcharms.UploadBundleWithSeries(c, s.client, test.uploadURL, "wordpress-simple", "bionic") } else { - url, _ = testcharms.UploadCharm(c, s.client, test.uploadURL, "wordpress") + url, _ = testcharms.UploadCharmWithSeries(c, s.client, test.uploadURL, "wordpress", "bionic") } // Change the ACL of the uploaded entity if required in this case. @@ -1140,8 +1472,88 @@ } } +var deployAuthorizationErrorTests = []struct { + about string + uploadURL string + deployURL string + readPermUser string + expectError string + expectOutput string +}{{ + about: "public charm, success", + uploadURL: "cs:~bob/quantal/wordpress1-10", + deployURL: "cs:~bob/quantal/wordpress1", + expectError: "wordpress1 is not available on the following series: quantal not supported", +}, { + about: "public charm, fully resolved, success", + uploadURL: "cs:~bob/quantal/wordpress2-10", + deployURL: "cs:~bob/quantal/wordpress2-10", + expectError: "wordpress2 is not available on the following series: quantal not supported", +}, { + about: "non-public charm, success", + uploadURL: "cs:~bob/quantal/wordpress3-10", + deployURL: "cs:~bob/quantal/wordpress3", + readPermUser: clientUserName, + expectError: "wordpress3 is not available on the following series: quantal not supported", +}, { + about: "non-public charm, fully resolved, success", + uploadURL: "cs:~bob/quantal/wordpress4-10", + deployURL: "cs:~bob/quantal/wordpress4-10", + readPermUser: clientUserName, + expectError: "wordpress4 is not available on the following series: quantal not supported", +}, { + about: "non-public charm, access denied", + uploadURL: "cs:~bob/trusty/wordpress5-10", + deployURL: "cs:~bob/trusty/wordpress5", + readPermUser: "bob", + expectError: `cannot resolve (charm )?URL "cs:~bob/trusty/wordpress5": cannot get "/~bob/trusty/wordpress5/meta/any\?include=id&include=supported-series&include=published": access denied for user "client-username"`, +}, { + about: "non-public charm, fully resolved, access denied", + uploadURL: "cs:~bob/trusty/wordpress6-47", + deployURL: "cs:~bob/trusty/wordpress6-47", + readPermUser: "bob", + expectError: `cannot resolve charm URL "cs:~bob/trusty/wordpress6-47": cannot get "/~bob/trusty/wordpress6-47/meta/any\?include=id&include=supported-series&include=published": access denied for user "client-username"`, +}, { + about: "public bundle, success", + uploadURL: "cs:~bob/bundle/wordpress-simple1-42", + deployURL: "cs:~bob/bundle/wordpress-simple1", + expectError: "cannot deploy bundle: mysql is not available on the following series: quantal not supported", +}, { + about: "non-public bundle, success", + uploadURL: "cs:~bob/bundle/wordpress-simple2-0", + deployURL: "cs:~bob/bundle/wordpress-simple2-0", + readPermUser: clientUserName, + expectError: "cannot deploy bundle: mysql is not available on the following series: quantal not supported", +}} + +func (s *DeployCharmStoreSuite) TestDeployAuthorizationWithSeriesReturnsError(c *gc.C) { + // Upload the two charms required to upload the bundle. + testcharms.UploadCharmWithSeries(c, s.client, "quantal/mysql-0", "mysql", "quantal") + testcharms.UploadCharmWithSeries(c, s.client, "quantal/wordpress-1", "wordpress", "quantal") + + // Run the tests. + for i, test := range deployAuthorizationErrorTests { + c.Logf("test %d: %s", i, test.about) + + // Upload the charm or bundle under test. + url := charm.MustParseURL(test.uploadURL) + if url.Series == "bundle" { + url, _ = testcharms.UploadBundleWithSeries(c, s.client, test.uploadURL, "wordpress-simple", "quantal") + } else { + url, _ = testcharms.UploadCharmWithSeries(c, s.client, test.uploadURL, "wordpress", "quantal") + } + + // Change the ACL of the uploaded entity if required in this case. + if test.readPermUser != "" { + s.changeReadPerm(c, url, test.readPermUser) + } + err := runDeploy(c, test.deployURL, fmt.Sprintf("wordpress%d", i)) + c.Check(err, gc.ErrorMatches, test.expectError) + } +} + func (s *DeployCharmStoreSuite) TestDeployWithTermsSuccess(c *gc.C) { - _, ch := testcharms.UploadCharm(c, s.client, "trusty/terms1-1", "terms1") + _, ch := testcharms.UploadCharmWithSeries(c, s.client, "trusty/terms1-1", "terms1", "bionic") _, stdErr, err := runDeployWithOutput(c, "trusty/terms1") c.Assert(err, jc.ErrorIsNil) expectedOutput := ` @@ -1163,15 +1575,15 @@ Message: "term agreement required: term/1 term/2", Code: "term agreement required", } - testcharms.UploadCharm(c, s.client, "quantal/terms1-1", "terms1") - err := runDeploy(c, "quantal/terms1") + testcharms.UploadCharmWithSeries(c, s.client, "bionic/terms1-1", "terms1", "bionic") + err := runDeploy(c, "bionic/terms1") expectedError := `Declined: some terms require agreement. Try: "juju agree term/1 term/2"` c.Assert(err, gc.ErrorMatches, expectedError) } func (s *DeployCharmStoreSuite) TestDeployWithChannel(c *gc.C) { - ch := testcharms.Repo.CharmArchive(c.MkDir(), "wordpress") - id := charm.MustParseURL("cs:~client-username/precise/wordpress-0") + ch := testcharms.RepoWithSeries("bionic").CharmArchive(c.MkDir(), "wordpress") + id := charm.MustParseURL("cs:~client-username/bionic/wordpress-0") err := s.client.UploadCharmWithRevision(id, ch, -1) c.Assert(err, gc.IsNil) @@ -1180,9 +1592,9 @@ err = runDeploy(c, "--channel", "edge", "~client-username/wordpress") c.Assert(err, gc.IsNil) - s.assertCharmsUploaded(c, "cs:~client-username/precise/wordpress-0") + s.assertCharmsUploaded(c, "cs:~client-username/bionic/wordpress-0") s.assertApplicationsDeployed(c, map[string]applicationInfo{ - "wordpress": {charm: "cs:~client-username/precise/wordpress-0", config: ch.Config().DefaultSettings()}, + "wordpress": {charm: "cs:~client-username/bionic/wordpress-0", config: ch.Config().DefaultSettings()}, }) } @@ -1277,6 +1689,10 @@ s.JujuConnSuite.ControllerConfigAttrs[controller.CharmStoreURL] = s.srv.URL s.JujuConnSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) + // Initialize the charm cache dir. s.PatchValue(&charmrepo.CacheDir, c.MkDir()) @@ -1429,18 +1845,18 @@ server := httptest.NewServer(handler) defer server.Close() - testcharms.UploadCharm(c, s.client, "cs:quantal/metered-1", "metered") - charmDir := testcharms.Repo.CharmDir("metered") + testcharms.UploadCharmWithSeries(c, s.client, "cs:bionic/metered-1", "metered", "bionic") + charmDir := testcharms.RepoWithSeries("bionic").CharmDir("metered") cfgAttrs := map[string]interface{}{ "name": "name", "uuid": "deadbeef-0bad-400d-8000-4b1d0d06f00d", "type": "foo", } - meteredURL := charm.MustParseURL("cs:quantal/metered-1") + meteredURL := charm.MustParseURL("cs:bionic/metered-1") fakeAPI := vanillaFakeModelAPI(cfgAttrs) fakeAPI.planURL = server.URL - withCharmDeployable(fakeAPI, meteredURL, "quantal", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) + withCharmDeployable(fakeAPI, meteredURL, "bionic", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) withCharmRepoResolvable(fakeAPI, meteredURL) // `"hello registration"\n` (quotes and newline from json @@ -1455,7 +1871,7 @@ return fakeAPI, nil }, } - _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:quantal/metered-1", "--plan", "someplan") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:bionic/metered-1", "--plan", "someplan") c.Assert(err, jc.ErrorIsNil) c.Check(setMetricCredentialsCall(), gc.Equals, 1) @@ -1463,7 +1879,7 @@ stub.CheckCalls(c, []jujutesting.StubCall{{ "Authorize", []interface{}{metricRegistrationPost{ ModelUUID: "deadbeef-0bad-400d-8000-4b1d0d06f00d", - CharmURL: "cs:quantal/metered-1", + CharmURL: "cs:bionic/metered-1", ApplicationName: "metered", PlanURL: "someplan", IncreaseBudget: 0, @@ -1477,18 +1893,18 @@ server := httptest.NewServer(handler) defer server.Close() - testcharms.UploadCharm(c, s.client, "cs:quantal/metered-1", "metered") - charmDir := testcharms.Repo.CharmDir("metered") + testcharms.UploadCharmWithSeries(c, s.client, "cs:bionic/metered-1", "metered", "bionic") + charmDir := testcharms.RepoWithSeries("bionic").CharmDir("metered") cfgAttrs := map[string]interface{}{ "name": "name", "uuid": "deadbeef-0bad-400d-8000-4b1d0d06f00d", "type": "foo", } - meteredURL := charm.MustParseURL("cs:quantal/metered-1") + meteredURL := charm.MustParseURL("cs:bionic/metered-1") fakeAPI := vanillaFakeModelAPI(cfgAttrs) fakeAPI.planURL = server.URL - withCharmDeployable(fakeAPI, meteredURL, "quantal", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) + withCharmDeployable(fakeAPI, meteredURL, "bionic", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) withCharmRepoResolvable(fakeAPI, meteredURL) creds := append([]byte(`"aGVsbG8gcmVnaXN0cmF0aW9u"`), 0xA) @@ -1500,16 +1916,16 @@ return fakeAPI, nil }, } - _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:quantal/metered-1") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:bionic/metered-1") c.Assert(err, jc.ErrorIsNil) c.Check(setMetricCredentialsCall(), gc.Equals, 1) stub.CheckCalls(c, []jujutesting.StubCall{{ - "DefaultPlan", []interface{}{"cs:quantal/metered-1"}, + "DefaultPlan", []interface{}{"cs:bionic/metered-1"}, }, { "Authorize", []interface{}{metricRegistrationPost{ ModelUUID: "deadbeef-0bad-400d-8000-4b1d0d06f00d", - CharmURL: "cs:quantal/metered-1", + CharmURL: "cs:bionic/metered-1", ApplicationName: "metered", PlanURL: "thisplan", IncreaseBudget: 0, @@ -1518,8 +1934,8 @@ } func (s *DeployCharmStoreSuite) TestSetMetricCredentialsNotCalledForUnmeteredCharm(c *gc.C) { - charmDir := testcharms.Repo.CharmDir("dummy") - testcharms.UploadCharm(c, s.client, "cs:quantal/dummy-1", "dummy") + charmDir := testcharms.RepoWithSeries("bionic").CharmDir("dummy") + testcharms.UploadCharmWithSeries(c, s.client, "cs:bionic/dummy-1", "dummy", "bionic") cfgAttrs := map[string]interface{}{ "name": "name", @@ -1528,9 +1944,9 @@ } fakeAPI := vanillaFakeModelAPI(cfgAttrs) - charmURL := charm.MustParseURL("cs:quantal/dummy-1") + charmURL := charm.MustParseURL("cs:bionic/dummy-1") withCharmRepoResolvable(fakeAPI, charmURL) - withCharmDeployable(fakeAPI, charmURL, "quantal", charmDir.Meta(), charmDir.Metrics(), false, false, 1, nil, nil) + withCharmDeployable(fakeAPI, charmURL, "bionic", charmDir.Meta(), charmDir.Metrics(), false, false, 1, nil, nil) deploy := &DeployCommand{ Steps: []DeployStep{&RegisterMeteredCharm{}}, @@ -1539,7 +1955,7 @@ }, } - _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:quantal/dummy-1") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:bionic/dummy-1") c.Assert(err, jc.ErrorIsNil) for _, call := range fakeAPI.Calls() { @@ -1563,7 +1979,7 @@ description: metered charm summary: summary ` - url, ch := testcharms.UploadCharmWithMeta(c, s.client, "cs:~user/quantal/metered", meteredMetaYAML, metricsYAML, 1) + url, ch := testcharms.UploadCharmWithMeta(c, s.client, "cs:~user/bionic/metered", meteredMetaYAML, metricsYAML, 1) cfgAttrs := map[string]interface{}{ "name": "name", @@ -1572,7 +1988,7 @@ } fakeAPI := vanillaFakeModelAPI(cfgAttrs) withCharmRepoResolvable(fakeAPI, url) - withCharmDeployable(fakeAPI, url, "quantal", ch.Meta(), ch.Metrics(), true, false, 1, nil, nil) + withCharmDeployable(fakeAPI, url, "bionic", ch.Meta(), ch.Metrics(), true, false, 1, nil, nil) stub := &jujutesting.Stub{} handler := &testMetricsRegistrationHandler{Stub: stub} @@ -1604,7 +2020,7 @@ description: metered charm summary: summary ` - url, ch := testcharms.UploadCharmWithMeta(c, s.client, "cs:~user/quantal/metered", meteredMetaYAML, metricsYAML, 1) + url, ch := testcharms.UploadCharmWithMeta(c, s.client, "cs:~user/bionic/metered", meteredMetaYAML, metricsYAML, 1) stub := &jujutesting.Stub{} handler := &testMetricsRegistrationHandler{Stub: stub} @@ -1619,7 +2035,7 @@ fakeAPI := vanillaFakeModelAPI(cfgAttrs) fakeAPI.planURL = server.URL withCharmRepoResolvable(fakeAPI, url) - withCharmDeployable(fakeAPI, url, "quantal", ch.Meta(), ch.Metrics(), true, false, 1, nil, nil) + withCharmDeployable(fakeAPI, url, "bionic", ch.Meta(), ch.Metrics(), true, false, 1, nil, nil) deploy := &DeployCommand{ Steps: []DeployStep{&RegisterMeteredCharm{PlanURL: server.URL}}, @@ -1633,7 +2049,7 @@ stub.CheckCalls(c, []jujutesting.StubCall{{ "Authorize", []interface{}{metricRegistrationPost{ ModelUUID: "deadbeef-0bad-400d-8000-4b1d0d06f00d", - CharmURL: "cs:~user/quantal/metered-0", + CharmURL: "cs:~user/bionic/metered-0", ApplicationName: "metered", PlanURL: "someplan", IncreaseBudget: 0, @@ -1647,11 +2063,11 @@ _, err = s.State.AddSpace("public", "", nil, false) c.Assert(err, jc.ErrorIsNil) - _, ch := testcharms.UploadCharm(c, s.client, "cs:quantal/wordpress-extra-bindings-1", "wordpress-extra-bindings") - err = runDeploy(c, "cs:quantal/wordpress-extra-bindings-1", "--bind", "db=db db-client=db public admin-api=public") + _, ch := testcharms.UploadCharmWithSeries(c, s.client, "cs:bionic/wordpress-extra-bindings-1", "wordpress-extra-bindings", "bionic") + err = runDeploy(c, "cs:bionic/wordpress-extra-bindings-1", "--bind", "db=db db-client=db public admin-api=public") c.Assert(err, jc.ErrorIsNil) s.assertApplicationsDeployed(c, map[string]applicationInfo{ - "wordpress-extra-bindings": {charm: "cs:quantal/wordpress-extra-bindings-1", config: ch.Config().DefaultSettings()}, + "wordpress-extra-bindings": {charm: "cs:bionic/wordpress-extra-bindings-1", config: ch.Config().DefaultSettings()}, }) s.assertDeployedApplicationBindings(c, map[string]applicationInfo{ "wordpress-extra-bindings": { @@ -1677,9 +2093,9 @@ server := httptest.NewServer(handler) defer server.Close() - meteredCharmURL := charm.MustParseURL("cs:quantal/metered-1") - testcharms.UploadCharm(c, s.client, meteredCharmURL.String(), "metered") - charmDir := testcharms.Repo.CharmDir("metered") + meteredCharmURL := charm.MustParseURL("cs:bionic/metered-1") + testcharms.UploadCharmWithSeries(c, s.client, meteredCharmURL.String(), "metered", "bionic") + charmDir := testcharms.RepoWithSeries("bionic").CharmDir("metered") cfgAttrs := map[string]interface{}{ "name": "name", @@ -1689,7 +2105,7 @@ fakeAPI := vanillaFakeModelAPI(cfgAttrs) fakeAPI.planURL = server.URL withCharmRepoResolvable(fakeAPI, meteredCharmURL) - withCharmDeployable(fakeAPI, meteredCharmURL, "quantal", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) + withCharmDeployable(fakeAPI, meteredCharmURL, "bionic", charmDir.Meta(), charmDir.Metrics(), true, false, 1, nil, nil) // `"hello registration"\n` (quotes and newline from json // encoding) is returned by the fake http server. This is binary64 @@ -1703,7 +2119,7 @@ return fakeAPI, nil }, } - _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:quantal/metered-1", "--plan", "someplan") + _, err := cmdtesting.RunCommand(c, modelcmd.Wrap(deploy), "cs:bionic/metered-1", "--plan", "someplan") c.Check(err, gc.ErrorMatches, "IsMetered") } @@ -1834,6 +2250,9 @@ func (s *DeployUnitTestSuite) SetUpTest(c *gc.C) { s.IsolationSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) cookiesFile := filepath.Join(c.MkDir(), ".go-cookies") s.PatchEnvironment("JUJU_COOKIEFILE", cookiesFile) } @@ -1852,7 +2271,7 @@ func (s *DeployUnitTestSuite) makeCharmDir(c *gc.C, cloneCharm string) *charm.CharmDir { charmsPath := c.MkDir() - return testcharms.Repo.ClonedDir(charmsPath, cloneCharm) + return testcharms.RepoWithSeries("bionic").ClonedDir(charmsPath, cloneCharm) } func (s *DeployUnitTestSuite) runDeploy(c *gc.C, fakeAPI *fakeDeployAPI, args ...string) (*cmd.Context, error) { @@ -1865,7 +2284,7 @@ func (s *DeployUnitTestSuite) TestDeployApplicationConfig(c *gc.C) { charmsPath := c.MkDir() - charmDir := testcharms.Repo.ClonedDir(charmsPath, "dummy") + charmDir := testcharms.RepoWithSeries("bionic").ClonedDir(charmsPath, "dummy") fakeAPI := vanillaFakeModelAPI(map[string]interface{}{ "name": "name", @@ -1957,7 +2376,7 @@ } func (s *DeployUnitTestSuite) TestDeployBundle_OutputsCorrectMessage(c *gc.C) { - bundleDir := testcharms.Repo.BundleArchive(c.MkDir(), "wordpress-simple") + bundleDir := testcharms.RepoWithSeries("bionic").BundleArchive(c.MkDir(), "wordpress-simple") fakeAPI := s.fakeAPI() withAllWatcher(fakeAPI) @@ -1971,8 +2390,8 @@ withCharmDeployable( fakeAPI, mysqlURL, - "quantal", - &charm.Meta{Series: []string{"quantal"}}, + "bionic", + &charm.Meta{Series: []string{"bionic"}}, &charm.Metrics{}, false, false, @@ -1990,8 +2409,8 @@ withCharmDeployable( fakeAPI, wordpressURL, - "quantal", - &charm.Meta{Series: []string{"quantal"}}, + "bionic", + &charm.Meta{Series: []string{"bionic"}}, &charm.Metrics{}, false, false, @@ -2049,7 +2468,7 @@ func (s *DeployUnitTestSuite) TestDeployAttachStorage(c *gc.C) { charmsPath := c.MkDir() - charmDir := testcharms.Repo.ClonedDir(charmsPath, "dummy") + charmDir := testcharms.RepoWithSeries("bionic").ClonedDir(charmsPath, "dummy") fakeAPI := vanillaFakeModelAPI(map[string]interface{}{ "name": "name", @@ -2074,7 +2493,7 @@ func (s *DeployUnitTestSuite) TestDeployAttachStorageFailContainer(c *gc.C) { charmsPath := c.MkDir() - charmDir := testcharms.Repo.ClonedDir(charmsPath, "dummy") + charmDir := testcharms.RepoWithSeries("bionic").ClonedDir(charmsPath, "dummy") fakeAPI := vanillaFakeModelAPI(map[string]interface{}{ "name": "name", @@ -2098,7 +2517,7 @@ func (s *DeployUnitTestSuite) TestDeployAttachStorageNotSupported(c *gc.C) { charmsPath := c.MkDir() - charmDir := testcharms.Repo.ClonedDir(charmsPath, "dummy") + charmDir := testcharms.RepoWithSeries("bionic").ClonedDir(charmsPath, "dummy") fakeAPI := vanillaFakeModelAPI(map[string]interface{}{ "name": "name", @@ -2295,6 +2714,26 @@ }, nil } +func (f *fakeDeployAPI) Offer(modelUUID, application string, endpoints []string, offerName, descr string) ([]params.ErrorResult, error) { + results := f.MethodCall(f, "Offer", modelUUID, application, endpoints, offerName, descr) + return results[0].([]params.ErrorResult), jujutesting.TypeAssertError(results[1]) +} + +func (f *fakeDeployAPI) GetConsumeDetails(offerURL string) (params.ConsumeOfferDetails, error) { + results := f.MethodCall(f, "GetConsumeDetails", offerURL) + return results[0].(params.ConsumeOfferDetails), jujutesting.TypeAssertError(results[1]) +} + +func (f *fakeDeployAPI) Consume(arg crossmodel.ConsumeApplicationArgs) (string, error) { + results := f.MethodCall(f, "Consume", arg) + return results[0].(string), jujutesting.TypeAssertError(results[1]) +} + +func (f *fakeDeployAPI) GrantOffer(user, access string, offerURLs ...string) error { + res := f.MethodCall(f, "GrantOffer", user, access, offerURLs) + return jujutesting.TypeAssertError(res[0]) +} + func stringToInterface(args []string) []interface{} { interfaceArgs := make([]interface{}, len(args)) for i, a := range args { @@ -2369,7 +2808,7 @@ fakeAPI.Call("ResolveWithChannel", url).Returns( url, csclientparams.Channel(""), - []string{"quantal"}, // Supported series + []string{"bionic"}, // Supported series error(nil), ) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/export_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/romulus" + gc "gopkg.in/check.v1" "gopkg.in/juju/charmrepo.v3" "gopkg.in/juju/charmrepo.v3/csclient" "gopkg.in/juju/charmrepo.v3/csclient/params" @@ -19,6 +20,7 @@ "github.com/juju/juju/api/modelconfig" "github.com/juju/juju/charmstore" "github.com/juju/juju/cmd/modelcmd" + jujutesting "github.com/juju/juju/juju/testing" "github.com/juju/juju/jujuclient" "github.com/juju/juju/resource/resourceadapters" "github.com/juju/juju/testcharms" @@ -288,3 +290,29 @@ client := c.Client.WithChannel(channel) return charmstoreClientToTestcharmsClientShim{client} } + +// RepoSuiteBaseSuite allows the patching of the supported juju suite for +// each test. +type RepoSuiteBaseSuite struct { + jujutesting.RepoSuite +} + +func (s *RepoSuiteBaseSuite) SetUpTest(c *gc.C) { + s.RepoSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) +} + +// JujuConnBaseSuite allows the patching of the supported juju suite for +// each test. +type JujuConnBaseSuite struct { + jujutesting.JujuConnSuite +} + +func (s *JujuConnBaseSuite) SetUpTest(c *gc.C) { + s.JujuConnSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/mocks/deploystepapi_mock.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/mocks/deploystepapi_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/mocks/deploystepapi_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/mocks/deploystepapi_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,9 +5,8 @@ package mocks import ( - reflect "reflect" - gomock "github.com/golang/mock/gomock" + reflect "reflect" ) // MockDeployStepAPI is a mock of DeployStepAPI interface diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/removeapplication.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/removeapplication.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/removeapplication.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/removeapplication.go 2019-06-28 17:10:43.000000000 +0000 @@ -239,8 +239,12 @@ for i, name := range c.ApplicationNames { result := results[i] if result.Error != nil { - ctx.Infof("removing application %s failed: %s", name, result.Error) anyFailed = true + err := result.Error.Error() + if params.IsCodeNotSupported(result.Error) { + err = errors.New("another user was updating application; please try again").Error() + } + ctx.Infof("removing application %s failed: %s", name, err) continue } ctx.Infof("removing application %s", name) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/remove_application_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/remove_application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/remove_application_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/remove_application_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,11 +6,13 @@ import ( "github.com/juju/cmd" "github.com/juju/cmd/cmdtesting" + "github.com/juju/errors" jujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" apiapplication "github.com/juju/juju/api/application" + "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/cmd/juju/application" "github.com/juju/juju/jujuclient" @@ -64,6 +66,58 @@ c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") s.api.CheckCallNames(c, "DestroyApplications", "Close") } + +func (s *RemoveApplicationCmdSuite) setupRace(c *gc.C, raceyApplications []string) { + s.api.destroyApplications = func(args apiapplication.DestroyApplicationsParams) ([]params.DestroyApplicationResult, error) { + results := make([]params.DestroyApplicationResult, len(args.Applications)) + for i, app := range args.Applications { + results[i].Info = ¶ms.DestroyApplicationInfo{} + for _, poison := range raceyApplications { + if app == poison { + err := errors.NewNotSupported(nil, "change detected") + results[i].Error = common.ServerError(err) + } + } + } + return results, nil + } +} + +func (s *RemoveApplicationCmdSuite) TestHandlingNotSupportedDoesNotAffectBaseCase(c *gc.C) { + s.setupRace(c, []string{"do-not-remove"}) + + ctx, err := s.runRemoveApplication(c, []string{"real-app"}...) + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, "removing application real-app\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") + s.api.CheckCallNames(c, "DestroyApplications", "Close") +} + +func (s *RemoveApplicationCmdSuite) TestHandlingNotSupported(c *gc.C) { + s.setupRace(c, []string{"do-not-remove"}) + + ctx, err := s.runRemoveApplication(c, []string{"do-not-remove"}...) + c.Assert(err, gc.Equals, cmd.ErrSilent) + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, ""+ + "removing application do-not-remove failed: "+ + "another user was updating application; please try again\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") + s.api.CheckCallNames(c, "DestroyApplications", "Close") +} + +func (s *RemoveApplicationCmdSuite) TestHandlingNotSupportedMultipleApps(c *gc.C) { + s.setupRace(c, []string{"do-not-remove"}) + + ctx, err := s.runRemoveApplication(c, []string{"real-app", "do-not-remove", "another"}...) + c.Assert(err, gc.Equals, cmd.ErrSilent) + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, ""+ + "removing application real-app\n"+ + "removing application do-not-remove failed: "+ + "another user was updating application; please try again\n"+ + "removing application another\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") + s.api.CheckCallNames(c, "DestroyApplications", "Close") +} type testApplicationRemoveUnitAPI struct { *jujutesting.Stub diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/removeapplication_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/removeapplication_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/removeapplication_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/removeapplication_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -44,7 +44,7 @@ func (s *RemoveApplicationSuite) setupTestApplication(c *gc.C) { // Destroy an application that exists. - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := runDeploy(c, ch, "multi-series") c.Assert(err, jc.ErrorIsNil) } @@ -69,7 +69,7 @@ } func (s *RemoveApplicationSuite) testStorageRemoval(c *gc.C, destroy bool) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "storage-filesystem-multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "storage-filesystem-multi-series") err := runDeploy(c, ch, "storage-filesystem-multi-series", "-n2", "--storage", "data=2,modelscoped") c.Assert(err, jc.ErrorIsNil) @@ -100,7 +100,7 @@ } func (s *RemoveApplicationSuite) TestRemoveLocalMetered(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "metered-multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "metered-multi-series") deploy := NewDeployCommand() _, err := cmdtesting.RunCommand(c, deploy, ch) c.Assert(err, jc.ErrorIsNil) @@ -146,6 +146,7 @@ c.Assert(err, gc.ErrorMatches, `--no-wait without --force not valid`) } +//TODO(tsm) remove unused RemoveCharmStoreCharmsSuite type RemoveCharmStoreCharmsSuite struct { legacyCharmStoreSuite ctx *cmd.Context @@ -158,7 +159,7 @@ s.ctx = cmdtesting.Context(c) - testcharms.UploadCharm(c, s.client, "cs:quantal/metered-1", "metered") + testcharms.UploadCharmWithSeries(c, s.client, "cs:quantal/metered-1", "metered", "bionic") deployCmd := &DeployCommand{} cmd := modelcmd.Wrap(deployCmd) deployCmd.NewAPIRoot = func() (DeployAPI, error) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/scaleapplication.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/scaleapplication.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/scaleapplication.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/scaleapplication.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/juju/api/application" "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" ) @@ -104,7 +105,8 @@ Scale: c.scale, }) if err != nil { - return errors.Trace(err) + return block.ProcessBlockedError(errors.Annotatef(err, "could not scale application %q", c.applicationName), block.BlockChange) + } if err := result.Error; err != nil { return err diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/scaleapplication_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/scaleapplication_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/scaleapplication_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/scaleapplication_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -72,6 +72,13 @@ c.Assert(out, gc.Equals, `foo scaled to 2 units`) } +func (s *ScaleApplicationSuite) TestScaleApplicationBlocked(c *gc.C) { + s.mockAPI.SetErrors(¶ms.Error{Code: params.CodeOperationBlocked, Message: "nope"}) + _, err := s.runScaleApplication(c, "foo", "2") + c.Assert(err.Error(), jc.Contains, `could not scale application "foo": nope`) + c.Assert(err.Error(), jc.Contains, `All operations that change model have been disabled for the current model.`) +} + func (s *ScaleApplicationSuite) TestScaleApplicationWrongModel(c *gc.C) { store := jujuclienttesting.MinimalStore() _, err := cmdtesting.RunCommand(c, NewScaleCommandForTest(s.mockAPI, store), "foo", "2") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/series_selector.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/series_selector.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/series_selector.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/series_selector.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "gopkg.in/juju/charm.v6" + "github.com/juju/errors" "github.com/juju/juju/juju/version" ) @@ -39,6 +40,8 @@ conf modelConfig // supportedSeries is the list of series the charm supports. supportedSeries []string + // supportedJujuSeries is the list of series that juju supports. + supportedJujuSeries []string // force indicates the user explicitly wants to deploy to a requested // series, regardless of whether the charm says it supports that series. force bool @@ -69,14 +72,33 @@ // Use model default series, if explicitly set and supported by the charm. if defaultSeries, explicit := s.conf.DefaultSeries(); explicit { if _, err := charm.SeriesForCharm(defaultSeries, s.supportedSeries); err == nil { + // validate the series we get from the charm + if err := s.validateSeries(defaultSeries); err != nil { + return "", err + } logger.Infof(msgDefaultModelSeries, defaultSeries) return defaultSeries, nil } } // Use the charm's perferred series, if it has one. In a multi-series - // charm, the first series in the list is the preferred one. - defaultSeries, err := charm.SeriesForCharm("", s.supportedSeries) + // charm, go through and check the series list and drop the first series + // if they're no longer supported. + supported := make(map[string]struct{}, len(s.supportedJujuSeries)) + for _, v := range s.supportedJujuSeries { + supported[v] = struct{}{} + } + + // we want to preseve the order of the supported series from the charm + // metadata, so the order could be out of order ubuntu series order. + // i.e. precise, xenial, bionic, trusty + var supportedSeries []string + for _, charmSeries := range s.supportedSeries { + if _, ok := supported[charmSeries]; ok { + supportedSeries = append(supportedSeries, charmSeries) + } + } + defaultSeries, err := charm.SeriesForCharm("", supportedSeries) if err == nil { return defaultSeries, nil } @@ -107,6 +129,11 @@ return "", err } + // validate the series we get from the charm + if err := s.validateSeries(series); err != nil { + return "", err + } + // either it's a supported series or the user used --force, so just // give them what they asked for. if s.fromBundle { @@ -116,3 +143,26 @@ logger.Infof(msgUserRequestedSeries, series) return series, nil } + +func (s seriesSelector) validateSeries(seriesName string) error { + // if we're forcing then we don't need the following validation checks. + if len(s.supportedJujuSeries) == 0 { + // programming error + return errors.Errorf("expected supported juju series to exist") + } + if s.force { + return nil + } + + var found bool + for _, supportedSeries := range s.supportedJujuSeries { + if seriesName == supportedSeries { + found = true + break + } + } + if !found { + return errors.NotSupportedf("series: %s", seriesName) + } + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/series_selector_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/series_selector_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/series_selector_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/series_selector_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -21,134 +21,262 @@ expectedSeries string err string - }{{ - // Simple selectors first, no supported series. + }{ + { + // Simple selectors first, no supported series. - title: "juju deploy simple # no default series, no supported series", - seriesSelector: seriesSelector{ - conf: defaultSeries{}, - }, - err: "series not specified and charm does not define any", - }, { - title: "juju deploy simple # default series set, no supported series", - seriesSelector: seriesSelector{ - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "wily", - }, { - title: "juju deploy simple --series=precise # default series set, no supported series", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "precise", - }, { - title: "juju deploy trusty/simple # charm series set, default series set, no supported series", - seriesSelector: seriesSelector{ - charmURLSeries: "trusty", - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "trusty", - }, { - title: "juju deploy trusty/simple --series=precise # series specified, charm series set, default series set, no supported series", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - charmURLSeries: "trusty", - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "precise", - }, { - title: "juju deploy simple --force # no default series, no supported series, use LTS (bionic)", - seriesSelector: seriesSelector{ - force: true, - conf: defaultSeries{}, + title: "juju deploy simple # no default series, no supported series", + seriesSelector: seriesSelector{ + conf: defaultSeries{}, + }, + err: "series not specified and charm does not define any", + }, { + title: "juju deploy simple # default series set, no supported series", + seriesSelector: seriesSelector{ + conf: defaultSeries{"bionic", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy simple with old series # default series set, no supported series", + seriesSelector: seriesSelector{ + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: "series: wily not supported", + }, + { + title: "juju deploy simple --series=precise # default series set, no supported series", + seriesSelector: seriesSelector{ + seriesFlag: "precise", + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: "series: precise not supported", + }, { + title: "juju deploy simple --series=bionic # default series set, no supported series, no supported juju series", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + conf: defaultSeries{"wily", true}, + }, + err: "expected supported juju series to exist", + }, + { + title: "juju deploy simple --series=bionic # default series set, no supported series", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy trusty/simple # charm series set, default series set, no supported series", + seriesSelector: seriesSelector{ + charmURLSeries: "trusty", + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: "series: trusty not supported", + }, + { + title: "juju deploy bionic/simple # charm series set, default series set, no supported series", + seriesSelector: seriesSelector{ + charmURLSeries: "bionic", + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy cosmic/simple --series=bionic # series specified, charm series set, default series set, no supported series", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + charmURLSeries: "cosmic", + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy simple --force # no default series, no supported series, use LTS (bionic)", + seriesSelector: seriesSelector{ + force: true, + conf: defaultSeries{}, + }, + expectedSeries: "bionic", }, - expectedSeries: "bionic", - }, { + // Now charms with supported series. - title: "juju deploy multiseries # use charm default, nothing specified, no default series", - seriesSelector: seriesSelector{ - supportedSeries: []string{"utopic", "vivid"}, - conf: defaultSeries{}, - }, - expectedSeries: "utopic", - }, { - title: "juju deploy multiseries # use charm defaults used if default series doesn't match, nothing specified", - seriesSelector: seriesSelector{ - supportedSeries: []string{"utopic", "vivid"}, - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "utopic", - }, { - title: "juju deploy multiseries # use model series defaults if supported by charm", - seriesSelector: seriesSelector{ - supportedSeries: []string{"utopic", "vivid", "wily"}, - conf: defaultSeries{"wily", true}, - }, - expectedSeries: "wily", - }, { - title: "juju deploy multiseries --series=precise # use supported requested", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - supportedSeries: []string{"utopic", "vivid", "precise"}, - conf: defaultSeries{}, - }, - expectedSeries: "precise", - }, { - title: "juju deploy multiseries --series=precise # unsupported requested", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - supportedSeries: []string{"utopic", "vivid"}, - conf: defaultSeries{}, - }, - err: `series "precise" not supported by charm, supported series are: utopic,vivid`, - }, { - title: "juju deploy multiseries --series=precise --force # unsupported forced", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - supportedSeries: []string{"utopic", "vivid"}, - force: true, - conf: defaultSeries{}, - }, - expectedSeries: "precise", - }, { - title: "juju deploy trusty/multiseries # non-default but supported series", - seriesSelector: seriesSelector{ - charmURLSeries: "trusty", - supportedSeries: []string{"utopic", "vivid", "trusty"}, - conf: defaultSeries{}, - }, - expectedSeries: "trusty", - }, { - title: "juju deploy trusty/multiseries --series=precise # non-default but supported series", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - charmURLSeries: "trusty", - supportedSeries: []string{"utopic", "vivid", "trusty", "precise"}, - conf: defaultSeries{}, - }, - expectedSeries: "precise", - }, { - title: "juju deploy trusty/multiseries --series=precise # unsupported series", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - charmURLSeries: "trusty", - supportedSeries: []string{"trusty", "utopic", "vivid"}, - conf: defaultSeries{}, - }, - err: `series "precise" not supported by charm, supported series are: trusty,utopic,vivid`, - }, { - title: "juju deploy trusty/multiseries --series=precise --force # unsupported series forced", - seriesSelector: seriesSelector{ - seriesFlag: "precise", - charmURLSeries: "trusty", - supportedSeries: []string{"trusty", "utopic", "vivid"}, - force: true, - conf: defaultSeries{}, + { + title: "juju deploy multiseries # use charm default, nothing specified, no default series", + seriesSelector: seriesSelector{ + supportedSeries: []string{"bionic", "cosmic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy multiseries with invalid series # use charm default, nothing specified, no default series", + seriesSelector: seriesSelector{ + supportedSeries: []string{"precise", "bionic", "cosmic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy multiseries with invalid serie # use charm default, nothing specified, no default series", + seriesSelector: seriesSelector{ + supportedSeries: []string{"precise"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: "series not specified and charm does not define any", + }, + { + title: "juju deploy multiseries # use charm defaults used if default series doesn't match, nothing specified", + seriesSelector: seriesSelector{ + supportedSeries: []string{"bionic", "cosmic"}, + conf: defaultSeries{"wily", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy multiseries # use model series defaults if supported by charm", + seriesSelector: seriesSelector{ + supportedSeries: []string{"bionic", "cosmic", "disco"}, + conf: defaultSeries{"disco", true}, + supportedJujuSeries: []string{"bionic", "cosmic", "disco"}, + }, + expectedSeries: "disco", + }, + { + title: "juju deploy multiseries # use model series defaults if supported by charm", + seriesSelector: seriesSelector{ + supportedSeries: []string{"bionic", "cosmic", "disco"}, + conf: defaultSeries{"disco", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: "series: disco not supported", + }, + { + title: "juju deploy multiseries with force # use model series defaults if supported by charm, force", + seriesSelector: seriesSelector{ + supportedSeries: []string{"bionic", "cosmic", "disco"}, + conf: defaultSeries{"disco", true}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + force: true, + }, + expectedSeries: "disco", + }, + { + title: "juju deploy multiseries --series=bionic # use supported requested", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + supportedSeries: []string{"utopic", "vivid", "bionic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy multiseries --series=bionic # use supported requested", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + supportedSeries: []string{"cosmic", "bionic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy multiseries --series=bionic # unsupported requested", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + supportedSeries: []string{"utopic", "vivid"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + err: `series "bionic" not supported by charm, supported series are: utopic,vivid`, + }, + { + title: "juju deploy multiseries --series=bionic --force # unsupported forced", + seriesSelector: seriesSelector{ + seriesFlag: "bionic", + supportedSeries: []string{"utopic", "vivid"}, + force: true, + conf: defaultSeries{}, + }, + err: "expected supported juju series to exist", + }, + { + title: "juju deploy bionic/multiseries # non-default but supported series", + seriesSelector: seriesSelector{ + charmURLSeries: "bionic", + supportedSeries: []string{"utopic", "vivid", "bionic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "bionic", + }, + { + title: "juju deploy bionic/multiseries # non-default but supported series", + seriesSelector: seriesSelector{ + charmURLSeries: "bionic", + supportedSeries: []string{"utopic", "vivid", "bionic"}, + conf: defaultSeries{}, + }, + err: "expected supported juju series to exist", + }, + { + title: "juju deploy bionic/multiseries --series=cosmic # non-default but supported series", + seriesSelector: seriesSelector{ + seriesFlag: "cosmic", + charmURLSeries: "bionic", + supportedSeries: []string{"utopic", "vivid", "bionic", "cosmic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "cosmic", + }, + { + title: "juju deploy bionic/multiseries --series=cosmic # unsupported series", + seriesSelector: seriesSelector{ + seriesFlag: "cosmic", + charmURLSeries: "bionic", + supportedSeries: []string{"bionic", "utopic", "vivid"}, + conf: defaultSeries{}, + }, + err: `series "cosmic" not supported by charm, supported series are: bionic,utopic,vivid`, + }, + { + title: "juju deploy bionic/multiseries --series=cosmic # unsupported series", + seriesSelector: seriesSelector{ + seriesFlag: "cosmic", + charmURLSeries: "bionic", + supportedSeries: []string{"bionic", "utopic", "vivid", "cosmic"}, + conf: defaultSeries{}, + supportedJujuSeries: []string{"bionic", "cosmic"}, + }, + expectedSeries: "cosmic", + }, + { + title: "juju deploy bionic/multiseries --series=precise --force # unsupported series forced", + seriesSelector: seriesSelector{ + seriesFlag: "precise", + charmURLSeries: "bionic", + supportedSeries: []string{"bionic", "utopic", "vivid"}, + force: true, + conf: defaultSeries{}, + }, + err: "expected supported juju series to exist", }, - expectedSeries: "precise", - }} + } // Use bionic for LTS for all calls. previous := series.SetLatestLtsForTesting("bionic") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/unexpose_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/unexpose_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/unexpose_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/unexpose_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -23,6 +23,9 @@ func (s *UnexposeSuite) SetUpTest(c *gc.C) { s.RepoSuite.SetUpTest(c) + s.PatchValue(&supportedJujuSeries, func() []string { + return defaultSupportedJujuSeries + }) s.CmdBlockHelper = testing.NewCmdBlockHelper(s.APIState) c.Assert(s.CmdBlockHelper, gc.NotNil) s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() }) @@ -43,7 +46,7 @@ } func (s *UnexposeSuite) TestUnexpose(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := runDeploy(c, ch, "some-application-name", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) @@ -66,7 +69,7 @@ } func (s *UnexposeSuite) TestBlockUnexpose(c *gc.C) { - ch := testcharms.Repo.CharmArchivePath(s.CharmsPath, "multi-series") + ch := testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "multi-series") err := runDeploy(c, ch, "some-application-name", "--series", "trusty") c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/upgradecharm_resources_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/upgradecharm_resources_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/upgradecharm_resources_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/upgradecharm_resources_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,8 +12,6 @@ "strings" "time" - "github.com/juju/juju/core/model" - "github.com/juju/cmd/cmdtesting" gitjujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" @@ -31,14 +29,14 @@ "github.com/juju/juju/component/all" "github.com/juju/juju/controller" "github.com/juju/juju/core/constraints" - jujutesting "github.com/juju/juju/juju/testing" + "github.com/juju/juju/core/model" "github.com/juju/juju/resource" "github.com/juju/juju/state" "github.com/juju/juju/testcharms" ) type UpgradeCharmResourceSuite struct { - jujutesting.RepoSuite + application.RepoSuiteBaseSuite } var _ = gc.Suite(&UpgradeCharmResourceSuite{}) @@ -49,8 +47,8 @@ } func (s *UpgradeCharmResourceSuite) SetUpTest(c *gc.C) { - s.RepoSuite.SetUpTest(c) - chPath := testcharms.Repo.ClonedDirPath(s.CharmsPath, "riak") + s.RepoSuiteBaseSuite.SetUpTest(c) + chPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "riak") _, err := runDeploy(c, chPath, "riak", "--series", "quantal", "--force") c.Assert(err, jc.ErrorIsNil) curl := charm.MustParseURL("local:quantal/riak-7") @@ -81,7 +79,7 @@ description: some comment ` - myriakPath := testcharms.Repo.ClonedDir(c.MkDir(), "riak") + myriakPath := testcharms.RepoWithSeries("bionic").ClonedDir(c.MkDir(), "riak") err := ioutil.WriteFile(path.Join(myriakPath.Path, "metadata.yaml"), []byte(riakResourceMeta), 0644) c.Assert(err, jc.ErrorIsNil) @@ -139,7 +137,7 @@ // charmStoreSuite is a suite fixture that puts the machinery in // place to allow testing code that calls addCharmViaAPI. type charmStoreSuite struct { - jujutesting.JujuConnSuite + application.JujuConnBaseSuite handler charmstore.HTTPCloseHandler srv *httptest.Server srvSession *mgo.Session @@ -174,7 +172,7 @@ } s.JujuConnSuite.ControllerConfigAttrs[controller.CharmStoreURL] = s.srv.URL - s.JujuConnSuite.SetUpTest(c) + s.JujuConnBaseSuite.SetUpTest(c) // Initialize the charm cache dir. s.PatchValue(&charmrepo.CacheDir, c.MkDir()) @@ -205,7 +203,7 @@ // charmstore endpoints are implemented. func (s *UpgradeCharmStoreResourceSuite) TestDeployStarsaySuccess(c *gc.C) { - testcharms.UploadCharm(c, s.client, "trusty/starsay-1", "starsay") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/starsay-1", "starsay", "bionic") // let's make a fake resource file to upload resourceContent := "some-data" @@ -301,7 +299,7 @@ sort.Sort(csbyname(oldCharmStoreResources)) - testcharms.UploadCharm(c, s.client, "trusty/starsay-2", "starsay") + testcharms.UploadCharmWithSeries(c, s.client, "trusty/starsay-2", "starsay", "bionic") _, err = cmdtesting.RunCommand(c, application.NewUpgradeCharmCommand(), "starsay") c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/upgradecharm_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/upgradecharm_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/application/upgradecharm_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/application/upgradecharm_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -301,8 +301,8 @@ } func (s *UpgradeCharmErrorsStateSuite) deployApplication(c *gc.C) { - ch := testcharms.Repo.ClonedDirPath(s.CharmsPath, "riak") - err := runDeploy(c, ch, "riak", "--series", "quantal") + ch := testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "riak") + err := runDeploy(c, ch, "riak", "--series", "bionic") c.Assert(err, jc.ErrorIsNil) } @@ -369,10 +369,10 @@ func (s *UpgradeCharmSuccessStateSuite) SetUpTest(c *gc.C) { s.RepoSuite.SetUpTest(c) - s.path = testcharms.Repo.ClonedDirPath(s.CharmsPath, "riak") - err := runDeploy(c, s.path, "--series", "quantal") + s.path = testcharms.RepoWithSeries("bionic").ClonedDirPath(s.CharmsPath, "riak") + err := runDeploy(c, s.path, "--series", "bionic") c.Assert(err, jc.ErrorIsNil) - curl := charm.MustParseURL("local:quantal/riak-7") + curl := charm.MustParseURL("local:bionic/riak-7") s.riak, _ = s.RepoSuite.AssertApplication(c, "riak", curl, 1, 1) _, forced, err := s.riak.Charm() @@ -421,8 +421,8 @@ } func (s *UpgradeCharmSuccessStateSuite) TestForcedSeriesUpgrade(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(c.MkDir(), "multi-series") - err := runDeploy(c, path, "multi-series", "--series", "precise") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(c.MkDir(), "multi-series") + err := runDeploy(c, path, "multi-series", "--series", "bionic") c.Assert(err, jc.ErrorIsNil) application, err := s.State.Application("multi-series") c.Assert(err, jc.ErrorIsNil) @@ -457,6 +457,7 @@ `series:`, ` - trusty`, ` - wily`, + ` - bionic`, }, "\n", ) @@ -477,7 +478,7 @@ } func (s *UpgradeCharmSuccessStateSuite) TestForcedLXDProfileUpgrade(c *gc.C) { - path := testcharms.Repo.ClonedDirPath(c.MkDir(), "lxd-profile-alt") + path := testcharms.RepoWithSeries("bionic").ClonedDirPath(c.MkDir(), "lxd-profile-alt") err := runDeploy(c, path, "lxd-profile-alt", "--to", "lxd") c.Assert(err, jc.ErrorIsNil) application, err := s.State.Application("lxd-profile-alt") @@ -534,7 +535,7 @@ } func (s *UpgradeCharmSuccessStateSuite) TestInitWithResources(c *gc.C) { - testcharms.Repo.CharmArchivePath(s.CharmsPath, "dummy") + testcharms.RepoWithSeries("bionic").CharmArchivePath(s.CharmsPath, "dummy") dir := c.MkDir() foopath := path.Join(dir, "foo") @@ -579,7 +580,7 @@ } func (s *UpgradeCharmSuccessStateSuite) TestCharmPath(c *gc.C) { - myriakPath := testcharms.Repo.ClonedDirPath(c.MkDir(), "riak") + myriakPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(c.MkDir(), "riak") // Change the revision to 42 and upgrade to it with explicit revision. err := ioutil.WriteFile(path.Join(myriakPath, "revision"), []byte("42"), 0644) @@ -587,22 +588,22 @@ err = runUpgradeCharm(c, "riak", "--path", myriakPath) c.Assert(err, jc.ErrorIsNil) curl := s.assertUpgraded(c, s.riak, 42, false) - c.Assert(curl.String(), gc.Equals, "local:quantal/riak-42") + c.Assert(curl.String(), gc.Equals, "local:bionic/riak-42") s.assertLocalRevision(c, 42, myriakPath) } func (s *UpgradeCharmSuccessStateSuite) TestCharmPathNoRevUpgrade(c *gc.C) { // Revision 7 is running to start with. - myriakPath := testcharms.Repo.ClonedDirPath(c.MkDir(), "riak") + myriakPath := testcharms.RepoWithSeries("bionic").ClonedDirPath(c.MkDir(), "riak") s.assertLocalRevision(c, 7, myriakPath) err := runUpgradeCharm(c, "riak", "--path", myriakPath) c.Assert(err, jc.ErrorIsNil) curl := s.assertUpgraded(c, s.riak, 8, false) - c.Assert(curl.String(), gc.Equals, "local:quantal/riak-8") + c.Assert(curl.String(), gc.Equals, "local:bionic/riak-8") } func (s *UpgradeCharmSuccessStateSuite) TestCharmPathDifferentNameFails(c *gc.C) { - myriakPath := testcharms.Repo.RenamedClonedDirPath(s.CharmsPath, "riak", "myriak") + myriakPath := testcharms.RepoWithSeries("bionic").RenamedClonedDirPath(s.CharmsPath, "riak", "myriak") metadataPath := filepath.Join(myriakPath, "metadata.yaml") file, err := os.OpenFile(metadataPath, os.O_TRUNC|os.O_RDWR, 0666) if err != nil { @@ -665,7 +666,7 @@ }} func (s *UpgradeCharmCharmStoreStateSuite) TestUpgradeCharmAuthorization(c *gc.C) { - testcharms.UploadCharm(c, s.client, "cs:~other/trusty/wordpress-0", "wordpress") + testcharms.UploadCharmWithSeries(c, s.client, "cs:~other/trusty/wordpress-0", "wordpress", "bionic") err := runDeploy(c, "cs:~other/trusty/wordpress-0") riak, err := s.State.Application("wordpress") @@ -685,7 +686,7 @@ c.Assert(err, jc.ErrorIsNil) for i, test := range upgradeCharmAuthorizationTests { c.Logf("test %d: %s", i, test.about) - url, _ := testcharms.UploadCharm(c, s.client, test.uploadURL, "wordpress") + url, _ := testcharms.UploadCharmWithSeries(c, s.client, test.uploadURL, "wordpress", "bionic") if test.readPermUser != "" { s.changeReadPerm(c, url, test.readPermUser) } @@ -699,8 +700,8 @@ } func (s *UpgradeCharmCharmStoreStateSuite) TestSwitch(c *gc.C) { - testcharms.UploadCharm(c, s.client, "cs:~other/trusty/riak-0", "riak") - testcharms.UploadCharm(c, s.client, "cs:~other/trusty/anotherriak-7", "riak") + testcharms.UploadCharmWithSeries(c, s.client, "cs:~other/trusty/riak-0", "riak", "bionic") + testcharms.UploadCharmWithSeries(c, s.client, "cs:~other/trusty/anotherriak-7", "riak", "bionic") err := runDeploy(c, "cs:~other/trusty/riak-0") c.Assert(err, jc.ErrorIsNil) @@ -728,7 +729,7 @@ c.Assert(err, gc.ErrorMatches, `already running specified charm "cs:~other/trusty/anotherriak-7"`) // Change the revision to 42 and upgrade to it with explicit revision. - testcharms.UploadCharm(c, s.client, "cs:~other/trusty/anotherriak-42", "riak") + testcharms.UploadCharmWithSeries(c, s.client, "cs:~other/trusty/anotherriak-42", "riak", "bionic") err = runUpgradeCharm(c, "riak", "--switch=cs:~other/trusty/anotherriak-42") c.Assert(err, jc.ErrorIsNil) curl = s.assertUpgraded(c, riak, 42, false) @@ -736,7 +737,7 @@ } func (s *UpgradeCharmCharmStoreStateSuite) TestUpgradeCharmWithChannel(c *gc.C) { - id, ch := testcharms.UploadCharm(c, s.client, "cs:~client-username/trusty/wordpress-0", "wordpress") + id, ch := testcharms.UploadCharmWithSeries(c, s.client, "cs:~client-username/trusty/wordpress-0", "wordpress", "bionic") err := runDeploy(c, "cs:~client-username/trusty/wordpress-0") c.Assert(err, jc.ErrorIsNil) @@ -767,7 +768,7 @@ } func (s *UpgradeCharmCharmStoreStateSuite) TestUpgradeCharmShouldRespectDeployedChannelByDefault(c *gc.C) { - id, ch := testcharms.UploadCharm(c, s.client, "cs:~client-username/trusty/wordpress-0", "wordpress") + id, ch := testcharms.UploadCharmWithSeries(c, s.client, "cs:~client-username/trusty/wordpress-0", "wordpress", "bionic") // publish charm to beta channel id.Revision = 1 @@ -813,8 +814,8 @@ } func (s *UpgradeCharmCharmStoreStateSuite) TestUpgradeWithTermsNotSigned(c *gc.C) { - id, ch := testcharms.UploadCharm(c, s.client, "quantal/terms1-1", "terms1") - err := runDeploy(c, "quantal/terms1") + id, ch := testcharms.UploadCharmWithSeries(c, s.client, "bionic/terms1-1", "terms1", "bionic") + err := runDeploy(c, "bionic/terms1") c.Assert(err, jc.ErrorIsNil) id.Revision = id.Revision + 1 err = s.client.UploadCharmWithRevision(id, ch, -1) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/block/doc.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/block/doc.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/block/doc.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/block/doc.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,9 +13,12 @@ "remove-object" prevents: destroy-controller destroy-model + detach-storage + remove-application remove-machine remove-relation - remove-application + remove-saas + remove-storage remove-unit "all" prevents: @@ -24,26 +27,36 @@ add-unit add-ssh-key add-user + attach-resource + attach-storage change-user-password config + consume deploy - disable-user destroy-controller destroy-model + disable-user enable-ha enable-user expose + import-filesystem import-ssh-key + model-defaults model-config + reload-spaces remove-application remove-machine remove-relation remove-ssh-key remove-unit + remove-user resolved retry-provisioning run + scale-application + set-credential set-constraints + set-series sync-agents unexpose upgrade-charm diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/add.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/add.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/add.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/add.go 2019-06-28 17:10:43.000000000 +0000 @@ -27,6 +27,7 @@ jujucmdcloud "github.com/juju/juju/cmd/juju/cloud" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -71,7 +72,7 @@ When running add-k8s the underlying cloud/region hosting the cluster needs to be detected to enable storage to be correctly configured. If the cloud/region cannot -be detected automatically, use --region to specify the host +be detected automatically, use --region / to specify the host cloud type and region. When adding a GKE or AKS cluster, you can use the --gke or --aks option to @@ -83,7 +84,9 @@ juju add-k8s myk8scloud --local juju add-k8s myk8scloud --controller mycontroller juju add-k8s --context-name mycontext myk8scloud - juju add-k8s myk8scloud --region + juju add-k8s myk8scloud --region / + juju add-k8s myk8scloud --cloud + juju add-k8s myk8scloud --cloud --region= KUBECONFIG=path-to-kubuconfig-file juju add-k8s myk8scloud --cluster-name=my_cluster_name kubectl config view --raw | juju add-k8s myk8scloud --cluster-name=my_cluster_name @@ -135,6 +138,8 @@ // hostCloudRegion is the cloud region that the nodes of cluster (k8s) are running in. // The format is . hostCloudRegion string + // cloud is an alias of the hostCloudRegion. + cloud string // workloadStorage is a storage class specified by the user. workloadStorage string @@ -156,9 +161,12 @@ func NewAddCAASCommand(cloudMetadataStore CloudMetadataStore) cmd.Command { store := jujuclient.NewFileClientStore() cmd := &AddCAASCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - cloudMetadataStore: cloudMetadataStore, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + cloudMetadataStore: cloudMetadataStore, + store: store, newClientConfigReader: func(caasType string) (clientconfig.ClientConfigFunc, error) { return clientconfig.NewClientConfigReader(caasType) }, @@ -192,6 +200,7 @@ f.StringVar(&c.clusterName, "cluster-name", "", "Specify the k8s cluster to import") f.StringVar(&c.contextName, "context-name", "", "Specify the k8s context to import") f.StringVar(&c.hostCloudRegion, "region", "", "kubernetes cluster cloud and/or region") + f.StringVar(&c.cloud, "cloud", "", "kubernetes cluster cloud and/or region") f.StringVar(&c.workloadStorage, "storage", "", "kubernetes storage class for workload storage") f.StringVar(&c.project, "project", "", "project to which the cluster belongs") f.StringVar(&c.credential, "credential", "", "the credential to use when accessing the cluster") @@ -214,6 +223,13 @@ if c.contextName != "" && c.clusterName != "" { return errors.New("only specify one of cluster-name or context-name, not both") } + if c.hostCloudRegion != "" || c.cloud != "" { + c.hostCloudRegion, err = c.tryEnsureCloudTypeForHostRegion(c.cloud, c.hostCloudRegion) + if err != nil { + return errors.Trace(err) + } + } + if c.gke { if c.contextName != "" { return errors.New("do not specify context name when adding a GKE cluster") @@ -328,7 +344,7 @@ storage defaults are available and to detect the cluster's cloud/region. This was not possible in this case so run add-k8s again, using --storage= to specify the storage class to use and - --region=/ to specify the cloud/region. + --cloud= --region=/ to specify the cloud/region. `[1:] var unknownClusterErrMsg = ` @@ -346,10 +362,11 @@ `[1:] // Run is defined on the Command interface. -func (c *AddCAASCommand) Run(ctx *cmd.Context) error { +func (c *AddCAASCommand) Run(ctx *cmd.Context) (err error) { if err := c.verifyName(c.caasName); err != nil { return errors.Trace(err) } + rdr, clusterName, err := c.getConfigReader(ctx) if err != nil { return errors.Trace(err) @@ -400,6 +417,11 @@ return errors.Trace(err) } + newCloud.HostCloudRegion, err = c.validateCloudRegion(ctx, newCloud.HostCloudRegion) + if err != nil { + return errors.Trace(err) + } + if err := addCloudToLocal(c.cloudMetadataStore, newCloud); err != nil { return errors.Trace(err) } @@ -409,10 +431,7 @@ } if clusterName == "" { - clusterName = c.hostCloudRegion - if clusterName == "" { - clusterName = newCloud.HostCloudRegion - } + clusterName = newCloud.HostCloudRegion } if c.controllerName == "" { successMsg := fmt.Sprintf("k8s substrate %q added as cloud %q%s", clusterName, c.caasName, storageMsg) @@ -427,7 +446,7 @@ } defer cloudClient.Close() - if err := c.addCloudToControllerWithRegion(cloudClient, newCloud); err != nil { + if err := addCloudToController(cloudClient, newCloud); err != nil { return errors.Trace(err) } if err := c.addCredentialToController(cloudClient, credential, credentialName); err != nil { @@ -439,20 +458,6 @@ return nil } -func (c *AddCAASCommand) addCloudToControllerWithRegion(apiClient AddCloudAPI, newCloud jujucloud.Cloud) (err error) { - if newCloud.HostCloudRegion != "" { - hostCloudRegion, err := c.validateCloudRegion(newCloud.HostCloudRegion) - if err != nil { - return errors.Trace(err) - } - newCloud.HostCloudRegion = hostCloudRegion - } - if err := addCloudToController(apiClient, newCloud); err != nil { - return errors.Trace(err) - } - return nil -} - func (c *AddCAASCommand) newK8sClusterBroker(cloud jujucloud.Cloud, credential jujucloud.Credential) (caas.ClusterMetadataChecker, error) { openParams, err := provider.BaseKubeCloudOpenParams(cloud, credential) if err != nil { @@ -468,15 +473,75 @@ return caas.New(openParams) } -func (c *AddCAASCommand) validateCloudRegion(cloudRegion string) (_ string, err error) { +func getCloudAndRegionFromOptions(cloudOption, regionOption string) (string, string, error) { + cloudNameOrType, region, err := jujucloud.SplitHostCloudRegion(regionOption) + if err != nil && cloudOption == "" { + return "", "", errors.Annotate(err, "parsing region option") + } + c, r, _ := jujucloud.SplitHostCloudRegion(cloudOption) + if region == "" && c != "" { + // --cloud ec2 --region us-east-1 + region = cloudNameOrType + cloudNameOrType = c + } + if r != "" { + return "", "", errors.NewNotValid(nil, "--cloud incorrectly specifies a cloud/region instead of just a cloud") + } + if cloudNameOrType != "" && region != "" && c != "" && cloudNameOrType != c { + return "", "", errors.NotValidf("two different clouds specified: %q, %q", cloudNameOrType, c) + } + if cloudNameOrType == "" { + cloudNameOrType = c + } + return cloudNameOrType, region, nil +} + +// tryEnsureCloudType try to find cloud type if the cloudNameOrType is cloud name. +func (c *AddCAASCommand) tryEnsureCloudTypeForHostRegion(cloudOption, regionOption string) (string, error) { + logger.Debugf("cloud option %q region option %q", cloudOption, regionOption) + cloudNameOrType, region, err := getCloudAndRegionFromOptions(cloudOption, regionOption) + if err != nil { + return "", errors.Annotate(err, "parsing cloud region") + } + logger.Debugf("cloud %q region %q", cloudNameOrType, region) + + clouds, err := c.getAllCloudDetails() + if err != nil { + return "", errors.Annotate(err, "listing cloud regions") + } + for name, details := range clouds { + // User may have specified cloud name or type so match on both. + if name == cloudNameOrType || details.CloudType == cloudNameOrType { + cloudNameOrType = details.CloudType + } + } + return jujucloud.BuildHostCloudRegion(cloudNameOrType, region), nil +} + +func isRegionOptional(cloudType string) bool { + for _, v := range []string{ + // Region is optional for CDK on microk8s, openstack, lxd, maas; + caas.K8sCloudMicrok8s, + caas.K8sCloudOpenStack, + caas.K8sCloudLXD, + caas.K8sCloudMAAS, + } { + if cloudType == v { + return true + } + } + return false +} + +func (c *AddCAASCommand) validateCloudRegion(ctx *cmd.Context, cloudRegion string) (_ string, err error) { defer errors.DeferredAnnotatef(&err, "validating cloud region %q", cloudRegion) - cloudNameOrType, region, err := provider.ParseCloudRegion(cloudRegion) + cloudType, region, err := jujucloud.SplitHostCloudRegion(cloudRegion) if err != nil { return "", errors.Annotate(err, "parsing cloud region") } // microk8s is special. - if cloudNameOrType == caas.K8sCloudMicrok8s && region == caas.Microk8sRegion { + if cloudType == caas.K8sCloudMicrok8s && region == caas.Microk8sRegion { return cloudRegion, nil } @@ -484,25 +549,36 @@ if err != nil { return "", errors.Annotate(err, "listing cloud regions") } - for name, details := range clouds { + regionListMsg := "" + for _, details := range clouds { // User may have specified cloud name or type so match on both. - if name == cloudNameOrType || details.CloudType == cloudNameOrType { - if region == "" && len(details.RegionsMap) == 0 { + if details.CloudType == cloudType { + if isRegionOptional(details.CloudType) && region == "" { + return jujucloud.BuildHostCloudRegion(details.CloudType, ""), nil + } + if len(details.RegionsMap) == 0 { + if region != "" { + return "", errors.NewNotValid(nil, fmt.Sprintf( + "cloud %q does not have a region, but %q provided", cloudType, region, + )) + } return details.CloudType, nil } for k := range details.RegionsMap { if k == region { logger.Debugf("cloud region %q is valid", cloudRegion) - return details.CloudType + "/" + region, nil + return jujucloud.BuildHostCloudRegion(details.CloudType, region), nil } + regionListMsg += fmt.Sprintf("\t%q\n", k) } } } + ctx.Infof("Supported regions for cloud %q: \n%s", cloudType, regionListMsg) return "", errors.NotValidf("cloud region %q", cloudRegion) } func (c *AddCAASCommand) getClusterMetadataFunc(ctx *cmd.Context) provider.GetClusterMetadataFunc { - return func(broker caas.ClusterMetadataChecker) (*caas.ClusterMetadata, error) { + return func(storageParams provider.KubeCloudStorageParams) (*caas.ClusterMetadata, error) { interrupted := make(chan os.Signal, 1) defer close(interrupted) ctx.InterruptNotify(interrupted) @@ -511,11 +587,12 @@ result := make(chan *caas.ClusterMetadata, 1) errChan := make(chan error, 1) go func() { - clusterMetadata, err := broker.GetClusterMetadata(c.workloadStorage) + clusterMetadata, err := storageParams.MetadataChecker.GetClusterMetadata(storageParams.WorkloadStorage) if err != nil { errChan <- err + } else { + result <- clusterMetadata } - result <- clusterMetadata }() timeout := 30 * time.Second @@ -572,7 +649,7 @@ func addCloudToLocal(cloudMetadataStore CloudMetadataStore, newCloud jujucloud.Cloud) error { personalClouds, err := cloudMetadataStore.PersonalCloudMetadata() if err != nil { - return err + return errors.Trace(err) } if personalClouds == nil { personalClouds = make(map[string]jujucloud.Cloud) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/add_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/add_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/add_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/add_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -294,6 +294,22 @@ "us-east1": {Name: "us-east1", Endpoint: "https://www.googleapis.com"}, }, }, + "aws": { + Source: "public", + CloudType: "ec2", + CloudDescription: "amazon Cloud Platform", + AuthTypes: []string{"jsonfile", "oauth2"}, + Regions: yaml.MapSlice{ + {Key: "ap-southeast-2", Value: map[string]string{"Name": "ap-southeast-2", "Endpoint": "https://ec2.ap-northeast-2.amazonaws.com"}}, + }, + RegionsMap: map[string]jujucmdcloud.RegionDetails{ + "ap-southeast-2": {Name: "ap-southeast-2", Endpoint: "https://ec2.ap-northeast-2.amazonaws.com"}, + }, + }, + "maas1": { + CloudType: "maas", + CloudDescription: "maas Cloud", + }, }, nil }, ) @@ -301,6 +317,7 @@ func (s *addCAASSuite) runCommand(c *gc.C, stdin io.Reader, com cmd.Command, args ...string) (*cmd.Context, error) { ctx := cmdtesting.Context(c) + c.Logf("run cmd with args: %v", args) if err := cmdtesting.InitCommand(com, args); err != nil { cmd.WriteError(ctx.Stderr, err) return ctx, err @@ -344,7 +361,7 @@ func (s *addCAASSuite) TestNonExistClusterName(c *gc.C) { cmd := s.makeCommand(c, true, false, true) _, err := s.runCommand(c, nil, cmd, "myk8s", "--cluster-name", "non existing cluster name") - c.Assert(err, gc.ErrorMatches, `context for cluster name \"non existing cluster name\" not found`) + c.Assert(err, gc.ErrorMatches, `context for cluster name "non existing cluster name" not found`) } type initTestsCase struct { @@ -380,41 +397,90 @@ type regionTestCase struct { title string - regionStr string + cloud, region string expectedErrStr string } -func (s *addCAASSuite) TestRegionFlag(c *gc.C) { - for _, ts := range []regionTestCase{ +func (s *addCAASSuite) TestCloudAndRegionFlag(c *gc.C) { + for i, ts := range []regionTestCase{ { - title: "missing cloud", - regionStr: "/region", - expectedErrStr: `validating cloud region "/region": cloud region "/region" not valid`, + title: "missing cloud --region=/region", + region: "/region", + expectedErrStr: `parsing cloud region: parsing region option: host cloud region "/region" not valid`, }, { - title: "missing region", - regionStr: "cloud/", - expectedErrStr: `validating cloud region "cloud/": cloud region "cloud/" not valid`, + title: "missing region --region=cloud/", + region: "cloud/", + expectedErrStr: `validating cloud region "cloud": cloud region "cloud" not valid`, }, { - title: "not a known juju cloud", - regionStr: "cloudRegion", - expectedErrStr: `validating cloud region "cloudRegion": cloud region "cloudRegion" not valid`, + title: "missing cloud --region=region", + region: "region", + expectedErrStr: `validating cloud region "region": cloud region "region" not valid`, }, { - title: "not a known juju cloud region", - regionStr: "cloud/region", + title: "not a known juju cloud region: --region=cloud/region", + region: "cloud/region", expectedErrStr: `validating cloud region "cloud/region": cloud region "cloud/region" not valid`, }, { - title: "all good", - regionStr: "gce/us-east1", - expectedErrStr: "", + title: "region is not required --region=maas/non-existing-region", + region: "maas/non-existing-region", + expectedErrStr: `validating cloud region "maas/non-existing-region": cloud "maas" does not have a region, but "non-existing-region" provided`, + }, + { + title: "region is not required --cloud=maas --region=non-existing-region", + cloud: "maas", + region: "non-existing-region", + expectedErrStr: `validating cloud region "maas/non-existing-region": cloud "maas" does not have a region, but "non-existing-region" provided`, + }, + { + title: "missing region --cloud=ec2", + cloud: "ec2", + expectedErrStr: `validating cloud region "ec2": cloud region "ec2" not valid`, + }, + { + title: "cloud option contains region --cloud=gce/us-east1", + cloud: "gce/us-east1", + expectedErrStr: `parsing cloud region: --cloud incorrectly specifies a cloud/region instead of just a cloud`, + }, + { + title: "two different clouds --cloud=gce --region=gce/us-east1", + cloud: "ec2", + region: "gce/us-east1", + expectedErrStr: `parsing cloud region: two different clouds specified: "gce", "ec2" not valid`, + }, + { + title: "all good --region=gce/us-east1", + region: "gce/us-east1", + }, + { + title: "all good --region=us-east1 --cloud=gce", + region: "us-east1", + cloud: "gce", + }, + { + title: "all good --cloud=maas", + cloud: "maas", + }, + { + title: "all good --region=maas", + region: "maas", }, } { + c.Logf("%v: %s", i, ts.title) delete(s.initialCloudMap, "myk8s") cmd := s.makeCommand(c, true, false, true) - _, err := s.runCommand(c, nil, cmd, "myk8s", "-c", "foo", "--cluster-name", "mrcloud2", "--region", ts.regionStr) + args := []string{ + "myk8s", "-c", "foo", "--cluster-name", "mrcloud2", + } + if ts.region != "" { + args = append(args, "--region", ts.region) + } + if ts.cloud != "" { + args = append(args, "--cloud", ts.cloud) + } + _, err := s.runCommand(c, nil, cmd, args...) if ts.expectedErrStr == "" { c.Check(err, jc.ErrorIsNil) } else { @@ -464,7 +530,7 @@ Endpoint: "fakeendpoint2", IdentityEndpoint: "", StorageEndpoint: "", - Regions: []cloud.Region{{Name: "us-east1"}}, + Regions: []cloud.Region{{Name: "us-east1", Endpoint: "fakeendpoint2"}}, Config: map[string]interface{}{"operator-storage": "operator-sc", "workload-storage": ""}, RegionConfig: cloud.RegionConfig(nil), CACertificates: []string{"fakecadata2"}, @@ -473,27 +539,35 @@ ) } -func (s *addCAASSuite) assertAddCloudResult(c *gc.C, cloudRegion, workloadStorage string, localOnly bool) { +func (s *addCAASSuite) assertAddCloudResult( + c *gc.C, + cloudRegion, workloadStorage, operatorStorage string, + localOnly bool, +) { + _, region, err := jujucloud.SplitHostCloudRegion(cloudRegion) + c.Assert(err, jc.ErrorIsNil) s.fakeK8sClusterMetadataChecker.CheckCall(c, 0, "GetClusterMetadata") + expectedCloudToAdd := cloud.Cloud{ + Name: "myk8s", + HostCloudRegion: cloudRegion, + Type: "kubernetes", + Description: "", + AuthTypes: cloud.AuthTypes{""}, + Endpoint: "fakeendpoint2", + IdentityEndpoint: "", + StorageEndpoint: "", + Config: map[string]interface{}{"operator-storage": operatorStorage, "workload-storage": workloadStorage}, + RegionConfig: cloud.RegionConfig(nil), + CACertificates: []string{"fakecadata2"}, + } + if region != "" { + expectedCloudToAdd.Regions = []cloud.Region{{Name: region, Endpoint: "fakeendpoint2"}} + } + if localOnly { s.fakeCloudAPI.CheckNoCalls(c) } else { - s.fakeCloudAPI.CheckCall(c, 0, "AddCloud", - cloud.Cloud{ - Name: "myk8s", - HostCloudRegion: cloudRegion, - Type: "kubernetes", - Description: "", - AuthTypes: cloud.AuthTypes{""}, - Endpoint: "fakeendpoint2", - IdentityEndpoint: "", - StorageEndpoint: "", - Regions: []cloud.Region{{Name: "us-east1"}}, - Config: map[string]interface{}{"operator-storage": "operator-sc", "workload-storage": workloadStorage}, - RegionConfig: cloud.RegionConfig(nil), - CACertificates: []string{"fakecadata2"}, - }, - ) + s.fakeCloudAPI.CheckCall(c, 0, "AddCloud", expectedCloudToAdd) } s.cloudMetadataStore.CheckCall(c, 2, "WritePersonalCloudMetadata", map[string]cloud.Cloud{ @@ -521,20 +595,7 @@ Config: map[string]interface{}(nil), RegionConfig: cloud.RegionConfig(nil), }, - "myk8s": { - Name: "myk8s", - HostCloudRegion: cloudRegion, - Type: "kubernetes", - Description: "", - AuthTypes: cloud.AuthTypes{""}, - Endpoint: "fakeendpoint2", - IdentityEndpoint: "", - StorageEndpoint: "", - Regions: []cloud.Region{{Name: "us-east1"}}, - Config: map[string]interface{}{"operator-storage": "operator-sc", "workload-storage": workloadStorage}, - RegionConfig: cloud.RegionConfig(nil), - CACertificates: []string{"fakecadata2"}, - }, + "myk8s": expectedCloudToAdd, }, ) } @@ -547,7 +608,7 @@ ctx, err := s.runCommand(c, nil, cmd, "myk8s", "-c", "foo", "--cluster-name", "mrcloud2") c.Assert(err, jc.ErrorIsNil) c.Assert(strings.Trim(cmdtesting.Stdout(ctx), "\n"), gc.Equals, `k8s substrate "mrcloud2" added as cloud "myk8s".`) - s.assertAddCloudResult(c, cloudRegion, "", false) + s.assertAddCloudResult(c, cloudRegion, "", "operator-sc", false) } func (s *addCAASSuite) TestGatherClusterMetadataError(c *gc.C) { @@ -561,7 +622,7 @@ storage defaults are available and to detect the cluster's cloud/region. This was not possible in this case so run add-k8s again, using --storage= to specify the storage class to use and - --region=/ to specify the cloud/region. + --cloud= --region=/ to specify the cloud/region. : oops`[1:] c.Assert(err, gc.ErrorMatches, expectedErr) } @@ -577,7 +638,7 @@ storage defaults are available and to detect the cluster's cloud/region. This was not possible in this case so run add-k8s again, using --storage= to specify the storage class to use and - --region=/ to specify the cloud/region. + --cloud= --region=/ to specify the cloud/region. `[1:] c.Assert(err, gc.ErrorMatches, expectedErr) } @@ -635,7 +696,7 @@ result := strings.Trim(cmdtesting.Stdout(ctx), "\n") result = strings.Replace(result, "\n", " ", -1) c.Assert(result, gc.Equals, `k8s substrate "mrcloud2" added as cloud "myk8s" with storage provisioned by the existing "mystorage" storage class.`) - s.assertAddCloudResult(c, cloudRegion, "mystorage", false) + s.assertAddCloudResult(c, cloudRegion, "mystorage", "mystorage", false) } func (s *addCAASSuite) TestCreateDefaultStorageProvisioner(c *gc.C) { @@ -661,7 +722,7 @@ result := strings.Trim(cmdtesting.Stdout(ctx), "\n") result = strings.Replace(result, "\n", " ", -1) c.Assert(result, gc.Equals, `k8s substrate "mrcloud2" added as cloud "myk8s" with gce disk default storage provisioned by the existing "mystorage" storage class.`) - s.assertAddCloudResult(c, cloudRegion, "mystorage", false) + s.assertAddCloudResult(c, cloudRegion, "mystorage", "mystorage", false) } func (s *addCAASSuite) TestCreateCustomStorageProvisioner(c *gc.C) { @@ -671,7 +732,7 @@ s.fakeK8sClusterMetadataChecker.Call("CheckDefaultWorkloadStorage").Returns( &jujucaas.NonPreferredStorageError{PreferredStorage: jujucaas.PreferredStorage{Name: "gce disk"}}) storageProvisioner := &jujucaas.StorageProvisioner{ - Name: "my disk", + Name: "mystorage", Provisioner: "my disk provisioner", } s.fakeK8sClusterMetadataChecker.Call("EnsureStorageProvisioner", jujucaas.StorageProvisioner{ @@ -684,7 +745,31 @@ result := strings.Trim(cmdtesting.Stdout(ctx), "\n") result = strings.Replace(result, "\n", " ", -1) c.Assert(result, gc.Equals, `k8s substrate "mrcloud2" added as cloud "myk8s" with storage provisioned by the existing "mystorage" storage class.`) - s.assertAddCloudResult(c, cloudRegion, "mystorage", false) + s.assertAddCloudResult(c, cloudRegion, "mystorage", "mystorage", false) +} + +func (s *addCAASSuite) TestFoundStorageProvisionerViaAnnationForMAASWIthoutStorageOptionProvided(c *gc.C) { + storageProvisioner := &jujucaas.StorageProvisioner{ + Name: "mystorage", + Provisioner: "my disk provisioner", + } + s.fakeK8sClusterMetadataChecker.Call("GetClusterMetadata").Returns(&jujucaas.ClusterMetadata{ + Cloud: "maas", + OperatorStorageClass: storageProvisioner, + NominatedStorageClass: storageProvisioner, + }, nil) + s.fakeK8sClusterMetadataChecker.Call("CheckDefaultWorkloadStorage").Returns(errors.NotFoundf("no sc config for this cloud type")) + s.fakeK8sClusterMetadataChecker.Call("EnsureStorageProvisioner", jujucaas.StorageProvisioner{ + Name: "mystorage", + }).Returns(storageProvisioner, nil) + + cmd := s.makeCommand(c, true, false, true) + ctx, err := s.runCommand(c, nil, cmd, "myk8s", "-c", "foo", "--cluster-name", "mrcloud2", "--cloud", "maas") + c.Assert(err, jc.ErrorIsNil) + result := strings.Trim(cmdtesting.Stdout(ctx), "\n") + result = strings.Replace(result, "\n", " ", -1) + c.Assert(result, gc.Equals, `k8s substrate "mrcloud2" added as cloud "myk8s" with storage provisioned by the existing "mystorage" storage class.`) + s.assertAddCloudResult(c, "maas", "mystorage", "mystorage", false) } func (s *addCAASSuite) TestLocalOnly(c *gc.C) { @@ -696,7 +781,7 @@ c.Assert(err, jc.ErrorIsNil) expected := `k8s substrate "mrcloud2" added as cloud "myk8s".You can now bootstrap to this cloud by running 'juju bootstrap myk8s'.` c.Assert(strings.Replace(cmdtesting.Stdout(ctx), "\n", "", -1), gc.Equals, expected) - s.assertAddCloudResult(c, cloudRegion, "", true) + s.assertAddCloudResult(c, cloudRegion, "", "operator-sc", true) } func mockStdinPipe(content string) (*os.File, error) { @@ -740,7 +825,9 @@ IdentityEndpoint: "", StorageEndpoint: "", HostCloudRegion: hostCloud, - Regions: []cloud.Region{{Name: "us-east1"}}, + Regions: []cloud.Region{ + {Name: "us-east1", Endpoint: "https://1.1.1.1:8888"}, + }, Config: map[string]interface{}{ "operator-storage": "operator-sc", "workload-storage": "", @@ -817,7 +904,7 @@ Endpoint: "fakeendpoint1", IdentityEndpoint: "", StorageEndpoint: "", - Regions: []cloud.Region{{Name: "us-east1"}}, + Regions: []cloud.Region{{Name: "us-east1", Endpoint: "fakeendpoint1"}}, Config: map[string]interface{}{"operator-storage": "operator-sc", "workload-storage": ""}, RegionConfig: cloud.RegionConfig(nil), CACertificates: []string{"fakecadata1"}, @@ -867,7 +954,7 @@ Endpoint: "fakeendpoint2", IdentityEndpoint: "", StorageEndpoint: "", - Regions: []cloud.Region{{Name: "us-east1"}}, + Regions: []cloud.Region{{Name: "us-east1", Endpoint: "fakeendpoint2"}}, Config: map[string]interface{}{"operator-storage": "operator-sc", "workload-storage": ""}, RegionConfig: cloud.RegionConfig(nil), CACertificates: []string{"fakecadata2"}, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/cluster.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/cluster.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/cluster.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/cluster.go 2019-06-28 17:10:43.000000000 +0000 @@ -61,6 +61,7 @@ name string project string region string + zone string credential string // used with AKS resourceGroup string @@ -69,6 +70,7 @@ type cluster struct { name string region string + zone string // for AKS resourceGroup string } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/gke.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/gke.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/gke.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/gke.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "fmt" "io" "os" + "regexp" "strings" "github.com/juju/cmd" @@ -51,9 +52,9 @@ cmd = append(cmd, "--project", p.project) qualifiedClusterName += p.project + "_" } - if p.region != "" { - cmd = append(cmd, "--region", p.region) - qualifiedClusterName += p.region + "_" + if p.zone != "" { + cmd = append(cmd, "--zone", p.zone) + qualifiedClusterName += p.zone + "_" } qualifiedClusterName += p.name @@ -89,7 +90,7 @@ } if p.name == "" { - p.name, p.region, err = g.queryCluster(pollster, p.credential, p.project, p.region) + p.name, p.region, p.zone, err = g.queryCluster(pollster, p.credential, p.project, p.region) if err != nil { return nil, errors.Trace(err) } @@ -180,13 +181,12 @@ return project, errors.Trace(err) } +var extractRegionFromZone = regexp.MustCompile(`([a-z]+-[a-z0-9]+)`).FindStringSubmatch + func (g *gke) listClusters(account, project, region string) (map[string]cluster, error) { cmd := []string{ "gcloud", "container", "clusters", "list", "--filter", "status:RUNNING", "--account", account, "--project", project, "--format", "value\\(name,zone\\)", } - if region != "" { - cmd = append(cmd, "--region", region) - } result, err := runCommand(g, cmd, "") if err != nil { return nil, errors.Trace(err) @@ -202,26 +202,34 @@ if len(parts) == 0 { continue } - c := cluster{name: parts[0]} + c := cluster{name: parts[0], region: region} if len(parts) > 1 { - c.region = parts[1] + c.zone = parts[1] + result := extractRegionFromZone(c.zone) + if result != nil && len(result) > 0 { + r := result[0] + if region != "" && region != r { + continue + } + c.region = r + } } clusters[c.name] = c } return clusters, nil } -func (g *gke) queryCluster(pollster *interact.Pollster, account, project, region string) (string, string, error) { +func (g *gke) queryCluster(pollster *interact.Pollster, account, project, region string) (string, string, string, error) { allClustersByName, err := g.listClusters(account, project, region) if err != nil { - return "", "", errors.Trace(err) + return "", "", "", errors.Trace(err) } if len(allClustersByName) == 0 { regionMsg := "" if region != "" { regionMsg = fmt.Sprintf(" in region %v", region) } - return "", "", errors.Errorf("no clusters have been set up%s.\n"+ + return "", "", "", errors.Errorf("no clusters have been set up%s.\n"+ "You can create a k8s cluster using 'gcloud container cluster create'", regionMsg, ) @@ -243,8 +251,8 @@ Default: clusterNamesAndRegions[0], }) if err != nil { - return "", "", errors.Trace(err) + return "", "", "", errors.Trace(err) } selected := clustersByNameRegion[cluster] - return selected.name, selected.region, nil + return selected.name, selected.region, selected.zone, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/gke_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/gke_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/gke_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/gke_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -63,11 +63,11 @@ }).Times(1). Return(&exec.ExecResponse{ Code: 0, - Stdout: []byte("mycluster somezone"), + Stdout: []byte("mycluster asia-southeast1-a"), }, nil), ) - stdin := strings.NewReader("mysecret\nmyproject\nmycluster in somezone\n") + stdin := strings.NewReader("mysecret\nmyproject\nmycluster in asia-southeast1\n") out := &bytes.Buffer{} ctx := &cmd.Context{ Dir: c.MkDir(), @@ -86,9 +86,9 @@ Select project [myproject]: Available Clusters - mycluster in somezone + mycluster in asia-southeast1 -Select cluster [mycluster in somezone]: +Select cluster [mycluster in asia-southeast1]: `[1:] outParams, err := gke.interactiveParams(ctx, &clusterParams{}) @@ -97,7 +97,8 @@ c.Assert(outParams, jc.DeepEquals, &clusterParams{ project: "myproject", name: "mycluster", - region: "somezone", + region: "asia-southeast1", + zone: "asia-southeast1-a", credential: "mysecret", }) } @@ -116,11 +117,11 @@ }).Times(1). Return(&exec.ExecResponse{ Code: 0, - Stdout: []byte("mycluster somezone"), + Stdout: []byte("mycluster asia-southeast1-a"), }, nil), ) - stdin := strings.NewReader("mycluster in somezone\n") + stdin := strings.NewReader("mycluster in asia-southeast1\n") out := &bytes.Buffer{} ctx := &cmd.Context{ Dir: c.MkDir(), @@ -130,9 +131,9 @@ } expected := ` Available Clusters - mycluster in somezone + mycluster in asia-southeast1 -Select cluster [mycluster in somezone]: +Select cluster [mycluster in asia-southeast1]: `[1:] outParams, err := gke.interactiveParams(ctx, &clusterParams{ @@ -144,7 +145,8 @@ c.Assert(outParams, jc.DeepEquals, &clusterParams{ project: "myproject", name: "mycluster", - region: "somezone", + region: "asia-southeast1", + zone: "asia-southeast1-a", credential: "mysecret", }) } @@ -158,16 +160,16 @@ gomock.InOrder( mockRunner.EXPECT().RunCommands(exec.RunParams{ - Commands: "gcloud container clusters list --filter status:RUNNING --account mysecret --project myproject --format value\\(name,zone\\) --region somezone", + Commands: "gcloud container clusters list --filter status:RUNNING --account mysecret --project myproject --format value\\(name,zone\\)", Environment: []string{"KUBECONFIG=", "PATH=/path/to/here"}, }).Times(1). Return(&exec.ExecResponse{ Code: 0, - Stdout: []byte("mycluster somezone"), + Stdout: []byte("mycluster asia-southeast1-a"), }, nil), ) - stdin := strings.NewReader("mycluster in somezone\n") + stdin := strings.NewReader("mycluster in asia-southeast1\n") out := &bytes.Buffer{} ctx := &cmd.Context{ Dir: c.MkDir(), @@ -177,14 +179,14 @@ } expected := ` Available Clusters - mycluster in somezone + mycluster in asia-southeast1 -Select cluster [mycluster in somezone]: +Select cluster [mycluster in asia-southeast1]: `[1:] outParams, err := gke.interactiveParams(ctx, &clusterParams{ project: "myproject", - region: "somezone", + region: "asia-southeast1", credential: "mysecret", }) c.Check(err, jc.ErrorIsNil) @@ -192,7 +194,8 @@ c.Assert(outParams, jc.DeepEquals, &clusterParams{ project: "myproject", name: "mycluster", - region: "somezone", + region: "asia-southeast1", + zone: "asia-southeast1-a", credential: "mysecret", }) } @@ -211,7 +214,7 @@ gomock.InOrder( mockRunner.EXPECT().RunCommands(exec.RunParams{ - Commands: "gcloud container clusters get-credentials mycluster --account mysecret --project myproject --region somezone", + Commands: "gcloud container clusters get-credentials mycluster --account mysecret --project myproject --zone asia-southeast1-a", Environment: []string{"KUBECONFIG=" + configFile, "PATH=/path/to/here"}, }).Times(1). Return(&exec.ExecResponse{ @@ -220,14 +223,15 @@ ) rdr, clusterName, err := gke.getKubeConfig(&clusterParams{ project: "myproject", - region: "somezone", + zone: "asia-southeast1-a", + region: "asia-southeast1", name: "mycluster", credential: "mysecret", }) c.Check(err, jc.ErrorIsNil) defer rdr.Close() - c.Assert(clusterName, gc.Equals, "gke_myproject_somezone_mycluster") + c.Assert(clusterName, gc.Equals, "gke_myproject_asia-southeast1-a_mycluster") data, err := ioutil.ReadAll(rdr) c.Assert(err, jc.ErrorIsNil) c.Assert(string(data), gc.DeepEquals, "data") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/remove.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/remove.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/caas/remove.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/caas/remove.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/juju/cloud" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -57,9 +58,13 @@ func NewRemoveCAASCommand(cloudMetadataStore CloudMetadataStore) cmd.Command { store := jujuclient.NewFileClientStore() cmd := &RemoveCAASCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - cloudMetadataStore: cloudMetadataStore, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + + cloudMetadataStore: cloudMetadataStore, + store: store, } cmd.apiFunc = func() (RemoveCloudAPI, error) { root, err := cmd.NewAPIRoot(cmd.store, cmd.controllerName, "") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/addcredential.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/addcredential.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/addcredential.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/addcredential.go 2019-06-28 17:10:43.000000000 +0000 @@ -26,47 +26,86 @@ Adds or replaces credentials for a cloud, stored locally on this client.`[1:] var usageAddCredentialDetails = ` -The user is prompted to add credentials interactively if a YAML-formatted -credentials file is not specified. Here is a sample credentials file: +The juju add-credential command operates in two modes. -credentials: - aws: - : - auth-type: access-key - access-key: - secret-key: - azure: - : - auth-type: service-principal-secret - application-id: - application-password: - subscription-id: - lxd: - : - auth-type: interactive - trust-password: - -A "credential name" is arbitrary and is used solely to represent a set of -credentials, of which there may be multiple per cloud. -The ` + "`--replace`" + ` option is required if credential information for the named -cloud already exists locally. All such information will be overwritten. -This command does not set default regions nor default credentials. Note -that if only one credential name exists, it will become the effective -default credential. -For credentials which are already in use by tools other than Juju, ` + "`juju \nautoload-credentials`" + ` may be used. -When Juju needs credentials for a cloud, i) if there are multiple -available; ii) there's no set default; iii) and one is not specified ('-- -credential'), an error will be emitted. +When called with only the argument, ` + "`juju add-credential`" + ` will +take you through an interactive prompt to add a credential specific to +the cloud provider. + +Providing the ` + "`-f ` " + `option switches to the +non-interactive mode. must be a path to a correctly +formatted YAML-formatted file. Details of the format are provided at +"About credentials.yaml" below. + +The ` + "`--replace`" + ` option is required if credential information +for the named cloud already exists locally. All such information will be +overwritten. + +About credentials.yaml: +Here is a sample credentials.yaml showing four credentials being stored +against three clouds: + + credentials: + aws: + : + auth-type: access-key + access-key: + secret-key: + azure: + : + auth-type: service-principal-secret + application-id: + application-password: + subscription-id: + lxd: + : + auth-type: interactive + trust-password: + : + auth-type: interactive + trust-password: + +More generally, here is a loosely defined grammar for credentials.yaml: + + credentials: + : + : + auth-type: + : + [: ] + +Every requires its own and +pairs. + +The parameter of each credential is arbitrary, but must +be unique within each . This allows allow each cloud to store +multiple credentials. Examples: juju add-credential google juju add-credential aws -f ~/credentials.yaml + juju add-credential aws --replace -f ~/credentials.yaml + +Notes: +If you are setting up Juju for the first time, consider running +` + "`juju autoload-credentials`" + `. This may allow you to skip adding +credentials manually. + +This command does not set default regions nor default credentials for the +cloud. The commands ` + "`juju set-default-region`" + ` and ` + "`juju set-default-credential`" + ` +provide that functionality. + +Further help: +Please visit https://discourse.jujucharms.com/t/1508 for cloud-specific +instructions. See also: credentials remove-credential set-default-credential - autoload-credentials` + set-default-region + autoload-credentials +` type addCredentialCommand struct { cmd.CommandBase diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/add.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/add.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/add.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/add.go 2019-06-28 17:10:43.000000000 +0000 @@ -26,6 +26,7 @@ "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/environs" "github.com/juju/juju/environs/context" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -76,8 +77,8 @@ If --local is used, Juju stores that definition its internal cache directly. -If already exists in Juju's cache, then the `[1:] + "`--replace`" + ` -option is required. +DEPRECATED If already exists in Juju's cache, then the `[1:] + "`--replace`" + ` +option is required. Use 'update-credential' instead. A cloud definition file has the following YAML format: @@ -113,17 +114,18 @@ Examples: juju add-cloud - juju add-cloud --local mycloud ~/mycloud.yaml + juju add-cloud mycloud ~/mycloud.yaml If the "multi-cloud" feature flag is turned on in the controller: - juju add-cloud mycloud ~/mycloud.yaml - juju add-cloud --replace mycloud ~/mycloud2.yaml juju add-cloud --controller mycontroller mycloud juju add-cloud --controller mycontroller mycloud --credential mycred + juju add-cloud --local mycloud ~/mycloud.yaml See also: - clouds` + clouds + update-cloud + update-credential` // AddCloudAPI - Implemented by cloudapi.Client. type AddCloudAPI interface { @@ -138,6 +140,7 @@ modelcmd.OptionalControllerCommand // Replace, if true, existing cloud information is overwritten. + // TODO (anastasiamac 2019-6-4) Remove as redundant and unsupported for Juju 3. Replace bool // Cloud is the name of the cloud to add. @@ -167,9 +170,12 @@ cloudCallCtx := context.NewCloudCallContext() store := jujuclient.NewFileClientStore() c := &AddCloudCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - cloudMetadataStore: cloudMetadataStore, - CloudCallCtx: cloudCallCtx, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + cloudMetadataStore: cloudMetadataStore, + CloudCallCtx: cloudCallCtx, // Ping is provider.Ping except in tests where we don't actually want to // require a valid cloud. Ping: func(p environs.EnvironProvider, endpoint string) error { @@ -202,7 +208,7 @@ // SetFlags initializes the flags supported by the command. func (c *AddCloudCommand) SetFlags(f *gnuflag.FlagSet) { c.OptionalControllerCommand.SetFlags(f) - f.BoolVar(&c.Replace, "replace", false, "Overwrite any existing cloud information for ") + f.BoolVar(&c.Replace, "replace", false, "DEPRECATED: Overwrite any existing cloud information for ") f.StringVar(&c.CloudFile, "f", "", "The path to a cloud definition file") f.StringVar(&c.credentialName, "credential", "", "Credential to use for new cloud") } @@ -283,6 +289,9 @@ // Run executes the add cloud command, adding a cloud based on a passed-in yaml // file or interactive queries. func (c *AddCloudCommand) Run(ctxt *cmd.Context) error { + if c.Replace { + ctxt.Warningf("'add-cloud --replace' is deprecated. Use 'update-cloud' instead.") + } if c.CloudFile == "" && c.controllerName == "" { return c.runInteractive(ctxt) } @@ -680,14 +689,14 @@ return err } if _, ok := personal[name]; ok { - return errors.Errorf("%q already exists; use --replace to replace this existing cloud", name) + return errors.Errorf("%q already exists; use `update-cloud` to replace this existing cloud", name) } msg, err := nameExists(name, public) if err != nil { return errors.Trace(err) } if msg != "" { - return errors.Errorf(msg + "; use --replace to override this definition") + return errors.Errorf(msg + "; use `update-cloud` to override this definition") } return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/add_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/add_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/add_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/add_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -198,7 +198,7 @@ fake.Call("PersonalCloudMetadata").Returns(mockCloud, nil) _, err = s.runCommand(c, fake, "homestack", cloudFile.Name()) - c.Assert(err, gc.ErrorMatches, `"homestack" already exists; use --replace to replace this existing cloud`) + c.Assert(err, gc.ErrorMatches, "\"homestack\" already exists; use `update-cloud` to replace this existing cloud") } func (s *addSuite) TestAddExistingReplace(c *gc.C) { @@ -235,7 +235,7 @@ fake.Call("PersonalCloudMetadata").Returns(map[string]jujucloud.Cloud{}, nil) _, err = s.runCommand(c, fake, "aws", cloudFile.Name()) - c.Assert(err, gc.ErrorMatches, `"aws" is the name of a public cloud; use --replace to override this definition`) + c.Assert(err, gc.ErrorMatches, "\"aws\" is the name of a public cloud; use `update-cloud` to override this definition") } func (s *addSuite) TestAddExistingBuiltin(c *gc.C) { @@ -252,7 +252,7 @@ fake.Call("PersonalCloudMetadata").Returns(map[string]jujucloud.Cloud{}, nil) _, err = s.runCommand(c, fake, "localhost", cloudFile.Name()) - c.Assert(err, gc.ErrorMatches, `"localhost" is the name of a built-in cloud; use --replace to override this definition`) + c.Assert(err, gc.ErrorMatches, "\"localhost\" is the name of a built-in cloud; use `update-cloud` to override this definition") } func (s *addSuite) TestAddExistingPublicReplace(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/listcredentials.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/listcredentials.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/listcredentials.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/listcredentials.go 2019-06-28 17:10:43.000000000 +0000 @@ -34,11 +34,11 @@ names. Actual authentication material is exposed with the '--show-secrets' -option. +option in json or yaml formats. Secrets are not shown in tabular format. A controller, and subsequently created models, can be created with a different set of credentials but any action taken within the model (e.g.: -` + "`juju deploy`; `juju add-unit`" + `) applies the credentail used +` + "`juju deploy`; `juju add-unit`" + `) applies the credential used to create that model. This model credential is stored on the controller. A credential for 'controller' model is determined at bootstrap time and @@ -132,7 +132,7 @@ func (c *listCredentialsCommand) SetFlags(f *gnuflag.FlagSet) { c.CommandBase.SetFlags(f) - f.BoolVar(&c.showSecrets, "show-secrets", false, "Show secrets") + f.BoolVar(&c.showSecrets, "show-secrets", false, "Show secrets, applicable to yaml or json formats only") c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{ "yaml": cmd.FormatYaml, "json": cmd.FormatJson, @@ -180,6 +180,9 @@ personalCloudNames = append(personalCloudNames, name) } + if c.showSecrets && c.out.Name() == "tabular" { + ctxt.Infof("secrets are not shown in tabular format") + } displayCredentials := make(map[string]CloudCredential) var missingClouds []string for cloudName, cred := range credentials { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/listcredentials_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/listcredentials_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/listcredentials_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/listcredentials_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -123,6 +123,20 @@ `[1:]) } +func (s *listCredentialsSuite) TestListCredentialsTabularShowsNoSecrets(c *gc.C) { + ctx, err := cmdtesting.RunCommand(c, cloud.NewListCredentialsCommandForTest(s.store, s.personalCloudsFunc, s.cloudByNameFunc), "--show-secrets") + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, "secrets are not shown in tabular format\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, ` +Cloud Credentials +aws down*, bob +azure azhja +google default +mycloud me + +`[1:]) +} + func (s *listCredentialsSuite) TestListCredentialsTabularMissingCloud(c *gc.C) { s.store.Credentials["missingcloud"] = jujucloud.CloudCredential{} out := s.listCredentials(c) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/list.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/list.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/list.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/list.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,6 +20,7 @@ "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/cmd/output" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -38,23 +39,40 @@ // listCloudsDoc is multi-line since we need to use ` to denote // commands for ease in markdown. var listCloudsDoc = "" + - "Output includes fundamental properties for each cloud known to the\n" + - "current Juju client: name, number of regions, default region, type,\n" + - "and description.\n" + - "\nThe default behaviour is to show clouds available on the current controller,\n" + - "or another controller specified using --controller.\n" + - "\nIf --local is specified, the output shows public clouds known to Juju out of the box;\n" + - "these can be used to bootstrap a controller. Clouds may change between Juju versions.\n" + - "In addition to these public clouds, the 'localhost' cloud (local LXD) is also listed.\n" + - "If you supply a controller name the clouds known on the controller will be displayed.\n" + - "\nThis command's default output format is 'tabular'.\n" + - "\nCloud metadata sometimes changes, e.g. AWS adds a new region. Use the\n" + - "`update-clouds` command to update the current Juju client accordingly.\n" + - "\nUse the `add-cloud` command to add a private cloud to the list of\n" + - "clouds known to the current Juju client.\n" + - "\nUse the `regions` command to list a cloud's regions. Use the\n" + - "`show-cloud` command to get more detail, such as regions and endpoints.\n" + - "\nFurther reading: https://docs.jujucharms.com/stable/clouds\n" + listCloudsDocExamples + "Display the fundamental properties for each cloud known to the current Juju client:\n" + + "name, number of regions, default region, type, and description\n" + + "\n" + + "The default behaviour is to show clouds available on the current controller.\n" + + "Another controller can specified using the --controller option. When no controllers\n" + + "are available, --local is implied.\n" + + "\n" + + "If --local is specified, the public clouds known to Juju out of the box are displayed,\n" + + "along with any which have been added with `add-cloud --local`. These clouds can be\n" + + "used to create a controller.\n" + + "\n" + + "Clouds may be listed that are co-hosted with the Juju client. When the LXD hypervisor\n" + + "is detected, the 'localhost' cloud is made available. When a microk8s installation is\n" + + "detected, the 'microk8s' cloud is displayed.\n" + + "\n" + + "This command's default output format is 'tabular'. Use 'json' and 'yaml' for\n" + + "machine-readable output.\n" + + "\n" + + "Cloud metadata sometimes changes, e.g. providers add regions. Use the `update-clouds`\n" + + "command to update the current Juju client.\n" + + "\n" + + "Use the `add-cloud` command to add a private cloud to the list of clouds known to the\n" + + "current Juju client.\n" + + "\n" + + "Use the `regions` command to list a cloud's regions.\n" + + "\n" + + "Use the `show-cloud` command to get more detail, such as regions and endpoints.\n" + + "\n" + + "Further reading:\n " + + "\n" + + " Documentation: https://docs.jujucharms.com/stable/clouds\n" + + " microk8s: https://microk8s.io/\n" + + " LXD hypervisor: https://linuxcontainers.org/lxd/\n" + + listCloudsDocExamples var listCloudsDocExamples = ` Examples: @@ -66,7 +84,11 @@ See also: add-cloud + credentials + controllers regions + set-default-credential + set-default-region show-cloud update-clouds ` @@ -80,8 +102,11 @@ func NewListCloudsCommand() cmd.Command { store := jujuclient.NewFileClientStore() c := &listCloudsCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + store: store, } c.listCloudsAPIFunc = c.cloudAPI diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/remove.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/remove.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/remove.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/remove.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/juju/cloud" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -18,9 +19,10 @@ Removes a user-defined cloud from Juju.`[1:] var usageRemoveCloudDetails = ` -Remove a named, user-defined cloud from Juju. The current -controller is used unless the --controller option is specified. +Remove a named, user-defined cloud from Juju's internal cache. +If the multi-cloud feature flag is enabled, the cloud is removed from a controller. +The current controller is used unless the --controller option is specified. If --local is specified, Juju removes the cloud from internal cache. Examples: @@ -53,8 +55,11 @@ func NewRemoveCloudCommand() cmd.Command { store := jujuclient.NewFileClientStore() c := &removeCloudCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + store: store, } c.removeCloudAPIFunc = c.cloudAPI return modelcmd.WrapBase(c) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/show.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/show.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/show.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/show.go 2019-06-28 17:10:43.000000000 +0000 @@ -17,6 +17,7 @@ jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -42,8 +43,9 @@ If ‘--include-config’ is used, additional configuration (key, type, and description) specific to the cloud are displayed if available. +If the multi-cloud feature flag is enabled, Juju shows a cloud on a controller, +otherwise Juju shows the cloud from internal cache. The current controller is used unless the --controller option is specified. - If --local is specified, Juju shows the cloud from internal cache. Examples: @@ -67,8 +69,11 @@ func NewShowCloudCommand() cmd.Command { store := jujuclient.NewFileClientStore() c := &showCloudCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + store: store, } c.showCloudAPIFunc = c.cloudAPI return modelcmd.WrapBase(c) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatecloud.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatecloud.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatecloud.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatecloud.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ jujucloud "github.com/juju/juju/cloud" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" "github.com/juju/juju/jujuclient" ) @@ -76,9 +77,12 @@ func newUpdateCloudCommand(cloudMetadataStore CloudMetadataStore) cmd.Command { store := jujuclient.NewFileClientStore() c := &updateCloudCommand{ - OptionalControllerCommand: modelcmd.OptionalControllerCommand{Store: store}, - cloudMetadataStore: cloudMetadataStore, - store: store, + OptionalControllerCommand: modelcmd.OptionalControllerCommand{ + Store: store, + EnabledFlag: feature.MultiCloud, + }, + cloudMetadataStore: cloudMetadataStore, + store: store, } c.updateCloudAPIFunc = c.updateCloudAPI diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds.go 2019-06-28 17:10:43.000000000 +0000 @@ -103,7 +103,7 @@ return err } if sameCloudInfo { - fmt.Fprintln(ctxt.Stderr, "Your list of public clouds is up to date, see `juju clouds`.") + fmt.Fprintln(ctxt.Stderr, "This client's list of public clouds is up to date, see `juju clouds --local`.") return nil } if err := jujucloud.WritePublicCloudMetadata(newPublicClouds); err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/cloud/updatepublicclouds_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -131,7 +131,7 @@ defer ts.Close() msg := s.run(c, ts.URL, "") - c.Assert(strings.Replace(msg, "\n", "", -1), gc.Matches, "Fetching latest public cloud list...Your list of public clouds is up to date, see `juju clouds`.") + c.Assert(strings.Replace(msg, "\n", "", -1), gc.Matches, "Fetching latest public cloud list...This client's list of public clouds is up to date, see `juju clouds --local`.") } func (s *updatePublicCloudsSuite) TestFirstRun(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "github.com/juju/naturalsort" "github.com/juju/schema" "github.com/juju/utils" "github.com/juju/utils/featureflag" @@ -505,6 +506,27 @@ if err != nil { return errors.Trace(err) } + // If region is specified by the user, validate it here. + // lp#1632735 + if c.Region != "" { + _, err := jujucloud.RegionByName(cloud.Regions, c.Region) + if err != nil { + allRegions := make([]string, len(cloud.Regions)) + for i, one := range cloud.Regions { + allRegions[i] = one.Name + } + if len(allRegions) > 0 { + naturalsort.Sort(allRegions) + plural := "s are" + if len(allRegions) == 1 { + plural = " is" + } + ctx.Infof("Available cloud region%v %v", plural, strings.Join(allRegions, ", ")) + } + return errors.NotValidf("region %q for cloud %q", c.Region, c.Cloud) + } + } + isCAASController := jujucloud.CloudIsCAAS(cloud) // Custom clouds may not have explicitly declared support for any auth- @@ -805,7 +827,7 @@ if hostedModel != nil { modelNameToSet = c.hostedModelName } - if err = c.SetModelName(modelcmd.JoinModelName(c.controllerName, modelNameToSet), false); err != nil { + if err = c.SetModelIdentifier(modelcmd.JoinModelName(c.controllerName, modelNameToSet), false); err != nil { return errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1456,9 +1456,8 @@ c, s.newBootstrapCommand(), "dummy-cloud-without-regions/my-region", "ctrl", "--config", "default-series=precise", ) - c.Check(cmdtesting.Stderr(ctx), gc.Matches, - "region \"my-region\" not found \\(expected one of \\[\\]\\)\n\n.*\n") - c.Assert(err, gc.Equals, cmd.ErrSilent) + c.Check(cmdtesting.Stderr(ctx), gc.Equals, "") + c.Assert(err, gc.ErrorMatches, `region "my-region" for cloud "dummy-cloud-without-regions" not valid`) } func (s *BootstrapSuite) TestBootstrapProviderNoCredentials(c *gc.C) { @@ -1516,9 +1515,9 @@ func (s *BootstrapSuite) TestBootstrapProviderDetectRegionsInvalid(c *gc.C) { s.patchVersionAndSeries(c, "raring") ctx, err := cmdtesting.RunCommand(c, s.newBootstrapCommand(), "dummy/not-dummy", "ctrl") - c.Assert(err, gc.Equals, cmd.ErrSilent) + c.Assert(err, gc.ErrorMatches, `region "not-dummy" for cloud "dummy" not valid`) stderr := strings.Replace(cmdtesting.Stderr(ctx), "\n", "", -1) - c.Assert(stderr, gc.Matches, `region "not-dummy" not found \(expected one of \["dummy"\]\)Specify an alternative region, or try "juju update-clouds".`) + c.Assert(stderr, gc.Matches, `Available cloud region is dummy`) } func (s *BootstrapSuite) TestBootstrapProviderManyCredentialsCloudNoAuthTypes(c *gc.C) { @@ -1863,6 +1862,14 @@ `[1:]) } +func (s *BootstrapSuite) TestBootstrapInvalidRegion(c *gc.C) { + resetJujuXDGDataHome(c) + ctx, err := cmdtesting.RunCommand(c, s.newBootstrapCommand(), "aws/eu-west") + c.Assert(err, gc.ErrorMatches, `region "eu-west" for cloud "aws" not valid`) + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, "Available cloud regions are ap-northeast-1, ap-northeast-2, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, sa-east-1, us-east-1, us-east-2, us-west-1, us-west-2\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, ``) +} + func (s *BootstrapSuite) TestBootstrapPrintCloudRegionsNoSuchCloud(c *gc.C) { resetJujuXDGDataHome(c) _, err := cmdtesting.RunCommand(c, s.newBootstrapCommand(), "--regions", "foo") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/enableha.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/enableha.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/enableha.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/enableha.go 2019-06-28 17:10:43.000000000 +0000 @@ -171,6 +171,9 @@ c.Placement = make([]string, len(placementSpecs)) for i, spec := range placementSpecs { p, err := instance.ParsePlacement(strings.TrimSpace(spec)) + if err == nil && p == nil { + return errors.New("empty placement directive passed to enable-ha") + } if err == nil && names.IsContainerMachine(p.Directive) { return errors.New("enable-ha cannot be used with container placement directives") } @@ -227,7 +230,7 @@ return err } - defer haClient.Close() + defer func() { _ = haClient.Close() }() enableHAResult, err := haClient.EnableHA( c.NumControllers, c.Constraints, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/enableha_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/enableha_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/enableha_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/enableha_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -207,6 +207,14 @@ c.Assert(s.fake.numControllers, gc.Equals, invalidNumServers) } +func (s *EnableHASuite) TestEnableHAErrorsWithInvalidPlacement(c *gc.C) { + _, err := s.runEnableHA(c, "--to", "in,,valid", "-n", "3") + c.Assert(err, gc.ErrorMatches, "empty placement directive passed to enable-ha") + + // Verify that enable-ha didn't call into the API + c.Assert(s.fake.numControllers, gc.Equals, invalidNumServers) +} + func (s *EnableHASuite) TestEnableHAAllows0(c *gc.C) { // If the number of controllers is specified as "0", the API will // then use the default number of 3. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/list_sshkeys.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/list_sshkeys.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/list_sshkeys.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/list_sshkeys.go 2019-06-28 17:10:43.000000000 +0000 @@ -69,7 +69,7 @@ if err != nil { return err } - defer client.Close() + defer func() { _ = client.Close() }() mode := ssh.Fingerprints if c.showFullKey { @@ -90,11 +90,11 @@ context.Infof("No keys to display.") return nil } - modelName, err := c.ModelName() + modelIdentifier, err := c.ModelIdentifier() if err != nil { return errors.Trace(err) } - fmt.Fprintf(context.Stdout, "Keys used in model: %s\n", modelName) - fmt.Fprintln(context.Stdout, strings.Join(result.Result, "\n")) + _, _ = fmt.Fprintf(context.Stdout, "Keys used in model: %s\n", modelIdentifier) + _, _ = fmt.Fprintln(context.Stdout, strings.Join(result.Result, "\n")) return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/main.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/main.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/main.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/main.go 2019-06-28 17:10:43.000000000 +0000 @@ -340,10 +340,10 @@ r.Register(model.NewShowCommand()) r.Register(model.NewModelCredentialCommand()) if featureflag.Enabled(feature.Generations) { - r.Register(model.NewBranchCommand()) + r.Register(model.NewAddBranchCommand()) r.Register(model.NewCommitCommand()) r.Register(model.NewTrackBranchCommand()) - r.Register(model.NewCheckoutCommand()) + r.Register(model.NewBranchCommand()) r.Register(model.NewDiffCommand()) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/migrate.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/migrate.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/migrate.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/migrate.go 2019-06-28 17:10:43.000000000 +0000 @@ -108,7 +108,10 @@ return errors.New("too many arguments specified") } - c.SetModelName(args[0], false) + if err := c.SetModelIdentifier(args[0], false); err != nil { + return errors.Trace(err) + } + c.targetController = args[1] return nil } @@ -119,7 +122,7 @@ if err != nil { return err } - modelName, err := c.ModelName() + modelName, err := c.ModelIdentifier() if err != nil { return errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/migrate_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/migrate_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/migrate_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/migrate_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -278,6 +278,7 @@ macs := s.api.specSeen.TargetMacaroons s.api.specSeen.TargetMacaroons = nil apitesting.MacaroonsEqual(c, macs, s.targetControllerAPI.macaroons) + c.Check(s.api.specSeen, jc.DeepEquals, &controller.MigrationSpec{ ModelUUID: modelUUID, TargetControllerUUID: targetControllerUUID, @@ -410,7 +411,7 @@ c.Check(s.api.specSeen.ModelUUID, gc.Equals, "prod-1-uuid") } -func (s *MigrateSuite) TestControllerDoesntExist(c *gc.C) { +func (s *MigrateSuite) TestControllerDoesNotExist(c *gc.C) { _, err := s.makeAndRun(c, "model", "wat") c.Check(err, gc.ErrorMatches, "controller wat not found") c.Check(s.api.specSeen, gc.IsNil) // API shouldn't have been called diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go 2019-06-28 17:10:43.000000000 +0000 @@ -272,7 +272,7 @@ return errors.Errorf("failed to get juju executable path: %v", err) } - modelName, err := c.ModelName() + modelName, err := c.ModelIdentifier() if err != nil { return errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/sshkeys_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/sshkeys_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/sshkeys_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/sshkeys_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -102,6 +102,19 @@ c.Assert(output, gc.Matches, "Keys used in model: controller\n.*\\(user@host\\)\n.*\\(another@host\\)") } +func (s *ListKeysSuite) TestListKeysWithModelUUID(c *gc.C) { + key1 := sshtesting.ValidKeyOne.Key + " user@host" + key2 := sshtesting.ValidKeyTwo.Key + " another@host" + s.setAuthorizedKeys(c, key1, key2) + + context, err := cmdtesting.RunCommand(c, NewListKeysCommand(), "-m", s.Model.UUID()) + c.Assert(err, jc.ErrorIsNil) + output := strings.TrimSpace(cmdtesting.Stdout(context)) + c.Assert(err, jc.ErrorIsNil) + c.Assert(output, gc.Matches, + fmt.Sprintf("Keys used in model: %s\n.*\\(user@host\\)\n.*\\(another@host\\)", s.Model.UUID())) +} + func (s *ListKeysSuite) TestListFullKeys(c *gc.C) { key1 := sshtesting.ValidKeyOne.Key + " user@host" key2 := sshtesting.ValidKeyTwo.Key + " another@host" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller.go 2019-06-28 17:10:43.000000000 +0000 @@ -268,7 +268,13 @@ }} jcmd.SetClientStore(c.ClientStore()) wrapped := modelcmd.Wrap(jcmd) - args := append(c.rawArgs, "-m", bootstrap.ControllerModelName) + controllerName, err := c.ControllerName() + if err != nil { + return errors.Trace(err) + } + fullControllerModelName := modelcmd.JoinModelName(controllerName, + bootstrap.ControllerModelName) + args := append(c.rawArgs, "-m", fullControllerModelName) if c.vers != "" { args = append(args, "--agent-version", c.vers) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgradecontroller_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/cmd" "github.com/juju/cmd/cmdtesting" + "github.com/juju/errors" "github.com/juju/os/series" jc "github.com/juju/testing/checkers" "github.com/juju/utils/arch" @@ -23,6 +24,7 @@ "github.com/juju/juju/environs/tools" jujutesting "github.com/juju/juju/juju/testing" "github.com/juju/juju/jujuclient" + "github.com/juju/juju/jujuclient/jujuclienttesting" coretesting "github.com/juju/juju/testing" jujuversion "github.com/juju/juju/version" ) @@ -115,6 +117,51 @@ s.checkToolsUploaded(c, vers, vers.Number) } +func (s *UpgradeIAASControllerSuite) TestUpgradeCorrectController(c *gc.C) { + badControllerName := "not-the-right-controller" + badControllerSelected := errors.New("bad controller selected") + upgradeCommand := func(minUpgradeVers map[int]version.Number) cmd.Command { + backingStore := s.ControllerStore + store := jujuclienttesting.WrapClientStore(backingStore) + store.ControllerByNameFunc = func(name string) (*jujuclient.ControllerDetails, error) { + if name == badControllerName { + return nil, badControllerSelected + } + return backingStore.ControllerByName(name) + } + store.CurrentControllerFunc = func() (string, error) { + return badControllerName, nil + } + s.ControllerStore = store + cmd := &upgradeControllerCommand{ + baseUpgradeCommand: baseUpgradeCommand{minMajorUpgradeVersion: minMajorUpgradeVersion}, + } + cmd.SetClientStore(s.ControllerStore) + return modelcmd.WrapController(cmd) + } + + tests := []upgradeTest{ + { + about: "latest supported stable release with specified controller", + available: []string{"2.1.0-quantal-amd64", "2.1.2-quantal-i386", "2.1.3-quantal-amd64", "2.1-dev1-quantal-amd64"}, + currentVersion: "2.0.0-quantal-amd64", + agentVersion: "2.0.0", + expectVersion: "2.1.3", + args: []string{"--controller", "kontroll"}, + }, + { + about: "latest supported stable release without specified controller", + available: []string{"2.1.0-quantal-amd64", "2.1.2-quantal-i386", "2.1.3-quantal-amd64", "2.1-dev1-quantal-amd64"}, + currentVersion: "2.0.0-quantal-amd64", + agentVersion: "2.0.0", + expectVersion: "2.1.3", + expectErr: badControllerSelected.Error(), + }, + } + + s.assertUpgradeTests(c, tests, upgradeCommand) +} + func (s *UpgradeIAASControllerSuite) TestUpgradeDryRun(c *gc.C) { s.assertUpgradeDryRun(c, "upgrade-controller", s.upgradeControllerCommand) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgrademodel.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgrademodel.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgrademodel.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgrademodel.go 2019-06-28 17:10:43.000000000 +0000 @@ -16,6 +16,7 @@ "github.com/juju/errors" "github.com/juju/gnuflag" "github.com/juju/os/series" + "github.com/juju/utils/set" "github.com/juju/version" apicontroller "github.com/juju/juju/api/controller" @@ -71,9 +72,9 @@ sync-agent-binaries` func newUpgradeJujuCommand() cmd.Command { - cmd := &upgradeJujuCommand{ + command := &upgradeJujuCommand{ baseUpgradeCommand: baseUpgradeCommand{minMajorUpgradeVersion: minMajorUpgradeVersion}} - return modelcmd.Wrap(cmd) + return modelcmd.Wrap(command) } func newUpgradeJujuCommandForTest( @@ -86,7 +87,7 @@ if minUpgradeVers == nil { minUpgradeVers = minMajorUpgradeVersion } - cmd := &upgradeJujuCommand{ + command := &upgradeJujuCommand{ baseUpgradeCommand: baseUpgradeCommand{ minMajorUpgradeVersion: minUpgradeVers, modelConfigAPI: modelConfigAPI, @@ -94,8 +95,8 @@ }, jujuClientAPI: jujuClientAPI, } - cmd.SetClientStore(store) - return modelcmd.Wrap(cmd, options...) + command.SetClientStore(store) + return modelcmd.Wrap(command, options...) } // baseUpgradeCommand is used by both the @@ -289,11 +290,11 @@ } func formatVersions(agents coretools.Versions) string { - formatted := make([]string, len(agents)) - for i, agent := range agents { - formatted[i] = fmt.Sprintf(" %s", agent.AgentVersion().String()) + formatted := set.NewStrings() + for _, agent := range agents { + formatted.Add(fmt.Sprintf(" %s", agent.AgentVersion().String())) } - return strings.Join(formatted, "\n") + return strings.Join(formatted.SortedValues(), "\n") } type toolsAPI interface { @@ -747,11 +748,11 @@ return errors.Trace(err) } defer f.Close() - os, err := series.GetOSFromSeries(builtTools.Version.Series) + seriesOs, err := series.GetOSFromSeries(builtTools.Version.Series) if err != nil { return errors.Trace(err) } - additionalSeries := series.OSSupportedSeries(os) + additionalSeries := series.OSSupportedSeries(seriesOs) uploaded, err := client.UploadTools(f, uploadToolsVersion, additionalSeries...) if err != nil { return errors.Trace(err) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgrademodel_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgrademodel_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/commands/upgrademodel_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/commands/upgrademodel_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -352,6 +352,49 @@ s.assertUpgradeTests(c, upgradeJujuTests, s.upgradeJujuCommandNoAPI) } +func (s *UpgradeBaseSuite) TestFormatVersions(c *gc.C) { + toolIt := func(name string) *coretools.Tools { + return &coretools.Tools{ + Version: version.MustParseBinary(name), + } + } + + for i, t := range []struct { + desc string + versions []string + expected string + }{ + { + desc: "different versions", + versions: []string{"1.21.3-quantal-amd64", "1.22.1-quantal-amd64"}, + expected: " 1.21.3\n 1.22.1", + }, + { + desc: "different versions, funny ordering", + versions: []string{"1.21.3-quantal-amd64", "2.6.0-quantal-amd64", "1.24.3-quantal-amd64", "1.22.1-quantal-amd64"}, + expected: " 1.21.3\n 1.22.1\n 1.24.3\n 2.6.0", + }, + { + desc: "same versions, diff series", + versions: []string{"1.21.3-quantal-amd64", "1.21.3-xenial-amd64"}, + expected: " 1.21.3", + }, + { + desc: "same versions, same series, diff arch", + versions: []string{"1.21.3-quantal-amd64", "1.21.3-quantal-arm64"}, + expected: " 1.21.3", + }, + } { + c.Logf("test %d: %v", i, t.desc) + versions := make(coretools.Versions, len(t.versions)) + for i, v := range t.versions { + versions[i] = toolIt(v) + } + obtained := formatVersions(versions) + c.Assert(obtained, gc.DeepEquals, t.expected) + } +} + func (s *UpgradeBaseSuite) assertUpgradeTests(c *gc.C, tests []upgradeTest, upgradeJujuCommand upgradeCommandFunc) { for i, test := range tests { c.Logf("\ntest %d: %s", i, test.about) @@ -490,8 +533,8 @@ func (s *UpgradeJujuSuite) TestUpgradeJujuWithRealUpload(c *gc.C) { s.Reset(c) s.PatchValue(&jujuversion.Current, version.MustParse("1.99.99")) - cmd := s.upgradeJujuCommandNoAPI(map[int]version.Number{2: version.MustParse("1.99.99")}) - _, err := cmdtesting.RunCommand(c, cmd, "--build-agent") + command := s.upgradeJujuCommandNoAPI(map[int]version.Number{2: version.MustParse("1.99.99")}) + _, err := cmdtesting.RunCommand(c, command, "--build-agent") c.Assert(err, jc.ErrorIsNil) vers := version.Binary{ Number: jujuversion.Current, @@ -511,8 +554,8 @@ agentVersion: "1.99.99.1", } s.PatchValue(&jujuversion.Current, version.MustParse("1.99.99")) - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) - _, err := cmdtesting.RunCommand(c, cmd) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) + _, err := cmdtesting.RunCommand(c, command) c.Assert(err, jc.ErrorIsNil) c.Assert(fakeAPI.tools, gc.Not(gc.HasLen), 0) c.Assert(fakeAPI.tools[0].Version.Number, gc.Equals, version.MustParse("1.99.99.2")) @@ -527,8 +570,8 @@ agentVersion: "1.99.99", } s.PatchValue(&jujuversion.Current, version.MustParse("1.100.0")) - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) - _, err := cmdtesting.RunCommand(c, cmd) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) + _, err := cmdtesting.RunCommand(c, command) c.Assert(err, jc.ErrorIsNil) c.Assert(fakeAPI.tools, gc.Not(gc.HasLen), 0) c.Assert(fakeAPI.tools[0].Version.Number, gc.Equals, version.MustParse("1.100.0.1")) @@ -545,8 +588,8 @@ agentVersion: "1.99.99.1", } s.PatchValue(&jujuversion.Current, version.MustParse("1.99.99")) - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) - _, err := cmdtesting.RunCommand(c, cmd) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) + _, err := cmdtesting.RunCommand(c, command) c.Assert(err, gc.ErrorMatches, "no more recent supported versions available") c.Assert(fakeAPI.ignoreAgentVersions, jc.IsFalse) } @@ -554,10 +597,10 @@ func (s *UpgradeJujuSuite) TestBlockUpgradeJujuWithRealUpload(c *gc.C) { s.Reset(c) s.PatchValue(&jujuversion.Current, version.MustParse("1.99.99")) - cmd := s.upgradeJujuCommandNoAPI(map[int]version.Number{2: version.MustParse("1.99.99")}) + command := s.upgradeJujuCommandNoAPI(map[int]version.Number{2: version.MustParse("1.99.99")}) // Block operation s.BlockAllChanges(c, "TestBlockUpgradeJujuWithRealUpload") - _, err := cmdtesting.RunCommand(c, cmd, "--build-agent") + _, err := cmdtesting.RunCommand(c, command, "--build-agent") coretesting.AssertOperationWasBlocked(c, err, ".*TestBlockUpgradeJujuWithRealUpload.*") } @@ -568,8 +611,8 @@ controllerUUID: "deadbeef-1bad-500d-9000-4b1d0d06f00d", agentVersion: "1.99.99", } - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) - _, err := cmdtesting.RunCommand(c, cmd, "--build-agent", "-m", "dummy-model") + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) + _, err := cmdtesting.RunCommand(c, command, "--build-agent", "-m", "dummy-model") c.Assert(err, gc.ErrorMatches, "--build-agent can only be used with the controller model") } @@ -582,8 +625,8 @@ agentVersion: "1.99.99", } s.PatchValue(&jujuversion.Current, version.MustParse("1.100.0")) - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) - _, err := cmdtesting.RunCommand(c, cmd, "--ignore-agent-versions") + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, nil) + _, err := cmdtesting.RunCommand(c, command, "--ignore-agent-versions") c.Assert(err, jc.ErrorIsNil) c.Assert(fakeAPI.tools, gc.Not(gc.HasLen), 0) c.Assert(fakeAPI.tools[0].Version.Number, gc.Equals, version.MustParse("1.100.0.1")) @@ -796,12 +839,12 @@ s.setUpEnvAndTools(c, test.currentVersion, test.agentVersion, test.tools) - cmd := s.upgradeJujuCommandNoAPI(test.upgradeMap) - err := cmdtesting.InitCommand(cmd, test.cmdArgs) + command := s.upgradeJujuCommandNoAPI(test.upgradeMap) + err := cmdtesting.InitCommand(command, test.cmdArgs) c.Assert(err, jc.ErrorIsNil) ctx := cmdtesting.Context(c) - err = cmd.Run(ctx) + err = command.Run(ctx) if test.expectedErr != "" { c.Check(err, gc.ErrorMatches, test.expectedErr) } else if !c.Check(err, jc.ErrorIsNil) { @@ -831,11 +874,11 @@ fakeAPI := NewFakeUpgradeJujuAPI(c, s.State) fakeAPI.addTools("2.1.0-weird-amd64") - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) - err := cmdtesting.InitCommand(cmd, []string{}) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) + err := cmdtesting.InitCommand(command, []string{}) c.Assert(err, jc.ErrorIsNil) - err = cmd.Run(cmdtesting.Context(c)) + err = command.Run(cmdtesting.Context(c)) c.Assert(err, gc.IsNil) // ensure find tools was called @@ -850,11 +893,11 @@ Code: params.CodeUpgradeInProgress, } - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) - err := cmdtesting.InitCommand(cmd, []string{}) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) + err := cmdtesting.InitCommand(command, []string{}) c.Assert(err, jc.ErrorIsNil) - err = cmd.Run(cmdtesting.Context(c)) + err = command.Run(cmdtesting.Context(c)) c.Assert(err, gc.ErrorMatches, "a message from the server about the problem\n"+ "\n"+ "Please wait for the upgrade to complete or if there was a problem with\n"+ @@ -867,13 +910,13 @@ fakeAPI := NewFakeUpgradeJujuAPI(c, s.State) fakeAPI.setVersionErr = common.OperationBlockedError("the operation has been blocked") - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) - err := cmdtesting.InitCommand(cmd, []string{}) + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) + err := cmdtesting.InitCommand(command, []string{}) c.Assert(err, jc.ErrorIsNil) // Block operation s.BlockAllChanges(c, "TestBlockUpgradeInProgress") - err = cmd.Run(cmdtesting.Context(c)) + err = command.Run(cmdtesting.Context(c)) s.AssertBlocked(c, err, ".*To enable changes.*") } @@ -892,11 +935,11 @@ fakeAPI.reset() - cmd := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) - err := cmdtesting.InitCommand(cmd, + command := s.upgradeJujuCommand(nil, fakeAPI, fakeAPI, fakeAPI) + err := cmdtesting.InitCommand(command, append([]string{"--reset-previous-upgrade"}, args...)) c.Assert(err, jc.ErrorIsNil) - err = cmd.Run(ctx) + err = command.Run(ctx) if expect { c.Assert(err, jc.ErrorIsNil) } else { @@ -1002,9 +1045,9 @@ ) { a.findToolsCalled = true a.tools = append(a.tools, a.nextVersion.String()) - tools := toolstesting.MakeTools(a.c, a.c.MkDir(), "released", a.tools) + testTools := toolstesting.MakeTools(a.c, a.c.MkDir(), "released", a.tools) return params.FindToolsResult{ - List: tools, + List: testTools, Error: nil, }, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/cloudcredential.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/cloudcredential.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/cloudcredential.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/cloudcredential.go 2019-06-28 17:10:43.000000000 +0000 @@ -68,10 +68,18 @@ store jujuclient.CredentialGetter, provider environs.EnvironProvider, args modelcmd.GetCredentialsParams, -) (_ *jujucloud.Credential, chosenCredentialName, regionName string, isDetected bool, _ error) { +) (_ *jujucloud.Credential, chosenCredentialName, regionName string, isDetected bool, returnedErr error) { fail := func(err error) (*jujucloud.Credential, string, string, bool, error) { return nil, "", "", false, err } + + defer func() { + if returnedErr == nil { + if !names.IsValidCloudCredentialName(chosenCredentialName) { + returnedErr = errors.NotValidf("credential name %q", chosenCredentialName) + } + } + }() credential, chosenCredentialName, regionName, err := modelcmd.GetCredentials(ctx, store, args) if !errors.IsNotFound(err) || args.CredentialName != "" { return credential, chosenCredentialName, regionName, false, err diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/cloudcredential_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/cloudcredential_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/cloudcredential_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/cloudcredential_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -17,6 +17,7 @@ "github.com/juju/juju/cloud" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" + _ "github.com/juju/juju/provider/dummy" ) var _ = gc.Suite(&cloudCredentialSuite{}) @@ -132,3 +133,44 @@ }) c.Assert(errors.Cause(err).Error(), gc.Matches, "bad") } + +func (*cloudCredentialSuite) assertInvalidCredentialName(c *gc.C, in modelcmd.GetCredentialsParams) { + ctrl := gomock.NewController(c) + defer ctrl.Finish() + + cloudCredential := &cloud.CloudCredential{AuthCredentials: map[string]cloud.Credential{"new one": cloud.NewEmptyCredential()}} + mockProvider := common.NewMockTestCloudProvider(ctrl) + mockStore := common.NewMockCredentialStore(ctrl) + mockStore.EXPECT().CredentialForCloud("cloud").Return( + cloudCredential, + nil, + ) + + stderr := new(bytes.Buffer) + + _, _, _, _, err := common.GetOrDetectCredential( + &cmd.Context{Stderr: stderr}, + mockStore, + mockProvider, + in, + ) + c.Assert(errors.Cause(err), gc.ErrorMatches, `credential name "new one" not valid`) + c.Assert(errors.Cause(err), jc.Satisfies, errors.IsNotValid) +} + +func (s *cloudCredentialSuite) TestGetOrDetectCredentialInvalidCredentialNameProvided(c *gc.C) { + s.assertInvalidCredentialName(c, + modelcmd.GetCredentialsParams{ + CredentialName: "new one", + Cloud: cloud.Cloud{Name: "cloud", Type: "dummy"}, + }, + ) +} + +func (s *cloudCredentialSuite) TestGetOrDetectCredentialInvalidCredentialName(c *gc.C) { + s.assertInvalidCredentialName(c, + modelcmd.GetCredentialsParams{ + Cloud: cloud.Cloud{Name: "cloud", Type: "dummy"}, + }, + ) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/controller.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/controller.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/common/controller.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/common/controller.go 2019-06-28 17:10:43.000000000 +0000 @@ -130,7 +130,7 @@ // BootstrapEndpointAddresses returns the addresses of the bootstrapped instance. func BootstrapEndpointAddresses(environ environs.InstanceBroker, callContext context.ProviderCallContext) ([]network.Address, error) { - instances, err := environ.AllInstances(callContext) + instances, err := environ.AllRunningInstances(callContext) if err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/kill.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/kill.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/kill.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/kill.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,8 @@ "github.com/juju/juju/api/controller" "github.com/juju/juju/api/credentialmanager" "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/caas" + "github.com/juju/juju/cloud" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/environs" @@ -215,13 +217,18 @@ hasErrors = true continue } - // TODO(caas) - only cloud providers support Destroy() - if cloudProvider, ok := p.(environs.CloudEnvironProvider); ok { - env, err := environs.Open(cloudProvider, environs.OpenParams{ + if cloudProvider, ok := p.(environs.EnvironProvider); ok { + openParams := environs.OpenParams{ ControllerUUID: ctrlUUID, Cloud: model.CloudSpec, Config: cfg, - }) + } + var env environs.CloudDestroyer + if model.CloudSpec.Type == cloud.CloudTypeCAAS { + env, err = caas.Open(cloudProvider, openParams) + } else { + env, err = environs.Open(cloudProvider, openParams) + } if err != nil { logger.Errorf(err.Error()) hasErrors = true diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/register.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/register.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/register.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/register.go 2019-06-28 17:10:43.000000000 +0000 @@ -138,6 +138,15 @@ if err != nil { return errors.Trace(err) } + + // Check if user is trying to register an already known controller by + // by providing the IP of one of its endpoints. + if registrationParams.publicHost != "" { + if err := ensureNotKnownEndpoint(c.store, registrationParams.publicHost); err != nil { + return errors.Trace(err) + } + } + controllerName, err := c.promptControllerName(registrationParams.defaultControllerName, ctx.Stderr, ctx.Stdin) if err != nil { return errors.Trace(err) @@ -202,6 +211,7 @@ if !strings.Contains(apiAddr, ":") { apiAddr += ":443" } + // Make a direct API connection because we don't yet know the // controller UUID so can't store the thus-incomplete controller // details to make a conventional connection. @@ -332,18 +342,7 @@ } for name, ctl := range all { if ctl.ControllerUUID == controllerDetails.ControllerUUID { - var buf bytes.Buffer - if err := alreadyRegisteredMessageT.Execute( - &buf, - map[string]interface{}{ - "ControllerName": name, - "UserName": accountDetails.User, - }, - ); err != nil { - return err - } - ctx.Warningf(buf.String()) - return errors.Errorf("controller is already registered as %q", name) + return genAlreadyRegisteredError(name, accountDetails.User) } } if err := store.AddController(controllerName, controllerDetails); err != nil { @@ -355,16 +354,6 @@ return nil } -var alreadyRegisteredMessageT = template.Must(template.New("").Parse(` -This controller has already been registered on this client as "{{.ControllerName}}." -To login user "{{.UserName}}" run 'juju login -u {{.UserName}} -c {{.ControllerName}}'. -To update controller details and login as user "{{.UserName}}": - 1. run 'juju unregister {{.UserName}}' - 2. request from your controller admin another registration string, i.e - output from 'juju change-user-password {{.UserName}} --reset' - 3. re-run 'juju register' with the registration from (2) above. -`[1:])) - func (c *registerCommand) listModels(store jujuclient.ClientStore, controllerName, userName string) ([]base.UserModel, error) { api, err := c.NewAPIRoot(store, controllerName, "") if err != nil { @@ -623,3 +612,54 @@ func (r byteAtATimeReader) Read(out []byte) (int, error) { return r.Reader.Read(out[:1]) } + +// ensureNotKnownEndpoint checks whether any controllers in the local client +// cache contain the provided endpoint and returns an error if that is the +// case. +func ensureNotKnownEndpoint(store jujuclient.ClientStore, endpoint string) error { + existingDetails, existingName, err := store.ControllerByAPIEndpoints(endpoint) + if err != nil && !errors.IsNotFound(err) { + return errors.Trace(err) + } + + if existingDetails == nil { + return nil + } + + // Check if we know the username for this controller + accountDetails, err := store.AccountDetails(existingName) + if err != nil && !errors.IsNotFound(err) { + return errors.Trace(err) + } + + if accountDetails != nil { + return genAlreadyRegisteredError(existingName, accountDetails.User) + } + + return errors.Errorf(`This controller has already been registered on this client as %q. +To login run 'juju login -c %s'.`, existingName, existingName) +} + +var alreadyRegisteredMessageT = template.Must(template.New("").Parse(` +This controller has already been registered on this client as "{{.ControllerName}}". +To login user "{{.UserName}}" run 'juju login -u {{.UserName}} -c {{.ControllerName}}'. +To update controller details and login as user "{{.UserName}}": + 1. run 'juju unregister {{.ControllerName}}' + 2. request from your controller admin another registration string, i.e + output from 'juju change-user-password {{.UserName}} --reset' + 3. re-run 'juju register' with the registration string from (2) above. +`[1:])) + +func genAlreadyRegisteredError(controller, user string) error { + var buf bytes.Buffer + if err := alreadyRegisteredMessageT.Execute( + &buf, + struct { + ControllerName string + UserName string + }{controller, user}, + ); err != nil { + return err + } + return errors.New(buf.String()) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/register_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/register_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/controller/register_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/controller/register_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -328,7 +328,15 @@ Initial password successfully set for bob. `[1:]) err = s.run(c, prompter, registrationData) - c.Assert(err, gc.ErrorMatches, `controller is already registered as "controller-name"`, gc.Commentf("details: %v", errors.Details(err))) + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, `This controller has already been registered on this client as "controller-name". +To login user "bob" run 'juju login -u bob -c controller-name'. +To update controller details and login as user "bob": + 1. run 'juju unregister controller-name' + 2. request from your controller admin another registration string, i.e + output from 'juju change-user-password bob --reset' + 3. re-run 'juju register' with the registration string from (2) above. +`) prompter.CheckDone() } @@ -485,6 +493,50 @@ }) } +func (s *RegisterSuite) TestRegisterAlreadyKnownControllerEndpoint(c *gc.C) { + prompter := cmdtesting.NewSeqPrompter(c, "»", "") + defer prompter.CheckDone() + + err := s.store.AddController("foo", jujuclient.ControllerDetails{ + APIEndpoints: []string{"42.42.42.42:17070"}, + ControllerUUID: "0d75314a-5266-4f4f-8523-415be76f92dc", + CACert: testing.CACert, + }) + c.Assert(err, jc.ErrorIsNil) + + err = s.run(c, prompter, "42.42.42.42:17070") + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, `This controller has already been registered on this client as "foo". +To login run 'juju login -c foo'.`) +} + +func (s *RegisterSuite) TestRegisterAlreadyKnownControllerEndpointAndUser(c *gc.C) { + prompter := cmdtesting.NewSeqPrompter(c, "»", "") + defer prompter.CheckDone() + + err := s.store.AddController("foo", jujuclient.ControllerDetails{ + APIEndpoints: []string{"42.42.42.42:17070"}, + ControllerUUID: "0d75314a-5266-4f4f-8523-415be76f92dc", + CACert: testing.CACert, + }) + c.Assert(err, jc.ErrorIsNil) + + s.store.Accounts["foo"] = jujuclient.AccountDetails{ + User: "bob", + } + + err = s.run(c, prompter, "42.42.42.42:17070") + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, `This controller has already been registered on this client as "foo". +To login user "bob" run 'juju login -u bob -c foo'. +To update controller details and login as user "bob": + 1. run 'juju unregister foo' + 2. request from your controller admin another registration string, i.e + output from 'juju change-user-password bob --reset' + 3. re-run 'juju register' with the registration string from (2) above. +`) +} + func (s *RegisterSuite) TestRegisterPublicAPIOpenError(c *gc.C) { s.apiOpenError = errors.New("open failed") prompter := cmdtesting.NewSeqPrompter(c, "»", ` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,9 +10,9 @@ "strings" "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "github.com/juju/juju/cmd/output" - "github.com/juju/juju/core/crossmodel" ) // formatFindTabular returns a tabular summary of remote applications or @@ -32,7 +32,7 @@ w.Println("Store", "URL", "Access", "Interfaces") for urlStr, one := range all { - url, err := crossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { return err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/find.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/find.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/find.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/find.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" jujucmd "github.com/juju/juju/cmd" @@ -26,9 +27,9 @@ $ juju find-offers --interface mysql $ juju find-offers --url fred/prod.db2 $ juju find-offers --offer db2 - + See also: - show-offer + show-offer ` type findCommand struct { @@ -147,7 +148,7 @@ c.source = controllerName return nil } - urlParts, err := crossmodel.ParseOfferURLParts(c.url) + urlParts, err := charm.ParseOfferURLParts(c.url) if err != nil { return errors.Trace(err) } @@ -214,7 +215,7 @@ Endpoints: convertRemoteEndpoints(one.Endpoints...), Users: convertUsers(one.Users...), } - url, err := crossmodel.ParseOfferURL(one.OfferURL) + url, err := charm.ParseOfferURL(one.OfferURL) if err != nil { return nil, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/list.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/list.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/list.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/list.go 2019-06-28 17:10:43.000000000 +0000 @@ -24,7 +24,7 @@ const listCommandDoc = ` List information about applications' endpoints that have been shared and who is connected. -The default tabular output shows each user connected (relating to) the offer, and the +The default tabular output shows each user connected (relating to) the offer, and the relation id of the relation. The summary output shows one row per offer, with a count of active/total relations. @@ -50,7 +50,7 @@ $ juju offers hosted-mysql --active-only See also: - find-offers + find-offers show-offer ` @@ -249,7 +249,7 @@ if activeOnly && len(one.Connections) == 0 { continue } - url, err := crossmodel.ParseOfferURL(one.OfferURL) + url, err := charm.ParseOfferURL(one.OfferURL) if err != nil { return nil, errors.Annotatef(err, "%v", one.OfferURL) } @@ -263,7 +263,7 @@ return result, nil } -func convertOfferToListItem(url *crossmodel.OfferURL, offer *crossmodel.ApplicationOfferDetails) ListOfferItem { +func convertOfferToListItem(url *charm.OfferURL, offer *crossmodel.ApplicationOfferDetails) ListOfferItem { item := ListOfferItem{ OfferName: offer.OfferName, ApplicationName: offer.ApplicationName, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,13 +10,13 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/api/applicationoffers" "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" - jujucrossmodel "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/jujuclient" ) @@ -163,7 +163,7 @@ if err != nil { return errors.Trace(err) } - url := jujucrossmodel.MakeURL(ownerTag.Name(), unqualifiedModelName, c.OfferName, "") + url := charm.MakeURL(ownerTag.Name(), unqualifiedModelName, c.OfferName, "") ep := strings.Join(c.Endpoints, ", ") ctx.Infof("Application %q endpoints [%s] available at %q", c.Application, ep, url) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/remove.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/remove.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/remove.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/remove.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,12 +10,12 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" "github.com/juju/juju/api/applicationoffers" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" - "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/jujuclient" ) @@ -122,7 +122,7 @@ return errors.Trace(err) } for i, urlStr := range c.offers { - url, err := crossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { url, err = makeURLFromCurrentModel(urlStr, c.offerSource, currentModel) if err != nil { @@ -164,7 +164,7 @@ return block.ProcessBlockedError(err, block.BlockRemove) } -func makeURLFromCurrentModel(urlStr, offerSource, currentModel string) (*crossmodel.OfferURL, error) { +func makeURLFromCurrentModel(urlStr, offerSource, currentModel string) (*charm.OfferURL, error) { // We may have just been given an offer name. // Try again with the current model as the host model. modelName := currentModel @@ -177,6 +177,6 @@ modelName = baseName userName = userTag.Name() } - derivedUrl := crossmodel.MakeURL(userName, modelName, urlStr, offerSource) - return crossmodel.ParseOfferURL(derivedUrl) + derivedUrl := charm.MakeURL(userName, modelName, urlStr, offerSource) + return charm.ParseOfferURL(derivedUrl) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,9 +10,9 @@ "strings" "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "github.com/juju/juju/cmd/output" - "github.com/juju/juju/core/crossmodel" ) const ( @@ -41,7 +41,7 @@ w.Println("Store", "URL", "Access", "Description", "Endpoint", "Interface", "Role") for urlStr, one := range all { - url, err := crossmodel.ParseOfferURL(urlStr) + url, err := charm.ParseOfferURL(urlStr) if err != nil { return err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/show.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/show.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/crossmodel/show.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/crossmodel/show.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" jujucmd "github.com/juju/juju/cmd" @@ -26,7 +27,7 @@ juju show-offer default.prod -The supplied URL can also include a username where offers require them. +The supplied URL can also include a username where offers require them. This will be given as part of the URL retrieved from the 'juju find-offers' command. To show information for the application 'prod' from the model 'default' from the user 'admin': @@ -95,7 +96,7 @@ if err != nil { return err } - url, err := crossmodel.ParseOfferURL(c.url) + url, err := charm.ParseOfferURL(c.url) if err != nil { store := c.ClientStore() currentModel, err := store.CurrentModel(controllerName) @@ -182,7 +183,7 @@ if one.ApplicationDescription != "" { app.Description = one.ApplicationDescription } - url, err := crossmodel.ParseOfferURL(one.OfferURL) + url, err := charm.ParseOfferURL(one.OfferURL) if err != nil { return nil, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/gui/gui.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/gui/gui.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/gui/gui.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/gui/gui.go 2019-06-28 17:10:43.000000000 +0000 @@ -190,7 +190,7 @@ if vers != nil { versInfo = fmt.Sprintf("%v ", vers) } - modelName, err := c.ModelName() + modelName, err := c.ModelIdentifier() if err != nil { return errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/addbranch.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/addbranch.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/addbranch.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/addbranch.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,128 @@ +// Copyright 2018 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package model + +import ( + "fmt" + + "github.com/juju/cmd" + "github.com/juju/errors" + "github.com/juju/gnuflag" + + "github.com/juju/juju/api/modelgeneration" + jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/model" +) + +const ( + addBranchSummary = "Adds a new branch to the model." + addBranchDoc = ` +A branch is a mechanism by which changes can be applied to units gradually at +the operator's discretion. When changes are made to charm configuration under +a branch, only units set to track the branch will realise such changes. +Once the changes are assessed and deemed acceptable, the branch can be +committed, applying the changes to the model and affecting all units. +The branch name "master" is reserved for primary model-based settings and is +not valid for new branches. + +Examples: + juju add-branch upgrade-postgresql + +See also: + track + branch + commit + abort + diff +` +) + +// NewAddBranchCommand wraps addBranchCommand with sane model settings. +func NewAddBranchCommand() cmd.Command { + return modelcmd.Wrap(&addBranchCommand{}) +} + +// addBranchCommand supplies the "add-branch" CLI command used to add a new branch to +// the current model. +type addBranchCommand struct { + modelcmd.ModelCommandBase + + api AddBranchCommandAPI + + branchName string +} + +// AddBranchCommandAPI describes API methods required +// to execute the branch command. +//go:generate mockgen -package mocks -destination ./mocks/addbranch_mock.go github.com/juju/juju/cmd/juju/model AddBranchCommandAPI +type AddBranchCommandAPI interface { + Close() error + + // AddBranch adds a new branch to the model. + AddBranch(branchName string) error +} + +// Info implements part of the cmd.Command interface. +func (c *addBranchCommand) Info() *cmd.Info { + info := &cmd.Info{ + Name: "add-branch", + Args: "", + Purpose: addBranchSummary, + Doc: addBranchDoc, + } + return jujucmd.Info(info) +} + +// SetFlags implements part of the cmd.Command interface. +func (c *addBranchCommand) SetFlags(f *gnuflag.FlagSet) { + c.ModelCommandBase.SetFlags(f) +} + +// Init implements part of the cmd.Command interface. +func (c *addBranchCommand) Init(args []string) error { + if len(args) != 1 { + return errors.Errorf("expected a branch name") + } + if err := model.ValidateBranchName(args[0]); err != nil { + return err + } + c.branchName = args[0] + return nil +} + +// getAPI returns the API that supplies methods +// required to execute this command. +func (c *addBranchCommand) getAPI() (AddBranchCommandAPI, error) { + if c.api != nil { + return c.api, nil + } + api, err := c.NewAPIRoot() + if err != nil { + return nil, errors.Annotate(err, "opening API connection") + } + client := modelgeneration.NewClient(api) + return client, nil +} + +// Run implements the meaty part of the cmd.Command interface. +func (c *addBranchCommand) Run(ctx *cmd.Context) error { + client, err := c.getAPI() + if err != nil { + return err + } + defer func() { _ = client.Close() }() + + if err = client.AddBranch(c.branchName); err != nil { + return err + } + + // Update the model store with the new active branch for this model. + if err = c.SetActiveBranch(c.branchName); err != nil { + return err + } + + _, err = ctx.Stdout.Write([]byte(fmt.Sprintf("Created branch %q and set active\n", c.branchName))) + return err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/addbranch_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/addbranch_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/addbranch_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/addbranch_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright 2018 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package model_test + +import ( + "github.com/golang/mock/gomock" + "github.com/juju/cmd" + "github.com/juju/cmd/cmdtesting" + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/cmd/juju/model" + "github.com/juju/juju/cmd/juju/model/mocks" + coremodel "github.com/juju/juju/core/model" +) + +type addBranchSuite struct { + generationBaseSuite +} + +var _ = gc.Suite(&addBranchSuite{}) + +func (s *addBranchSuite) TestInit(c *gc.C) { + err := s.runInit(s.branchName) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *addBranchSuite) TestInitNoName(c *gc.C) { + err := s.runInit() + c.Assert(err, gc.ErrorMatches, "expected a branch name") +} + +func (s *addBranchSuite) TestInitInvalidName(c *gc.C) { + err := s.runInit(coremodel.GenerationMaster) + c.Assert(err, jc.Satisfies, errors.IsNotValid) +} + +func (s *addBranchSuite) TestRunCommand(c *gc.C) { + ctrl, api := setUpMocks(c) + defer ctrl.Finish() + + api.EXPECT().AddBranch(s.branchName).Return(nil) + + ctx, err := s.runCommand(c, api) + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Created branch \""+s.branchName+"\" and set active\n") + + // Ensure the local store has "new-branch" as the target. + details, err := s.store.ModelByName( + s.store.CurrentControllerName, s.store.Models[s.store.CurrentControllerName].CurrentModel) + c.Assert(err, jc.ErrorIsNil) + c.Assert(details.ActiveBranch, gc.Equals, s.branchName) +} + +func (s *addBranchSuite) TestRunCommandFail(c *gc.C) { + ctrl, api := setUpMocks(c) + defer ctrl.Finish() + + api.EXPECT().AddBranch(s.branchName).Return(errors.Errorf("fail")) + + _, err := s.runCommand(c, api) + c.Assert(err, gc.ErrorMatches, "fail") +} + +func (s *addBranchSuite) runInit(args ...string) error { + return cmdtesting.InitCommand(model.NewAddBranchCommandForTest(nil, s.store), args) +} + +func (s *addBranchSuite) runCommand(c *gc.C, api model.AddBranchCommandAPI) (*cmd.Context, error) { + return cmdtesting.RunCommand(c, model.NewAddBranchCommandForTest(api, s.store), s.branchName) +} + +func setUpMocks(c *gc.C) (*gomock.Controller, *mocks.MockAddBranchCommandAPI) { + ctrl := gomock.NewController(c) + api := mocks.NewMockAddBranchCommandAPI(ctrl) + api.EXPECT().Close() + return ctrl, api +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/branch.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/branch.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/branch.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/branch.go 2019-06-28 17:10:43.000000000 +0000 @@ -1,12 +1,11 @@ -// Copyright 2018 Canonical Ltd. +// Copyright 2019 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package model import ( "fmt" - - "github.com/juju/juju/core/model" + "io" "github.com/juju/cmd" "github.com/juju/errors" @@ -15,28 +14,37 @@ "github.com/juju/juju/api/modelgeneration" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/model" ) const ( - branchSummary = "Adds a new branch to the model." + branchSummary = "Work on the supplied branch." branchDoc = ` -A branch is a mechanism by which changes can be applied to units gradually at -the operator's discretion. When changes are made to charm configuration under -a branch, only units set to track the branch will realise such changes. -Once the changes are assessed and deemed acceptable, the branch can be -committed, applying the changes to the model and affecting all units. -The branch name "master" is reserved for primary model-based settings and is -not valid for new branches. +Switch to the supplied branch, causing changes to charm configuration to apply +only to units tracking the branch. Changing the branch to "master" causes +subsequent changes to be applied to all units that are not tracking an active +branch. If no branch is supplied, active branch is displayed. Examples: - juju branch upgrade-postgresql + +Switch to make changes to test-branch: + + juju branch test-branch + +Switch to make changes to master, changes applied to all units not tracking an active branch: + + juju branch master + +Display the active branch: + + juju branch See also: + add-branch track - checkout commit abort - diff + diff ` ) @@ -45,8 +53,8 @@ return modelcmd.Wrap(&branchCommand{}) } -// branchCommand supplies the "branch" CLI command used to add a new branch to -// the current model. +// branchCommand supplies the "branch" CLI command used to switch the +// active branch for this operator. type branchCommand struct { modelcmd.ModelCommandBase @@ -60,16 +68,16 @@ //go:generate mockgen -package mocks -destination ./mocks/branch_mock.go github.com/juju/juju/cmd/juju/model BranchCommandAPI type BranchCommandAPI interface { Close() error - - // AddBranch adds a new branch to the model. - AddBranch(branchName string) error + // HasActiveBranch returns true if the model has an + // "in-flight" branch with the input name. + HasActiveBranch(branchName string) (bool, error) } // Info implements part of the cmd.Command interface. func (c *branchCommand) Info() *cmd.Info { info := &cmd.Info{ Name: "branch", - Args: "", + Args: "[]", Purpose: branchSummary, Doc: branchDoc, } @@ -83,13 +91,12 @@ // Init implements part of the cmd.Command interface. func (c *branchCommand) Init(args []string) error { - if len(args) != 1 { - return errors.Errorf("expected a branch name") + if len(args) > 1 { + return errors.Errorf("must specify a branch name to switch to or leave blank") } - if err := model.ValidateBranchName(args[0]); err != nil { - return err + if len(args) == 1 { + c.branchName = args[0] } - c.branchName = args[0] return nil } @@ -107,23 +114,44 @@ return client, nil } -// Run implements the meaty part of the cmd.Command interface. +// Run (cmd.Command) sets the active branch in the local store. func (c *branchCommand) Run(ctx *cmd.Context) error { - client, err := c.getAPI() - if err != nil { - return err + // If no branch specified, print the current active branch. + if c.branchName == "" { + return c.activeBranch(ctx.Stdout) + } + // If the active branch is not being set to the (default) master, + // then first ensure that a branch with the supplied name exists. + if c.branchName != model.GenerationMaster { + client, err := c.getAPI() + if err != nil { + return err + } + defer func() { _ = client.Close() }() + + hasBranch, err := client.HasActiveBranch(c.branchName) + if err != nil { + return errors.Annotate(err, "checking for active branch") + } + if !hasBranch { + return errors.Errorf("this model has no active branch %q", c.branchName) + } } - defer func() { _ = client.Close() }() - if err = client.AddBranch(c.branchName); err != nil { + if err := c.SetActiveBranch(c.branchName); err != nil { return err } + msg := fmt.Sprintf("Active branch set to %q\n", c.branchName) + _, err := ctx.Stdout.Write([]byte(msg)) + return err +} - // Update the model store with the new active branch for this model. - if err = c.SetActiveBranch(c.branchName); err != nil { - return err +func (c *branchCommand) activeBranch(out io.Writer) error { + activeBranchName, err := c.ActiveBranch() + if err != nil { + return errors.Trace(err) } - - _, err = ctx.Stdout.Write([]byte(fmt.Sprintf("Active branch set to %q\n", c.branchName))) + msg := fmt.Sprintf("Active branch is %q\n", activeBranchName) + _, err = out.Write([]byte(msg)) return err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/branch_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/branch_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/branch_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/branch_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 Canonical Ltd. +// Copyright 2019 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package model_test @@ -7,7 +7,6 @@ "github.com/golang/mock/gomock" "github.com/juju/cmd" "github.com/juju/cmd/cmdtesting" - "github.com/juju/errors" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -27,52 +26,68 @@ c.Assert(err, jc.ErrorIsNil) } -func (s *branchSuite) TestInitNoName(c *gc.C) { +func (s *branchSuite) TestInitNone(c *gc.C) { err := s.runInit() - c.Assert(err, gc.ErrorMatches, "expected a branch name") + c.Assert(err, jc.ErrorIsNil) } -func (s *branchSuite) TestInitInvalidName(c *gc.C) { - err := s.runInit(coremodel.GenerationMaster) - c.Assert(err, jc.Satisfies, errors.IsNotValid) +func (s *branchSuite) TestInitFail(c *gc.C) { + err := s.runInit("test", "me") + c.Assert(err, gc.ErrorMatches, "must specify a branch name to switch to or leave blank") } -func (s *branchSuite) TestRunCommand(c *gc.C) { - ctrl, api := setUpMocks(c) +func (s *branchSuite) TestRunCommandMaster(c *gc.C) { + ctx, err := s.runCommand(c, nil, coremodel.GenerationMaster) + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Active branch set to \"master\"\n") + + cName := s.store.CurrentControllerName + details, err := s.store.ModelByName(cName, s.store.Models[cName].CurrentModel) + c.Assert(err, jc.ErrorIsNil) + c.Assert(details.ActiveBranch, gc.Equals, coremodel.GenerationMaster) +} + +func (s *branchSuite) TestRunCommandBranchExists(c *gc.C) { + ctrl, api := setUpSwitchMocks(c) defer ctrl.Finish() - api.EXPECT().AddBranch(s.branchName).Return(nil) + api.EXPECT().HasActiveBranch(s.branchName).Return(true, nil) - ctx, err := s.runCommand(c, api) + ctx, err := s.runCommand(c, api, s.branchName) c.Assert(err, jc.ErrorIsNil) - c.Assert(cmdtesting.Stdout(ctx), gc.Equals, `Active branch set to "`+s.branchName+"\"\n") + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Active branch set to \"new-branch\"\n") - // Ensure the local store has "new-branch" as the target. - details, err := s.store.ModelByName( - s.store.CurrentControllerName, s.store.Models[s.store.CurrentControllerName].CurrentModel) + cName := s.store.CurrentControllerName + details, err := s.store.ModelByName(cName, s.store.Models[cName].CurrentModel) c.Assert(err, jc.ErrorIsNil) c.Assert(details.ActiveBranch, gc.Equals, s.branchName) } -func (s *branchSuite) TestRunCommandFail(c *gc.C) { - ctrl, api := setUpMocks(c) +func (s *branchSuite) TestRunCommandNoBranchError(c *gc.C) { + ctrl, api := setUpSwitchMocks(c) defer ctrl.Finish() - api.EXPECT().AddBranch(s.branchName).Return(errors.Errorf("fail")) + api.EXPECT().HasActiveBranch(s.branchName).Return(false, nil) + + _, err := s.runCommand(c, api, s.branchName) + c.Assert(err, gc.ErrorMatches, `this model has no active branch "`+s.branchName+`"`) +} - _, err := s.runCommand(c, api) - c.Assert(err, gc.ErrorMatches, "fail") +func (s *branchSuite) TestRunCommandActiveBranch(c *gc.C) { + ctx, err := s.runCommand(c, nil) + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Active branch is \"master\"\n") } func (s *branchSuite) runInit(args ...string) error { return cmdtesting.InitCommand(model.NewBranchCommandForTest(nil, s.store), args) } -func (s *branchSuite) runCommand(c *gc.C, api model.BranchCommandAPI) (*cmd.Context, error) { - return cmdtesting.RunCommand(c, model.NewBranchCommandForTest(api, s.store), s.branchName) +func (s *branchSuite) runCommand(c *gc.C, api model.BranchCommandAPI, args ...string) (*cmd.Context, error) { + return cmdtesting.RunCommand(c, model.NewBranchCommandForTest(api, s.store), args...) } -func setUpMocks(c *gc.C) (*gomock.Controller, *mocks.MockBranchCommandAPI) { +func setUpSwitchMocks(c *gc.C) (*gomock.Controller, *mocks.MockBranchCommandAPI) { ctrl := gomock.NewController(c) api := mocks.NewMockBranchCommandAPI(ctrl) api.EXPECT().Close() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/checkout.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/checkout.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/checkout.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/checkout.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -// Copyright 2019 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package model - -import ( - "fmt" - - "github.com/juju/juju/core/model" - - "github.com/juju/cmd" - "github.com/juju/errors" - "github.com/juju/gnuflag" - - "github.com/juju/juju/api/modelgeneration" - jujucmd "github.com/juju/juju/cmd" - "github.com/juju/juju/cmd/modelcmd" -) - -const ( - checkoutSummary = "Work on the supplied branch." - checkoutDoc = ` -Switch to the supplied branch, causing changes to charm configuration to apply -only to units tracking the branch. Changing the branch to "master" causes -subsequent changes to be applied to all units that are not tracking an active -branch. - -Examples: - juju checkout test-branch - juju checkout master - -See also: - branch - track - commit - abort - diff -` -) - -// NewCheckoutCommand wraps checkoutCommand with sane model settings. -func NewCheckoutCommand() cmd.Command { - return modelcmd.Wrap(&checkoutCommand{}) -} - -// checkoutCommand supplies the "checkout" CLI command used to switch the -// active branch for this operator. -type checkoutCommand struct { - modelcmd.ModelCommandBase - - api CheckoutCommandAPI - - branchName string -} - -// CheckoutCommandAPI describes API methods required -// to execute the checkout command. -//go:generate mockgen -package mocks -destination ./mocks/checkout_mock.go github.com/juju/juju/cmd/juju/model CheckoutCommandAPI -type CheckoutCommandAPI interface { - Close() error - // HasActiveBranch returns true if the model has an - // "in-flight" branch with the input name. - HasActiveBranch(branchName string) (bool, error) -} - -// Info implements part of the cmd.Command interface. -func (c *checkoutCommand) Info() *cmd.Info { - info := &cmd.Info{ - Name: "checkout", - Args: "", - Purpose: checkoutSummary, - Doc: checkoutDoc, - } - return jujucmd.Info(info) -} - -// SetFlags implements part of the cmd.Command interface. -func (c *checkoutCommand) SetFlags(f *gnuflag.FlagSet) { - c.ModelCommandBase.SetFlags(f) -} - -// Init implements part of the cmd.Command interface. -func (c *checkoutCommand) Init(args []string) error { - if len(args) != 1 { - return errors.Errorf("must specify a branch name to switch to") - } - c.branchName = args[0] - return nil -} - -// getAPI returns the API that supplies methods -// required to execute this command. -func (c *checkoutCommand) getAPI() (CheckoutCommandAPI, error) { - if c.api != nil { - return c.api, nil - } - api, err := c.NewAPIRoot() - if err != nil { - return nil, errors.Annotate(err, "opening API connection") - } - client := modelgeneration.NewClient(api) - return client, nil -} - -// Run (cmd.Command) sets the active branch in the local store. -func (c *checkoutCommand) Run(ctx *cmd.Context) error { - // If the active branch is not being set to the (default) master, - // then first ensure that a branch with the supplied name exists. - if c.branchName != model.GenerationMaster { - client, err := c.getAPI() - if err != nil { - return err - } - defer func() { _ = client.Close() }() - - hasBranch, err := client.HasActiveBranch(c.branchName) - if err != nil { - return errors.Annotate(err, "checking for active branch") - } - if !hasBranch { - return errors.Errorf("this model has no active branch %q", c.branchName) - } - } - - if err := c.SetActiveBranch(c.branchName); err != nil { - return err - } - msg := fmt.Sprintf("Active branch set to %q\n", c.branchName) - _, err := ctx.Stdout.Write([]byte(msg)) - return err -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/checkout_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/checkout_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/checkout_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/checkout_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -// Copyright 2019 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package model_test - -import ( - "github.com/golang/mock/gomock" - "github.com/juju/cmd" - "github.com/juju/cmd/cmdtesting" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/juju/cmd/juju/model" - "github.com/juju/juju/cmd/juju/model/mocks" - coremodel "github.com/juju/juju/core/model" -) - -type checkoutSuite struct { - generationBaseSuite -} - -var _ = gc.Suite(&checkoutSuite{}) - -func (s *checkoutSuite) TestInit(c *gc.C) { - err := s.runInit(s.branchName) - c.Assert(err, jc.ErrorIsNil) -} - -func (s *checkoutSuite) TestInitFail(c *gc.C) { - err := s.runInit() - c.Assert(err, gc.ErrorMatches, "must specify a branch name to switch to") -} - -func (s *checkoutSuite) TestRunCommandMaster(c *gc.C) { - ctx, err := s.runCommand(c, nil, coremodel.GenerationMaster) - c.Assert(err, jc.ErrorIsNil) - c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Active branch set to \"master\"\n") - - cName := s.store.CurrentControllerName - details, err := s.store.ModelByName(cName, s.store.Models[cName].CurrentModel) - c.Assert(err, jc.ErrorIsNil) - c.Assert(details.ActiveBranch, gc.Equals, coremodel.GenerationMaster) -} - -func (s *checkoutSuite) TestRunCommandBranchExists(c *gc.C) { - ctrl, api := setUpSwitchMocks(c) - defer ctrl.Finish() - - api.EXPECT().HasActiveBranch(s.branchName).Return(true, nil) - - ctx, err := s.runCommand(c, api, s.branchName) - c.Assert(err, jc.ErrorIsNil) - c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "Active branch set to \"new-branch\"\n") - - cName := s.store.CurrentControllerName - details, err := s.store.ModelByName(cName, s.store.Models[cName].CurrentModel) - c.Assert(err, jc.ErrorIsNil) - c.Assert(details.ActiveBranch, gc.Equals, s.branchName) -} - -func (s *checkoutSuite) TestRunCommandNoBranchError(c *gc.C) { - ctrl, api := setUpSwitchMocks(c) - defer ctrl.Finish() - - api.EXPECT().HasActiveBranch(s.branchName).Return(false, nil) - - _, err := s.runCommand(c, api, s.branchName) - c.Assert(err, gc.ErrorMatches, `this model has no active branch "`+s.branchName+`"`) -} - -func (s *checkoutSuite) runInit(args ...string) error { - return cmdtesting.InitCommand(model.NewCheckoutCommandForTest(nil, s.store), args) -} - -func (s *checkoutSuite) runCommand(c *gc.C, api model.CheckoutCommandAPI, args ...string) (*cmd.Context, error) { - return cmdtesting.RunCommand(c, model.NewCheckoutCommandForTest(api, s.store), args...) -} - -func setUpSwitchMocks(c *gc.C) (*gomock.Controller, *mocks.MockCheckoutCommandAPI) { - ctrl := gomock.NewController(c) - api := mocks.NewMockCheckoutCommandAPI(ctrl) - api.EXPECT().Close() - return ctrl, api -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/commit.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/commit.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/commit.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/commit.go 2019-06-28 17:10:43.000000000 +0000 @@ -27,9 +27,9 @@ juju commit upgrade-postgresql See also: - branch + add-branch track - checkout + branch abort diff ` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/destroy.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/destroy.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/destroy.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/destroy.go 2019-06-28 17:10:43.000000000 +0000 @@ -168,7 +168,7 @@ case 0: return errors.New("no model specified") case 1: - return c.SetModelName(args[0], false) + return c.SetModelIdentifier(args[0], false) default: return cmd.CheckEmpty(args[1:]) } @@ -317,7 +317,7 @@ } // Attempt to destroy the model. - ctx.Infof("Destroying model") + fmt.Fprint(ctx.Stderr, "Destroying model") var destroyStorage *bool if c.destroyStorage || c.releaseStorage { destroyStorage = &c.destroyStorage @@ -394,6 +394,14 @@ errorCount int } +func (data *modelData) isEmpty() bool { + return data.errorCount == 0 && + data.machineCount == 0 && + data.applicationCount == 0 && + data.volumeCount == 0 && + data.filesystemCount == 0 +} + func waitForModelDestroyed( ctx *cmd.Context, api DestroyModelAPI, @@ -417,6 +425,9 @@ // no wait for 1st time. intervalSeconds := 0 * time.Second timeoutAfter := clock.After(timeout) + reported := "" + lineLength := 0 + const perLineLength = 80 for { select { case <-interrupted: @@ -432,7 +443,20 @@ // model has been destroyed successfully. return nil } - ctx.Infof(formatDestroyModelInfo(data) + "...") + msg := formatDestroyModelInfo(data) + if reported == msg { + if lineLength == perLineLength { + // Time to break to the next line. + fmt.Fprintln(ctx.Stderr) + lineLength = 0 + } + fmt.Fprint(ctx.Stderr, ".") + lineLength++ + } else { + fmt.Fprint(ctx.Stderr, fmt.Sprintf("\n%v...", msg)) + reported = msg + lineLength = len(msg) + 3 + } intervalSeconds = 2 * time.Second } } @@ -492,7 +516,7 @@ } if err != nil { if params.IsCodeNotFound(err) { - ctx.Infof("Model destroyed.") + ctx.Infof("\nModel destroyed.") } else { ctx.Infof("Unable to get the model status from the API: %v.", err) } @@ -542,14 +566,11 @@ } func formatDestroyModelInfo(data *modelData) string { - out := "Waiting on model to be removed" + out := "Waiting for model to be removed" if data.errorCount > 0 { // always shows errorCount even if no machines and applications left. out += fmt.Sprintf(", %d error(s)", data.errorCount) } - if data.machineCount == 0 && data.applicationCount == 0 { - return out - } if data.machineCount > 0 { out += fmt.Sprintf(", %d machine(s)", data.machineCount) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/destroy_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/destroy_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/destroy_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/destroy_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -207,7 +207,19 @@ c.Assert(err, jc.ErrorIsNil) checkModelRemovedFromStore(c, "test1:admin/test2", s.store) s.stub.CheckCalls(c, []jutesting.StubCall{ - {"DestroyModel", []interface{}{names.NewModelTag("test2-uuid"), (*bool)(nil), (*bool)(nil), (*time.Duration)(nil)}}, + {"DestroyModel", + []interface{}{names.NewModelTag("test2-uuid"), (*bool)(nil), (*bool)(nil), (*time.Duration)(nil)}}, + }) +} + +func (s *DestroySuite) TestDestroyWithPartModelUUID(c *gc.C) { + checkModelExistsInStore(c, "test1:admin/test2", s.store) + _, err := s.runDestroyCommand(c, "test2-uu", "-y") + c.Assert(err, jc.ErrorIsNil) + checkModelRemovedFromStore(c, "test1:admin/test2", s.store) + s.stub.CheckCalls(c, []jutesting.StubCall{ + {"DestroyModel", + []interface{}{names.NewModelTag("test2-uuid"), (*bool)(nil), (*bool)(nil), (*time.Duration)(nil)}}, }) } @@ -446,9 +458,7 @@ case <-done: c.Assert(<-outStdErr, gc.Equals, ` Destroying model -Waiting on model to be removed, 5 error(s), 1 machine(s), 2 application(s), 3 volume(s), 2 filesystems(s)... -Waiting on model to be removed, 5 error(s), 1 machine(s), 2 application(s), 3 volume(s), 2 filesystems(s)... -`[1:]) +Waiting for model to be removed, 5 error(s), 1 machine(s), 2 application(s), 3 volume(s), 2 filesystems(s)....`[1:]) c.Assert(<-outStdOut, gc.Equals, ` The following errors were encountered during destroying the model. @@ -464,6 +474,46 @@ // timeout after 3s. c.Assert(<-outErr, jc.Satisfies, errors.IsTimeout) checkModelExistsInStore(c, "test1:admin/test2", s.store) + case <-time.After(testing.LongWait): + c.Fatalf("timed out waiting for destroy cmd.") + } +} + +func (s *DestroySuite) TestDestroyCommandLeanMessage(c *gc.C) { + checkModelExistsInStore(c, "test1:admin/test2", s.store) + + s.api.modelInfoErr = []*params.Error{nil, nil} + s.api.modelStatusPayload = []base.ModelStatus{{ + ApplicationCount: 0, + HostedMachineCount: 0, + Volumes: []base.Volume{}, + Filesystems: []base.Filesystem{}, + }} + + done := make(chan struct{}, 1) + outErr := make(chan error, 1) + outStdOut := make(chan string, 1) + outStdErr := make(chan string, 1) + + go func() { + // run destroy model cmd, and timeout in 3s. + ctx, err := s.runDestroyCommand(c, "test2", "-y", "-t", "3s") + outStdOut <- cmdtesting.Stdout(ctx) + outStdErr <- cmdtesting.Stderr(ctx) + outErr <- err + done <- struct{}{} + }() + + c.Assert(s.clock.WaitAdvance(5*time.Second, testing.LongWait, 2), jc.ErrorIsNil) + + select { + case <-done: + c.Assert(<-outStdErr, gc.Equals, ` +Destroying model +Waiting for model to be removed....`[1:]) + // timeout after 3s. + c.Assert(<-outErr, jc.Satisfies, errors.IsTimeout) + checkModelExistsInStore(c, "test1:admin/test2", s.store) case <-time.After(testing.LongWait): c.Fatalf("timed out waiting for destroy cmd.") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/diff.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/diff.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/diff.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/diff.go 2019-06-28 17:10:43.000000000 +0000 @@ -39,9 +39,9 @@ juju diff --utc See also: - branch + add-branch track - checkout + branch commit abort ` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/exportbundle.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/exportbundle.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/exportbundle.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/exportbundle.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,17 +9,23 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6" + "gopkg.in/yaml.v2" + "github.com/juju/juju/api/application" "github.com/juju/juju/api/bundle" + appFacade "github.com/juju/juju/apiserver/facades/client/application" + "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/model" ) // NewExportBundleCommand returns a fully constructed export bundle command. func NewExportBundleCommand() cmd.Command { cmd := &exportBundleCommand{} - cmd.newAPIFunc = func() (ExportBundleAPI, error) { - return cmd.getAPI() + cmd.newAPIFunc = func() (ExportBundleAPI, ConfigAPI, error) { + return cmd.getAPIs() } return modelcmd.Wrap(cmd) } @@ -27,7 +33,7 @@ type exportBundleCommand struct { modelcmd.ModelCommandBase out cmd.Output - newAPIFunc func() (ExportBundleAPI, error) + newAPIFunc func() (ExportBundleAPI, ConfigAPI, error) Filename string } @@ -66,32 +72,51 @@ // ExportBundleAPI specifies the used function calls of the BundleFacade. type ExportBundleAPI interface { + BestAPIVersion() int Close() error ExportBundle() (string, error) } -func (c *exportBundleCommand) getAPI() (ExportBundleAPI, error) { +// ConfigAPI specifies the used function calls of the ApplicationFacade. +type ConfigAPI interface { + Close() error + Get(branchName string, application string) (*params.ApplicationGetResults, error) +} + +func (c *exportBundleCommand) getAPIs() (ExportBundleAPI, ConfigAPI, error) { api, err := c.NewAPIRoot() if err != nil { - return nil, err + return nil, nil, err } - return bundle.NewClient(api), nil + return bundle.NewClient(api), application.NewClient(api), nil } // Run implements Command. func (c *exportBundleCommand) Run(ctx *cmd.Context) error { - client, err := c.newAPIFunc() + bundleClient, cfgClient, err := c.newAPIFunc() if err != nil { return err } - defer client.Close() + defer func() { + _ = bundleClient.Close() + _ = cfgClient.Close() + }() - result, err := client.ExportBundle() + result, err := bundleClient.ExportBundle() if err != nil { return err } + // The V3 API exports the trust flag for bundle contents; for + // older server API versions we need to query the config for each + // app and patch the bundle client-side. + if bundleClient.BestAPIVersion() < 3 { + if result, err = c.injectTrustFlag(cfgClient, result); err != nil { + return errors.Trace(err) + } + } + if c.Filename == "" { _, err := fmt.Fprintf(ctx.Stdout, "%v", result) return err @@ -112,3 +137,40 @@ return nil } + +func (c *exportBundleCommand) injectTrustFlag(cfgClient ConfigAPI, bundleYaml string) (string, error) { + var ( + bundleSpec *charm.BundleData + appliedPatch bool + ) + if err := yaml.Unmarshal([]byte(bundleYaml), &bundleSpec); err != nil { + return "", err + } + + for appName, appSpec := range bundleSpec.Applications { + res, err := cfgClient.Get(model.GenerationMaster, appName) + if err != nil { + return "", errors.Annotatef(err, "could not retrieve configuration for %q", appName) + } + + if res.ApplicationConfig == nil { + continue + } + + cfgMap, ok := res.ApplicationConfig[appFacade.TrustConfigOptionName].(map[string]interface{}) + if ok && cfgMap["value"] == true { + appSpec.RequiresTrust = true + appliedPatch = true + } + } + + if !appliedPatch { + return bundleYaml, nil + } + + patchedYaml, err := yaml.Marshal(bundleSpec) + if err != nil { + return "", err + } + return string(patchedYaml), nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/exportbundle_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/exportbundle_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/exportbundle_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/exportbundle_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,12 +8,15 @@ "io/ioutil" "os" "path/filepath" + "sort" "github.com/juju/cmd/cmdtesting" jujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" + appFacade "github.com/juju/juju/apiserver/facades/client/application" + "github.com/juju/juju/apiserver/params" "github.com/juju/juju/cmd/juju/model" coremodel "github.com/juju/juju/core/model" "github.com/juju/juju/jujuclient" @@ -22,9 +25,10 @@ type ExportBundleCommandSuite struct { testing.FakeJujuXDGDataHomeSuite - fake *fakeExportBundleClient - stub *jujutesting.Stub - store *jujuclient.MemStore + fakeBundle *fakeExportBundleClient + fakeConfig *fakeConfigClient + stub *jujutesting.Stub + store *jujuclient.MemStore } var _ = gc.Suite(&ExportBundleCommandSuite{}) @@ -32,7 +36,11 @@ func (s *ExportBundleCommandSuite) SetUpTest(c *gc.C) { s.FakeJujuXDGDataHomeSuite.SetUpTest(c) s.stub = &jujutesting.Stub{} - s.fake = &fakeExportBundleClient{ + s.fakeBundle = &fakeExportBundleClient{ + Stub: s.stub, + bestAPIVersion: 3, + } + s.fakeConfig = &fakeConfigClient{ Stub: s.stub, } s.store = jujuclient.NewMemStore() @@ -50,12 +58,12 @@ } func (s *ExportBundleCommandSuite) TearDownTest(c *gc.C) { - if s.fake.filename != "" { - err := os.Remove(s.fake.filename + ".yaml") + if s.fakeBundle.filename != "" { + err := os.Remove(s.fakeBundle.filename + ".yaml") if !os.IsNotExist(err) { c.Check(err, jc.ErrorIsNil) } - err = os.Remove(s.fake.filename) + err = os.Remove(s.fakeBundle.filename) if !os.IsNotExist(err) { c.Check(err, jc.ErrorIsNil) } @@ -65,7 +73,7 @@ } func (s *ExportBundleCommandSuite) TestExportBundleSuccessNoFilename(c *gc.C) { - s.fake.result = "applications:\n" + + s.fakeBundle.result = "applications:\n" + " mysql:\n" + " charm: \"\"\n" + " num_units: 1\n" + @@ -85,9 +93,9 @@ "- - wordpress:db\n" + " - mysql:mysql\n" - ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fake, s.store)) + ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fakeBundle, s.fakeConfig, s.store)) c.Assert(err, jc.ErrorIsNil) - s.fake.CheckCalls(c, []jujutesting.StubCall{ + s.fakeBundle.CheckCalls(c, []jujutesting.StubCall{ {"ExportBundle", nil}, }) @@ -115,8 +123,8 @@ } func (s *ExportBundleCommandSuite) TestExportBundleSuccessFilename(c *gc.C) { - s.fake.filename = filepath.Join(c.MkDir(), "mymodel") - s.fake.result = "applications:\n" + + s.fakeBundle.filename = filepath.Join(c.MkDir(), "mymodel") + s.fakeBundle.result = "applications:\n" + " magic:\n" + " charm: cs:zesty/magic\n" + " series: zesty\n" + @@ -128,15 +136,15 @@ "series: xenial\n" + "relations:\n" + "- []\n" - ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fake, s.store), "--filename", s.fake.filename) + ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fakeBundle, s.fakeConfig, s.store), "--filename", s.fakeBundle.filename) c.Assert(err, jc.ErrorIsNil) - s.fake.CheckCalls(c, []jujutesting.StubCall{ + s.fakeBundle.CheckCalls(c, []jujutesting.StubCall{ {"ExportBundle", nil}, }) out := cmdtesting.Stdout(ctx) - c.Assert(out, gc.Equals, fmt.Sprintf("Bundle successfully exported to %s\n", s.fake.filename)) - output, err := ioutil.ReadFile(s.fake.filename) + c.Assert(out, gc.Equals, fmt.Sprintf("Bundle successfully exported to %s\n", s.fakeBundle.filename)) + output, err := ioutil.ReadFile(s.fakeBundle.filename) c.Check(err, jc.ErrorIsNil) c.Assert(string(output), gc.Equals, "applications:\n"+ " magic:\n"+ @@ -153,28 +161,150 @@ } func (s *ExportBundleCommandSuite) TestExportBundleFailNoFilename(c *gc.C) { - _, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fake, s.store), "--filename") + _, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fakeBundle, s.fakeConfig, s.store), "--filename") c.Assert(err, gc.NotNil) c.Assert(err.Error(), gc.Equals, "option needs an argument: --filename") } func (s *ExportBundleCommandSuite) TestExportBundleSuccesssOverwriteFilename(c *gc.C) { - s.fake.filename = filepath.Join(c.MkDir(), "mymodel") - s.fake.result = "fake-data" - ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fake, s.store), "--filename", s.fake.filename) + s.fakeBundle.filename = filepath.Join(c.MkDir(), "mymodel") + s.fakeBundle.result = "fake-data" + ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fakeBundle, s.fakeConfig, s.store), "--filename", s.fakeBundle.filename) c.Assert(err, jc.ErrorIsNil) - s.fake.CheckCalls(c, []jujutesting.StubCall{ + s.fakeBundle.CheckCalls(c, []jujutesting.StubCall{ {"ExportBundle", nil}, }) out := cmdtesting.Stdout(ctx) - c.Assert(out, gc.Equals, fmt.Sprintf("Bundle successfully exported to %s\n", s.fake.filename)) - output, err := ioutil.ReadFile(s.fake.filename) + c.Assert(out, gc.Equals, fmt.Sprintf("Bundle successfully exported to %s\n", s.fakeBundle.filename)) + output, err := ioutil.ReadFile(s.fakeBundle.filename) c.Check(err, jc.ErrorIsNil) c.Assert(string(output), gc.Equals, "fake-data") } +func (s *ExportBundleCommandSuite) TestPatchOfExportedBundleToExposeTrustFlag(c *gc.C) { + s.fakeBundle.result = "applications:\n" + + " aws-integrator:\n" + + " charm: \"\"\n" + + " num_units: 1\n" + + " to:\n" + + " - \"0\"\n" + + " gcp-integrator:\n" + + " charm: \"\"\n" + + " num_units: 2\n" + + " to:\n" + + " - \"0\"\n" + + " - \"1\"\n" + + " ubuntu-lite:\n" + + " charm: \"\"\n" + + " num_units: 1\n" + + " to:\n" + + " - \"2\"\n" + + "machines:\n" + + " \"0\": {}\n" + + " \"1\": {}\n" + + " \"2\": {}\n" + + "series: bionic\n" + + // Pretend we target an older controller that does not expose the + // TrustRequired flag in the yaml output. + s.fakeBundle.bestAPIVersion = 2 + + s.fakeConfig.result = map[string]*params.ApplicationGetResults{ + "aws-integrator": { + ApplicationConfig: map[string]interface{}{ + appFacade.TrustConfigOptionName: map[string]interface{}{ + "description": "Does this application have access to trusted credentials", + "default": false, + "type": "bool", + "value": true, + }, + }, + }, + "gcp-integrator": { + ApplicationConfig: map[string]interface{}{ + appFacade.TrustConfigOptionName: map[string]interface{}{ + "description": "Does this application have access to trusted credentials", + "default": false, + "type": "bool", + "value": false, + }, + }, + }, + "ubuntu-lite": { + ApplicationConfig: map[string]interface{}{ + "unrelated": map[string]interface{}{ + "description": "The question to the meaning of life", + "default": 42, + "type": "int", + "value": 42, + }, + }, + }, + } + + ctx, err := cmdtesting.RunCommand(c, model.NewExportBundleCommandForTest(s.fakeBundle, s.fakeConfig, s.store)) + c.Assert(err, jc.ErrorIsNil) + + // Since we are iterating a map with applications we cannot call + // stub.CheckCalls but instead need to collect the calls, sort them and + // run the checks manually. + var exportBundleCallCount, getConfigCallCount int + var getConfigAppList []string + for _, call := range s.stub.Calls() { + switch call.FuncName { + case "ExportBundle": + exportBundleCallCount++ + case "Get": + getConfigCallCount++ + getConfigAppList = append(getConfigAppList, call.Args[1].(string)) + default: + c.Fatalf("unexpected call to %q", call.FuncName) + } + } + sort.Strings(getConfigAppList) + + c.Assert(exportBundleCallCount, gc.Equals, 1) + c.Assert(getConfigCallCount, gc.Equals, 3) + c.Assert(getConfigAppList, gc.DeepEquals, []string{"aws-integrator", "gcp-integrator", "ubuntu-lite"}) + + out := cmdtesting.Stdout(ctx) + c.Assert(out, gc.Equals, ""+ + "applications:\n"+ + " aws-integrator:\n"+ + " charm: \"\"\n"+ + " num_units: 1\n"+ + " to:\n"+ + " - \"0\"\n"+ + " trust: true\n"+ + " gcp-integrator:\n"+ + " charm: \"\"\n"+ + " num_units: 2\n"+ + " to:\n"+ + " - \"0\"\n"+ + " - \"1\"\n"+ + " ubuntu-lite:\n"+ + " charm: \"\"\n"+ + " num_units: 1\n"+ + " to:\n"+ + " - \"2\"\n"+ + "machines:\n"+ + " \"0\": {}\n"+ + " \"1\": {}\n"+ + " \"2\": {}\n"+ + "series: bionic\n") +} + +type fakeExportBundleClient struct { + *jujutesting.Stub + result string + filename string + bestAPIVersion int +} + +func (f *fakeExportBundleClient) BestAPIVersion() int { return f.bestAPIVersion } + func (f *fakeExportBundleClient) Close() error { return nil } func (f *fakeExportBundleClient) ExportBundle() (string, error) { @@ -186,8 +316,22 @@ return f.result, f.NextErr() } -type fakeExportBundleClient struct { +type fakeConfigClient struct { *jujutesting.Stub - result string - filename string + result map[string]*params.ApplicationGetResults +} + +func (f *fakeConfigClient) Close() error { return nil } + +func (f *fakeConfigClient) Get(branch string, app string) (*params.ApplicationGetResults, error) { + f.MethodCall(f, "Get", branch, app) + if err := f.NextErr(); err != nil { + return nil, err + } + + if f.result == nil { + return nil, f.NextErr() + } + + return f.result[app], f.NextErr() } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/export_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -67,9 +67,9 @@ } // NewExportBundleCommandForTest returns a ExportBundleCommand with the api provided as specified. -func NewExportBundleCommandForTest(api ExportBundleAPI, store jujuclient.ClientStore) cmd.Command { - cmd := &exportBundleCommand{newAPIFunc: func() (ExportBundleAPI, error) { - return api, nil +func NewExportBundleCommandForTest(bundleAPI ExportBundleAPI, cfgAPI ConfigAPI, store jujuclient.ClientStore) cmd.Command { + cmd := &exportBundleCommand{newAPIFunc: func() (ExportBundleAPI, ConfigAPI, error) { + return bundleAPI, cfgAPI, nil }} cmd.SetClientStore(store) return modelcmd.Wrap(cmd) @@ -181,8 +181,8 @@ return modelcmd.Wrap(cmd) } -func NewBranchCommandForTest(api BranchCommandAPI, store jujuclient.ClientStore) cmd.Command { - cmd := &branchCommand{ +func NewAddBranchCommandForTest(api AddBranchCommandAPI, store jujuclient.ClientStore) cmd.Command { + cmd := &addBranchCommand{ api: api, } cmd.SetClientStore(store) @@ -205,8 +205,8 @@ return modelcmd.Wrap(cmd) } -func NewCheckoutCommandForTest(api CheckoutCommandAPI, store jujuclient.ClientStore) cmd.Command { - cmd := &checkoutCommand{ +func NewBranchCommandForTest(api BranchCommandAPI, store jujuclient.ClientStore) cmd.Command { + cmd := &branchCommand{ api: api, } cmd.SetClientStore(store) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,13 +6,13 @@ import ( "github.com/juju/cmd" "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" "github.com/juju/juju/api/applicationoffers" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" - "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/jujuclient" "github.com/juju/juju/permission" ) @@ -65,7 +65,7 @@ juju grant sam read fred/prod.hosted-mysql mary/test.hosted-mysql -See also: +See also: revoke add-user`[1:] @@ -96,7 +96,7 @@ juju revoke sam consume fred/prod.hosted-mysql mary/test.hosted-mysql -See also: +See also: grant`[1:] type accessCommand struct { @@ -104,7 +104,7 @@ User string ModelNames []string - OfferURLs []*crossmodel.OfferURL + OfferURLs []*charm.OfferURL Access string } @@ -122,7 +122,7 @@ c.Access = args[1] // The remaining args are either model names or offer names. for _, arg := range args[2:] { - url, err := crossmodel.ParseOfferURL(arg) + url, err := charm.ParseOfferURL(arg) if err == nil { c.OfferURLs = append(c.OfferURLs, url) continue @@ -386,7 +386,7 @@ // setUnsetUsers sets any empty user entries in the given offer URLs // to the currently logged in user. -func setUnsetUsers(c accountDetailsGetter, offerURLs []*crossmodel.OfferURL) error { +func setUnsetUsers(c accountDetailsGetter, offerURLs []*charm.OfferURL) error { var currentAccountDetails *jujuclient.AccountDetails for _, url := range offerURLs { if url.User != "" { @@ -405,7 +405,7 @@ } // offersForModel group the offer URLs per model. -func offersForModel(offerURLs []*crossmodel.OfferURL) map[string][]string { +func offersForModel(offerURLs []*charm.OfferURL) map[string][]string { offersForModel := make(map[string][]string) for _, url := range offerURLs { fullName := jujuclient.JoinOwnerModelName(names.NewUserTag(url.User), url.ModelName) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/grantrevoke_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/grantrevoke_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,10 +10,10 @@ "github.com/juju/cmd/cmdtesting" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6" "github.com/juju/juju/apiserver/common" "github.com/juju/juju/cmd/juju/model" - "github.com/juju/juju/core/crossmodel" coremodel "github.com/juju/juju/core/model" "github.com/juju/juju/jujuclient" "github.com/juju/juju/testing" @@ -148,11 +148,11 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(grantCmd.User, gc.Equals, "bob") - url1, err := crossmodel.ParseOfferURL("fred/model.offer1") + url1, err := charm.ParseOfferURL("fred/model.offer1") c.Assert(err, jc.ErrorIsNil) - url2, err := crossmodel.ParseOfferURL("mary/model.offer2") + url2, err := charm.ParseOfferURL("mary/model.offer2") c.Assert(err, jc.ErrorIsNil) - c.Assert(grantCmd.OfferURLs, jc.DeepEquals, []*crossmodel.OfferURL{url1, url2}) + c.Assert(grantCmd.OfferURLs, jc.DeepEquals, []*charm.OfferURL{url1, url2}) c.Assert(grantCmd.ModelNames, gc.HasLen, 0) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/addbranch_mock.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/addbranch_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/addbranch_mock.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/addbranch_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,57 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/juju/cmd/juju/model (interfaces: AddBranchCommandAPI) + +// Package mocks is a generated GoMock package. +package mocks + +import ( + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockAddBranchCommandAPI is a mock of AddBranchCommandAPI interface +type MockAddBranchCommandAPI struct { + ctrl *gomock.Controller + recorder *MockAddBranchCommandAPIMockRecorder +} + +// MockAddBranchCommandAPIMockRecorder is the mock recorder for MockAddBranchCommandAPI +type MockAddBranchCommandAPIMockRecorder struct { + mock *MockAddBranchCommandAPI +} + +// NewMockAddBranchCommandAPI creates a new mock instance +func NewMockAddBranchCommandAPI(ctrl *gomock.Controller) *MockAddBranchCommandAPI { + mock := &MockAddBranchCommandAPI{ctrl: ctrl} + mock.recorder = &MockAddBranchCommandAPIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockAddBranchCommandAPI) EXPECT() *MockAddBranchCommandAPIMockRecorder { + return m.recorder +} + +// AddBranch mocks base method +func (m *MockAddBranchCommandAPI) AddBranch(arg0 string) error { + ret := m.ctrl.Call(m, "AddBranch", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddBranch indicates an expected call of AddBranch +func (mr *MockAddBranchCommandAPIMockRecorder) AddBranch(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBranch", reflect.TypeOf((*MockAddBranchCommandAPI)(nil).AddBranch), arg0) +} + +// Close mocks base method +func (m *MockAddBranchCommandAPI) Close() error { + ret := m.ctrl.Call(m, "Close") + ret0, _ := ret[0].(error) + return ret0 +} + +// Close indicates an expected call of Close +func (mr *MockAddBranchCommandAPIMockRecorder) Close() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockAddBranchCommandAPI)(nil).Close)) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/branch_mock.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/branch_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/branch_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/branch_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -32,18 +32,6 @@ return m.recorder } -// AddBranch mocks base method -func (m *MockBranchCommandAPI) AddBranch(arg0 string) error { - ret := m.ctrl.Call(m, "AddBranch", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// AddBranch indicates an expected call of AddBranch -func (mr *MockBranchCommandAPIMockRecorder) AddBranch(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBranch", reflect.TypeOf((*MockBranchCommandAPI)(nil).AddBranch), arg0) -} - // Close mocks base method func (m *MockBranchCommandAPI) Close() error { ret := m.ctrl.Call(m, "Close") @@ -55,3 +43,16 @@ func (mr *MockBranchCommandAPIMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockBranchCommandAPI)(nil).Close)) } + +// HasActiveBranch mocks base method +func (m *MockBranchCommandAPI) HasActiveBranch(arg0 string) (bool, error) { + ret := m.ctrl.Call(m, "HasActiveBranch", arg0) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// HasActiveBranch indicates an expected call of HasActiveBranch +func (mr *MockBranchCommandAPIMockRecorder) HasActiveBranch(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasActiveBranch", reflect.TypeOf((*MockBranchCommandAPI)(nil).HasActiveBranch), arg0) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/checkout_mock.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/checkout_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/mocks/checkout_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/mocks/checkout_mock.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/juju/juju/cmd/juju/model (interfaces: CheckoutCommandAPI) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - gomock "github.com/golang/mock/gomock" - reflect "reflect" -) - -// MockCheckoutCommandAPI is a mock of CheckoutCommandAPI interface -type MockCheckoutCommandAPI struct { - ctrl *gomock.Controller - recorder *MockCheckoutCommandAPIMockRecorder -} - -// MockCheckoutCommandAPIMockRecorder is the mock recorder for MockCheckoutCommandAPI -type MockCheckoutCommandAPIMockRecorder struct { - mock *MockCheckoutCommandAPI -} - -// NewMockCheckoutCommandAPI creates a new mock instance -func NewMockCheckoutCommandAPI(ctrl *gomock.Controller) *MockCheckoutCommandAPI { - mock := &MockCheckoutCommandAPI{ctrl: ctrl} - mock.recorder = &MockCheckoutCommandAPIMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockCheckoutCommandAPI) EXPECT() *MockCheckoutCommandAPIMockRecorder { - return m.recorder -} - -// Close mocks base method -func (m *MockCheckoutCommandAPI) Close() error { - ret := m.ctrl.Call(m, "Close") - ret0, _ := ret[0].(error) - return ret0 -} - -// Close indicates an expected call of Close -func (mr *MockCheckoutCommandAPIMockRecorder) Close() *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockCheckoutCommandAPI)(nil).Close)) -} - -// HasActiveBranch mocks base method -func (m *MockCheckoutCommandAPI) HasActiveBranch(arg0 string) (bool, error) { - ret := m.ctrl.Call(m, "HasActiveBranch", arg0) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// HasActiveBranch indicates an expected call of HasActiveBranch -func (mr *MockCheckoutCommandAPIMockRecorder) HasActiveBranch(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasActiveBranch", reflect.TypeOf((*MockCheckoutCommandAPI)(nil).HasActiveBranch), arg0) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/setcredential.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/setcredential.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/setcredential.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/setcredential.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/juju/api/modelmanager" "github.com/juju/juju/cloud" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" ) @@ -150,7 +151,7 @@ err = modelClient.ChangeModelCredential(modelTag, credentialTag) if err != nil { - return fail(errors.Trace(err)) + return block.ProcessBlockedError(errors.Annotate(err, "could not set model credential"), block.BlockChange) } ctx.Infof("Changed cloud credential on model %q to %q.", modelName, c.credential) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/setcredential_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/setcredential_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/setcredential_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/setcredential_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,7 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/api/base" + "github.com/juju/juju/apiserver/params" "github.com/juju/juju/cloud" "github.com/juju/juju/cmd/juju/model" coremodel "github.com/juju/juju/core/model" @@ -161,9 +162,17 @@ s.modelClient.SetErrors(errors.New("kaboom")) err := s.assertRemoteCredentialFound(c, ` Found credential remotely, on the controller. Not looking locally... -Failed to change model credential: kaboom `[1:]) - c.Assert(err, gc.ErrorMatches, "kaboom") + c.Assert(err, gc.ErrorMatches, "could not set model credential: kaboom") +} + +func (s *ModelCredentialCommandSuite) TestSetCredentialBlocked(c *gc.C) { + s.modelClient.SetErrors(¶ms.Error{Code: params.CodeOperationBlocked, Message: "nope"}) + err := s.assertRemoteCredentialFound(c, ` +Found credential remotely, on the controller. Not looking locally... +`[1:]) + c.Assert(err.Error(), jc.Contains, `could not set model credential: nope`) + c.Assert(err.Error(), jc.Contains, `All operations that change model have been disabled for the current model.`) } func (s *ModelCredentialCommandSuite) assertRemoteCredentialFound(c *gc.C, expectedStderr string) error { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/show.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/show.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/show.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/show.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/gnuflag" "gopkg.in/juju/names.v2" + "github.com/juju/juju/api" "github.com/juju/juju/api/modelmanager" "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" @@ -74,7 +75,7 @@ modelName = args[0] args = args[1:] } - if err := c.SetModelName(modelName, true); err != nil { + if err := c.SetModelIdentifier(modelName, true); err != nil { return errors.Trace(err) } if err := c.ModelCommandBase.Init(args); err != nil { @@ -106,7 +107,7 @@ return err } if results[0].Error != nil { - return results[0].Error + return maybeEmitRedirectError(results[0].Error) } infoMap, err := c.apiModelInfoToModelInfoMap([]params.ModelInfo{*results[0].Result}, controllerName) if err != nil { @@ -129,3 +130,21 @@ } return output, nil } + +func maybeEmitRedirectError(err error) error { + pErr, ok := errors.Cause(err).(*params.Error) + if !ok { + return err + } + + var redirInfo params.RedirectErrorInfo + if err := pErr.UnmarshalInfo(&redirInfo); err == nil && redirInfo.CACert != "" && len(redirInfo.Servers) != 0 { + return &api.RedirectError{ + Servers: params.NetworkHostsPorts(redirInfo.Servers), + CACert: redirInfo.CACert, + ControllerAlias: redirInfo.ControllerAlias, + FollowRedirect: false, // user-action required + } + } + return err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/show_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/show_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/show_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/show_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,11 +15,14 @@ gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" + "github.com/juju/juju/api" "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cert" "github.com/juju/juju/cmd/juju/model" coremodel "github.com/juju/juju/core/model" "github.com/juju/juju/core/status" "github.com/juju/juju/jujuclient" + "github.com/juju/juju/network" "github.com/juju/juju/testing" ) @@ -134,6 +137,15 @@ }) } +func (s *ShowCommandSuite) TestShowWithPartModelUUID(c *gc.C) { + _, err := cmdtesting.RunCommand(c, s.newShowCommand(), "deadbeef") + c.Assert(err, jc.ErrorIsNil) + s.fake.CheckCalls(c, []gitjujutesting.StubCall{ + {"ModelInfo", []interface{}{[]names.ModelTag{testing.ModelTag}}}, + {"Close", nil}, + }) +} + func (s *ShowCommandSuite) TestShowUnknownCallsRefresh(c *gc.C) { called := false refresh := func(jujuclient.ClientStore, string) error { @@ -637,6 +649,25 @@ c.Assert(cmdtesting.Stdout(ctx), gc.Equals, s.expectedDisplay) } +func (s *ShowCommandSuite) TestHandleRedirectError(c *gc.C) { + nhp := network.NewHostPorts(5555, "1.2.3.4") + caFingerprint, _ := cert.Fingerprint(testing.CACert) + s.fake.SetErrors( + &api.RedirectError{ + Servers: [][]network.HostPort{nhp}, + CACert: testing.CACert, + ControllerAlias: "target", + }, + ) + _, err := cmdtesting.RunCommand(c, model.NewShowCommandForTest(&s.fake, nil, s.store)) + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, `Model "admin/mymodel" has been migrated to another controller. +To access it run one of the following commands (you can replace the -c argument with your own preferred controller name): + 'juju login 1.2.3.4:5555 -c target' + +New controller fingerprint [`+caFingerprint+`]`) +} + func createBasicModelInfo() *params.ModelInfo { return ¶ms.ModelInfo{ Name: "basic-model", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/trackbranch.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/trackbranch.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/model/trackbranch.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/model/trackbranch.go 2019-06-28 17:10:43.000000000 +0000 @@ -28,8 +28,8 @@ juju track test-branch redis/0 mysql See also: + add-branch branch - checkout commit abort diff diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/resource/upload.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/resource/upload.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/resource/upload.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/resource/upload.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,6 +12,7 @@ "gopkg.in/juju/names.v2" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/resource" ) @@ -155,5 +156,8 @@ } defer f.Close() err = client.Upload(rf.application, rf.name, rf.value, f) - return errors.Trace(err) + if err := block.ProcessBlockedError(err, block.BlockChange); err != nil { + return errors.Trace(err) + } + return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/resource/upload_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/resource/upload_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/resource/upload_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/resource/upload_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,6 +8,7 @@ jujucmd "github.com/juju/cmd" "github.com/juju/errors" + "github.com/juju/juju/apiserver/params" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -129,6 +130,40 @@ s.stub.CheckCallNames(c, "NewClient", + "ListResources", + "OpenResource", + "Upload", + "FileClose", + "Close", + ) + s.stub.CheckCall(c, 1, "ListResources", []string{"svc"}) + s.stub.CheckCall(c, 2, "OpenResource", "bar") + s.stub.CheckCall(c, 3, "Upload", "svc", "foo", "bar", file) +} + +func (s *UploadSuite) TestUploadFileChangeBlocked(c *gc.C) { + file := &stubFile{stub: s.stub} + s.stubDeps.file = file + u := resourcecmd.NewUploadCommandForTest(resourcecmd.UploadDeps{ + NewClient: s.stubDeps.NewClient, + OpenResource: s.stubDeps.OpenResource, + }, + ) + err := u.Init([]string{"svc", "foo=bar"}) + c.Assert(err, jc.ErrorIsNil) + + expectedError := params.Error{ + Message: "test-block", + Code: params.CodeOperationBlocked, + } + s.stub.SetErrors(nil, nil, nil, expectedError) + + err = u.Run(nil) + c.Assert(err.Error(), jc.Contains, `failed to upload resource "foo": test-block`) + c.Assert(err.Error(), jc.Contains, `All operations that change model have been disabled for the current model.`) + + s.stub.CheckCallNames(c, + "NewClient", "ListResources", "OpenResource", "Upload", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/add.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/add.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/add.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/add.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" ) @@ -73,7 +74,7 @@ if params.IsCodeUnauthorized(err) { common.PermissionsMessage(ctx.Stderr, "add a space") } - return errors.Annotatef(err, "cannot add space %q", c.Name) + return block.ProcessBlockedError(errors.Annotatef(err, "cannot add space %q", c.Name), block.BlockChange) } ctx.Infof("added space %q with %s", c.Name, msgSuffix) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/add_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/add_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/add_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/add_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -84,3 +84,22 @@ "foo", "10.1.2.0/24", ) } + +func (s *AddSuite) TestRunWhenSpacesBlocked(c *gc.C) { + s.api.SetErrors(¶ms.Error{Code: params.CodeOperationBlocked, Message: "nope"}) + stdout, stderr, err := s.RunCommand(c, "foo", "10.1.2.0/24") + c.Assert(err, gc.ErrorMatches, ` +cannot add space "foo": nope + +All operations that change model have been disabled for the current model. +To enable changes, run + + juju enable-command all + +`[1:]) + c.Assert(stderr, gc.Equals, "") + c.Assert(stdout, gc.Equals, "") + + s.api.CheckCallNames(c, "AddSpace", "Close") + s.api.CheckCall(c, 0, "AddSpace", "foo", s.Strings("10.1.2.0/24"), true) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/reload.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/reload.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/space/reload.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/space/reload.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/errors" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/modelcmd" ) @@ -44,7 +45,7 @@ if errors.IsNotSupported(err) { ctx.Infof("cannot reload spaces: %v", err) } - return errors.Annotate(err, "cannot reload spaces") + return block.ProcessBlockedError(errors.Annotate(err, "could not reload spaces"), block.BlockChange) } return nil }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/output_tabular.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/output_tabular.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/output_tabular.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/output_tabular.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,7 +19,6 @@ cmdcrossmodel "github.com/juju/juju/cmd/juju/crossmodel" "github.com/juju/juju/cmd/juju/storage" "github.com/juju/juju/cmd/output" - "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/relation" "github.com/juju/juju/core/status" @@ -262,7 +261,7 @@ for _, appName := range naturalsort.Sort(stringKeysFromMap(remoteApplications)) { app := remoteApplications[appName] var store, urlPath string - url, err := crossmodel.ParseOfferURL(app.OfferURL) + url, err := charm.ParseOfferURL(app.OfferURL) if err == nil { store = url.Source url.Source = "" @@ -341,7 +340,7 @@ } // Subsequent lines only need to display endpoint information. // This will display less noise. - w.Println("", "", "", "", endpointName, endpoint.Interface, endpoint.Role) + w.Println("", "", "", "", "", endpointName, endpoint.Interface, endpoint.Role) } } endSection(tw) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/status.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/status.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/status.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/status.go 2019-06-28 17:10:43.000000000 +0000 @@ -334,7 +334,7 @@ return nil } if len(c.patterns) == 0 { - modelName, err := c.ModelName() + modelName, err := c.ModelIdentifier() if err != nil { return err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/status_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/status_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/status/status_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/status/status_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4943,13 +4943,7 @@ return ctx } -func (s *StatusSuite) TestStatusWithFormatTabular(c *gc.C) { - ctx := s.prepareTabularData(c) - defer s.resetContext(c, ctx) - code, stdout, stderr := runStatus(c, "--format", "tabular", "--relations") - c.Check(code, gc.Equals, 0) - c.Check(string(stderr), gc.Equals, "") - expected := ` +var expectedTabularStatus = ` Model Controller Cloud/Region Version SLA Timestamp Notes controller kontroll dummy/dummy-region 1.2.3 unsupported 15:04:05+07:00 upgrade available: 1.2.4 @@ -4985,9 +4979,29 @@ `[1:] +func (s *StatusSuite) TestStatusWithFormatTabular(c *gc.C) { + ctx := s.prepareTabularData(c) + defer s.resetContext(c, ctx) + code, stdout, stderr := runStatus(c, "--format", "tabular", "--relations") + c.Check(code, gc.Equals, 0) + c.Check(string(stderr), gc.Equals, "") + + output := substituteFakeTimestamp(c, stdout, false) + output = substituteSpacingBetweenTimestampAndNotes(c, output) + c.Assert(string(output), gc.Equals, expectedTabularStatus) +} + +func (s *StatusSuite) TestStatusWithFormatTabularValidModelUUID(c *gc.C) { + ctx := s.prepareTabularData(c) + defer s.resetContext(c, ctx) + + code, stdout, stderr := runStatus(c, "--format", "tabular", "--relations", "-m", s.Model.UUID()) + c.Check(code, gc.Equals, 0) + c.Check(string(stderr), gc.Equals, "") + output := substituteFakeTimestamp(c, stdout, false) output = substituteSpacingBetweenTimestampAndNotes(c, output) - c.Assert(string(output), gc.Equals, expected) + c.Assert(string(output), gc.Equals, expectedTabularStatus) } func (s *StatusSuite) TestStatusWithFormatYaml(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/storage/attach.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/storage/attach.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/storage/attach.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/storage/attach.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/juju/apiserver/params" jujucmd "github.com/juju/juju/cmd" + "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" ) @@ -85,7 +86,7 @@ if params.IsCodeUnauthorized(err) { common.PermissionsMessage(ctx.Stderr, "attach storage") } - return errors.Trace(err) + return block.ProcessBlockedError(errors.Annotatef(err, "could not attach storage %v", c.storageIds), block.BlockChange) } for i, result := range results { if result.Error == nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/storage/attach_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/storage/attach_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/storage/attach_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/storage/attach_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,8 @@ package storage_test import ( + "regexp" + "github.com/juju/cmd" "github.com/juju/cmd/cmdtesting" "github.com/juju/testing" @@ -56,7 +58,7 @@ fake.SetErrors(nil, ¶ms.Error{Code: params.CodeUnauthorized, Message: "nope"}) cmd := storage.NewAttachStorageCommandForTest(fake.new, jujuclienttesting.MinimalStore()) ctx, err := cmdtesting.RunCommand(c, cmd, "foo/0", "bar/1") - c.Assert(err, gc.ErrorMatches, "nope") + c.Assert(err, gc.ErrorMatches, regexp.QuoteMeta("could not attach storage [bar/1]: nope")) c.Assert(cmdtesting.Stderr(ctx), gc.Equals, ` You do not have permission to attach storage. You may ask an administrator to grant you access with "juju grant". @@ -64,6 +66,15 @@ `) } +func (s *AttachStorageSuite) TestAttachBlocked(c *gc.C) { + var fake fakeEntityAttacher + fake.SetErrors(nil, ¶ms.Error{Code: params.CodeOperationBlocked, Message: "nope"}) + cmd := storage.NewAttachStorageCommandForTest(fake.new, jujuclienttesting.MinimalStore()) + _, err := cmdtesting.RunCommand(c, cmd, "foo/0", "bar/1") + c.Assert(err.Error(), jc.Contains, `could not attach storage [bar/1]: nope`) + c.Assert(err.Error(), jc.Contains, `All operations that change model have been disabled for the current model.`) +} + func (s *AttachStorageSuite) TestAttachInitErrors(c *gc.C) { s.testAttachInitError(c, []string{}, "attach-storage requires a unit ID and at least one storage ID") s.testAttachInitError(c, []string{"unit/0"}, "attach-storage requires a unit ID and at least one storage ID") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/user/login.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/user/login.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/user/login.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/user/login.go 2019-06-28 17:10:43.000000000 +0000 @@ -618,10 +618,10 @@ } if accountDetails != nil { - return errors.Errorf(`This controller has already been registered on this client as %q + return errors.Errorf(`This controller has already been registered on this client as %q. To login as user %q run 'juju login -u %s -c %s'.`, existingName, accountDetails.User, accountDetails.User, existingName) } - return errors.Errorf(`This controller has already been registered on this client as %q + return errors.Errorf(`This controller has already been registered on this client as %q. To login run 'juju login -c %s'.`, existingName, existingName) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/user/login_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/user/login_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/juju/user/login_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/juju/user/login_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -370,7 +370,7 @@ descr: "user provides an endpoint as the controller name and has a local account for the controller", cmd: []string{details.APIEndpoints[0]}, expErr: ` -ERROR This controller has already been registered on this client as "` + existingName + `" +ERROR This controller has already been registered on this client as "` + existingName + `". To login as user "current-user" run 'juju login -u current-user -c ` + existingName + `'. `, }, @@ -378,7 +378,7 @@ descr: "user provides an endpoint as the controller name and does not have a local account for the controller", cmd: []string{"1.1.1.1:12345"}, expErr: ` -ERROR This controller has already been registered on this client as "controller-with-no-account" +ERROR This controller has already been registered on this client as "controller-with-no-account". To login run 'juju login -c controller-with-no-account'. `, }, @@ -386,7 +386,7 @@ descr: "user provides an endpoint and overrides the controller name", cmd: []string{details.APIEndpoints[0], "-c", "some-controller-name"}, expErr: ` -ERROR This controller has already been registered on this client as "` + existingName + `" +ERROR This controller has already been registered on this client as "` + existingName + `". To login as user "current-user" run 'juju login -u current-user -c ` + existingName + `'. `, }, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/agent.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/agent.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/agent.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/agent.go 2019-06-28 17:10:43.000000000 +0000 @@ -161,13 +161,14 @@ func dependencyEngineConfig() dependency.EngineConfig { return dependency.EngineConfig{ - IsFatal: util.IsFatal, - WorstError: util.MoreImportantError, - ErrorDelay: 3 * time.Second, - BounceDelay: 10 * time.Millisecond, - BackoffFactor: 1.2, - MaxDelay: 2 * time.Minute, - Clock: clock.WallClock, - Logger: loggo.GetLogger("juju.worker.dependency"), + IsFatal: util.IsFatal, + WorstError: util.MoreImportantError, + ErrorDelay: 3 * time.Second, + BounceDelay: 10 * time.Millisecond, + BackoffFactor: 1.2, + BackoffResetTime: 1 * time.Minute, + MaxDelay: 2 * time.Minute, + Clock: clock.WallClock, + Logger: loggo.GetLogger("juju.worker.dependency"), } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/caasoperator/manifolds.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/caasoperator/manifolds.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/caasoperator/manifolds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/caasoperator/manifolds.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,8 @@ import ( "time" + "github.com/juju/loggo" + "github.com/juju/clock" "github.com/juju/errors" "github.com/juju/utils/voyeur" @@ -200,6 +202,8 @@ loggingConfigUpdaterName: ifNotMigrating(logger.Manifold(logger.ManifoldConfig{ AgentName: agentName, APICallerName: apiCallerName, + LoggingContext: loggo.DefaultContext(), + Logger: loggo.GetLogger("juju.worker.logger"), UpdateAgentFunc: config.UpdateLoggerConfig, })), diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/engine_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/engine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/engine_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/engine_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -25,8 +25,8 @@ "api-config-watcher", "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-alive-flag", "not-dead-flag", "valid-credential-flag", @@ -42,10 +42,10 @@ "instance-poller", "machine-undertaker", // tertiary dependency: will be inactive because migration workers will be inactive "metric-worker", // tertiary dependency: will be inactive because migration workers will be inactive - "migration-fortress", // secondary dependency: will be inactive because depends on environ-upgrader - "migration-inactive-flag", // secondary dependency: will be inactive because depends on environ-upgrader - "migration-master", // secondary dependency: will be inactive because depends on environ-upgrader - "environ-upgrader", + "migration-fortress", // secondary dependency: will be inactive because depends on model-upgrader + "migration-inactive-flag", // secondary dependency: will be inactive because depends on model-upgrader + "migration-master", // secondary dependency: will be inactive because depends on model-upgrader + "model-upgrader", "remote-relations", // tertiary dependency: will be inactive because migration workers will be inactive "state-cleaner", // tertiary dependency: will be inactive because migration workers will be inactive "status-history-pruner", // tertiary dependency: will be inactive because migration workers will be inactive @@ -79,8 +79,8 @@ "migration-fortress", "migration-inactive-flag", "migration-master", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "log-forwarder", } // ReallyLongTimeout should be long enough for the model-tracker diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds.go 2019-06-28 17:10:43.000000000 +0000 @@ -52,7 +52,6 @@ lxdbroker "github.com/juju/juju/worker/containerbroker" "github.com/juju/juju/worker/controllerport" "github.com/juju/juju/worker/credentialvalidator" - "github.com/juju/juju/worker/dblogpruner" "github.com/juju/juju/worker/deployer" "github.com/juju/juju/worker/diskmanager" "github.com/juju/juju/worker/externalcontrollerupdater" @@ -269,16 +268,11 @@ // connectFilter exists: // 1) to let us retry api connections immediately on password change, // rather than causing the dependency engine to wait for a while; - // 2) to ensure that certain connection failures correctly trigger - // complete agent removal. (It's not safe to let any agent other - // than the machine mess around with SetCanUninstall). + // 2) to decide how to deal with fatal, non-recoverable errors + // e.g apicaller.ErrConnectImpossible. connectFilter := func(err error) error { cause := errors.Cause(err) if cause == apicaller.ErrConnectImpossible { - err2 := coreagent.SetCanUninstall(config.Agent) - if err2 != nil { - return errors.Trace(err2) - } return jworker.ErrTerminateAgent } else if cause == apicaller.ErrChangedPassword { return dependency.ErrBounce @@ -509,7 +503,7 @@ // If the legacy-leases feature flag is set the global clock // updater updates the lease clock in the database. . globalClockUpdaterName: ifLegacyLeasesEnabled(globalclockupdater.Manifold(globalclockupdater.ManifoldConfig{ - ClockName: clockName, + Clock: config.Clock, StateName: stateName, NewWorker: globalclockupdater.NewWorker, UpdateInterval: globalClockUpdaterUpdateInterval, @@ -519,7 +513,7 @@ // We also run another clock updater to feed time updates into // the lease FSM. leaseClockUpdaterName: globalclockupdater.Manifold(globalclockupdater.ManifoldConfig{ - ClockName: clockName, + Clock: config.Clock, LeaseManagerName: leaseManagerName, RaftName: raftForwarderName, NewWorker: globalclockupdater.NewWorker, @@ -532,7 +526,7 @@ // attempt to claim responsibility for running certain workers // that must not be run concurrently by multiple agents. isPrimaryControllerFlagName: ifController(singular.Manifold(singular.ManifoldConfig{ - ClockName: clockName, + Clock: config.Clock, APICallerName: apiCallerName, Duration: config.ControllerLeaseDuration, Claimant: machineTag, @@ -566,6 +560,8 @@ loggingConfigUpdaterName: ifNotMigrating(logger.Manifold(logger.ManifoldConfig{ AgentName: agentName, APICallerName: apiCallerName, + LoggingContext: loggo.DefaultContext(), + Logger: loggo.GetLogger("juju.worker.logger"), UpdateAgentFunc: config.UpdateLoggerConfig, })), @@ -636,15 +632,6 @@ }, ))), - logPrunerName: ifNotMigrating(ifPrimaryController(dblogpruner.Manifold( - dblogpruner.ManifoldConfig{ - ClockName: clockName, - StateName: stateName, - PruneInterval: config.LogPruneInterval, - NewWorker: dblogpruner.NewWorker, - }, - ))), - txnPrunerName: ifNotMigrating(ifPrimaryController(txnpruner.Manifold( txnpruner.ManifoldConfig{ ClockName: clockName, @@ -808,6 +795,7 @@ FSM: leaseFSM, RequestTopic: leaseRequestTopic, Logger: loggo.GetLogger("juju.worker.lease.raft"), + LogDir: agentConfig.LogDir(), PrometheusRegisterer: config.PrometheusRegisterer, NewWorker: leasemanager.NewWorker, NewStore: leasemanager.NewStore, @@ -1076,7 +1064,6 @@ isPrimaryControllerFlagName = "is-primary-controller-flag" isControllerFlagName = "is-controller-flag" instanceMutaterName = "instance-mutater" - logPrunerName = "log-pruner" txnPrunerName = "transaction-pruner" certificateWatcherName = "certificate-watcher" modelCacheName = "model-cache" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine/manifolds_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,6 +18,8 @@ "github.com/juju/juju/cmd/jujud/agent/agenttest" "github.com/juju/juju/cmd/jujud/agent/machine" "github.com/juju/juju/testing" + jworker "github.com/juju/juju/worker" + "github.com/juju/juju/worker/apicaller" "github.com/juju/juju/worker/gate" ) @@ -82,7 +84,6 @@ "lease-clock-updater", "lease-manager", "legacy-leases-flag", - "log-pruner", "log-sender", "logging-config-updater", "machine-action-runner", @@ -156,7 +157,6 @@ "lease-clock-updater", "lease-manager", "legacy-leases-flag", - "log-pruner", "log-sender", "logging-config-updater", "machine-action-runner", @@ -289,7 +289,6 @@ ) primaryControllerWorkers := set.NewStrings( "external-controller-updater", - "log-pruner", "transaction-pruner", ) for name, manifold := range manifolds { @@ -308,6 +307,24 @@ } } +func (*ManifoldsSuite) TestAPICallerNonRecoverableErrorHandling(c *gc.C) { + ag := &mockAgent{ + conf: mockConfig{ + dataPath: c.MkDir(), + }, + } + manifolds := machine.IAASManifolds(machine.ManifoldsConfig{ + Agent: ag, + }) + + c.Assert(manifolds["api-caller"], gc.Not(gc.IsNil)) + apiCaller := manifolds["api-caller"] + + // Check that when the api-caller maps non-recoverable errors to ErrTerminateAgent. + err := apiCaller.Filter(apicaller.ErrConnectImpossible) + c.Assert(err, gc.Equals, jworker.ErrTerminateAgent) +} + func checkContains(c *gc.C, names []string, seek string) { for _, name := range names { if name == seek { @@ -485,7 +502,6 @@ "agent", "api-caller", "api-config-watcher", - "clock", "is-controller-flag", "is-primary-controller-flag", "migration-fortress", @@ -512,7 +528,6 @@ "global-clock-updater": { "agent", - "clock", "is-controller-flag", "legacy-leases-flag", "state", @@ -578,7 +593,6 @@ "agent", "api-caller", "api-config-watcher", - "clock", "is-controller-flag", "state", "state-config-watcher", @@ -620,23 +634,6 @@ "state-config-watcher", }, - "log-pruner": { - "agent", - "api-caller", - "api-config-watcher", - "clock", - "is-controller-flag", - "is-primary-controller-flag", - "migration-fortress", - "migration-inactive-flag", - "state", - "state-config-watcher", - "upgrade-check-flag", - "upgrade-check-gate", - "upgrade-steps-flag", - "upgrade-steps-gate", - }, - "log-sender": { "agent", "api-caller", @@ -1035,9 +1032,10 @@ type mockConfig struct { agent.ConfigSetter - tag names.Tag - ssiSet bool - ssi params.StateServingInfo + tag names.Tag + ssiSet bool + ssi params.StateServingInfo + dataPath string } func (mc *mockConfig) Tag() names.Tag { @@ -1063,3 +1061,10 @@ func (mc *mockConfig) LogDir() string { return "log-dir" } + +func (mc *mockConfig) DataDir() string { + if mc.dataPath != "" { + return mc.dataPath + } + return "data-dir" +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine.go 2019-06-28 17:10:43.000000000 +0000 @@ -65,7 +65,6 @@ "github.com/juju/juju/mongo/mongometrics" "github.com/juju/juju/pubsub/centralhub" "github.com/juju/juju/service" - "github.com/juju/juju/service/common" "github.com/juju/juju/state" "github.com/juju/juju/state/multiwatcher" "github.com/juju/juju/state/stateenvirons" @@ -502,8 +501,6 @@ close(a.workersStarted) err = a.runner.Wait() switch errors.Cause(err) { - case jworker.ErrTerminateAgent: - err = a.uninstallAgent() case jworker.ErrRebootMachine: logger.Infof("Caught reboot error") err = a.executeRebootOrShutdown(params.ShouldReboot) @@ -876,6 +873,7 @@ } params := provisioner.ContainerSetupParams{ Runner: runner, + Logger: loggo.GetLogger("juju.container-setup"), WorkerName: watcherName, SupportedContainers: containers, Machine: machine, @@ -1225,58 +1223,6 @@ return } -func (a *MachineAgent) uninstallAgent() error { - // We should only uninstall if the uninstall file is present. - if !agent.CanUninstall(a) { - logger.Infof("ignoring uninstall request") - return nil - } - logger.Infof("uninstalling agent") - - agentConfig := a.CurrentConfig() - var errs []error - agentServiceName := agentConfig.Value(agent.AgentServiceName) - if agentServiceName == "" { - // For backwards compatibility, handle lack of AgentServiceName. - agentServiceName = os.Getenv("UPSTART_JOB") - } - - if agentServiceName != "" { - svc, err := service.DiscoverService(agentServiceName, common.Conf{}) - if err != nil { - errs = append(errs, errors.Errorf("cannot remove service %q: %v", agentServiceName, err)) - } else if err := svc.Remove(); err != nil { - errs = append(errs, errors.Errorf("cannot remove service %q: %v", agentServiceName, err)) - } - } - - errs = append(errs, a.removeJujudSymlinks()...) - - // TODO(fwereade): surely this shouldn't be happening here? Once we're - // at this point we should expect to be killed in short order; if this - // work is remotely important we should be blocking machine death on - // its completion. - insideContainer := container.RunningInContainer() - if insideContainer { - // We're running inside a container, so loop devices may leak. Detach - // any loop devices that are backed by files on this machine. - if err := a.loopDeviceManager.DetachLoopDevices("/", agentConfig.DataDir()); err != nil { - errs = append(errs, err) - } - } - - if err := mongo.RemoveService(); err != nil { - errs = append(errs, errors.Annotate(err, "cannot stop/remove mongo service")) - } - if err := os.RemoveAll(agentConfig.DataDir()); err != nil { - errs = append(errs, err) - } - if len(errs) == 0 { - return nil - } - return errors.Errorf("uninstall failed: %v", errs) -} - // newDeployContext gives the tests the opportunity to create a deployer.Context // that can be used for testing so as to avoid (1) deploying units to the system // running the tests and (2) get access to the *State used internally, so that diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/machine_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/machine_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -213,32 +213,6 @@ c.Assert(charmrepo.CacheDir, gc.Equals, filepath.Join(ac.DataDir(), "charmcache")) } -func (s *MachineLegacyLeasesSuite) TestWithDeadMachine(c *gc.C) { - m, ac, _ := s.primeAgent(c, state.JobHostUnits) - err := m.EnsureDead() - c.Assert(err, jc.ErrorIsNil) - a := s.newAgent(c, m) - err = runWithTimeout(a) - c.Assert(err, jc.ErrorIsNil) - - _, err = os.Stat(ac.DataDir()) - c.Assert(err, jc.Satisfies, os.IsNotExist) -} - -func (s *MachineLegacyLeasesSuite) TestWithRemovedMachine(c *gc.C) { - m, ac, _ := s.primeAgent(c, state.JobHostUnits) - err := m.EnsureDead() - c.Assert(err, jc.ErrorIsNil) - err = m.Remove() - c.Assert(err, jc.ErrorIsNil) - a := s.newAgent(c, m) - err = runWithTimeout(a) - c.Assert(err, jc.ErrorIsNil) - - _, err = os.Stat(ac.DataDir()) - c.Assert(err, jc.Satisfies, os.IsNotExist) -} - func (s *MachineLegacyLeasesSuite) TestDyingMachine(c *gc.C) { m, _, _ := s.primeAgent(c, state.JobHostUnits) a := s.newAgent(c, m) @@ -787,11 +761,14 @@ } func (s *MachineLegacyLeasesSuite) TestMachineAgentUninstall(c *gc.C) { + c.Skip("test takes over 30s to complete; we need to investigate why it takes so long for the agent to appear as alive") + m, ac, _ := s.primeAgent(c, state.JobHostUnits) - err := m.EnsureDead() - c.Assert(err, jc.ErrorIsNil) a := s.newAgent(c, m) - err = runWithTimeout(a) + + // Wait for the agent to become alive, then run EnsureDead and wait + // for the agent to exit + err := s.WithAliveAgent(m, a, m.EnsureDead) c.Assert(err, jc.ErrorIsNil) // juju-* symlinks should have been removed on termination. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds.go 2019-06-28 17:10:43.000000000 +0000 @@ -163,7 +163,7 @@ NewWorker: lifeflag.NewWorker, }), isResponsibleFlagName: singular.Manifold(singular.ManifoldConfig{ - ClockName: clockName, + Clock: config.Clock, APICallerName: apiCallerName, Duration: config.RunFlagDuration, Claimant: machineTag, @@ -234,7 +234,7 @@ charmRevisionUpdaterName: ifNotMigrating(charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: apiCallerName, - ClockName: clockName, + Clock: config.Clock, Period: config.CharmRevisionUpdateInterval, NewFacade: charmrevisionmanifold.NewAPIFacade, @@ -253,7 +253,6 @@ })), statusHistoryPrunerName: ifNotMigrating(pruner.Manifold(pruner.ManifoldConfig{ APICallerName: apiCallerName, - EnvironName: environTrackerName, ClockName: clockName, NewWorker: statushistorypruner.New, NewFacade: statushistorypruner.NewFacade, @@ -261,7 +260,6 @@ })), actionPrunerName: ifNotMigrating(pruner.Manifold(pruner.ManifoldConfig{ APICallerName: apiCallerName, - EnvironName: environTrackerName, ClockName: clockName, NewWorker: actionpruner.New, NewFacade: actionpruner.NewFacade, @@ -280,9 +278,9 @@ // which is the agent that will run the upgrade steps; // the other controller agents will wait for it to complete // running those steps before allowing logins to the model. - environUpgradeGateName: gate.Manifold(), - environUpgradedFlagName: gate.FlagManifold(gate.FlagManifoldConfig{ - GateName: environUpgradeGateName, + modelUpgradeGateName: gate.Manifold(), + modelUpgradedFlagName: gate.FlagManifold(gate.FlagManifoldConfig{ + GateName: modelUpgradeGateName, NewWorker: gate.NewFlagWorker, }), } @@ -325,20 +323,23 @@ // it. // The undertaker is currently the only ifNotAlive worker. - undertakerName: ifNotUpgrading(ifNotAlive(ifCredentialValid(undertaker.Manifold(undertaker.ManifoldConfig{ + undertakerName: ifNotUpgrading(ifNotAlive(undertaker.Manifold(undertaker.ManifoldConfig{ APICallerName: apiCallerName, CloudDestroyerName: environTrackerName, + Logger: loggo.GetLogger("juju.worker.undertaker"), NewFacade: undertaker.NewFacade, NewWorker: undertaker.NewWorker, NewCredentialValidatorFacade: common.NewCredentialInvalidatorFacade, - })))), + }))), // All the rest depend on ifNotMigrating. computeProvisionerName: ifNotMigrating(ifCredentialValid(provisioner.Manifold(provisioner.ManifoldConfig{ - AgentName: agentName, - APICallerName: apiCallerName, - EnvironName: environTrackerName, + AgentName: agentName, + APICallerName: apiCallerName, + EnvironName: environTrackerName, + Logger: loggo.GetLogger("juju.worker.provisioner"), + NewProvisionerFunc: provisioner.NewEnvironProvisioner, NewCredentialValidatorFacade: common.NewCredentialInvalidatorFacade, }))), @@ -385,16 +386,16 @@ NewWorker: machineundertaker.NewWorker, NewCredentialValidatorFacade: common.NewCredentialInvalidatorFacade, }))), - environUpgraderName: ifCredentialValid(modelupgrader.Manifold(modelupgrader.ManifoldConfig{ + modelUpgraderName: ifNotDead(ifCredentialValid(modelupgrader.Manifold(modelupgrader.ManifoldConfig{ APICallerName: apiCallerName, EnvironName: environTrackerName, - GateName: environUpgradeGateName, + GateName: modelUpgradeGateName, ControllerTag: controllerTag, ModelTag: modelTag, NewFacade: modelupgrader.NewFacade, NewWorker: modelupgrader.NewWorker, NewCredentialValidatorFacade: common.NewCredentialInvalidatorFacade, - })), + }))), instanceMutaterName: ifNotMigrating(instancemutater.ModelManifold(instancemutater.ModelManifoldConfig{ AgentName: agentName, APICallerName: apiCallerName, @@ -419,14 +420,15 @@ modelTag := agentConfig.Model() manifolds := dependency.Manifolds{ // The undertaker is currently the only ifNotAlive worker. - undertakerName: ifNotUpgrading(ifNotAlive(ifCredentialValid(undertaker.Manifold(undertaker.ManifoldConfig{ + undertakerName: ifNotUpgrading(ifNotAlive(undertaker.Manifold(undertaker.ManifoldConfig{ APICallerName: apiCallerName, CloudDestroyerName: caasBrokerTrackerName, + Logger: loggo.GetLogger("juju.worker.undertaker"), NewFacade: undertaker.NewFacade, NewWorker: undertaker.NewWorker, NewCredentialValidatorFacade: common.NewCredentialInvalidatorFacade, - })))), + }))), caasBrokerTrackerName: ifResponsible(caasbroker.Manifold(caasbroker.ManifoldConfig{ APICallerName: apiCallerName, @@ -463,9 +465,9 @@ NewWorker: caasunitprovisioner.NewWorker, }, )), - environUpgraderName: caasenvironupgrader.Manifold(caasenvironupgrader.ManifoldConfig{ + modelUpgraderName: caasenvironupgrader.Manifold(caasenvironupgrader.ManifoldConfig{ APICallerName: apiCallerName, - GateName: environUpgradeGateName, + GateName: modelUpgradeGateName, ModelTag: modelTag, NewFacade: caasenvironupgrader.NewFacade, NewWorker: caasenvironupgrader.NewWorker, @@ -550,7 +552,7 @@ // the environ upgrade worker has completed. ifNotUpgrading = engine.Housing{ Flags: []string{ - environUpgradedFlagName, + modelUpgradedFlagName, }, }.Decorate @@ -577,9 +579,9 @@ migrationInactiveFlagName = "migration-inactive-flag" migrationMasterName = "migration-master" - environUpgradeGateName = "environ-upgrade-gate" - environUpgradedFlagName = "environ-upgraded-flag" - environUpgraderName = "environ-upgrader" + modelUpgradeGateName = "model-upgrade-gate" + modelUpgradedFlagName = "model-upgraded-flag" + modelUpgraderName = "model-upgrader" environTrackerName = "environ-tracker" undertakerName = "undertaker" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/model/manifolds_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -41,9 +41,6 @@ "clock", "compute-provisioner", "environ-tracker", - "environ-upgrade-gate", - "environ-upgraded-flag", - "environ-upgrader", "firewaller", "instance-mutater", "instance-poller", @@ -54,6 +51,9 @@ "migration-fortress", "migration-inactive-flag", "migration-master", + "model-upgrade-gate", + "model-upgraded-flag", + "model-upgrader", "not-alive-flag", "not-dead-flag", "remote-relations", @@ -88,14 +88,14 @@ "caas-unit-provisioner", "charm-revision-updater", "clock", - "environ-upgrade-gate", - "environ-upgraded-flag", - "environ-upgrader", "is-responsible-flag", "log-forwarder", "migration-fortress", "migration-inactive-flag", "migration-master", + "model-upgrade-gate", + "model-upgraded-flag", + "model-upgrader", "not-alive-flag", "not-dead-flag", "remote-relations", @@ -117,9 +117,9 @@ "not-dead-flag", // model upgrade manifolds are run on all // controller agents, "responsible" or not. - "environ-upgrade-gate", - "environ-upgraded-flag", - "environ-upgrader", + "model-upgrade-gate", + "model-upgraded-flag", + "model-upgrader", "valid-credential-flag", ) manifolds := model.IAASManifolds(model.ManifoldsConfig{ @@ -193,12 +193,11 @@ "agent", "api-caller", "clock", - "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "agent": {}, @@ -207,18 +206,17 @@ "api-config-watcher": {"agent"}, - "caas-broker-tracker": {"agent", "api-caller", "clock", "is-responsible-flag"}, + "caas-broker-tracker": {"agent", "api-caller", "is-responsible-flag"}, "caas-firewaller": { "agent", "api-caller", "caas-broker-tracker", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "caas-operator-provisioner": { @@ -229,8 +227,8 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "caas-storage-provisioner": { @@ -241,8 +239,8 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag"}, @@ -250,69 +248,63 @@ "agent", "api-caller", "caas-broker-tracker", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "charm-revision-updater": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "clock": {}, - "is-responsible-flag": {"agent", "api-caller", "clock"}, + "is-responsible-flag": {"agent", "api-caller"}, "log-forwarder": { "agent", "api-caller", - "clock", "is-responsible-flag", "not-dead-flag"}, "migration-fortress": { "agent", "api-caller", - "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "migration-inactive-flag": { "agent", "api-caller", - "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "migration-master": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, - "environ-upgrade-gate": {}, + "model-upgrade-gate": {}, - "environ-upgraded-flag": {"environ-upgrade-gate"}, + "model-upgraded-flag": {"model-upgrade-gate"}, - "environ-upgrader": {"agent", "api-caller", "environ-upgrade-gate"}, + "model-upgrader": {"agent", "api-caller", "model-upgrade-gate"}, "not-alive-flag": {"agent", "api-caller"}, @@ -321,12 +313,11 @@ "remote-relations": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "state-cleaner": { @@ -336,32 +327,29 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "status-history-pruner": { "agent", "api-caller", "clock", - "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "undertaker": { "agent", "api-caller", "caas-broker-tracker", - "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-alive-flag", - "valid-credential-flag", }, "valid-credential-flag": {"agent", "api-caller"}, @@ -373,14 +361,12 @@ "agent", "api-caller", "clock", - "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", - "valid-credential-flag", }, "agent": {}, @@ -392,23 +378,21 @@ "application-scaler": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "charm-revision-updater": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "clock": {}, @@ -416,13 +400,12 @@ "compute-provisioner": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, @@ -430,7 +413,6 @@ "environ-tracker": { "agent", "api-caller", - "clock", "is-responsible-flag", "valid-credential-flag", }, @@ -438,13 +420,12 @@ "firewaller": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, @@ -452,13 +433,12 @@ "instance-mutater": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, @@ -471,31 +451,29 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, - "is-responsible-flag": {"agent", "api-caller", "clock"}, + "is-responsible-flag": {"agent", "api-caller"}, "log-forwarder": { "agent", "api-caller", - "clock", "is-responsible-flag", "not-dead-flag"}, "machine-undertaker": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, @@ -503,53 +481,49 @@ "metric-worker": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "migration-fortress": { "agent", "api-caller", - "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "migration-inactive-flag": { "agent", "api-caller", - "clock", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "migration-master": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, - "environ-upgrade-gate": {}, + "model-upgrade-gate": {}, - "environ-upgraded-flag": {"environ-upgrade-gate"}, + "model-upgraded-flag": {"model-upgrade-gate"}, - "environ-upgrader": { + "model-upgrader": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", - "environ-upgrade-gate", + "model-upgrade-gate", + "not-dead-flag", "valid-credential-flag", }, @@ -560,12 +534,11 @@ "remote-relations": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "state-cleaner": { @@ -575,22 +548,20 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "status-history-pruner": { "agent", "api-caller", "clock", - "environ-tracker", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", - "valid-credential-flag", }, "storage-provisioner": { @@ -601,8 +572,8 @@ "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag", "valid-credential-flag", }, @@ -610,11 +581,10 @@ "undertaker": { "agent", "api-caller", - "clock", "environ-tracker", "is-responsible-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-alive-flag", "valid-credential-flag", }, @@ -622,12 +592,11 @@ "unit-assigner": { "agent", "api-caller", - "clock", "is-responsible-flag", "migration-fortress", "migration-inactive-flag", - "environ-upgrade-gate", - "environ-upgraded-flag", + "model-upgrade-gate", + "model-upgraded-flag", "not-dead-flag"}, "valid-credential-flag": {"agent", "api-caller"}, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/unit/manifolds.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/unit/manifolds.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/unit/manifolds.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/unit/manifolds.go 2019-06-28 17:10:43.000000000 +0000 @@ -246,6 +246,8 @@ loggingConfigUpdaterName: ifNotMigrating(logger.Manifold(logger.ManifoldConfig{ AgentName: agentName, APICallerName: apiCallerName, + LoggingContext: loggo.DefaultContext(), + Logger: loggo.GetLogger("juju.worker.logger"), UpdateAgentFunc: config.UpdateLoggerConfig, })), diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/util_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/util_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/agent/util_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/agent/util_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -255,6 +255,44 @@ dummy.SetInstanceAddresses(insts[0], addrs) } +// WithAliveAgent starts the agent, wait till it becomes alive and then invokes +// the provided cb. Once the callback returns, WithAliveAgent will block until +// the agent either exits or exceeds its run timeout. In both cases, any error +// returned by the agent's Run method will be captured and returned to the +// caller. +func (s *commonMachineSuite) WithAliveAgent(m *state.Machine, a *MachineAgent, cb func() error) error { + // achilleasa: the agent usually takes a around 30 seconds + waitTime := coretesting.LongWait * 3 + + errCh := make(chan error, 1) + go func() { + select { + case errCh <- a.Run(nil): + case <-time.After(waitTime): + errCh <- fmt.Errorf("time out waiting for agent to complete its run") + } + a.Stop() + close(errCh) + }() + + if err := m.WaitAgentPresence(waitTime); err != nil { + return err + } + + if cb != nil { + if err := cb(); err != nil { + return err + } + } + + // Wait for agent to exit or timeout + for err := range errCh { + return err + } + + return nil +} + // opRecvTimeout waits for any of the given kinds of operation to // be received from ops, and times out if not. func opRecvTimeout(c *gc.C, st *state.State, opc <-chan dummy.Operation, kinds ...dummy.Operation) dummy.Operation { @@ -414,7 +452,7 @@ return nil } -func (e *minModelWorkersEnviron) AllInstances(context.ProviderCallContext) ([]instances.Instance, error) { +func (e *minModelWorkersEnviron) AllRunningInstances(context.ProviderCallContext) ([]instances.Instance, error) { return nil, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/dumplogs/dumplogs.go juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/dumplogs/dumplogs.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/jujud/dumplogs/dumplogs.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/jujud/dumplogs/dumplogs.go 2019-06-28 17:10:43.000000000 +0000 @@ -193,7 +193,7 @@ writer.WriteString(c.format( rec.Time, rec.Level, - rec.Entity.String(), + rec.Entity, rec.Module, rec.Message, ) + "\n") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/base.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/base.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/base.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/base.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,6 +36,43 @@ type modelMigratedError string +func newModelMigratedError(store jujuclient.ClientStore, modelName string, redirErr *api.RedirectError) error { + // Check if this is a known controller + allEndpoints := network.HostPortsToStrings(network.CollapseHostPorts(redirErr.Servers)) + _, existingName, err := store.ControllerByAPIEndpoints(allEndpoints...) + if err != nil && !errors.IsNotFound(err) { + return err + } + + if existingName != "" { + mErr := fmt.Sprintf(`Model %q has been migrated to controller %q. +To access it run 'juju switch %s:%s'.`, modelName, existingName, existingName, modelName) + + return modelMigratedError(mErr) + } + + // CACerts are always valid so no error checking is required here. + fingerprint, _ := cert.Fingerprint(redirErr.CACert) + + ctrlAlias := "new-controller" + if redirErr.ControllerAlias != "" { + ctrlAlias = redirErr.ControllerAlias + } + + var loginCmds []string + for _, endpoint := range allEndpoints { + loginCmds = append(loginCmds, fmt.Sprintf(" 'juju login %s -c %s'", endpoint, ctrlAlias)) + } + + mErr := fmt.Sprintf(`Model %q has been migrated to another controller. +To access it run one of the following commands (you can replace the -c argument with your own preferred controller name): +%s + +New controller fingerprint [%s]`, modelName, strings.Join(loginCmds, "\n"), fingerprint) + + return modelMigratedError(mErr) +} + func (e modelMigratedError) Error() string { return string(e) } @@ -172,9 +209,8 @@ return nil, c.missingModelError(store, controllerName, modelName) } if redirErr, ok := errors.Cause(err).(*api.RedirectError); ok { - return nil, c.modelMigratedError(store, modelName, redirErr) + return nil, newModelMigratedError(store, modelName, redirErr) } - return conn, err } @@ -183,7 +219,7 @@ // If this model has also been cached as current, it will be reset if // the requesting command can modify current model. // For example, commands such as add/destroy-model, login/register, etc. -// If the model was cached as currnet but the command is not expected to +// If the model was cached as current but the command is not expected to // change current model, this call will still remove model details from the client cache // but will keep current model name intact to allow subsequent calls to try to resolve // model details on the controller. @@ -210,43 +246,6 @@ return errors.Errorf("model %q has been removed from the controller, run 'juju models' and switch to one of them.", modelName) } -func (c *CommandBase) modelMigratedError(store jujuclient.ClientStore, modelName string, redirErr *api.RedirectError) error { - // Check if this is a known controller - allEndpoints := network.HostPortsToStrings(network.CollapseHostPorts(redirErr.Servers)) - _, existingName, err := store.ControllerByAPIEndpoints(allEndpoints...) - if err != nil && !errors.IsNotFound(err) { - return err - } - - if existingName != "" { - mErr := fmt.Sprintf(`Model %q has been migrated to controller %q. -To access it run 'juju switch %s:%s'.`, modelName, existingName, existingName, modelName) - - return modelMigratedError(mErr) - } - - // CACerts are always valid so no error checking is required here. - fingerprint, _ := cert.Fingerprint(redirErr.CACert) - - ctrlAlias := "new-controller" - if redirErr.ControllerAlias != "" { - ctrlAlias = redirErr.ControllerAlias - } - - var loginCmds []string - for _, endpoint := range allEndpoints { - loginCmds = append(loginCmds, fmt.Sprintf(" 'juju login %s -c %s'", endpoint, ctrlAlias)) - } - - mErr := fmt.Sprintf(`Model %q has been migrated to another controller. -To access it run one of the following commands (you can replace the -c argument with your own preferred controller name): -%s - -New controller fingerprint [%s]`, modelName, strings.Join(loginCmds, "\n"), fingerprint) - - return modelMigratedError(mErr) -} - // NewAPIConnectionParams returns a juju.NewAPIConnectionParams with the // given arguments such that a call to juju.NewAPIConnection with the // result behaves the same as a call to CommandBase.NewAPIRoot with @@ -340,7 +339,7 @@ if err != nil { return errors.Trace(err) } - defer modelManager.Close() + defer func() { _ = modelManager.Close() }() accountDetails, err := store.AccountDetails(controllerName) if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/base_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/base_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/base_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/base_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -62,7 +62,7 @@ baseCmd.SetAPIOpen(apiOpen) modelcmd.InitContexts(&cmd.Context{Stderr: ioutil.Discard}, baseCmd) modelcmd.SetRunStarted(baseCmd) - baseCmd.SetModelName("foo:admin/badmodel", false) + baseCmd.SetModelIdentifier("foo:admin/badmodel", false) conn, err := baseCmd.NewAPIRoot() c.Assert(conn, gc.IsNil) msg := strings.Replace(err.Error(), "\n", "", -1) @@ -124,7 +124,8 @@ baseCmd.SetAPIOpen(apiOpen) modelcmd.InitContexts(&cmd.Context{Stderr: ioutil.Discard}, baseCmd) modelcmd.SetRunStarted(baseCmd) - baseCmd.SetModelName("foo:admin/badmodel", false) + + c.Assert(baseCmd.SetModelIdentifier("foo:admin/badmodel", false), jc.ErrorIsNil) fingerprint, _ := cert.Fingerprint(coretesting.CACert) specs := []struct { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/controller.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/controller.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/controller.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/controller.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/cmd" "github.com/juju/errors" "github.com/juju/gnuflag" + "github.com/juju/utils/featureflag" "gopkg.in/macaroon-bakery.v2-unstable/httpbakery" "github.com/juju/juju/api" @@ -389,6 +390,7 @@ CommandBase Store jujuclient.ClientStore + EnabledFlag string Local bool controllerName string } @@ -405,7 +407,9 @@ // A non default controller can be chosen using the --controller option. // Use the --local arg to return an empty string, meaning no controller is selected. func (c *OptionalControllerCommand) ControllerNameFromArg() (string, error) { - if c.Local { + requireExplicitController := !featureflag.Enabled(c.EnabledFlag) + if c.Local || (requireExplicitController && c.controllerName == "") { + c.Local = true return "", nil } controllerName := c.controllerName diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/controller_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/controller_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/controller_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/controller_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,6 +18,7 @@ "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/juju/osenv" "github.com/juju/juju/jujuclient" + coretesting "github.com/juju/juju/testing" ) type ControllerCommandSuite struct { @@ -144,12 +145,23 @@ type OptionalControllerCommandSuite struct { testing.IsolationSuite + coretesting.JujuOSEnvSuite } var _ = gc.Suite(&OptionalControllerCommandSuite{}) +func (s *OptionalControllerCommandSuite) SetUpTest(c *gc.C) { + s.IsolationSuite.SetUpTest(c) + s.JujuOSEnvSuite.SetUpTest(c) +} + +func (s *OptionalControllerCommandSuite) TearDownTest(c *gc.C) { + s.IsolationSuite.TearDownTest(c) + s.JujuOSEnvSuite.TearDownTest(c) +} + func (s *OptionalControllerCommandSuite) TestControllerCommandNoneRunning(c *gc.C) { - cmd, err := runTestOptionalControllerCommand(c, jujuclient.NewMemStore()) + cmd, err := runTestOptionalControllerCommand(c, "", jujuclient.NewMemStore()) c.Assert(err, jc.ErrorIsNil) _, err = cmd.ControllerNameFromArg() c.Assert(err, gc.NotNil) @@ -167,7 +179,7 @@ "fred": {}, } store.CurrentControllerName = "fred" - cmd, err := runTestOptionalControllerCommand(c, store) + cmd, err := runTestOptionalControllerCommand(c, "", store) c.Assert(err, jc.ErrorIsNil) controllerName, err := cmd.ControllerNameFromArg() c.Assert(err, jc.ErrorIsNil) @@ -182,7 +194,7 @@ "mary": {}, } store.CurrentControllerName = "fred" - cmd, err := runTestOptionalControllerCommand(c, store) + cmd, err := runTestOptionalControllerCommand(c, "", store) c.Assert(err, jc.ErrorIsNil) controllerName, err := cmd.ControllerNameFromArg() c.Assert(err, jc.ErrorIsNil) @@ -195,13 +207,40 @@ "fred": {}, } store.CurrentControllerName = "fred" - cmd, err := runTestOptionalControllerCommand(c, store, "--local") + cmd, err := runTestOptionalControllerCommand(c, "", store, "--local") + c.Assert(err, jc.ErrorIsNil) + controllerName, err := cmd.ControllerNameFromArg() + c.Assert(err, jc.ErrorIsNil) + c.Assert(controllerName, gc.Equals, "") +} + +func (s *OptionalControllerCommandSuite) TestControllerCommandNoFlag(c *gc.C) { + store := jujuclient.NewMemStore() + store.Controllers = map[string]jujuclient.ControllerDetails{ + "fred": {}, + } + store.CurrentControllerName = "fred" + cmd, err := runTestOptionalControllerCommand(c, "multi-cloud", store) c.Assert(err, jc.ErrorIsNil) controllerName, err := cmd.ControllerNameFromArg() c.Assert(err, jc.ErrorIsNil) c.Assert(controllerName, gc.Equals, "") } +func (s *OptionalControllerCommandSuite) TestControllerCommandWithFlag(c *gc.C) { + s.SetFeatureFlags("multi-cloud") + store := jujuclient.NewMemStore() + store.Controllers = map[string]jujuclient.ControllerDetails{ + "fred": {}, + } + store.CurrentControllerName = "fred" + cmd, err := runTestOptionalControllerCommand(c, "multi-cloud", store) + c.Assert(err, jc.ErrorIsNil) + controllerName, err := cmd.ControllerNameFromArg() + c.Assert(err, jc.ErrorIsNil) + c.Assert(controllerName, gc.Equals, "fred") +} + type testOptionalControllerCommand struct { modelcmd.OptionalControllerCommand } @@ -217,10 +256,11 @@ return nil } -func runTestOptionalControllerCommand(c *gc.C, store jujuclient.ClientStore, args ...string) (*testOptionalControllerCommand, error) { +func runTestOptionalControllerCommand(c *gc.C, enabledFlag string, store jujuclient.ClientStore, args ...string) (*testOptionalControllerCommand, error) { cmd := &testOptionalControllerCommand{ OptionalControllerCommand: modelcmd.OptionalControllerCommand{ - Store: store, + Store: store, + EnabledFlag: enabledFlag, }, } _, err := cmdtesting.RunCommand(c, cmd, args...) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go 2019-06-28 17:10:43.000000000 +0000 @@ -48,22 +48,23 @@ // associated with. ClientStore() jujuclient.ClientStore - // SetModelName sets the model name for this command. Setting the model - // name will also set the related controller name. The model name can - // be qualified with a controller name (controller:model), or - // unqualified, in which case it will be assumed to be within the - // current controller. + // SetModelIdentifier sets the model identifier for this command. + // Setting the model identifier will also set the related controller name. + // The model name can be qualified with a controller name + // (controller:model), or unqualified, in which case it will be assumed + // to be within the current controller. // // Passing an empty model name will choose the default // model, or return an error if there isn't one. // - // SetModelName is called prior to the wrapped command's Init method - // with the active model name. The model name is guaranteed - // to be non-empty at entry of Init. - SetModelName(modelName string, allowDefault bool) error - - // ModelName returns the name of the model. - ModelName() (string, error) + // SetModelIdentifier is called prior to the wrapped command's Init method + // with the active model name. + // The model identifier is guaranteed to be non-empty at entry of Init. + SetModelIdentifier(modelIdentifier string, allowDefault bool) error + + // ModelIdentifier returns a string identifying the target model. + // It may be a model name, or a full or partial model UUID. + ModelIdentifier() (string, error) // ModelType returns the type of the model. ModelType() (model.ModelType, error) @@ -94,15 +95,15 @@ // about controllers, models, etc. store jujuclient.ClientStore - // _modelName, _modelType, _modelGeneration and _controllerName hold the - // current model and controller names, model type and generation. They - // are only valid after maybeInitModel is called, and should in general - // not be accessed directly, but through ModelName and ControllerName - // respectively. - _modelName string - _modelType model.ModelType - _activeBranch string - _controllerName string + // _modelIdentifier, _modelType, _modelGeneration and _controllerName hold + // the current model identifier, controller name, model type and branch. + // They are only valid after maybeInitModel is called, and should in + // general not be accessed directly, but through ModelIdentifier and + // ControllerName respectively. + _modelIdentifier string + _modelType model.ModelType + _activeBranch string + _controllerName string allowDefaultModel bool @@ -133,12 +134,11 @@ // returned [ErrNoModelSpecified,ErrNoControllersDefined,ErrNoCurrentController] // at that point and so need to try again. // If any other error result was returned, we bail early here. - retriableError := func(original error) bool { - return errors.Cause(c.initModelError) != ErrNoModelSpecified && - errors.Cause(c.initModelError) != ErrNoControllersDefined && - errors.Cause(c.initModelError) != ErrNoCurrentController + noRetry := func(original error) bool { + c := errors.Cause(c.initModelError) + return c != ErrNoModelSpecified && c != ErrNoControllersDefined && c != ErrNoCurrentController } - if c.doneInitModel && retriableError(c.initModelError) { + if c.doneInitModel && noRetry(c.initModelError) { return errors.Trace(c.initModelError) } @@ -162,13 +162,14 @@ } func (c *ModelCommandBase) initModel0() error { - if c._modelName == "" && !c.allowDefaultModel { + if c._modelIdentifier == "" && !c.allowDefaultModel { return errors.Trace(ErrNoModelSpecified) } - if c._modelName == "" { - c._modelName = os.Getenv(osenv.JujuModelEnvKey) + if c._modelIdentifier == "" { + c._modelIdentifier = os.Getenv(osenv.JujuModelEnvKey) } - controllerName, modelName := SplitModelName(c._modelName) + + controllerName, modelIdentifier := SplitModelName(c._modelIdentifier) if controllerName == "" { currentController, err := DetermineCurrentController(c.store) if err != nil { @@ -179,20 +180,21 @@ return errors.Trace(err) } c._controllerName = controllerName - if modelName == "" { + + if modelIdentifier == "" { currentModel, err := c.store.CurrentModel(controllerName) if err != nil { return errors.Trace(err) } - modelName = currentModel + modelIdentifier = currentModel } - c._modelName = modelName + c._modelIdentifier = modelIdentifier return nil } -// SetModelName implements the ModelCommand interface. -func (c *ModelCommandBase) SetModelName(modelName string, allowDefault bool) error { - c._modelName = modelName +// SetModelIdentifier implements the ModelCommand interface. +func (c *ModelCommandBase) SetModelIdentifier(modelIdentifier string, allowDefault bool) error { + c._modelIdentifier = modelIdentifier c.allowDefaultModel = allowDefault // After setting the model name, we may need to ensure we have access to the @@ -204,12 +206,12 @@ } // ModelName implements the ModelCommand interface. -func (c *ModelCommandBase) ModelName() (string, error) { +func (c *ModelCommandBase) ModelIdentifier() (string, error) { c.assertRunStarted() if err := c.maybeInitModel(); err != nil { return "", errors.Trace(err) } - return c._modelName, nil + return c._modelIdentifier, nil } // ModelType implements the ModelCommand interface. @@ -217,17 +219,19 @@ if c._modelType != "" { return c._modelType, nil } + // If we need to look up the model type, we need to ensure we // have access to the model details. if err := c.maybeInitModel(); err != nil { return "", errors.Trace(err) } - details, err := c.store.ModelByName(c._controllerName, c._modelName) + + _, details, err := c.modelFromStore(c._controllerName, c._modelIdentifier) if err != nil { if !c.runStarted { return "", errors.Trace(err) } - details, err = c.modelDetails(c._controllerName, c._modelName) + _, details, err = c.modelDetails(c._controllerName, c._modelIdentifier) if err != nil { return "", errors.Trace(err) } @@ -238,12 +242,12 @@ // SetModelGeneration implements the ModelCommand interface. func (c *ModelCommandBase) SetActiveBranch(branchName string) error { - _, modelDetails, err := c.ModelDetails() + name, modelDetails, err := c.ModelDetails() if err != nil { return errors.Annotate(err, "getting model details") } modelDetails.ActiveBranch = branchName - if err = c.store.UpdateModel(c._controllerName, c._modelName, *modelDetails); err != nil { + if err = c.store.UpdateModel(c._controllerName, name, *modelDetails); err != nil { return err } c._activeBranch = branchName @@ -255,17 +259,19 @@ if c._activeBranch != "" { return c._activeBranch, nil } + // If we need to look up the model generation, we need to ensure we // have access to the model details. if err := c.maybeInitModel(); err != nil { return "", errors.Trace(err) } - details, err := c.store.ModelByName(c._controllerName, c._modelName) + + _, details, err := c.modelFromStore(c._controllerName, c._modelIdentifier) if err != nil { if !c.runStarted { return "", errors.Trace(err) } - details, err = c.modelDetails(c._controllerName, c._modelName) + _, details, err = c.modelDetails(c._controllerName, c._modelIdentifier) if err != nil { return "", errors.Trace(err) } @@ -307,8 +313,10 @@ return root.Client(), nil } +// ModelDetails returns details from the file store for the model indicated by +// the currently set controller name and model identifier. func (c *ModelCommandBase) ModelDetails() (string, *jujuclient.ModelDetails, error) { - modelName, err := c.ModelName() + modelIdentifier, err := c.ModelIdentifier() if err != nil { return "", nil, errors.Trace(err) } @@ -316,28 +324,72 @@ if err != nil { return "", nil, errors.Trace(err) } - details, err := c.modelDetails(controllerName, modelName) - return modelName, details, err + + name, details, err := c.modelDetails(controllerName, modelIdentifier) + return name, details, errors.Trace(err) } -func (c *ModelCommandBase) modelDetails(controllerName, modelName string) (*jujuclient.ModelDetails, error) { - if modelName == "" { - return nil, errors.Trace(ErrNoModelSpecified) +func (c *ModelCommandBase) modelDetails(controllerName, modelIdentifier string) ( + string, *jujuclient.ModelDetails, error, +) { + if modelIdentifier == "" { + return "", nil, errors.Trace(ErrNoModelSpecified) } - details, err := c.store.ModelByName(controllerName, modelName) + + name, details, err := c.modelFromStore(controllerName, modelIdentifier) if err != nil { if !errors.IsNotFound(err) { - return nil, errors.Trace(err) + return "", nil, errors.Trace(err) } - logger.Debugf("model %q not found, refreshing", modelName) - // The model isn't known locally, so query the models + logger.Debugf("model %q not found, refreshing", modelIdentifier) + // The model is not known locally, so query the models // available in the controller, and cache them locally. if err := c.RefreshModels(c.store, controllerName); err != nil { - return nil, errors.Annotate(err, "refreshing models") + return "", nil, errors.Annotate(err, "refreshing models") } - details, err = c.store.ModelByName(controllerName, modelName) + name, details, err = c.modelFromStore(controllerName, modelIdentifier) } - return details, errors.Trace(err) + return name, details, errors.Trace(err) +} + +// modelFromStore attempts to retrieve details from the store, first under the +// assumption that the input identifier is a model name, then using treating +// the identifier as a full or partial model UUID. +// If a model is successfully located its name and details are returned. +func (c *ModelCommandBase) modelFromStore(controllerName, modelIdentifier string) ( + string, *jujuclient.ModelDetails, error, +) { + // Check if the model identifier is a name that identifies a stored model. + // This will be the most common case. + details, err := c.store.ModelByName(controllerName, modelIdentifier) + if err == nil { + return modelIdentifier, details, nil + } + if !errors.IsNotFound(err) { + return "", nil, errors.Trace(err) + } + + // If the identifier is at 6 least characters long, + // attempt to match one of the stored model UUIDs. + if len(modelIdentifier) > 5 { + models, err := c.store.AllModels(controllerName) + if err != nil { + return "", nil, errors.Trace(err) + } + + for name, details := range models { + if strings.HasPrefix(details.ModelUUID, modelIdentifier) { + return name, &details, nil + } + } + } + + // Keep the not-found error from the store if we have one. + // This will preserve the user-qualified model identifier. + if err == nil { + err = errors.NotFoundf("model %s:%s", controllerName, modelIdentifier) + } + return "", nil, errors.Trace(err) } // NewAPIRoot returns a new connection to the API server for the environment @@ -456,7 +508,10 @@ skipModelFlags bool useDefaultModel bool - modelName string + + // modelIdentifier may be a model name, a full model UUID, + // or a short 6-8 model UUID prefix. + modelIdentifier string } func (w *modelCommandWrapper) inner() cmd.Command { @@ -516,7 +571,7 @@ func (w *modelCommandWrapper) Init(args []string) error { if !w.skipModelFlags { - if err := w.ModelCommand.SetModelName(w.modelName, w.useDefaultModel); err != nil { + if err := w.ModelCommand.SetModelIdentifier(w.modelIdentifier, w.useDefaultModel); err != nil { return errors.Trace(err) } } @@ -548,13 +603,19 @@ if err := w.validateCommandForModelType(true); err != nil { return errors.Trace(err) } - return w.ModelCommand.Run(ctx) + err := w.ModelCommand.Run(ctx) + if redirErr, ok := errors.Cause(err).(*api.RedirectError); ok { + modelIdentifier, _ := w.ModelCommand.ModelIdentifier() + return newModelMigratedError(store, modelIdentifier, redirErr) + } + return err } func (w *modelCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if !w.skipModelFlags { - f.StringVar(&w.modelName, "m", "", "Model to operate in. Accepts [:]") - f.StringVar(&w.modelName, "model", "", "") + desc := "Model to operate in. Accepts [:]|" + f.StringVar(&w.modelIdentifier, "m", "", desc) + f.StringVar(&w.modelIdentifier, "model", "", "") } w.ModelCommand.SetFlags(f) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/modelcommand_test.go juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/modelcommand_test.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/modelcmd/modelcommand_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/modelcmd/modelcommand_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -58,6 +58,16 @@ expectController: "bar", expectModel: "noncurrentbar", }, { + about: "explicit controller and model UUID, long form", + args: []string{"--model", "bar:uuidbar2"}, + expectController: "bar", + expectModel: "uuidbar2", +}, { + about: "explicit controller and model UUID, short form", + args: []string{"-m", "bar:uuidbar2"}, + expectController: "bar", + expectModel: "uuidbar2", +}, { about: "implicit controller, explicit model, short form", args: []string{"-m", "explicit"}, expectController: "foo", @@ -68,6 +78,16 @@ expectController: "foo", expectModel: "explicit", }, { + about: "implicit controller, explicit model UUID, short form", + args: []string{"-m", "uuidfoo3"}, + expectController: "foo", + expectModel: "uuidfoo3", +}, { + about: "implicit controller, explicit model UUID, long form", + args: []string{"--model", "uuidfoo3"}, + expectController: "foo", + expectModel: "uuidfoo3", +}, { about: "explicit controller, implicit model", args: []string{"--model", "bar:"}, expectController: "bar", @@ -101,7 +121,7 @@ expectModel: "noncurrentfoo", }} -func (s *ModelCommandSuite) TestModelName(c *gc.C) { +func (s *ModelCommandSuite) TestModelIdentifier(c *gc.C) { s.store.Controllers["foo"] = jujuclient.ControllerDetails{} s.store.Controllers["bar"] = jujuclient.ControllerDetails{} s.store.CurrentControllerName = "foo" @@ -111,29 +131,38 @@ s.store.Accounts["bar"] = jujuclient.AccountDetails{ User: "baz", Password: "hunter3", } + err := s.store.UpdateModel("foo", "adminfoo/currentfoo", jujuclient.ModelDetails{ModelUUID: "uuidfoo1", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) - err = s.store.UpdateModel("foo", "adminfoo/oncurrentfoo", + + err = s.store.UpdateModel("foo", "adminfoo/noncurrentfoo", jujuclient.ModelDetails{ModelUUID: "uuidfoo2", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.UpdateModel("foo", "bar/explicit", jujuclient.ModelDetails{ModelUUID: "uuidfoo3", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.UpdateModel("foo", "bar/noncurrentfoo", jujuclient.ModelDetails{ModelUUID: "uuidfoo4", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.UpdateModel("bar", "adminbar/currentbar", jujuclient.ModelDetails{ModelUUID: "uuidbar1", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.UpdateModel("bar", "adminbar/noncurrentbar", jujuclient.ModelDetails{ModelUUID: "uuidbar2", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.UpdateModel("bar", "baz/noncurrentbar", jujuclient.ModelDetails{ModelUUID: "uuidbar3", ModelType: model.IAAS}) c.Assert(err, jc.ErrorIsNil) + err = s.store.SetCurrentModel("foo", "adminfoo/currentfoo") c.Assert(err, jc.ErrorIsNil) + err = s.store.SetCurrentModel("bar", "adminbar/currentbar") c.Assert(err, jc.ErrorIsNil) @@ -240,28 +269,22 @@ func (s *ModelCommandSuite) assertRunHasModel(c *gc.C, expectControllerName, expectModelName string, args ...string) { cmd, err := runTestCommand(c, s.store, args...) c.Assert(err, jc.ErrorIsNil) + controllerName, err := cmd.ControllerName() c.Assert(err, jc.ErrorIsNil) c.Assert(controllerName, gc.Equals, expectControllerName) - modelName, err := cmd.ModelName() + + modelName, err := cmd.ModelIdentifier() c.Assert(err, jc.ErrorIsNil) c.Assert(modelName, gc.Equals, expectModelName) } func (s *ModelCommandSuite) TestIAASOnlyCommandIAASModel(c *gc.C) { - s.store.Controllers["foo"] = jujuclient.ControllerDetails{} - s.store.CurrentControllerName = "foo" - s.store.Accounts["foo"] = jujuclient.AccountDetails{ - User: "bar", Password: "hunter2", - } - err := s.store.UpdateModel("foo", "bar/currentfoo", - jujuclient.ModelDetails{ModelUUID: "uuidfoo1", ModelType: model.IAAS}) - c.Assert(err, jc.ErrorIsNil) - err = s.store.SetCurrentModel("foo", "bar/currentfoo") - c.Assert(err, jc.ErrorIsNil) + s.setupIAASModel(c) cmd, err := runTestCommand(c, s.store) c.Assert(err, jc.ErrorIsNil) + modelType, err := cmd.ModelType() c.Assert(err, jc.ErrorIsNil) c.Assert(modelType, gc.Equals, model.IAAS) @@ -284,18 +307,9 @@ } func (s *ModelCommandSuite) TestCAASOnlyCommandIAASModel(c *gc.C) { - s.store.Controllers["foo"] = jujuclient.ControllerDetails{} - s.store.CurrentControllerName = "foo" - s.store.Accounts["foo"] = jujuclient.AccountDetails{ - User: "bar", Password: "hunter2", - } - err := s.store.UpdateModel("foo", "bar/currentfoo", - jujuclient.ModelDetails{ModelUUID: "uuidfoo1", ModelType: model.IAAS}) - c.Assert(err, jc.ErrorIsNil) - err = s.store.SetCurrentModel("foo", "bar/currentfoo") - c.Assert(err, jc.ErrorIsNil) + s.setupIAASModel(c) - _, err = runCaasCommand(c, s.store) + _, err := runCaasCommand(c, s.store) c.Assert(err, gc.ErrorMatches, `Juju command "caas-command" not supported on non-container models`) } @@ -318,6 +332,38 @@ c.Assert(modelType, gc.Equals, model.CAAS) } +func (s *ModelCommandSuite) TestPartialModelUUIDSuccess(c *gc.C) { + s.setupIAASModel(c) + + cmd, err := runTestCommand(c, s.store, "-m", "uuidfoo") + c.Assert(err, jc.ErrorIsNil) + + modelType, err := cmd.ModelType() + c.Assert(err, jc.ErrorIsNil) + c.Assert(modelType, gc.Equals, model.IAAS) +} + +func (s *ModelCommandSuite) TestPartialModelUUIDTooShortError(c *gc.C) { + s.setupIAASModel(c) + + _, err := runTestCommand(c, s.store, "-m", "uuidf") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *ModelCommandSuite) setupIAASModel(c *gc.C) { + s.store.Controllers["foo"] = jujuclient.ControllerDetails{} + s.store.CurrentControllerName = "foo" + s.store.Accounts["foo"] = jujuclient.AccountDetails{ + User: "bar", Password: "hunter2", + } + err := s.store.UpdateModel("foo", "bar/currentfoo", + jujuclient.ModelDetails{ModelUUID: "uuidfoo1", ModelType: model.IAAS}) + c.Assert(err, jc.ErrorIsNil) + + err = s.store.SetCurrentModel("foo", "bar/currentfoo") + c.Assert(err, jc.ErrorIsNil) +} + func noOpRefresh(_ jujuclient.ClientStore, _ string) error { return nil } @@ -443,7 +489,7 @@ c.SetClientStore(s.store) modelcmd.InitContexts(&cmd.Context{Stderr: ioutil.Discard}, &c) modelcmd.SetRunStarted(&c) - err := c.SetModelName(s.controllerName+":"+s.modelName, false) + err := c.SetModelIdentifier(s.controllerName+":"+s.modelName, false) if err != nil { panic(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/cmd/plugins/juju-metadata/imagemetadata.go juju-core-2.6.5/src/github.com/juju/juju/cmd/plugins/juju-metadata/imagemetadata.go --- juju-core-2.6.2/src/github.com/juju/juju/cmd/plugins/juju-metadata/imagemetadata.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/cmd/plugins/juju-metadata/imagemetadata.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/gnuflag" "github.com/juju/utils/arch" + "github.com/juju/juju/caas" jujucmd "github.com/juju/juju/cmd" "github.com/juju/juju/cmd/modelcmd" "github.com/juju/juju/environs" @@ -39,6 +40,9 @@ if err != nil { return nil, errors.Trace(err) } + if _, ok := provider.(caas.ContainerEnvironProvider); ok { + return nil, errors.NotSupportedf("preparing environ for CAAS") + } cfg, err := provider.PrepareConfig(*params) if err != nil { return nil, errors.Trace(err) @@ -50,9 +54,8 @@ // we'll do about simplestreams.MetadataValidator yet. Probably // move it to the EnvironProvider interface. return environs.New(environs.OpenParams{ - ControllerUUID: bootstrapConfig.ControllerConfig.ControllerUUID(), - Cloud: params.Cloud, - Config: cfg, + Cloud: params.Cloud, + Config: cfg, }) } @@ -184,13 +187,13 @@ 1. For local access, use the --metadata-source parameter when bootstrapping: juju bootstrap --metadata-source %s [...] -2. For remote access, use image-metadata-url attribute for model configuration. -To set it as a default for any model or for the controller model, +2. For remote access, use image-metadata-url attribute for model configuration. +To set it as a default for any model or for the controller model, it needs to be supplied as part of --model-default to 'juju bootstrap' command. See 'bootstrap' help for more details. For configuration for a particular model, set it as --image-metadata-url on 'juju model-config'. See 'model-config' help for more details. -Regardless of where this attribute is used, it expects a reachable URL. +Regardless of where this attribute is used, it expects a reachable URL. You need to configure a http server to serve the contents of %s and set the value of image-metadata-url accordingly. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/container/broker/broker_test.go juju-core-2.6.5/src/github.com/juju/juju/container/broker/broker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/container/broker/broker_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/container/broker/broker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -296,7 +296,7 @@ } func assertInstancesStarted(c *gc.C, broker environs.InstanceBroker, results ...*environs.StartInstanceResult) { - allInstances, err := broker.AllInstances(context.NewCloudCallContext()) + allInstances, err := broker.AllRunningInstances(context.NewCloudCallContext()) c.Assert(err, jc.ErrorIsNil) instancetest.MatchInstances(c, allInstances, instancesFromResults(results...)...) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/container/broker/kvm-broker.go juju-core-2.6.5/src/github.com/juju/juju/container/broker/kvm-broker.go --- juju-core-2.6.2/src/github.com/juju/juju/container/broker/kvm-broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/container/broker/kvm-broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -191,7 +191,12 @@ return nil } -// AllInstances only returns running containers. +// AllInstances returns all containers. func (broker *kvmBroker) AllInstances(ctx context.ProviderCallContext) (result []instances.Instance, err error) { return broker.manager.ListContainers() } + +// AllRunningInstances only returns running containers. +func (broker *kvmBroker) AllRunningInstances(ctx context.ProviderCallContext) (result []instances.Instance, err error) { + return broker.manager.ListContainers() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/container/broker/kvm-broker_test.go juju-core-2.6.5/src/github.com/juju/juju/container/broker/kvm-broker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/container/broker/kvm-broker_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/container/broker/kvm-broker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -172,7 +172,7 @@ s.assertNoResults(c, broker) } -func (s *kvmBrokerSuite) TestAllInstances(c *gc.C) { +func (s *kvmBrokerSuite) TestAllRunningInstances(c *gc.C) { broker, brokerErr := s.newKVMBroker(c) c.Assert(brokerErr, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/container/broker/lxd-broker.go juju-core-2.6.5/src/github.com/juju/juju/container/broker/lxd-broker.go --- juju-core-2.6.2/src/github.com/juju/juju/container/broker/lxd-broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/container/broker/lxd-broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -169,11 +169,16 @@ return nil } -// AllInstances only returns running containers. +// AllInstances returns all containers. func (broker *lxdBroker) AllInstances(ctx context.ProviderCallContext) (result []instances.Instance, err error) { return broker.manager.ListContainers() } +// AllRunningInstances only returns running containers. +func (broker *lxdBroker) AllRunningInstances(ctx context.ProviderCallContext) (result []instances.Instance, err error) { + return broker.manager.ListContainers() +} + // MaintainInstance ensures the container's host has the required iptables and // routing rules to make the container visible to both the host and other // machines on the same subnet. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/controller/config.go juju-core-2.6.5/src/github.com/juju/juju/controller/config.go --- juju-core-2.6.2/src/github.com/juju/juju/controller/config.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/controller/config.go 2019-06-28 17:10:43.000000000 +0000 @@ -122,6 +122,8 @@ // detault MongoMemoryProfile = "mongo-memory-profile" + // TODO(thumper): remove max-logs-age and max-logs-size in 2.7 branch. + // MaxLogsAge is the maximum age for log entries, eg "72h" MaxLogsAge = "max-logs-age" @@ -129,6 +131,10 @@ // before it is pruned, eg "4M" MaxLogsSize = "max-logs-size" + // ModelLogsSize is the size of the capped collections used to hold the + // logs for the models, eg "20M". Size is per model. + ModelLogsSize = "model-logs-size" + // MaxTxnLogSize is the maximum size the of capped txn log collection, eg "10M" MaxTxnLogSize = "max-txn-log-size" @@ -191,6 +197,8 @@ // DefaultMongoMemoryProfile is the default profile used by mongo. DefaultMongoMemoryProfile = MongoProfDefault + // TODO(thumper): remove DefaultMaxLogsAgeDays and DefaultMaxLogCollectionMB in 2.7 branch. + // DefaultMaxLogsAgeDays is the maximum age in days of log entries. DefaultMaxLogsAgeDays = 3 @@ -207,6 +215,10 @@ // DefaultMaxPruneTxnPasses is the default number of batches we will process (deprecated) DefaultMaxPruneTxnPasses = 100 + // DefaultModelLogsSizeMB is the size in MB of the capped logs collection + // for each model. + DefaultModelLogsSizeMB = 20 + // DefaultPruneTxnQueryCount is the number of transactions to read in a single query. DefaultPruneTxnQueryCount = 1000 @@ -259,11 +271,13 @@ SetNUMAControlPolicyKey, StatePort, MongoMemoryProfile, + // TODO(thumper): remove MaxLogsAge and MaxLogsSize in 2.7 branch. MaxLogsSize, MaxLogsAge, MaxTxnLogSize, MaxPruneTxnBatchSize, MaxPruneTxnPasses, + ModelLogsSize, PruneTxnQueryCount, PruneTxnSleepTime, JujuHASpace, @@ -292,8 +306,10 @@ ControllerAPIPort, MaxPruneTxnBatchSize, MaxPruneTxnPasses, + // TODO(thumper): remove MaxLogsAge and MaxLogsSize in 2.7 branch. MaxLogsSize, MaxLogsAge, + ModelLogsSize, MongoMemoryProfile, PruneTxnQueryCount, PruneTxnSleepTime, @@ -569,18 +585,11 @@ return value } -// MaxLogsAge is the maximum age of log entries before they are pruned. -func (c Config) MaxLogsAge() time.Duration { +// ModelLogsSizeMB is the size of the capped collection used to store the model +// logs. Total size on disk will be ModelLogsSizeMB * number of models. +func (c Config) ModelLogsSizeMB() int { // Value has already been validated. - val, _ := time.ParseDuration(c.mustString(MaxLogsAge)) - return val -} - -// MaxLogSizeMB is the maximum size in MiB which the log collection -// can grow to before being pruned. -func (c Config) MaxLogSizeMB() int { - // Value has already been validated. - val, _ := utils.ParseSize(c.mustString(MaxLogsSize)) + val, _ := utils.ParseSize(c.mustString(ModelLogsSize)) return int(val) } @@ -694,6 +703,7 @@ } } + // TODO(thumper): remove MaxLogsAge and MaxLogsSize validation in 2.7 branch. if v, ok := c[MaxLogsAge].(string); ok { if _, err := time.ParseDuration(v); err != nil { return errors.Annotate(err, "invalid logs prune interval in configuration") @@ -706,6 +716,16 @@ } } + if v, ok := c[ModelLogsSize].(string); ok { + mb, err := utils.ParseSize(v) + if err != nil { + return errors.Annotate(err, "invalid model logs size in configuration") + } + if mb < 1 { + return errors.NotValidf("model logs size less than 1 MB") + } + } + if v, ok := c[MaxTxnLogSize].(string); ok { if _, err := utils.ParseSize(v); err != nil { return errors.Annotate(err, "invalid max txn log size in configuration") @@ -868,6 +888,7 @@ MaxTxnLogSize: schema.String(), MaxPruneTxnBatchSize: schema.ForceInt(), MaxPruneTxnPasses: schema.ForceInt(), + ModelLogsSize: schema.String(), PruneTxnQueryCount: schema.ForceInt(), PruneTxnSleepTime: schema.String(), JujuHASpace: schema.String(), @@ -899,6 +920,7 @@ MaxTxnLogSize: fmt.Sprintf("%vM", DefaultMaxTxnLogCollectionMB), MaxPruneTxnBatchSize: DefaultMaxPruneTxnBatchSize, MaxPruneTxnPasses: DefaultMaxPruneTxnPasses, + ModelLogsSize: fmt.Sprintf("%vM", DefaultModelLogsSizeMB), PruneTxnQueryCount: DefaultPruneTxnQueryCount, PruneTxnSleepTime: DefaultPruneTxnSleepTime, JujuHASpace: schema.Omit, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/controller/config_test.go juju-core-2.6.5/src/github.com/juju/juju/controller/config_test.go --- juju-core-2.6.2/src/github.com/juju/juju/controller/config_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/controller/config_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -189,6 +189,20 @@ }, expectError: `invalid audit log exclude methods: should be a list of "Facade.Method" names \(or "ReadOnlyMethods"\), got "Sharon Jones" at position 3`, }, { + about: "invalid model log max size", + config: controller.Config{ + controller.CACertKey: testing.CACert, + controller.ModelLogsSize: "abcd", + }, + expectError: `invalid model logs size in configuration: expected a non-negative number, got "abcd"`, +}, { + about: "zero model log max size", + config: controller.Config{ + controller.CACertKey: testing.CACert, + controller.ModelLogsSize: "0", + }, + expectError: "model logs size less than 1 MB not valid", +}, { about: "invalid CAAS docker image repo", config: controller.Config{ controller.CACertKey: testing.CACert, @@ -298,25 +312,29 @@ func (s *ConfigSuite) TestLogConfigDefaults(c *gc.C) { cfg, err := controller.NewConfig(testing.ControllerTag.Id(), testing.CACert, nil) c.Assert(err, jc.ErrorIsNil) - c.Assert(cfg.MaxLogsAge(), gc.Equals, 72*time.Hour) - c.Assert(cfg.MaxLogSizeMB(), gc.Equals, 4096) + // TODO(thumper): remove max-logs-age and max-logs-size in 2.7 branch. + c.Assert(cfg["max-logs-age"], gc.Equals, "72h") + c.Assert(cfg["max-logs-size"], gc.Equals, "4096M") + c.Assert(cfg.ModelLogsSizeMB(), gc.Equals, 20) } func (s *ConfigSuite) TestLogConfigValues(c *gc.C) { + // TODO(thumper): remove MaxLogsAge and MaxLogsSize in 2.7 branch. c.Assert(controller.AllowedUpdateConfigAttributes.Contains(controller.MaxLogsAge), jc.IsTrue) c.Assert(controller.AllowedUpdateConfigAttributes.Contains(controller.MaxLogsSize), jc.IsTrue) + c.Assert(controller.AllowedUpdateConfigAttributes.Contains(controller.ModelLogsSize), jc.IsTrue) cfg, err := controller.NewConfig( testing.ControllerTag.Id(), testing.CACert, map[string]interface{}{ - "max-logs-size": "8G", - "max-logs-age": "96h", + "max-logs-size": "8G", + "max-logs-age": "96h", + "model-logs-size": "35M", }, ) c.Assert(err, jc.ErrorIsNil) - c.Assert(cfg.MaxLogsAge(), gc.Equals, 96*time.Hour) - c.Assert(cfg.MaxLogSizeMB(), gc.Equals, 8192) + c.Assert(cfg.ModelLogsSizeMB(), gc.Equals, 35) } func (s *ConfigSuite) TestTxnLogConfigDefault(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/application.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/application.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/application.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/application.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,15 +4,13 @@ package cache import ( - "sync" - "github.com/juju/pubsub" ) const ( - // the application's charm url has changed. - applicationCharmURLChange = "application-charmurl-change" - // application config has changed. + // An application charm URL has changed. + applicationCharmURLChange = "application-charm-url-change" + // Application config has changed. applicationConfigChange = "application-config-change" ) @@ -34,33 +32,31 @@ // Link to model? metrics *ControllerGauges hub *pubsub.SimpleHub - mu sync.Mutex details ApplicationChange configHash string hashCache *hashCache } +// Note that these property accessors are not lock-protected. +// They are intended for calling from external packages that have retrieved a +// deep copy from the cache. + // CharmURL returns the charm url string for this application. func (a *Application) CharmURL() string { - a.mu.Lock() - defer a.mu.Unlock() return a.details.CharmURL } // Config returns a copy of the current application config. func (a *Application) Config() map[string]interface{} { - a.mu.Lock() - cfg := make(map[string]interface{}, len(a.details.Config)) - for k, v := range a.details.Config { - cfg[k] = v - } - a.mu.Unlock() a.metrics.ApplicationConfigReads.Inc() - return cfg + return a.details.Config } // WatchConfig creates a watcher for the application config. +// Do not use this to watch config on behalf of a unit. +// It is not aware of branch-based config deltas +// and only deals with master settings. func (a *Application) WatchConfig(keys ...string) *ConfigWatcher { w := newConfigWatcher(keys, a.hashCache, a.hub, a.topic(applicationConfigChange), a.Resident) return w @@ -74,8 +70,6 @@ } func (a *Application) setDetails(details ApplicationChange) { - a.mu.Lock() - // If this is the first receipt of details, set the removal message. if a.removalMessage == nil { a.removalMessage = RemoveApplication{ @@ -87,10 +81,7 @@ a.setStale(false) if a.details.CharmURL != details.CharmURL { - a.hub.Publish( - a.modelTopic(applicationCharmURLChange), - appCharmUrlChange{appName: a.details.Name, chURL: details.CharmURL}, - ) + a.hub.Publish(applicationCharmURLChange, appCharmUrlChange{appName: a.details.Name, chURL: details.CharmURL}) } a.details = details @@ -100,19 +91,19 @@ if configHash != a.configHash { a.configHash = configHash a.hashCache = hashCache + a.hashCache.incMisses() a.hub.Publish(a.topic(applicationConfigChange), hashCache) } - - a.mu.Unlock() } -// topic prefixes the input string with the model ID and application name. -// TODO (manadart 2019-03-14) The model ID will not be necessary when there is -// one hub per model. -func (a *Application) topic(suffix string) string { - return a.details.ModelUUID + ":" + a.details.Name + ":" + suffix +// copy returns a copy of the unit, ensuring appropriate deep copying. +func (a *Application) copy() Application { + ca := *a + ca.details = ca.details.copy() + return ca } -func (a *Application) modelTopic(suffix string) string { - return modelTopic(a.details.ModelUUID, suffix) +// topic prefixes the input string with the application name. +func (a *Application) topic(suffix string) string { + return a.details.Name + ":" + suffix } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/application_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/application_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/application_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,8 @@ package cache_test import ( + "sync" + "github.com/prometheus/client_golang/prometheus/testutil" gc "gopkg.in/check.v1" "gopkg.in/juju/worker.v1/workertest" @@ -23,10 +25,23 @@ func (s *ApplicationSuite) TestConfigIncrementsReadCount(c *gc.C) { m := s.NewApplication(appChange) c.Check(testutil.ToFloat64(s.Gauges.ApplicationConfigReads), gc.Equals, float64(0)) + m.Config() c.Check(testutil.ToFloat64(s.Gauges.ApplicationConfigReads), gc.Equals, float64(1)) m.Config() c.Check(testutil.ToFloat64(s.Gauges.ApplicationConfigReads), gc.Equals, float64(2)) + + // Goroutine safety. + var wg sync.WaitGroup + wg.Add(3) + for i := 0; i < 3; i++ { + go func() { + m.Config() + wg.Done() + }() + } + wg.Wait() + c.Check(testutil.ToFloat64(s.Gauges.ApplicationConfigReads), gc.Equals, float64(5)) } // See model_test.go for other config watcher tests. @@ -43,7 +58,7 @@ s.AssertWorkerResource(c, a.Resident, resourceId, false) }() - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() @@ -57,6 +72,11 @@ // The value is retrieved from the cache when the watcher is created and notified. c.Check(testutil.ToFloat64(s.Gauges.ApplicationHashCacheHit), gc.Equals, float64(2)) + + // Setting the same values causes no notification and no cache miss. + a.SetDetails(change) + wc.AssertNoChange() + c.Check(testutil.ToFloat64(s.Gauges.ApplicationHashCacheMiss), gc.Equals, float64(2)) } var appChange = cache.ApplicationChange{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/branch.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/branch.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/branch.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/branch.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cache + +import ( + "github.com/juju/pubsub" + + "github.com/juju/juju/core/settings" +) + +const branchChange = "branch-change" + +// Branch represents an active branch in a cached model. +type Branch struct { + // Resident identifies the branch as a type-agnostic cached entity + // and tracks resources that it is responsible for cleaning up. + *Resident + + metrics *ControllerGauges + hub *pubsub.SimpleHub + + details BranchChange +} + +func newBranch(metrics *ControllerGauges, hub *pubsub.SimpleHub, res *Resident) *Branch { + return &Branch{ + Resident: res, + metrics: metrics, + hub: hub, + } +} + +// Note that these property accessors are not lock-protected. +// They are intended for calling from external packages that have retrieved a +// deep copy from the cache. + +// Name returns the name of the branch. +// It is guaranteed to uniquely identify an active branch in the cache. +func (b *Branch) Name() string { + return b.details.Name +} + +// AssignedUnits returns a map of the names of units tracking this branch, +// keyed by application names with changes made under the branch. +func (b *Branch) AssignedUnits() map[string][]string { + return b.details.AssignedUnits +} + +// Config returns the configuration changes that apply to the branch. +func (b *Branch) Config() map[string]settings.ItemChanges { + return b.details.Config +} + +// AppConfig returns the configuration changes that +// apply to the branch for a specific application. +func (b *Branch) AppConfig(appName string) settings.ItemChanges { + return b.details.Config[appName] +} + +// Created returns a Unix timestamp indicating when this generation +// was created. +func (b *Branch) Created() int64 { + return b.details.Created +} + +// CreatedBy returns user who created the branch. +func (b *Branch) CreatedBy() string { + return b.details.CreatedBy +} + +// Completed returns a Unix timestamp indicating when this generation +// was committed. +func (b *Branch) Completed() int64 { + return b.details.Completed +} + +// CreatedBy returns user who committed the branch. +func (b *Branch) CompletedBy() string { + return b.details.CompletedBy +} + +func (b *Branch) setDetails(details BranchChange) { + // If this is the first receipt of details, set the removal message. + if b.removalMessage == nil { + b.removalMessage = RemoveBranch{ + ModelUUID: details.ModelUUID, + Id: details.Id, + } + } + + b.setStale(false) + + b.details = details + b.hub.Publish(branchChange, b.copy()) +} + +// copy returns a copy of the branch, ensuring appropriate deep copying. +func (b *Branch) copy() Branch { + cb := *b + cb.details = cb.details.copy() + return cb +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/branch_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/branch_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/branch_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/branch_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cache_test + +import ( + "time" + + gc "gopkg.in/check.v1" + + "github.com/juju/juju/core/cache" + "github.com/juju/juju/core/settings" + "github.com/juju/juju/testing" +) + +type BranchSuite struct { + cache.EntitySuite +} + +var _ = gc.Suite(&BranchSuite{}) + +func (s *BranchSuite) TestBranchSetDetailsPublishesCopy(c *gc.C) { + rcv := make(chan interface{}, 1) + unsub := s.Hub.Subscribe("branch-change", func(_ string, msg interface{}) { rcv <- msg }) + defer unsub() + + _ = s.NewBranch(branchChange) + + select { + case msg := <-rcv: + b, ok := msg.(cache.Branch) + if !ok { + c.Fatal("wrong type published; expected Branch.") + } + c.Check(b.Name(), gc.Equals, branchChange.Name) + + case <-time.After(testing.LongWait): + c.Fatal("branch change message not Received") + } +} + +var branchChange = cache.BranchChange{ + ModelUUID: "model-uuid", + Id: "0", + Name: "testing-branch", + AssignedUnits: map[string][]string{"redis": {"redis/0", "redis/1"}}, + Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "pass666")}}, + Created: 0, + CreatedBy: "test-user", + Completed: 0, + CompletedBy: "different-user", + GenerationId: 0, +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/controller.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/controller.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/controller.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/controller.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cachetest + +import ( + "time" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/core/cache" + "github.com/juju/juju/state" + "github.com/juju/juju/testing" +) + +// TestController wraps a cache controller for testing. +// It allows synchronisation of state objects with the cache +// without the need for a multi-watcher and cache worker. +// This is useful when testing with StateSuite; +// JujuConnSuite sets up a cache worker and multiwatcher to keep the model +// cache in sync, so direct population using this technique is not necessary. +type TestController struct { + *cache.Controller + + matchers []func(interface{}) bool + changes chan interface{} + events chan interface{} +} + +// NewTestController returns creates and returns a new test controller +// with an initial set of matchers for receiving cache event notifications. +// The controller can be instantiated like this in suite/test setups in order +// to retain a common set of matchers, but `Init` should be called in each +// test (see below). +func NewTestController(matchers ...func(interface{}) bool) *TestController { + return &TestController{ + matchers: matchers, + } +} + +// Init instantiates the inner cache controller and sets up event +// synchronisation based on the input matchers. +// Changes sent to the cache can be waited on by using the `NextChange` method. +// +// NOTE: It is recommended to perform this initialisation in the actual test +// method rather than `SetupSuite` or `SetupTest` as different gc.C references +// are supplied to each of those methods. +func (tc *TestController) Init(c *gc.C, matchers ...func(interface{}) bool) { + tc.events = make(chan interface{}) + matchers = append(tc.matchers, matchers...) + + notify := func(change interface{}) { + send := false + for _, m := range matchers { + if m(change) { + send = true + break + } + } + + if send { + c.Logf("sending %#v", change) + select { + case tc.events <- change: + case <-time.After(testing.LongWait): + c.Fatalf("change not processed by test") + } + } + } + + tc.changes = make(chan interface{}) + cc, err := cache.NewController(cache.ControllerConfig{ + Changes: tc.changes, + Notify: notify, + }) + c.Assert(err, jc.ErrorIsNil) + tc.Controller = cc +} + +// UpdateModel updates the current model for the input state in the cache. +func (tc *TestController) UpdateModel(c *gc.C, m *state.Model) { + tc.SendChange(ModelChange(c, m)) +} + +// UpdateCharm updates the input state charm in the cache. +func (tc *TestController) UpdateCharm(modelUUID string, ch *state.Charm) { + tc.SendChange(CharmChange(modelUUID, ch)) +} + +// UpdateApplication updates the input state application in the cache. +func (tc *TestController) UpdateApplication(c *gc.C, modelUUID string, app *state.Application) { + tc.SendChange(ApplicationChange(c, modelUUID, app)) +} + +// UpdateMachine updates the input state machine in the cache. +func (tc *TestController) UpdateMachine(c *gc.C, modelUUID string, machine *state.Machine) { + tc.SendChange(MachineChange(c, modelUUID, machine)) +} + +// UpdateUnit updates the input state unit in the cache. +func (tc *TestController) UpdateUnit(c *gc.C, modelUUID string, unit *state.Unit) { + tc.SendChange(UnitChange(c, modelUUID, unit)) +} + +func (tc *TestController) SendChange(change interface{}) { + tc.changes <- change +} + +// NextChange returns the next change processed by the cache that satisfies a +// matcher, or fails the test with a time-out. +func (tc *TestController) NextChange(c *gc.C) interface{} { + var obtained interface{} + select { + case obtained = <-tc.events: + case <-time.After(testing.LongWait): + c.Fatalf("change not processed by test") + } + return obtained +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/eventmatchers.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/eventmatchers.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/eventmatchers.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/eventmatchers.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cachetest + +import "github.com/juju/juju/core/cache" + +func ModelEvents(change interface{}) bool { + switch change.(type) { + case cache.ModelChange: + return true + case cache.RemoveModel: + return true + } + return false +} + +func ApplicationEvents(change interface{}) bool { + switch change.(type) { + case cache.ApplicationChange: + return true + case cache.RemoveApplication: + return true + } + return false +} + +func MachineEvents(change interface{}) bool { + switch change.(type) { + case cache.MachineChange: + return true + case cache.RemoveMachine: + return true + } + return false +} + +func CharmEvents(change interface{}) bool { + switch change.(type) { + case cache.CharmChange: + return true + case cache.RemoveCharm: + return true + } + return false +} + +func UnitEvents(change interface{}) bool { + switch change.(type) { + case cache.UnitChange: + return true + case cache.RemoveUnit: + return true + } + return false +} + +func BranchEvents(change interface{}) bool { + switch change.(type) { + case cache.BranchChange: + return true + case cache.RemoveBranch: + return true + } + return false +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/state.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/state.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/cachetest/state.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/cachetest/state.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,52 +10,175 @@ "github.com/juju/juju/core/cache" "github.com/juju/juju/core/life" + "github.com/juju/juju/core/lxdprofile" + "github.com/juju/juju/core/model" + "github.com/juju/juju/network" "github.com/juju/juju/state" ) // ModelChangeFromState returns a ModelChange representing the current // model for the state object. func ModelChangeFromState(c *gc.C, st *state.State) cache.ModelChange { - model, err := st.Model() + m, err := st.Model() c.Assert(err, jc.ErrorIsNil) - return ModelChange(c, model) + return ModelChange(c, m) } -// ModelChangeFromStateErr returns a ModelChange representing the current -// model for the state object. May return an error. -func ModelChangeFromStateErr(st *state.State) (cache.ModelChange, error) { - model, err := st.Model() - if err != nil { - return cache.ModelChange{}, errors.Trace(err) - } - return ModelChangeErr(model) -} - -// ModelChange returns a ModelChange representing the current state of the model. +// ModelChange returns a ModelChange representing the input state model. func ModelChange(c *gc.C, model *state.Model) cache.ModelChange { - change, err := ModelChangeErr(model) + cfg, err := model.Config() + c.Assert(err, jc.ErrorIsNil) + + status, err := model.Status() c.Assert(err, jc.ErrorIsNil) - return change -} -// ModelChangeErr returns a ModelChange representing the current state of the model. -// May return an error if unable to load config or status. -func ModelChangeErr(model *state.Model) (cache.ModelChange, error) { - change := cache.ModelChange{ + return cache.ModelChange{ ModelUUID: model.UUID(), Name: model.Name(), Life: life.Value(model.Life().String()), Owner: model.Owner().Name(), + Config: cfg.AllAttrs(), + Status: status, } - config, err := model.Config() - if err != nil { - return cache.ModelChange{}, errors.Trace(err) +} + +// CharmChange returns a CharmChange representing the input state charm. +func CharmChange(modelUUID string, ch *state.Charm) cache.CharmChange { + prof := ch.LXDProfile() + cProf := lxdprofile.Profile{ + Config: prof.Config, + Description: prof.Description, + Devices: prof.Devices, } - change.Config = config.AllAttrs() - status, err := model.Status() - if err != nil { - return cache.ModelChange{}, errors.Trace(err) + + return cache.CharmChange{ + ModelUUID: modelUUID, + CharmURL: ch.URL().String(), + CharmVersion: ch.Version(), + LXDProfile: cProf, + DefaultConfig: ch.Config().DefaultSettings(), + } +} + +// ApplicationChange returns an ApplicationChange +// representing the input state application. +func ApplicationChange(c *gc.C, modelUUID string, app *state.Application) cache.ApplicationChange { + // Note that this will include charm defaults as if explicitly set. + // If this matters for tests, we will have to pass a state and attempt + // to access the settings document for this application charm config. + config, err := app.CharmConfig(model.GenerationMaster) + c.Assert(err, jc.ErrorIsNil) + + cons, err := app.Constraints() + c.Assert(err, jc.ErrorIsNil) + + sts, err := app.Status() + c.Assert(err, jc.ErrorIsNil) + + cURL, _ := app.CharmURL() + + return cache.ApplicationChange{ + ModelUUID: modelUUID, + Name: app.Name(), + Exposed: app.IsExposed(), + CharmURL: cURL.Path(), + Life: life.Value(app.Life().String()), + MinUnits: app.MinUnits(), + Constraints: cons, + Config: config, + Status: sts, + // TODO: Subordinate, WorkloadVersion. + } +} + +func MachineChange(c *gc.C, modelUUID string, machine *state.Machine) cache.MachineChange { + iid, err := machine.InstanceId() + c.Assert(err, jc.ErrorIsNil) + + aSts, err := machine.Status() + c.Assert(err, jc.ErrorIsNil) + + iSts, err := machine.InstanceStatus() + c.Assert(err, jc.ErrorIsNil) + + hwc, err := machine.HardwareCharacteristics() + c.Assert(err, jc.ErrorIsNil) + + chProf, err := machine.CharmProfiles() + c.Assert(err, jc.ErrorIsNil) + + sc, scKnown := machine.SupportedContainers() + + return cache.MachineChange{ + ModelUUID: modelUUID, + Id: machine.Id(), + InstanceId: string(iid), + AgentStatus: aSts, + InstanceStatus: iSts, + Life: life.Value(machine.Life().String()), + Series: machine.Series(), + ContainerType: string(machine.ContainerType()), + SupportedContainers: sc, + SupportedContainersKnown: scKnown, + HardwareCharacteristics: hwc, + CharmProfiles: chProf, + HasVote: machine.HasVote(), + WantsVote: machine.WantsVote(), + // TODO: Config, Addresses. + } + +} + +// UnitChange returns a UnitChange representing the input state unit. +func UnitChange(c *gc.C, modelUUID string, unit *state.Unit) cache.UnitChange { + // If these addresses are not set in state, we simply eschew setting them + // in the cache rather than propagating such errors. + publicAddr, err := unit.PublicAddress() + if !network.IsNoAddressError(err) { + c.Assert(err, jc.ErrorIsNil) + } + privateAddr, err := unit.PrivateAddress() + if !network.IsNoAddressError(err) { + c.Assert(err, jc.ErrorIsNil) + } + + machineId, err := unit.AssignedMachineId() + if !errors.IsNotAssigned(err) { + c.Assert(err, jc.ErrorIsNil) + } + + var charmURL string + if cURL, ok := unit.CharmURL(); ok { + charmURL = cURL.String() + } + + pr, err := unit.OpenedPorts() + if !errors.IsNotAssigned(err) { + c.Assert(err, jc.ErrorIsNil) + } + + sts, err := unit.Status() + c.Assert(err, jc.ErrorIsNil) + + aSts, err := unit.AgentStatus() + c.Assert(err, jc.ErrorIsNil) + + principal, _ := unit.PrincipalName() + + return cache.UnitChange{ + ModelUUID: modelUUID, + Name: unit.Name(), + Application: unit.ApplicationName(), + Series: unit.Series(), + CharmURL: charmURL, + Life: life.Value(unit.Life().String()), + PublicAddress: publicAddr.String(), + PrivateAddress: privateAddr.String(), + MachineId: machineId, + PortRanges: pr, + Principal: principal, + WorkloadStatus: sts, + AgentStatus: aSts, + // TODO: Subordinate } - change.Status = status - return change, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/changes.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/changes.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/changes.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/changes.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,11 +4,14 @@ package cache import ( + "time" + "github.com/juju/juju/core/constraints" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/life" "github.com/juju/juju/core/lxdprofile" "github.com/juju/juju/core/network" + "github.com/juju/juju/core/settings" "github.com/juju/juju/core/status" ) @@ -45,6 +48,17 @@ WorkloadVersion string } +// copy returns a deep copy of the ApplicationChange. +func (a ApplicationChange) copy() ApplicationChange { + cons := a.Constraints.String() + a.Constraints = constraints.MustParse(cons) + + a.Config = copyDataMap(a.Config) + a.Status = copyStatusInfo(a.Status) + + return a +} + // RemoveApplication represents the situation when an application // is removed from a model in the database. type RemoveApplication struct { @@ -55,10 +69,44 @@ // CharmChange represents either a new charm, or a change // to an existing charm in a model. type CharmChange struct { - ModelUUID string - CharmURL string - CharmVersion string - LXDProfile lxdprofile.Profile + ModelUUID string + CharmURL string + CharmVersion string + LXDProfile lxdprofile.Profile + DefaultConfig map[string]interface{} +} + +func (c CharmChange) copy() CharmChange { + var cpConfig map[string]string + pConfig := c.LXDProfile.Config + if pConfig != nil { + cpConfig = make(map[string]string, len(pConfig)) + for k, v := range pConfig { + cpConfig[k] = v + } + } + c.LXDProfile.Config = cpConfig + + var cpDevices map[string]map[string]string + pDevices := c.LXDProfile.Devices + if pDevices != nil { + cpDevices = make(map[string]map[string]string, len(pDevices)) + for dName, dCfg := range pDevices { + var cCfg map[string]string + if dCfg != nil { + cCfg = make(map[string]string, len(dCfg)) + for k, v := range dCfg { + cCfg[k] = v + } + } + cpDevices[dName] = cCfg + } + } + c.LXDProfile.Devices = cpDevices + + c.DefaultConfig = copyDataMap(c.DefaultConfig) + + return c } // RemoveCharm represents the situation when an charm @@ -88,6 +136,34 @@ AgentStatus status.StatusInfo } +// copy returns a deep copy of the UnitChange. +func (u UnitChange) copy() UnitChange { + var cPorts []network.Port + uPorts := u.Ports + if uPorts != nil { + cPorts = make([]network.Port, len(uPorts)) + for i, p := range uPorts { + cPorts[i] = p + } + } + u.Ports = cPorts + + var cPortRanges []network.PortRange + uPortRanges := u.PortRanges + if uPortRanges != nil { + cPortRanges = make([]network.PortRange, len(uPortRanges)) + for i, p := range uPortRanges { + cPortRanges[i] = p + } + } + u.PortRanges = cPortRanges + + u.WorkloadStatus = copyStatusInfo(u.WorkloadStatus) + u.AgentStatus = copyStatusInfo(u.AgentStatus) + + return u +} + // RemoveUnit represents the situation when a unit // is removed from a model in the database. type RemoveUnit struct { @@ -106,6 +182,7 @@ Life life.Value Config map[string]interface{} Series string + ContainerType string SupportedContainers []instance.ContainerType SupportedContainersKnown bool HardwareCharacteristics *instance.HardwareCharacteristics @@ -115,9 +192,141 @@ WantsVote bool } +// copy returns a deep copy of the MachineChange. +func (m MachineChange) copy() MachineChange { + m.AgentStatus = copyStatusInfo(m.AgentStatus) + m.InstanceStatus = copyStatusInfo(m.InstanceStatus) + m.Config = copyDataMap(m.Config) + + var cSupportedContainers []instance.ContainerType + if m.SupportedContainers != nil { + cSupportedContainers = make([]instance.ContainerType, len(m.SupportedContainers)) + for i, v := range m.SupportedContainers { + cSupportedContainers[i] = v + } + } + m.SupportedContainers = cSupportedContainers + + var cHardwareCharacteristics instance.HardwareCharacteristics + if m.HardwareCharacteristics != nil { + cHardwareCharacteristics = *m.HardwareCharacteristics + } + m.HardwareCharacteristics = &cHardwareCharacteristics + + var cCharmProfiles []string + if m.CharmProfiles != nil { + cCharmProfiles = make([]string, len(m.CharmProfiles)) + for i, v := range m.CharmProfiles { + cCharmProfiles[i] = v + } + } + m.CharmProfiles = cCharmProfiles + + var cAddresses []network.Address + if m.Addresses != nil { + cAddresses = make([]network.Address, len(m.Addresses)) + for i, v := range m.Addresses { + cAddresses[i] = v + } + } + m.Addresses = cAddresses + + return m +} + // RemoveMachine represents the situation when a machine // is removed from a model in the database. type RemoveMachine struct { ModelUUID string Id string } + +// BranchChange represents a change to an active model branch. +// Note that this corresponds to a multi-watcher GenerationInfo payload, +// and that the cache behaviour differs from other entities; +// when a generation is completed (aborted or committed), +// it is no longer an active branch and will be removed from the cache. +type BranchChange struct { + ModelUUID string + Id string + Name string + AssignedUnits map[string][]string + Config map[string]settings.ItemChanges + Created int64 + CreatedBy string + Completed int64 + CompletedBy string + GenerationId int +} + +func (b BranchChange) copy() BranchChange { + var cAssignedUnits map[string][]string + bAssignedUnits := b.AssignedUnits + if bAssignedUnits != nil { + cAssignedUnits = make(map[string][]string, len(bAssignedUnits)) + for k, v := range bAssignedUnits { + units := make([]string, len(v)) + for i, u := range v { + units[i] = u + } + cAssignedUnits[k] = units + } + } + b.AssignedUnits = cAssignedUnits + + var cConfig map[string]settings.ItemChanges + bConfig := b.Config + if bConfig != nil { + cConfig = make(map[string]settings.ItemChanges, len(bConfig)) + for k, v := range bConfig { + changes := make(settings.ItemChanges, len(v)) + for i, ch := range v { + changes[i] = settings.ItemChange{ + Type: ch.Type, + Key: ch.Key, + NewValue: ch.NewValue, + OldValue: ch.OldValue, + } + } + cConfig[k] = changes + } + } + b.Config = cConfig + + return b +} + +// RemoveBranch represents the situation when a branch is to be removed +// from the cache. This will rarely be a result of deletion from the database. +// It will usually be the result of the branch no longer being considered +// "in-flight" due to being committed or aborted. +type RemoveBranch struct { + ModelUUID string + Id string +} + +func copyStatusInfo(info status.StatusInfo) status.StatusInfo { + var cSince *time.Time + if info.Since != nil { + s := *info.Since + cSince = &s + } + + return status.StatusInfo{ + Status: info.Status, + Message: info.Message, + Data: copyDataMap(info.Data), + Since: cSince, + } +} + +func copyDataMap(data map[string]interface{}) map[string]interface{} { + var cData map[string]interface{} + if data != nil { + cData = make(map[string]interface{}, len(data)) + for i, d := range data { + cData[i] = d + } + } + return cData +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/charmconfigwatcher.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/charmconfigwatcher.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/charmconfigwatcher.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/charmconfigwatcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,257 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cache + +import ( + "github.com/juju/collections/set" + "github.com/juju/errors" + "github.com/juju/pubsub" + + "github.com/juju/juju/core/settings" +) + +type charmConfigModel interface { + Application(string) (Application, error) + Branches() map[string]Branch +} + +// charmConfigWatchConfig contains data required for a +// CharmConfigWatcher to operate. +type charmConfigWatcherConfig struct { + model charmConfigModel + + unitName string + appName string + charmURL string + + // appConfigChangeTopic is the pub/sub topic to which the watcher will + // listen for application charm config change messages. + appConfigChangeTopic string + // branchChangeTopic is the pub/sub topic to which the watcher will + // listen for model branch change messages. + branchChangeTopic string + // branchRemoveTopic is the pub/sub topic to which the watcher will + // listen for model branch removal messages. + branchRemoveTopic string + + // hub is the pub/sub hub on which the watcher will receive messages + // before determining whether to notify. + hub *pubsub.SimpleHub + // res is the cache resident responsible for creating this watcher. + res *Resident +} + +// CharmConfigWatcher watches application charm config on behalf of a unit. +// The watcher will notify if either of the following events cause a change +// to the unit's effective configuration: +// - Changes to the charm config settings for the unit's application. +// - Changes to a model branch being tracked by the unit. +type CharmConfigWatcher struct { + *stringsWatcherBase + + // initComplete is a channel that will be closed when the + // watcher is fully constructed and ready to handle events. + initComplete chan struct{} + + unitName string + appName string + charmURL string + branchName string + + masterSettings map[string]interface{} + branchDeltas settings.ItemChanges + configHash string +} + +// newUnitConfigWatcher returns a new watcher for the unit indicated in the +// input configuration. +func newCharmConfigWatcher(cfg charmConfigWatcherConfig) (*CharmConfigWatcher, error) { + w := &CharmConfigWatcher{ + stringsWatcherBase: &stringsWatcherBase{changes: make(chan []string, 1)}, + initComplete: make(chan struct{}), + unitName: cfg.unitName, + appName: cfg.appName, + charmURL: cfg.charmURL, + } + + deregister := cfg.res.registerWorker(w) + + multi := cfg.hub.NewMultiplexer() + multi.Add(cfg.appConfigChangeTopic, w.appConfigChanged) + multi.Add(cfg.branchChangeTopic, w.branchChanged) + multi.Add(cfg.branchRemoveTopic, w.branchRemoved) + + w.tomb.Go(func() error { + <-w.tomb.Dying() + multi.Unsubscribe() + deregister() + return nil + }) + + if err := w.init(cfg.model); err != nil { + _ = w.Stop() + return nil, errors.Trace(err) + } + return w, nil +} + +// init determines baseline master configuration, branch tracking settings +// and the configuration hash for the watcher's unit. +// It then closes the init channel to indicate the watcher is operational. +func (w *CharmConfigWatcher) init(model charmConfigModel) error { + app, err := model.Application(w.appName) + if err != nil { + return errors.Trace(err) + } + w.masterSettings = app.Config() + + for _, b := range model.Branches() { + if w.isTracking(b) { + w.branchName = b.Name() + w.branchDeltas = b.AppConfig(w.appName) + break + } + } + + // Always notify with the first hash. + if _, err := w.setConfigHash(); err != nil { + return errors.Trace(err) + } + w.notify([]string{w.configHash}) + + close(w.initComplete) + return nil +} + +// appConfigChanged is called when a message is received indicating changed +// application master charm configuration. +func (w *CharmConfigWatcher) appConfigChanged(_ string, msg interface{}) { + if !w.waitInitOrDying() { + return + } + + hashCache, ok := msg.(*hashCache) + if !ok { + logger.Errorf("programming error; application config message was not of expected type, *hashCache") + return + } + + w.masterSettings = hashCache.config + w.checkConfig() +} + +// branchChanged is called when we receive a message to say that a branch has +// been updated in the cache. +// If it is the branch that this watcher's unit is tracking, +// check if the latest config delta warrants a notification. +func (w *CharmConfigWatcher) branchChanged(_ string, msg interface{}) { + if !w.waitInitOrDying() { + return + } + + b, okUnit := msg.(Branch) + if !okUnit { + logger.Errorf("programming error; branch change message was not of expected type, Branch") + return + } + + // If we do not know whether we are tracking this branch, find out. + if w.branchName == "" && w.isTracking(b) { + w.branchName = b.Name() + } + if w.branchName != b.Name() { + return + } + + w.branchDeltas = b.AppConfig(w.appName) + w.checkConfig() +} + +// branchRemoved is called when we receive a message to say that a branch has +// been removed from the cache. +// If this watcher's unit was tracking the branch, clean the branch-based +// details and check if the resulting settings warrant a notification. +func (w *CharmConfigWatcher) branchRemoved(topic string, msg interface{}) { + if !w.waitInitOrDying() { + return + } + + name, okUnit := msg.(string) + if !okUnit { + logger.Errorf("programming error; branch deleted message was not of expected type, string") + return + } + + if w.branchName != name { + return + } + + // The branch we are tracking was deleted. + // Since we know that a branch with tracking units can not be aborted, + // the branch must have been committed. + // This means that we can anticipate a message for a master settings change + // (it may even have preceded this event), so just clear the branch info + // without reevaluating the hash. + w.branchName = "" + w.branchDeltas = nil +} + +// isTracking returns true if this watcher's unit is tracking the input branch. +func (w *CharmConfigWatcher) isTracking(b Branch) bool { + units := b.AssignedUnits()[w.appName] + if len(units) == 0 { + return false + } + return set.NewStrings(units...).Contains(w.unitName) +} + +// checkConfig generates a new hash based on current effective configuration. +// If the hash has changed, a notification is sent. +func (w *CharmConfigWatcher) checkConfig() { + changed, err := w.setConfigHash() + if err != nil { + logger.Errorf("generating hash for charm config: %s", errors.ErrorStack(err)) + return + } + if changed { + w.notify([]string{w.configHash}) + } +} + +// checkConfig applies any known branch deltas to the master charm config, +// Then compares a hash of the result with the last known config hash. +// The boolean return indicates whether the has has changed. +func (w *CharmConfigWatcher) setConfigHash() (bool, error) { + cfg := copyDataMap(w.masterSettings) + for _, delta := range w.branchDeltas { + switch { + case delta.IsAddition(), delta.IsModification(): + cfg[delta.Key] = delta.NewValue + case delta.IsDeletion(): + delete(cfg, delta.Key) + } + } + + newHash, err := hash(cfg, w.charmURL) + if err != nil { + return false, errors.Trace(err) + } + if w.configHash == newHash { + return false, nil + } + + w.configHash = newHash + return true, nil +} + +// waitInitOrDying returns true when the watcher is fully initialised, +// or false if it is dying. +func (w *CharmConfigWatcher) waitInitOrDying() bool { + select { + case <-w.initComplete: + return true + case <-w.tomb.Dying(): + return false + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/charmconfigwatcher_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/charmconfigwatcher_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/charmconfigwatcher_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/charmconfigwatcher_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,195 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package cache + +import ( + "github.com/juju/errors" + "github.com/juju/juju/core/settings" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" +) + +const ( + branchName = "test-branch" + defaultPassword = "default-pass" + defaultCharmURL = "default-charm-url" + defaultUnitName = "redis/0" +) + +type charmConfigWatcherSuite struct { + EntitySuite +} + +var _ = gc.Suite(&charmConfigWatcherSuite{}) + +func (s *charmConfigWatcherSuite) TestTrackingBranchChangedNotified(c *gc.C) { + w := s.newWatcher(c, defaultUnitName, defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL) + + // Publish a tracked branch change with altered config. + b := Branch{ + details: BranchChange{ + Name: branchName, + Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}}, + }, + } + s.Hub.Publish(branchChange, b) + + s.assertOneChange(c, w, map[string]interface{}{"password": "new-pass"}, defaultCharmURL) + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestNotTrackingBranchChangedNotNotified(c *gc.C) { + // This will initialise the watcher without branch info. + w := s.newWatcher(c, "redis/9", defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{}, defaultCharmURL) + + // Publish a branch change with altered config. + b := Branch{ + details: BranchChange{ + Name: branchName, + Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}}, + }, + } + s.Hub.Publish(branchChange, b) + + // Nothing should change. + w.AssertNoChange() + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestDifferentBranchChangedNotNotified(c *gc.C) { + w := s.newWatcher(c, defaultUnitName, defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL) + + // Publish a branch change with a different name to the tracked one. + b := Branch{ + details: BranchChange{ + Name: "some-other-branch", + Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", "new-pass")}}, + }, + } + s.Hub.Publish(branchChange, b) + + w.AssertNoChange() + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestTrackingBranchMasterChangedNotified(c *gc.C) { + w := s.newWatcher(c, defaultUnitName, defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL) + + // Publish a change to master configuration. + hc, _ := newHashCache(map[string]interface{}{"databases": 4}, nil, nil) + s.Hub.Publish(applicationConfigChange, hc) + + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword, "databases": 4}, defaultCharmURL) + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestTrackingBranchCommittedNotNotified(c *gc.C) { + w := s.newWatcher(c, "redis/0", defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL) + + // Publish a branch removal. + s.Hub.Publish(modelBranchRemove, branchName) + w.AssertNoChange() + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestNotTrackedBranchSeesMasterConfig(c *gc.C) { + // Watcher is for a unit not tracking the branch. + w := s.newWatcher(c, "redis/9", defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{}, defaultCharmURL) + w.AssertStops() +} + +func (s *charmConfigWatcherSuite) TestSameUnitDifferentCharmURLYieldsDifferentHash(c *gc.C) { + w := s.newWatcher(c, defaultUnitName, defaultCharmURL) + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, defaultCharmURL) + h1 := w.Watcher.(*CharmConfigWatcher).configHash + w.AssertStops() + + w = s.newWatcher(c, defaultUnitName, "different-charm-url") + s.assertOneChange(c, w, map[string]interface{}{"password": defaultPassword}, "different-charm-url") + h2 := w.Watcher.(*CharmConfigWatcher).configHash + w.AssertStops() + + c.Check(h1, gc.Not(gc.Equals), h2) +} + +func (s *charmConfigWatcherSuite) newWatcher(c *gc.C, unitName string, charmURL string) StringsWatcherC { + appName, err := names.UnitApplication(unitName) + c.Assert(err, jc.ErrorIsNil) + + // The topics can be arbitrary here; + // these tests are isolated from actual cache behaviour. + cfg := charmConfigWatcherConfig{ + model: s.newStubModel(), + unitName: unitName, + appName: appName, + charmURL: charmURL, + appConfigChangeTopic: applicationConfigChange, + branchChangeTopic: branchChange, + branchRemoveTopic: modelBranchRemove, + hub: s.Hub, + res: s.NewResident(), + } + + w, err := newCharmConfigWatcher(cfg) + c.Assert(err, jc.ErrorIsNil) + + // Wrap the watcher and ensure we get the default notification. + wc := NewStringsWatcherC(c, w) + return wc +} + +// newStub model sets up a cached model containing a redis application +// and a branch with 2 redis units tracking it. +func (s *charmConfigWatcherSuite) newStubModel() *stubCharmConfigModel { + app := newApplication(s.Gauges, s.Hub, s.NewResident()) + app.setDetails(ApplicationChange{ + Name: "redis", + Config: map[string]interface{}{}}, + ) + + branch := newBranch(s.Gauges, s.Hub, s.NewResident()) + branch.setDetails(BranchChange{ + Name: branchName, + AssignedUnits: map[string][]string{"redis": {"redis/0", "redis/1"}}, + Config: map[string]settings.ItemChanges{"redis": {settings.MakeAddition("password", defaultPassword)}}, + }) + + return &stubCharmConfigModel{ + app: *app, + branches: map[string]Branch{"0": *branch}, + } +} + +// assertWatcherConfig unwraps the charm config watcher and ensures that its +// configuration hash matches that of the input configuration map. +func (s *charmConfigWatcherSuite) assertOneChange( + c *gc.C, wc StringsWatcherC, cfg map[string]interface{}, extra ...string, +) { + h, err := hash(cfg, extra...) + c.Assert(err, jc.ErrorIsNil) + wc.AssertOneChange([]string{h}) +} + +type stubCharmConfigModel struct { + app Application + branches map[string]Branch +} + +func (m *stubCharmConfigModel) Application(name string) (Application, error) { + if name == m.app.details.Name { + return m.app, nil + } + return Application{}, errors.NotFoundf("application %q", name) +} + +func (m *stubCharmConfigModel) Branches() map[string]Branch { + return m.branches +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/charm.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/charm.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/charm.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/charm.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,8 +4,6 @@ package cache import ( - "sync" - "github.com/juju/pubsub" "github.com/juju/juju/core/lxdprofile" @@ -29,21 +27,21 @@ // Link to model? metrics *ControllerGauges hub *pubsub.SimpleHub - mu sync.Mutex details CharmChange } // LXDProfile returns the lxd profile of this charm. func (c *Charm) LXDProfile() lxdprofile.Profile { - c.mu.Lock() - defer c.mu.Unlock() return c.details.LXDProfile } -func (c *Charm) setDetails(details CharmChange) { - c.mu.Lock() +// DefaultConfig returns the default configuration settings for the charm. +func (c *Charm) DefaultConfig() map[string]interface{} { + return c.details.DefaultConfig +} +func (c *Charm) setDetails(details CharmChange) { // If this is the first receipt of details, set the removal message. if c.removalMessage == nil { c.removalMessage = RemoveCharm{ @@ -54,6 +52,11 @@ c.setStale(false) c.details = details +} - c.mu.Unlock() +// copy returns a copy of the unit, ensuring appropriate deep copying. +func (c *Charm) copy() Charm { + cc := *c + cc.details = cc.details.copy() + return cc } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/charm_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/charm_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/charm_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/charm_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -22,4 +22,8 @@ LXDProfile: lxdprofile.Profile{ Config: map[string]string{"key": "value"}, }, + DefaultConfig: map[string]interface{}{ + "key": "default-value", + "something": "else", + }, } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/controller.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/controller.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/controller.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/controller.go 2019-06-28 17:10:43.000000000 +0000 @@ -48,7 +48,6 @@ tomb tomb.Tomb mu sync.Mutex - hub *pubsub.SimpleHub metrics *ControllerGauges } @@ -71,10 +70,6 @@ changes: config.Changes, notify: config.Notify, models: make(map[string]*Model), - hub: pubsub.NewSimpleHub(&pubsub.SimpleHubConfig{ - // TODO: (thumper) add a get child method to loggers. - Logger: loggo.GetLogger("juju.core.cache.hub"), - }), metrics: createControllerGauges(), } @@ -112,6 +107,10 @@ c.updateUnit(ch) case RemoveUnit: err = c.removeUnit(ch) + case BranchChange: + c.updateBranch(ch) + case RemoveBranch: + err = c.removeBranch(ch) } if c.notify != nil { c.notify(change) @@ -214,8 +213,6 @@ } // removeApplication removes the application for the cached model. -// If the cache does not have the model loaded for the application yet, -// then it will not have the application cached. func (c *Controller) removeApplication(ch RemoveApplication) error { return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeApplication(ch) })) } @@ -234,8 +231,6 @@ } // removeUnit removes the unit from the cached model. -// If the cache does not have the model loaded for the unit yet, -// then it will not have the unit cached. func (c *Controller) removeUnit(ch RemoveUnit) error { return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeUnit(ch) })) } @@ -246,12 +241,24 @@ } // removeMachine removes the machine from the cached model. -// If the cache does not have the model loaded for the machine yet, -// then it will not have the machine cached. func (c *Controller) removeMachine(ch RemoveMachine) error { return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeMachine(ch) })) } +// updateBranch adds or updates the branch in the specified model. +func (c *Controller) updateBranch(ch BranchChange) { + c.ensureModel(ch.ModelUUID).updateBranch(ch, c.manager) +} + +// removeBranch removes the branch from the cached model. +func (c *Controller) removeBranch(ch RemoveBranch) error { + return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeBranch(ch) })) +} + +// removeResident uses the input removal function to remove a cache resident, +// including cleaning up resources it was responsible for creating. +// If the cache does not have the model loaded for the resident yet, +// then it will not have the entity cached, and a no-op results. func (c *Controller) removeResident(modelUUID string, removeFrom func(m *Model) error) error { c.mu.Lock() @@ -275,7 +282,7 @@ model, found := c.models[modelUUID] if !found { - model = newModel(c.metrics, c.hub, c.manager.new()) + model = newModel(c.metrics, newPubSubHub(), c.manager.new()) c.models[modelUUID] = model } else { model.setStale(false) @@ -284,3 +291,10 @@ c.mu.Unlock() return model } + +func newPubSubHub() *pubsub.SimpleHub { + return pubsub.NewSimpleHub(&pubsub.SimpleHubConfig{ + // TODO: (thumper) add a get child method to loggers. + Logger: loggo.GetLogger("juju.core.cache.hub"), + }) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/controller_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/controller_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/controller_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/controller_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -56,6 +56,7 @@ "charm-count": 0, "machine-count": 0, "unit-count": 0, + "branch-count": 0, }}) // The model has the first ID and is registered. @@ -190,7 +191,6 @@ unit, err := mod.Unit(unitChange.Name) c.Assert(err, jc.ErrorIsNil) - c.Check(unit, gc.NotNil) s.AssertResident(c, unit.CacheId(), true) } @@ -213,6 +213,38 @@ s.AssertResident(c, unit.CacheId(), false) } +func (s *ControllerSuite) TestAddBranch(c *gc.C) { + controller, events := s.new(c) + s.processChange(c, branchChange, events) + + mod, err := controller.Model(modelChange.ModelUUID) + c.Assert(err, jc.ErrorIsNil) + c.Check(mod.Report()["branch-count"], gc.Equals, 1) + + branch, err := mod.Branch(branchChange.Name) + c.Assert(err, jc.ErrorIsNil) + s.AssertResident(c, branch.CacheId(), true) +} + +func (s *ControllerSuite) TestRemoveBranch(c *gc.C) { + controller, events := s.new(c) + s.processChange(c, branchChange, events) + + mod, err := controller.Model(modelChange.ModelUUID) + c.Assert(err, jc.ErrorIsNil) + branch, err := mod.Branch(branchChange.Name) + c.Assert(err, jc.ErrorIsNil) + + remove := cache.RemoveBranch{ + ModelUUID: modelChange.ModelUUID, + Id: branchChange.Id, + } + s.processChange(c, remove, events) + + c.Check(mod.Report()["unit-count"], gc.Equals, 0) + s.AssertResident(c, branch.CacheId(), false) +} + func (s *ControllerSuite) TestMarkAndSweep(c *gc.C) { controller, events := s.new(c) @@ -281,6 +313,10 @@ send = true case cache.RemoveUnit: send = true + case cache.BranchChange: + send = true + case cache.RemoveBranch: + send = true default: // no-op } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/export_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,18 +15,22 @@ // Expose Remove* for testing -func (m *Model) RemoveCharm(ch RemoveCharm) error { - return m.removeCharm(ch) +func (m *Model) RemoveCharm(details RemoveCharm) error { + return m.removeCharm(details) } -func (m *Model) RemoveUnit(ch RemoveUnit) error { - return m.removeUnit(ch) +func (m *Model) RemoveUnit(details RemoveUnit) error { + return m.removeUnit(details) } func (m *Model) RemoveMachine(details RemoveMachine) error { return m.removeMachine(details) } +func (m *Model) RemoveBranch(details RemoveBranch) error { + return m.removeBranch(details) +} + // Expose Update* for testing. func (m *Model) UpdateMachine(details MachineChange, manager *residentManager) { @@ -44,3 +48,7 @@ func (m *Model) UpdateCharm(details CharmChange, manager *residentManager) { m.updateCharm(details, manager) } + +func (m *Model) UpdateBranch(details BranchChange, manager *residentManager) { + m.updateBranch(details, manager) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/hash.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/hash.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/hash.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/hash.go 2019-06-28 17:10:43.000000000 +0000 @@ -56,15 +56,13 @@ return value } + c.incMisses() value = c.generateHash(keys) c.hash[key] = value return value } func (c *hashCache) generateHash(keys []string) string { - // We are generating a hash, so call it a miss. - c.incMisses() - interested := c.config if len(keys) > 0 { interested = make(map[string]interface{}) @@ -96,15 +94,23 @@ // hash returns a hash of the yaml serialized settings. // If the settings are not able to be serialized an error is returned. -func hash(settings map[string]interface{}) (string, error) { - bytes, err := yaml.Marshal(settings) +func hash(settings map[string]interface{}, extra ...string) (string, error) { + encoded, err := yaml.Marshal(settings) if err != nil { return "", errors.Trace(err) } + hash := sha256.New() - _, err = hash.Write(bytes) + for _, s := range extra { + _, err = hash.Write([]byte(s)) + if err != nil { + return "", errors.Trace(err) + } + } + _, err = hash.Write(encoded) if err != nil { return "", errors.Trace(err) } + return hex.EncodeToString(hash.Sum(nil)), nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/lxdprofilewatcher.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/lxdprofilewatcher.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/lxdprofilewatcher.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/lxdprofilewatcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -28,9 +28,9 @@ // MachineAppModeler is a point of use model for MachineLXDProfileWatcher to // get Applications, Charms and Units. type MachineAppModeler interface { - Application(string) (*Application, error) - Charm(string) (*Charm, error) - Unit(string) (*Unit, error) + Application(string) (Application, error) + Charm(string) (Charm, error) + Unit(string) (Unit, error) } type appInfo struct { @@ -44,7 +44,7 @@ provisionedTopic string unitAddTopic string unitRemoveTopic string - machine *Machine + machine Machine modeler MachineAppModeler metrics *ControllerGauges hub *pubsub.SimpleHub @@ -88,7 +88,7 @@ } // init sets up the initial data used to determine when a notify occurs. -func (w *MachineLXDProfileWatcher) init(machine *Machine) error { +func (w *MachineLXDProfileWatcher) init(machine Machine) error { units, err := machine.Units() if err != nil { return errors.Annotatef(err, "failed to get units to start MachineLXDProfileWatcher") @@ -141,7 +141,7 @@ // applicationCharmURLChange sends a notification if what is saved for its // charm lxdprofile changes. No notification is sent if the profile pointer // begins and ends as nil. -func (w *MachineLXDProfileWatcher) applicationCharmURLChange(topic string, value interface{}) { +func (w *MachineLXDProfileWatcher) applicationCharmURLChange(_ string, value interface{}) { // We don't want to respond to any events until we have been fully initialized. select { case <-w.initialized: @@ -195,7 +195,7 @@ // addUnit modifies the map of applications being watched when a unit is // added to the machine. Notification is sent if a new unit whose charm has // an lxd profile is added. -func (w *MachineLXDProfileWatcher) addUnit(topic string, value interface{}) { +func (w *MachineLXDProfileWatcher) addUnit(_ string, value interface{}) { // We don't want to respond to any events until we have been fully initialized. select { case <-w.initialized: @@ -213,7 +213,7 @@ } }(¬ify) - unit, okUnit := value.(*Unit) + unit, okUnit := value.(Unit) if !okUnit { w.logError("programming error, value not of type *Unit") return @@ -246,7 +246,7 @@ logger.Debugf("end of unit change %#v", w.applications) } -func (w *MachineLXDProfileWatcher) add(unit *Unit) bool { +func (w *MachineLXDProfileWatcher) add(unit Unit) bool { unitName := unit.Name() appName := unit.Application() @@ -289,7 +289,7 @@ // removeUnit modifies the map of applications being watched when a unit is // removed from the machine. Notification is sent if a unit being removed // has a profile and other units exist on the machine. -func (w *MachineLXDProfileWatcher) removeUnit(topic string, value interface{}) { +func (w *MachineLXDProfileWatcher) removeUnit(_ string, value interface{}) { // We don't want to respond to any events until we have been fully initialized. select { case <-w.initialized: @@ -307,26 +307,26 @@ } }(¬ify) - rUnit, ok := value.(unitLXDProfileRemove) + rUnit, ok := value.(Unit) if !ok { w.logError("programming error, value not of type unitLXDProfileRemove") return } - app, ok := w.applications[rUnit.appName] + app, ok := w.applications[rUnit.Application()] if !ok { w.logError("programming error, unit removed before being added, application name not found") return } - if !app.units.Contains(rUnit.name) { + if !app.units.Contains(rUnit.Name()) { return } profile := app.charmProfile - app.units.Remove(rUnit.name) + app.units.Remove(rUnit.Name()) if app.units.Size() == 0 { // the application has no more units on this machine, // stop watching it. - delete(w.applications, rUnit.appName) + delete(w.applications, rUnit.Application()) } // If there are additional units on the machine and the current // application has an lxd profile, notify so it can be removed @@ -339,7 +339,7 @@ // provisionedChanged notifies when called. Topic subscribed to is specific to // this machine. -func (w *MachineLXDProfileWatcher) provisionedChange(topic string, _ interface{}) { +func (w *MachineLXDProfileWatcher) provisionedChange(_ string, _ interface{}) { // We don't want to respond to any events until we have been fully initialized. select { case <-w.initialized: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/lxdprofilewatcher_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/lxdprofilewatcher_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/lxdprofilewatcher_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/lxdprofilewatcher_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -17,17 +17,13 @@ cache.EntitySuite model *cache.Model - machine0 *cache.Machine - machine1 *cache.Machine - wc0 NotifyWatcherC + machine0 cache.Machine + machine1 cache.Machine + wc0 cache.NotifyWatcherC } var _ = gc.Suite(&lxdProfileWatcherSuite{}) -func (s *lxdProfileWatcherSuite) SetUpTest(c *gc.C) { - s.EntitySuite.SetUpTest(c) -} - func (s *lxdProfileWatcherSuite) TestMachineLXDProfileWatcher(c *gc.C) { w := s.assertStartOneMachineWatcher(c) @@ -115,14 +111,14 @@ w0, err := s.machine0.WatchLXDProfileVerificationNeeded() c.Assert(err, jc.ErrorIsNil) defer workertest.CleanKill(c, w0) - wc0 := NewNotifyWatcherC(c, w0) + wc0 := cache.NewNotifyWatcherC(c, w0) // Sends initial event. s.assertChangeValidateMetrics(c, wc0.AssertOneChange, 0, 0, 0) w1, err := s.machine1.WatchLXDProfileVerificationNeeded() c.Assert(err, jc.ErrorIsNil) defer workertest.CleanKill(c, w1) - wc1 := NewNotifyWatcherC(c, w1) + wc1 := cache.NewNotifyWatcherC(c, w1) // Sends initial event. s.assertChangeValidateMetrics(c, wc1.AssertOneChange, 0, 0, 0) @@ -142,14 +138,14 @@ defer workertest.CleanKill(c, s.assertStartOneMachineWatcher(c)) // Add a new subordinate unit with a profile of a new application. s.newUnitForMachineLXDProfileWatcherSubProfile(c, s.machine0.Id(), unitChange.Name) - s.assertChangeValidateMetrics(c, s.wc0.AssertOneChange, 0, 1, 0) + s.assertChangeValidateMetrics(c, s.wc0.AssertOneChange, 0, 1, 1) } func (s *lxdProfileWatcherSuite) TestMachineLXDProfileWatcherSubordinateNoProfile(c *gc.C) { defer workertest.CleanKill(c, s.assertStartOneMachineWatcher(c)) // Add a new subordinate unit with no profile of a new application. s.newUnitForMachineLXDProfileWatcherNoProfile(c, s.machine0.Id(), unitChange.Name) - s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 0, 0, 1) + s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 0, 0, 2) } func (s *lxdProfileWatcherSuite) TestMachineLXDProfileWatcherRemoveUnitWithProfileTwoUnits(c *gc.C) { @@ -157,7 +153,7 @@ // Add a new unit of a new application. s.newUnitForMachineLXDProfileWatcherNoProfile(c, s.machine0.Id(), "") - s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 0, 0, 1) + s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 0, 0, 2) // Remove the original unit which has a profile. c.Assert(s.model.RemoveUnit( @@ -165,7 +161,7 @@ ModelUUID: "model-uuid", Name: "application-name/0", }), jc.ErrorIsNil) - s.assertChangeValidateMetrics(c, s.wc0.AssertOneChange, 0, 1, 1) + s.assertChangeValidateMetrics(c, s.wc0.AssertOneChange, 0, 1, 2) } func (s *lxdProfileWatcherSuite) TestMachineLXDProfileWatcherRemoveOnlyUnit(c *gc.C) { @@ -222,7 +218,7 @@ Application: "new-application-name", MachineId: s.machine0.Id(), }, s.Manager) - s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 1, 0, 1) + s.assertChangeValidateMetrics(c, s.wc0.AssertNoChange, 1, 0, 2) } func (s *lxdProfileWatcherSuite) TestMachineLXDProfileWatcherUnitChangeUnitCharmURLIgnored(c *gc.C) { @@ -364,7 +360,7 @@ w, err := s.machine0.WatchLXDProfileVerificationNeeded() c.Assert(err, jc.ErrorIsNil) - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() s.wc0 = wc @@ -387,7 +383,7 @@ w, err := s.machine0.WatchLXDProfileVerificationNeeded() c.Assert(err, jc.ErrorIsNil) - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() s.wc0 = wc diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/machine.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/machine.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/machine.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/machine.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,7 +6,6 @@ import ( "fmt" "regexp" - "sync" "github.com/juju/errors" "gopkg.in/juju/names.v2" @@ -33,56 +32,60 @@ *Resident model *Model - mu sync.Mutex - modelUUID string details MachineChange configHash string } +// Note that these property accessors are not lock-protected. +// They are intended for calling from external packages that have retrieved a +// deep copy from the cache. + // Id returns the id string of this machine. func (m *Machine) Id() string { - m.mu.Lock() - defer m.mu.Unlock() return m.details.Id } // InstanceId returns the provider specific instance id for this machine and -// returns not provisioned if instance id is empty +// returns not provisioned if instance ID is empty. func (m *Machine) InstanceId() (instance.Id, error) { - m.mu.Lock() - defer m.mu.Unlock() - if m.details.InstanceId == "" { return "", errors.NotProvisionedf("machine %v", m.details.Id) } return instance.Id(m.details.InstanceId), nil } -// CharmProfiles returns the cached list of charm profiles for the machine +// CharmProfiles returns the cached list of charm profiles for the machine. func (m *Machine) CharmProfiles() []string { - m.mu.Lock() - defer m.mu.Unlock() return m.details.CharmProfiles } +// ContainerType returns the cached container type hosting this machine. +func (m *Machine) ContainerType() instance.ContainerType { + return instance.ContainerType(m.details.ContainerType) +} + +// Config returns configuration settings for the machine. +func (m *Machine) Config() map[string]interface{} { + return m.details.Config +} + // Units returns all the units that have been assigned to the machine // including subordinates. -func (m *Machine) Units() ([]*Unit, error) { - m.mu.Lock() - defer m.mu.Unlock() - - result := make([]*Unit, 0) - for unitName, unit := range m.model.units { - if unit.details.MachineId == m.details.Id { +func (m *Machine) Units() ([]Unit, error) { + units := m.model.Units() + + var result []Unit + for unitName, unit := range units { + if unit.MachineId() == m.details.Id { result = append(result, unit) } if unit.details.Subordinate { - principalUnit, found := m.model.units[unit.details.Principal] + principalUnit, found := units[unit.Principal()] if !found { - return result, errors.NotFoundf("principal unit %q for subordinate %s", unit.details.Principal, unitName) + return result, errors.NotFoundf("principal unit %q for subordinate %s", unit.Principal(), unitName) } - if principalUnit.details.MachineId == m.details.Id { + if principalUnit.MachineId() == m.details.Id { result = append(result, unit) } } @@ -110,7 +113,7 @@ w := newPredicateStringsWatcher(regexpPredicate(compiled), machines...) deregister := m.registerWorker(w) - unsub := m.model.hub.Subscribe(m.modelTopic(modelAddRemoveMachine), w.changed) + unsub := m.model.hub.Subscribe(modelAddRemoveMachine, w.changed) w.tomb.Go(func() error { <-w.tomb.Dying() @@ -125,20 +128,20 @@ // WatchLXDProfileVerificationNeeded notifies if any of the following happen // relative to this machine: -// 1. A new unit whose charm has an lxd profile is added. +// 1. A new unit whose charm has an LXD profile is added. // 2. A unit being removed has a profile and other units // exist on the machine. -// 3. The lxdprofile of an application with a unit on this +// 3. The LXD profile of an application with a unit on this // machine is added, removed, or exists. // 4. The machine's instanceId is changed, indicating it // has been provisioned. func (m *Machine) WatchLXDProfileVerificationNeeded() (*MachineLXDProfileWatcher, error) { return newMachineLXDProfileWatcher(MachineLXDProfileWatcherConfig{ - appTopic: m.model.topic(applicationCharmURLChange), + appTopic: applicationCharmURLChange, provisionedTopic: m.topic(machineProvisioned), - unitAddTopic: m.model.topic(modelUnitLXDProfileAdd), - unitRemoveTopic: m.model.topic(modelUnitLXDProfileRemove), - machine: m, + unitAddTopic: modelUnitAdd, + unitRemoveTopic: modelUnitRemove, + machine: m.copy(), modeler: m.model, metrics: m.model.metrics, hub: m.model.hub, @@ -151,14 +154,7 @@ return regexp.Compile(regExp) } -func (m *Machine) modelTopic(suffix string) string { - return modelTopic(m.details.ModelUUID, suffix) -} - func (m *Machine) setDetails(details MachineChange) { - m.mu.Lock() - defer m.mu.Unlock() - // If this is the first receipt of details, set the removal message. if m.removalMessage == nil { m.removalMessage = RemoveMachine{ @@ -169,12 +165,13 @@ m.setStale(false) - if details.InstanceId != m.details.InstanceId { + provisioned := details.InstanceId != m.details.InstanceId + m.details = details + + if provisioned { m.model.hub.Publish(m.topic(machineProvisioned), nil) } - m.details = details - configHash, err := hash(details.Config) if err != nil { logger.Errorf("invariant error - machine config should be yaml serializable and hashable, %v", err) @@ -186,6 +183,12 @@ } } +func (m *Machine) copy() Machine { + cm := *m + cm.details = cm.details.copy() + return cm +} + func (m *Machine) topic(suffix string) string { - return m.details.ModelUUID + ":" + m.details.Id + ":" + suffix + return m.details.Id + ":" + suffix } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/machine_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/machine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/machine_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/machine_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,9 @@ import ( "sort" "strings" + "time" + + "github.com/juju/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -21,8 +24,8 @@ cache.EntitySuite model *cache.Model - machine0 *cache.Machine - wc0 StringsWatcherC + machine0 cache.Machine + wc0 cache.StringsWatcherC } var _ = gc.Suite(&machineSuite{}) @@ -174,6 +177,23 @@ s.wc0.AssertOneChange([]string{rm.Id}) } +func (s *machineSuite) TestMachineArrivesProvisionedPublished(c *gc.C) { + msg := make(chan struct{}, 1) + unsub := s.Hub.Subscribe( + machineChange.Id+":machine-provisioned", + func(_ string, _ interface{}) { msg <- struct{}{} }, + ) + defer unsub() + + s.NewModel(modelChange).UpdateMachine(machineChange, s.Manager) + + select { + case <-msg: + case <-time.After(testing.LongWait): + c.Fatal("machine provisioned message not received") + } +} + func (s *machineSuite) setupMachine0(c *gc.C) { s.model.UpdateMachine(machineChange, s.Manager) machine, err := s.model.Machine(machineChange.Id) @@ -190,7 +210,7 @@ w, err := s.machine0.WatchContainers() c.Assert(err, jc.ErrorIsNil) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. if addContainer { wc.AssertOneChange([]string{"0/lxd/0"}) @@ -209,20 +229,21 @@ s.model.UpdateMachine(mc, s.Manager) } -func (s *machineSuite) setupMachineWithUnits(c *gc.C, machineId string, apps []string) (*cache.Machine, []*cache.Unit) { +func (s *machineSuite) setupMachineWithUnits(c *gc.C, machineId string, apps []string) (cache.Machine, []cache.Unit) { mc := machineChange mc.Id = machineId s.model.UpdateMachine(mc, s.Manager) machine, err := s.model.Machine(machineId) c.Assert(err, jc.ErrorIsNil) - units := make([]*cache.Unit, len(apps)) + units := make([]cache.Unit, len(apps)) for i, name := range apps { uc := unitChange uc.MachineId = machineId uc.Name = name + "/" + machineId uc.Application = name s.model.UpdateUnit(uc, s.Manager) + unit, err := s.model.Unit(uc.Name) c.Assert(err, jc.ErrorIsNil) units[i] = unit @@ -231,7 +252,7 @@ return machine, units } -type orderedUnits []*cache.Unit +type orderedUnits []cache.Unit func (o orderedUnits) Len() int { return len(o) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/metrics.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/metrics.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/metrics.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/metrics.go 2019-06-28 17:10:43.000000000 +0000 @@ -138,6 +138,21 @@ } } +// Describe is part of the prometheus.Collector interface. +func (c *ControllerGauges) Describe(ch chan<- *prometheus.Desc) { + c.ModelConfigReads.Describe(ch) + c.ModelHashCacheHit.Describe(ch) + c.ModelHashCacheMiss.Describe(ch) + + c.ApplicationConfigReads.Describe(ch) + c.ApplicationHashCacheHit.Describe(ch) + c.ApplicationHashCacheMiss.Describe(ch) + + c.LXDProfileChangeError.Describe(ch) + c.LXDProfileChangeHit.Describe(ch) + c.LXDProfileChangeMiss.Describe(ch) +} + // Collect is part of the prometheus.Collector interface. func (c *ControllerGauges) Collect(ch chan<- prometheus.Metric) { c.ModelConfigReads.Collect(ch) @@ -232,6 +247,8 @@ // Describe is part of the prometheus.Collector interface. func (c *Collector) Describe(ch chan<- *prometheus.Desc) { + c.controller.metrics.Describe(ch) + c.models.Describe(ch) c.machines.Describe(ch) c.applications.Describe(ch) @@ -279,6 +296,7 @@ } func (c *Collector) updateModelMetrics(modelUUID string) { + logger.Tracef("updating cache metrics for %s", modelUUID) model, err := c.controller.Model(modelUUID) if err != nil { logger.Debugf("error getting model: %v", err) @@ -303,7 +321,7 @@ c.units.With(prometheus.Labels{ agentStatusLabel: string(unit.details.AgentStatus.Status), lifeLabel: string(unit.details.Life), - instanceStatusLabel: string(unit.details.WorkloadStatus.Status), + workloadStatusLabel: string(unit.details.WorkloadStatus.Status), }).Inc() } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/metrics_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/metrics_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/metrics_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/metrics_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,59 @@ +// Copyright 2018 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package cache_test + +import ( + "bytes" + + "github.com/juju/loggo" + jc "github.com/juju/testing/checkers" + "github.com/prometheus/client_golang/prometheus/testutil" + gc "gopkg.in/check.v1" + "gopkg.in/juju/worker.v1/workertest" + + "github.com/juju/juju/core/cache" +) + +// The metrics hook into the ControllerSuite as it has +// the base methods we need to enable this cleanly. + +func (s *ControllerSuite) TestCollect(c *gc.C) { + loggo.GetLogger("juju.core.cache").SetLogLevel(loggo.TRACE) + controller, events := s.new(c) + + // Note that the model change is processed last. + s.processChange(c, charmChange, events) + s.processChange(c, appChange, events) + s.processChange(c, machineChange, events) + s.processChange(c, unitChange, events) + s.processChange(c, modelChange, events) + + collector := cache.NewMetricsCollector(controller) + + expected := bytes.NewBuffer([]byte(` +# HELP juju_cache_applications Number of applications managed by the controller. +# TYPE juju_cache_applications gauge +juju_cache_applications{life="alive"} 1 +# HELP juju_cache_machines Number of machines managed by the controller. +# TYPE juju_cache_machines gauge +juju_cache_machines{agent_status="active",instance_status="active",life="alive"} 1 +# HELP juju_cache_models Number of models in the controller. +# TYPE juju_cache_models gauge +juju_cache_models{life="alive",status="active"} 1 +# HELP juju_cache_units Number of units managed by the controller. +# TYPE juju_cache_units gauge +juju_cache_units{agent_status="active",life="alive",workload_status="active"} 1 + `[1:])) + + err := testutil.CollectAndCompare( + collector, expected, + "juju_cache_models", + "juju_cache_machines", + "juju_cache_applications", + "juju_cache_units") + if !c.Check(err, jc.ErrorIsNil) { + c.Logf("\nerror:\n%v", err) + } + + workertest.CleanKill(c, controller) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/model.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/model.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/model.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/model.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,29 +14,29 @@ ) const ( - // a machine has been added or removed from the model. - modelAddRemoveMachine = "model-add-remove-machine" - // model config has changed. + // Model config has changed. modelConfigChange = "model-config-change" - // a unit in the model has been added such than a lxd profile change - // maybe be necessary has been made. - modelUnitLXDProfileAdd = "model-unit-lxd-profile-add" - // a unit in the model has been removed such than a lxd profile change - // maybe be necessary has been made. - modelUnitLXDProfileRemove = "model-unit-remove" + // A machine has been added to, or removed from the model. + modelAddRemoveMachine = "model-add-remove-machine" + // A unit has landed on a machine, or a subordinate unit has been changed, + // Either of which likely indicate the addition of a unit to the model. + modelUnitAdd = "model-unit-add" + // A unit has been removed from the model. + modelUnitRemove = "model-unit-remove" + // A branch has been removed from the model. + modelBranchRemove = "model-branch-remove" ) func newModel(metrics *ControllerGauges, hub *pubsub.SimpleHub, res *Resident) *Model { m := &Model{ - Resident: res, - metrics: metrics, - // TODO: consider a separate hub per model for better scalability - // when many models. + Resident: res, + metrics: metrics, hub: hub, applications: make(map[string]*Application), charms: make(map[string]*Charm), machines: make(map[string]*Machine), units: make(map[string]*Unit), + branches: make(map[string]*Branch), } return m } @@ -59,6 +59,7 @@ charms map[string]*Charm machines map[string]*Machine units map[string]*Unit + branches map[string]*Branch } // Config returns the current model config. @@ -80,7 +81,7 @@ // WatchConfig creates a watcher for the model config. func (m *Model) WatchConfig(keys ...string) *ConfigWatcher { - return newConfigWatcher(keys, m.hashCache, m.hub, m.topic(modelConfigChange), m.Resident) + return newConfigWatcher(keys, m.hashCache, m.hub, modelConfigChange, m.Resident) } // Report returns information that is used in the dependency engine report. @@ -94,56 +95,112 @@ "charm-count": len(m.charms), "machine-count": len(m.machines), "unit-count": len(m.units), + "branch-count": len(m.branches), } } +// Branches returns all active branches in the model. +func (m *Model) Branches() map[string]Branch { + m.mu.Lock() + + branches := make(map[string]Branch, len(m.branches)) + for id, b := range m.branches { + branches[id] = b.copy() + } + + m.mu.Unlock() + return branches +} + +// Branch returns the branch with the input name. +// If the branch is not found, a NotFoundError is returned. +// All API-level logic identifies active branches by their name whereas they +// are managed in the cache by ID - we iterate over the map to locate them. +// We do not expect many active branches to exist at once, +// so the performance should be acceptable. +func (m *Model) Branch(name string) (Branch, error) { + defer m.doLocked()() + + for _, b := range m.branches { + if b.details.Name == name { + return b.copy(), nil + } + } + return Branch{}, errors.NotFoundf("branch %q", name) +} + // Application returns the application for the input name. // If the application is not found, a NotFoundError is returned. -func (m *Model) Application(appName string) (*Application, error) { +func (m *Model) Application(appName string) (Application, error) { defer m.doLocked()() app, found := m.applications[appName] if !found { - return nil, errors.NotFoundf("application %q", appName) + return Application{}, errors.NotFoundf("application %q", appName) } - return app, nil + return app.copy(), nil } -// Charm returns the charm for the input charmURL. -// If the charm is not found, a NotFoundError is returned. -func (m *Model) Charm(charmURL string) (*Charm, error) { +// Units returns all units in the model. +func (m *Model) Units() map[string]Unit { + m.mu.Lock() + + units := make(map[string]Unit, len(m.units)) + for name, u := range m.units { + units[name] = u.copy() + } + + m.mu.Unlock() + return units +} + +// Unit returns the unit with the input name. +// If the unit is not found, a NotFoundError is returned. +func (m *Model) Unit(unitName string) (Unit, error) { defer m.doLocked()() - charm, found := m.charms[charmURL] + unit, found := m.units[unitName] if !found { - return nil, errors.NotFoundf("charm %q", charmURL) + return Unit{}, errors.NotFoundf("unit %q", unitName) } - return charm, nil + return unit.copy(), nil } // Machines makes a copy of the model's machine collection and returns it. -func (m *Model) Machines() map[string]*Machine { - machines := make(map[string]*Machine) - +func (m *Model) Machines() map[string]Machine { m.mu.Lock() + + machines := make(map[string]Machine, len(m.machines)) for k, v := range m.machines { - machines[k] = v + machines[k] = v.copy() } - m.mu.Unlock() + m.mu.Unlock() return machines } // Machine returns the machine with the input id. // If the machine is not found, a NotFoundError is returned. -func (m *Model) Machine(machineId string) (*Machine, error) { +func (m *Model) Machine(machineId string) (Machine, error) { defer m.doLocked()() machine, found := m.machines[machineId] if !found { - return nil, errors.NotFoundf("machine %q", machineId) + return Machine{}, errors.NotFoundf("machine %q", machineId) } - return machine, nil + return machine.copy(), nil +} + +// Charm returns the charm for the input charmURL. +// If the charm is not found, a NotFoundError is returned. +func (m *Model) Charm(charmURL string) (Charm, error) { + defer m.doLocked()() + + charm, found := m.charms[charmURL] + if !found { + return Charm{}, errors.NotFoundf("charm %q", charmURL) + } + return charm.copy(), nil } // WatchMachines returns a PredicateStringsWatcher to notify about @@ -169,7 +226,7 @@ w := newPredicateStringsWatcher(fn, machines...) deregister := m.registerWorker(w) - unsub := m.hub.Subscribe(m.topic(modelAddRemoveMachine), w.changed) + unsub := m.hub.Subscribe(modelAddRemoveMachine, w.changed) w.tomb.Go(func() error { <-w.tomb.Dying() @@ -181,18 +238,6 @@ return w, nil } -// Unit returns the unit with the input name. -// If the unit is not found, a NotFoundError is returned. -func (m *Model) Unit(unitName string) (*Unit, error) { - defer m.doLocked()() - - unit, found := m.units[unitName] - if !found { - return nil, errors.NotFoundf("unit %q", unitName) - } - return unit, nil -} - // updateApplication adds or updates the application in the model. func (m *Model) updateApplication(ch ApplicationChange, rm *residentManager) { m.mu.Lock() @@ -255,7 +300,7 @@ unit, found := m.units[ch.Name] if !found { - unit = newUnit(m.metrics, m.hub, rm.new()) + unit = newUnit(m, rm.new()) m.units[ch.Name] = unit } unit.setDetails(ch) @@ -263,20 +308,13 @@ m.mu.Unlock() } -// unitLXDProfileRemove contains an appName and it's charm URL. To be used -// when publishing for modelUnitLXDProfileRemove. -type unitLXDProfileRemove struct { - name string - appName string -} - // removeUnit removes the unit from the model. func (m *Model) removeUnit(ch RemoveUnit) error { defer m.doLocked()() unit, ok := m.units[ch.Name] if ok { - m.hub.Publish(m.topic(modelUnitLXDProfileRemove), unitLXDProfileRemove{name: ch.Name, appName: unit.details.Application}) + m.hub.Publish(modelUnitRemove, unit.copy()) if err := unit.evict(); err != nil { return errors.Trace(err) } @@ -293,7 +331,7 @@ if !found { machine = newMachine(m, rm.new()) m.machines[ch.Id] = machine - m.hub.Publish(m.topic(modelAddRemoveMachine), []string{ch.Id}) + m.hub.Publish(modelAddRemoveMachine, []string{ch.Id}) } machine.setDetails(ch) @@ -306,7 +344,7 @@ machine, ok := m.machines[ch.Id] if ok { - m.hub.Publish(m.topic(modelAddRemoveMachine), []string{ch.Id}) + m.hub.Publish(modelAddRemoveMachine, []string{ch.Id}) if err := machine.evict(); err != nil { return errors.Trace(err) } @@ -315,13 +353,36 @@ return nil } -// topic prefixes the input string with the model UUID. -func (m *Model) topic(suffix string) string { - return modelTopic(m.details.ModelUUID, suffix) +// updateBranch adds or updates the branch in the model. +// Only "in-flight" branches should ever reside in the change. +// A committed or aborted branch (with a non-zero time-stamp for completion) +// should be passed through by the cache worker as a deletion. +func (m *Model) updateBranch(ch BranchChange, rm *residentManager) { + m.mu.Lock() + + branch, found := m.branches[ch.Id] + if !found { + branch = newBranch(m.metrics, m.hub, rm.new()) + m.branches[ch.Id] = branch + } + branch.setDetails(ch) + + m.mu.Unlock() } -func modelTopic(modelUUID, suffix string) string { - return modelUUID + ":" + suffix +// removeBranch removes the branch from the model. +func (m *Model) removeBranch(ch RemoveBranch) error { + defer m.doLocked()() + + branch, ok := m.branches[ch.Id] + if ok { + m.hub.Publish(modelBranchRemove, branch.Name()) + if err := branch.evict(); err != nil { + return errors.Trace(err) + } + delete(m.branches, ch.Id) + } + return nil } func (m *Model) setDetails(details ModelChange) { @@ -341,7 +402,8 @@ if configHash != m.configHash { m.configHash = configHash m.hashCache = hashCache - m.hub.Publish(m.topic(modelConfigChange), hashCache) + m.hashCache.incMisses() + m.hub.Publish(modelConfigChange, hashCache) } m.mu.Unlock() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/model_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/model_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/model_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/model_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,8 @@ package cache_test import ( + "time" + "github.com/juju/errors" jc "github.com/juju/testing/checkers" "github.com/prometheus/client_golang/prometheus/testutil" @@ -12,7 +14,9 @@ "github.com/juju/juju/core/cache" "github.com/juju/juju/core/life" + "github.com/juju/juju/core/network" "github.com/juju/juju/core/status" + "github.com/juju/juju/testing" ) type ModelSuite struct { @@ -30,6 +34,7 @@ "charm-count": 0, "machine-count": 0, "unit-count": 0, + "branch-count": 0, }) } @@ -61,7 +66,7 @@ func (s *ModelSuite) TestConfigWatcherStops(c *gc.C) { m := s.NewModel(modelChange) w := m.WatchConfig() - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() wc.AssertStops() @@ -71,7 +76,7 @@ m := s.NewModel(modelChange) w := m.WatchConfig() defer workertest.CleanKill(c, w) - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() @@ -83,18 +88,23 @@ m.SetDetails(change) wc.AssertOneChange() - // The hash is generated each time we set the details. + // The hash is generated each time we set different details. c.Check(testutil.ToFloat64(s.Gauges.ModelHashCacheMiss), gc.Equals, float64(2)) // The value is retrieved from the cache when the watcher is created and notified. c.Check(testutil.ToFloat64(s.Gauges.ModelHashCacheHit), gc.Equals, float64(2)) + + // Setting the same values causes no notification and no cache miss. + m.SetDetails(change) + wc.AssertNoChange() + c.Check(testutil.ToFloat64(s.Gauges.ModelHashCacheMiss), gc.Equals, float64(2)) } func (s *ModelSuite) TestConfigWatcherOneValue(c *gc.C) { m := s.NewModel(modelChange) w := m.WatchConfig("key") defer workertest.CleanKill(c, w) - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() @@ -120,7 +130,7 @@ s.AssertWorkerResource(c, m.Resident, resourceId, false) }() - wc := NewNotifyWatcherC(c, w) + wc := cache.NewNotifyWatcherC(c, w) // Sends initial event. wc.AssertOneChange() @@ -156,24 +166,142 @@ c.Assert(errors.IsNotFound(err), jc.IsTrue) } +func (s *ModelSuite) TestApplicationReturnsCopy(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateApplication(appChange, s.Manager) + + a1, err := m.Application(appChange.Name) + c.Assert(err, jc.ErrorIsNil) + + // Make a change to the map returned in the copy. + ac := a1.Config() + ac["mister"] = "squiggle" + + // Get another copy from the model and ensure it is unchanged. + a2, err := m.Application(appChange.Name) + c.Assert(err, jc.ErrorIsNil) + c.Assert(a2.Config(), gc.DeepEquals, appChange.Config) +} + func (s *ModelSuite) TestCharmNotFoundError(c *gc.C) { m := s.NewModel(modelChange) _, err := m.Charm("nope") c.Assert(errors.IsNotFound(err), jc.IsTrue) } +func (s *ModelSuite) TestCharmReturnsCopy(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateCharm(charmChange, s.Manager) + + ch1, err := m.Charm(charmChange.CharmURL) + c.Assert(err, jc.ErrorIsNil) + + // Make a change to the map returned in the copy. + cc := ch1.DefaultConfig() + cc["mister"] = "squiggle" + + // Get another copy from the model and ensure it is unchanged. + ch2, err := m.Charm(charmChange.CharmURL) + c.Assert(err, jc.ErrorIsNil) + c.Assert(ch2.DefaultConfig(), gc.DeepEquals, charmChange.DefaultConfig) +} + func (s *ModelSuite) TestMachineNotFoundError(c *gc.C) { m := s.NewModel(modelChange) _, err := m.Machine("nope") c.Assert(errors.IsNotFound(err), jc.IsTrue) } +func (s *ModelSuite) TestMachineReturnsCopy(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateMachine(machineChange, s.Manager) + + m1, err := m.Machine(machineChange.Id) + c.Assert(err, jc.ErrorIsNil) + + // Make a change to the map returned in the copy. + mc := m1.Config() + mc["mister"] = "squiggle" + + // Get another copy from the model and ensure it is unchanged. + m2, err := m.Machine(machineChange.Id) + c.Assert(err, jc.ErrorIsNil) + c.Assert(m2.Config(), gc.DeepEquals, machineChange.Config) +} + func (s *ModelSuite) TestUnitNotFoundError(c *gc.C) { m := s.NewModel(modelChange) _, err := m.Unit("nope") c.Assert(errors.IsNotFound(err), jc.IsTrue) } +func (s *ModelSuite) TestUnitReturnsCopy(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateUnit(unitChange, s.Manager) + + u1, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + + // Make a change to the slice returned in the copy. + ports := u1.Ports() + ports = append(ports, network.Port{Protocol: "tcp", Number: 54321}) + + // Get another copy from the model and ensure it is unchanged. + u2, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + c.Assert(u2.Ports(), gc.DeepEquals, unitChange.Ports) +} + +func (s *ModelSuite) TestBranchNotFoundError(c *gc.C) { + m := s.NewModel(modelChange) + _, err := m.Branch("nope") + c.Assert(errors.IsNotFound(err), jc.IsTrue) +} + +func (s *ModelSuite) TestBranchReturnsCopy(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateBranch(branchChange, s.Manager) + + b1, err := m.Branch(branchChange.Name) + c.Assert(err, jc.ErrorIsNil) + + // Make a change to the map returned in the copy. + au := b1.AssignedUnits() + au["banana"] = []string{"banana/1", "banana/2"} + + // Get another copy from the model and ensure it is unchanged. + b2, err := m.Branch(branchChange.Name) + c.Assert(err, jc.ErrorIsNil) + c.Assert(b2.AssignedUnits(), gc.DeepEquals, branchChange.AssignedUnits) +} + +func (s *ModelSuite) TestRemoveBranchPublishesName(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateBranch(branchChange, s.Manager) + + rcv := make(chan interface{}, 1) + unsub := s.Hub.Subscribe("model-branch-remove", func(_ string, msg interface{}) { rcv <- msg }) + defer unsub() + + err := m.RemoveBranch(cache.RemoveBranch{ + ModelUUID: branchChange.ModelUUID, + Id: branchChange.Id, + }) + c.Assert(err, jc.ErrorIsNil) + + select { + case msg := <-rcv: + name, ok := msg.(string) + if !ok { + c.Fatal("wrong type published; expected string.") + } + c.Check(name, gc.Equals, branchChange.Name) + + case <-time.After(testing.LongWait): + c.Fatal("branch removal message not Received") + } +} + func (s *ControllerSuite) TestWatchMachineStops(c *gc.C) { controller, _ := s.newWithMachine(c) m, err := controller.Model(modelChange.ModelUUID) @@ -181,7 +309,7 @@ w, err := m.WatchMachines() c.Assert(err, jc.ErrorIsNil) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) @@ -195,7 +323,7 @@ func (s *ControllerSuite) TestWatchMachineAddMachine(c *gc.C) { w, events := s.setupWithWatchMachine(c) defer workertest.CleanKill(c, w) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) @@ -210,7 +338,7 @@ func (s *ControllerSuite) TestWatchMachineAddContainerNoChange(c *gc.C) { w, events := s.setupWithWatchMachine(c) defer workertest.CleanKill(c, w) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) @@ -228,7 +356,7 @@ func (s *ControllerSuite) TestWatchMachineRemoveMachine(c *gc.C) { w, events := s.setupWithWatchMachine(c) defer workertest.CleanKill(c, w) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) @@ -243,7 +371,7 @@ func (s *ControllerSuite) TestWatchMachineChangeMachine(c *gc.C) { w, events := s.setupWithWatchMachine(c) defer workertest.CleanKill(c, w) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) @@ -258,7 +386,7 @@ func (s *ControllerSuite) TestWatchMachineGatherMachines(c *gc.C) { w, events := s.setupWithWatchMachine(c) defer workertest.CleanKill(c, w) - wc := NewStringsWatcherC(c, w) + wc := cache.NewStringsWatcherC(c, w) // Sends initial event. wc.AssertOneChange([]string{machineChange.Id}) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/notifywatcher_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/notifywatcher_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/notifywatcher_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/notifywatcher_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Copyright 2018 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package cache_test - -import ( - "time" - - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/juju/core/cache" - "github.com/juju/juju/testing" -) - -func NewNotifyWatcherC(c *gc.C, watcher cache.NotifyWatcher) NotifyWatcherC { - return NotifyWatcherC{ - C: c, - Watcher: watcher, - } -} - -type NotifyWatcherC struct { - *gc.C - Watcher cache.NotifyWatcher -} - -// AssertOneChange fails if no change is sent before a long time has passed; or -// if, subsequent to that, any further change is sent before a short time has -// passed. -func (c NotifyWatcherC) AssertOneChange() { - select { - case _, ok := <-c.Watcher.Changes(): - c.Assert(ok, jc.IsTrue) - case <-time.After(testing.LongWait): - c.Fatalf("watcher did not send change") - } - c.AssertNoChange() -} - -// AssertNoChange fails if it manages to read a value from Changes before a -// short time has passed. -func (c NotifyWatcherC) AssertNoChange() { - select { - case _, ok := <-c.Watcher.Changes(): - if ok { - c.Fatalf("watcher sent unexpected change") - } - c.Fatalf("watcher changes channel closed") - case <-time.After(testing.ShortWait): - } -} - -// AssertStops Kills the watcher and asserts (1) that Wait completes without -// error before a long time has passed; and (2) that Changes channel is closed. -func (c NotifyWatcherC) AssertStops() { - c.Watcher.Kill() - wait := make(chan error) - go func() { - wait <- c.Watcher.Wait() - }() - select { - case <-time.After(testing.LongWait): - c.Fatalf("watcher never stopped") - case err := <-wait: - c.Assert(err, jc.ErrorIsNil) - } - - select { - case _, ok := <-c.Watcher.Changes(): - if ok { - c.Fatalf("watcher sent unexpected change") - } - default: - c.Fatalf("channel not closed") - } -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/package_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/package_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/package_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/package_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,7 +5,9 @@ import ( "testing" + "time" + "github.com/juju/collections/set" "github.com/juju/loggo" "github.com/juju/pubsub" jujutesting "github.com/juju/testing" @@ -53,6 +55,17 @@ c.Assert(s.Manager.residents, gc.HasLen, 0) } +func (s *BaseSuite) AssertWorkerResource(c *gc.C, resident *Resident, id uint64, expectPresent bool) { + _, present := resident.workers[id] + c.Assert(present, gc.Equals, expectPresent) +} + +func (s *BaseSuite) NewHub() *pubsub.SimpleHub { + logger := loggo.GetLogger("test") + logger.SetLogLevel(loggo.TRACE) + return pubsub.NewSimpleHub(&pubsub.SimpleHubConfig{Logger: logger}) +} + // entitySuite is the base suite for testing cached entities // (models, applications, machines). type EntitySuite struct { @@ -65,13 +78,8 @@ func (s *EntitySuite) SetUpTest(c *gc.C) { s.BaseSuite.SetUpTest(c) - logger := loggo.GetLogger("test") - logger.SetLogLevel(loggo.TRACE) - s.Hub = pubsub.NewSimpleHub(&pubsub.SimpleHubConfig{ - Logger: logger, - }) - s.Gauges = createControllerGauges() + s.Hub = s.NewHub() } func (s *EntitySuite) NewModel(details ModelChange) *Model { @@ -82,13 +90,14 @@ func (s *EntitySuite) NewApplication(details ApplicationChange) *Application { a := newApplication(s.Gauges, s.Hub, s.NewResident()) - a.SetDetails(details) + a.setDetails(details) return a } -func (s *BaseSuite) AssertWorkerResource(c *gc.C, resident *Resident, id uint64, expectPresent bool) { - _, present := resident.workers[id] - c.Assert(present, gc.Equals, expectPresent) +func (s *EntitySuite) NewBranch(details BranchChange) *Branch { + b := newBranch(s.Gauges, s.Hub, s.NewResident()) + b.setDetails(details) + return b } type ImportSuite struct{} @@ -105,6 +114,173 @@ "core/life", "core/lxdprofile", "core/network", + "core/settings", "core/status", }) } + +// NotifyWatcherC wraps a notify watcher, adding testing convenience methods. +type NotifyWatcherC struct { + *gc.C + Watcher NotifyWatcher +} + +func NewNotifyWatcherC(c *gc.C, watcher NotifyWatcher) NotifyWatcherC { + return NotifyWatcherC{ + C: c, + Watcher: watcher, + } +} + +// AssertOneChange fails if no change is sent before a long time has passed; or +// if, subsequent to that, any further change is sent before a short time has +// passed. +func (c NotifyWatcherC) AssertOneChange() { + select { + case _, ok := <-c.Watcher.Changes(): + c.Assert(ok, jc.IsTrue) + case <-time.After(coretesting.LongWait): + c.Fatalf("watcher did not send change") + } + c.AssertNoChange() +} + +// AssertNoChange fails if it manages to read a value from Changes before a +// short time has passed. +func (c NotifyWatcherC) AssertNoChange() { + select { + case _, ok := <-c.Watcher.Changes(): + if ok { + c.Fatalf("watcher sent unexpected change") + } + c.Fatalf("watcher changes channel closed") + case <-time.After(coretesting.ShortWait): + } +} + +// AssertStops Kills the watcher and asserts (1) that Wait completes without +// error before a long time has passed; and (2) that Changes channel is closed. +func (c NotifyWatcherC) AssertStops() { + c.Watcher.Kill() + wait := make(chan error) + go func() { + wait <- c.Watcher.Wait() + }() + select { + case <-time.After(coretesting.LongWait): + c.Fatalf("watcher never stopped") + case err := <-wait: + c.Assert(err, jc.ErrorIsNil) + } + + select { + case _, ok := <-c.Watcher.Changes(): + if ok { + c.Fatalf("watcher sent unexpected change") + } + default: + c.Fatalf("channel not closed") + } +} + +func NewStringsWatcherC(c *gc.C, watcher StringsWatcher) StringsWatcherC { + return StringsWatcherC{ + C: c, + Watcher: watcher, + } +} + +type StringsWatcherC struct { + *gc.C + Watcher StringsWatcher +} + +// AssertOneChange fails if no change is sent before a long time has passed; or +// if, subsequent to that, any further change is sent before a short time has +// passed. +func (c StringsWatcherC) AssertOneChange(expected []string) { + select { + case obtained, ok := <-c.Watcher.Changes(): + c.Assert(ok, jc.IsTrue) + c.Assert(obtained, jc.SameContents, expected) + case <-time.After(coretesting.LongWait): + c.Fatalf("watcher did not send change") + } + c.AssertNoChange() +} + +// AssertMaybeCombinedChanges fails if no change is sent before a long time +// has passed; if an empty change is found; if the change isn't part of the +// changes expected. +func (c StringsWatcherC) AssertMaybeCombinedChanges(expected []string) { + var found bool + expectedSet := set.NewStrings(expected...) + timeout := time.After(coretesting.LongWait) + + for { + select { + case obtained, ok := <-c.Watcher.Changes(): + c.Assert(ok, jc.IsTrue) + c.Logf("expected %v; obtained %v", expectedSet.Values(), obtained) + + // Maybe the expected changes came through as 1 change. + if expectedSet.Size() == len(obtained) { + c.Assert(obtained, jc.SameContents, expectedSet.Values()) + c.Logf("") + found = true + break + } + + // Remove the obtained results from expected, if nothing is removed + // from expected, fail here, received bad data. + leftOver := expectedSet.Difference(set.NewStrings(obtained...)) + if expectedSet.Size() == leftOver.Size() { + c.Fatalf("obtained %v, not contained in expected %v", obtained, expectedSet.Values()) + } + expectedSet = leftOver + case <-timeout: + c.Fatalf("watcher did not send change") + } + if found { + break + } + } +} + +// AssertNoChange fails if it manages to read a value from Changes before a +// short time has passed. +func (c StringsWatcherC) AssertNoChange() { + select { + case _, ok := <-c.Watcher.Changes(): + if ok { + c.Fatalf("watcher sent unexpected change") + } + c.Fatalf("watcher changes channel closed") + case <-time.After(coretesting.ShortWait): + } +} + +// AssertStops Kills the watcher and asserts (1) that Wait completes without +// error before a long time has passed; and (2) that Changes channel is closed. +func (c StringsWatcherC) AssertStops() { + c.Watcher.Kill() + wait := make(chan error) + go func() { + wait <- c.Watcher.Wait() + }() + select { + case <-time.After(coretesting.LongWait): + c.Fatalf("watcher never stopped") + case err := <-wait: + c.Assert(err, jc.ErrorIsNil) + } + + select { + case _, ok := <-c.Watcher.Changes(): + if ok { + c.Fatalf("watcher sent unexpected change") + } + default: + c.Fatalf("channel not closed") + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/stringswatcher_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/stringswatcher_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/stringswatcher_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/stringswatcher_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -// Copyright 2018 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package cache_test - -import ( - "time" - - "github.com/juju/collections/set" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/juju/core/cache" - "github.com/juju/juju/testing" -) - -func NewStringsWatcherC(c *gc.C, watcher cache.StringsWatcher) StringsWatcherC { - return StringsWatcherC{ - C: c, - Watcher: watcher, - } -} - -type StringsWatcherC struct { - *gc.C - Watcher cache.StringsWatcher -} - -// AssertOneChange fails if no change is sent before a long time has passed; or -// if, subsequent to that, any further change is sent before a short time has -// passed. -func (c StringsWatcherC) AssertOneChange(expected []string) { - select { - case obtained, ok := <-c.Watcher.Changes(): - c.Assert(ok, jc.IsTrue) - c.Assert(obtained, jc.SameContents, expected) - case <-time.After(testing.LongWait): - c.Fatalf("watcher did not send change") - } - c.AssertNoChange() -} - -// AssertMaybeCombinedChanges fails if no change is sent before a long time -// has passed; if an empty change is found; if the change isn't part of the -// changes expected. -func (c StringsWatcherC) AssertMaybeCombinedChanges(expected []string) { - var found bool - expectedSet := set.NewStrings(expected...) - for { - select { - case obtained, ok := <-c.Watcher.Changes(): - c.Assert(ok, jc.IsTrue) - c.Logf("expected %v; obtained %v", expectedSet.Values(), obtained) - // Maybe the expected changes came thru as 1 change. - if expectedSet.Size() == len(obtained) { - c.Assert(obtained, jc.SameContents, expectedSet.Values()) - c.Logf("") - found = true - break - } - // Remove the obtained results from expected, if nothing is removed - // from expected, fail here, received bad data. - leftOver := expectedSet.Difference(set.NewStrings(obtained...)) - if expectedSet.Size() == leftOver.Size() { - c.Fatalf("obtained %v, not contained in expected %v", obtained, expectedSet.Values()) - } - expectedSet = leftOver - case <-time.After(testing.LongWait): - c.Fatalf("watcher did not send change") - } - if found { - break - } - } -} - -// AssertNoChange fails if it manages to read a value from Changes before a -// short time has passed. -func (c StringsWatcherC) AssertNoChange() { - select { - case _, ok := <-c.Watcher.Changes(): - if ok { - c.Fatalf("watcher sent unexpected change") - } - c.Fatalf("watcher changes channel closed") - case <-time.After(testing.ShortWait): - } -} - -// AssertStops Kills the watcher and asserts (1) that Wait completes without -// error before a long time has passed; and (2) that Changes channel is closed. -func (c StringsWatcherC) AssertStops() { - c.Watcher.Kill() - wait := make(chan error) - go func() { - wait <- c.Watcher.Wait() - }() - select { - case <-time.After(testing.LongWait): - c.Fatalf("watcher never stopped") - case err := <-wait: - c.Assert(err, jc.ErrorIsNil) - } - - select { - case _, ok := <-c.Watcher.Changes(): - if ok { - c.Fatalf("watcher sent unexpected change") - } - default: - c.Fatalf("channel not closed") - } -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/unit.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/unit.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/unit.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/unit.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,9 +4,14 @@ package cache import ( - "sync" + "fmt" - "github.com/juju/pubsub" + "github.com/juju/collections/set" + "github.com/juju/errors" + "gopkg.in/juju/charm.v6" + + "github.com/juju/juju/core/network" + "github.com/juju/juju/core/settings" ) // Unit represents a unit in a cached model. @@ -15,68 +20,133 @@ // and tracks resources that it is responsible for cleaning up. *Resident - metrics *ControllerGauges - hub *pubsub.SimpleHub - mu sync.Mutex - - details UnitChange - configHash string + model *Model + details UnitChange } -func newUnit(metrics *ControllerGauges, hub *pubsub.SimpleHub, res *Resident) *Unit { - u := &Unit{ +func newUnit(model *Model, res *Resident) *Unit { + return &Unit{ Resident: res, - metrics: metrics, - hub: hub, + model: model, } - return u } +// Note that these property accessors are not lock-protected. +// They are intended for calling from external packages that have retrieved a +// deep copy from the cache. + // Name returns the name of this unit. func (u *Unit) Name() string { - u.mu.Lock() - defer u.mu.Unlock() return u.details.Name } // Application returns the application name of this unit. func (u *Unit) Application() string { - u.mu.Lock() - defer u.mu.Unlock() return u.details.Application } // MachineId returns the ID of the machine hosting this unit. func (u *Unit) MachineId() string { - u.mu.Lock() - defer u.mu.Unlock() return u.details.MachineId } // Subordinate returns a bool indicating whether this unit is a subordinate. func (u *Unit) Subordinate() bool { - u.mu.Lock() - defer u.mu.Unlock() return u.details.Subordinate } // Principal returns the name of the principal unit for the same application. func (u *Unit) Principal() string { - u.mu.Lock() - defer u.mu.Unlock() return u.details.Principal } // CharmURL returns the charm URL for this unit's application. func (u *Unit) CharmURL() string { - u.mu.Lock() - defer u.mu.Unlock() return u.details.CharmURL } -func (u *Unit) setDetails(details UnitChange) { - u.mu.Lock() +// Ports returns the exposed ports for the unit. +func (u *Unit) Ports() []network.Port { + return u.details.Ports +} + +// Config settings returns the effective charm configuration for this unit +// taking into account whether it is tracking a model branch. +func (u *Unit) ConfigSettings() (charm.Settings, error) { + if u.details.CharmURL == "" { + return nil, errors.New("unit charm not set") + } + + appName := u.details.Application + app, err := u.model.Application(appName) + if err != nil { + return nil, errors.Trace(err) + } + cfg := app.Config() + if cfg == nil { + cfg = make(map[string]interface{}) + } + + // Apply any branch-based deltas to the master settings. + var deltas settings.ItemChanges + for _, b := range u.model.Branches() { + if units := b.AssignedUnits()[appName]; len(units) > 0 { + if set.NewStrings(units...).Contains(u.details.Name) { + deltas = b.AppConfig(appName) + break + } + } + } + + for _, delta := range deltas { + switch { + case delta.IsAddition(), delta.IsModification(): + cfg[delta.Key] = delta.NewValue + case delta.IsDeletion(): + delete(cfg, delta.Key) + } + } + // Fill in any empty values with charm defaults. + ch, err := u.model.Charm(u.details.CharmURL) + if err != nil { + return nil, errors.Trace(err) + } + charmDefaults := ch.DefaultConfig() + + for k, v := range charmDefaults { + if _, ok := cfg[k]; !ok { + cfg[k] = v + } + } + + return cfg, nil +} + +// WatchConfigSettings returns a new watcher that will notify when the +// effective application charm config for this unit changes. +func (u *Unit) WatchConfigSettings() (*CharmConfigWatcher, error) { + if u.details.CharmURL == "" { + return nil, errors.New("unit charm not set") + } + + cfg := charmConfigWatcherConfig{ + model: u.model, + unitName: u.details.Name, + appName: u.details.Application, + charmURL: u.details.CharmURL, + appConfigChangeTopic: fmt.Sprintf("%s:%s", u.details.Application, applicationConfigChange), + branchChangeTopic: branchChange, + branchRemoveTopic: modelBranchRemove, + hub: u.model.hub, + res: u.Resident, + } + + w, err := newCharmConfigWatcher(cfg) + return w, errors.Trace(err) +} + +func (u *Unit) setDetails(details UnitChange) { // If this is the first receipt of details, set the removal message. if u.removalMessage == nil { u.removalMessage = RemoveUnit{ @@ -90,13 +160,13 @@ machineChange := u.details.MachineId != details.MachineId u.details = details if machineChange || u.details.Subordinate { - u.hub.Publish(u.modelTopic(modelUnitLXDProfileAdd), u) + u.model.hub.Publish(modelUnitAdd, u.copy()) } - - // TODO (manadart 2019-02-11): Maintain hash and publish changes. - u.mu.Unlock() } -func (u *Unit) modelTopic(suffix string) string { - return modelTopic(u.details.ModelUUID, suffix) +// copy returns a copy of the unit, ensuring appropriate deep copying. +func (u *Unit) copy() Unit { + cu := *u + cu.details = cu.details.copy() + return cu } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/unit_test.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/unit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/unit_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/unit_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1,12 +1,17 @@ // Copyright 2019 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. + package cache_test import ( + jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6" + "gopkg.in/juju/worker.v1/workertest" "github.com/juju/juju/core/cache" "github.com/juju/juju/core/life" + "github.com/juju/juju/core/settings" "github.com/juju/juju/core/status" ) @@ -16,6 +21,94 @@ var _ = gc.Suite(&UnitSuite{}) +func (s *UnitSuite) TestWatchCharmConfigNewWatcher(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateApplication(appChange, s.Manager) + m.UpdateUnit(unitChange, s.Manager) + + u, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + + w, err := u.WatchConfigSettings() + c.Assert(err, jc.ErrorIsNil) + + workertest.CleanKill(c, w) +} + +func (s *UnitSuite) TestConfigSettingsNoBranch(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateCharm(charmChange, s.Manager) + m.UpdateApplication(appChange, s.Manager) + m.UpdateUnit(unitChange, s.Manager) + + u, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + + cfg, err := u.ConfigSettings() + c.Assert(err, jc.ErrorIsNil) + + expected := charm.Settings{ + "key": "value", + "another": "foo", + "something": "else", + } + c.Assert(cfg, gc.DeepEquals, expected) +} + +func (s *UnitSuite) TestConfigSettingsBranch(c *gc.C) { + m := s.NewModel(modelChange) + m.UpdateCharm(charmChange, s.Manager) + m.UpdateApplication(appChange, s.Manager) + m.UpdateUnit(unitChange, s.Manager) + + br := branchChange + br.AssignedUnits = map[string][]string{appChange.Name: {unitChange.Name}} + br.Config = map[string]settings.ItemChanges{ + appChange.Name: { + settings.MakeAddition("new-key", "new-value"), + settings.MakeDeletion("key", "this-will-revert-to-default"), + settings.MakeModification("another", "foo", "new-foo"), + }, + } + m.UpdateBranch(br, s.Manager) + + u, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + + cfg, err := u.ConfigSettings() + c.Assert(err, jc.ErrorIsNil) + + expected := charm.Settings{ + "key": "default-value", + "another": "new-foo", + "new-key": "new-value", + "something": "else", + } + c.Assert(cfg, gc.DeepEquals, expected) +} + +func (s *UnitSuite) TestConfigSettingsDefaultsOnly(c *gc.C) { + appNoCfg := appChange + appNoCfg.Config = nil + + m := s.NewModel(modelChange) + m.UpdateCharm(charmChange, s.Manager) + m.UpdateApplication(appNoCfg, s.Manager) + m.UpdateUnit(unitChange, s.Manager) + + u, err := m.Unit(unitChange.Name) + c.Assert(err, jc.ErrorIsNil) + + cfg, err := u.ConfigSettings() + c.Assert(err, jc.ErrorIsNil) + + expected := charm.Settings{ + "key": "default-value", + "something": "else", + } + c.Assert(cfg, gc.DeepEquals, expected) +} + var unitChange = cache.UnitChange{ ModelUUID: "model-uuid", Name: "application-name/0", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/cache/watcher.go juju-core-2.6.5/src/github.com/juju/juju/core/cache/watcher.go --- juju-core-2.6.2/src/github.com/juju/juju/core/cache/watcher.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/cache/watcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -72,9 +72,12 @@ return } + // The watcher must be dying or dead before we close the channel. + // Otherwise readers could fail, but the watcher's tomb would indicate + // "still alive". + w.tomb.Kill(nil) w.closed = true close(w.changes) - w.tomb.Kill(nil) } // Wait is part of the worker.Worker interface. @@ -203,9 +206,12 @@ return } + // The watcher must be dying or dead before we close the channel. + // Otherwise readers could fail, but the watcher's tomb would indicate + // "still alive". + w.tomb.Kill(nil) w.closed = true close(w.changes) - w.tomb.Kill(nil) } // Wait is part of the worker.Worker interface. @@ -219,6 +225,11 @@ return w.Wait() } +// Err returns the inner tomb's error. +func (w *stringsWatcherBase) Err() error { + return w.tomb.Err() +} + func (w *stringsWatcherBase) notify(values []string) { w.mu.Lock() @@ -253,7 +264,7 @@ } // PredicateStringsWatcher notifies that something changed, with -// a slice of strings. The predicateFunc will test the values +// a slice of strings. The predicateFunc will test the values // before notification. An initial event is sent with the input // given at creation. type PredicateStringsWatcher struct { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/constraints/constraints.go juju-core-2.6.5/src/github.com/juju/juju/core/constraints/constraints.go --- juju-core-2.6.2/src/github.com/juju/juju/core/constraints/constraints.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/constraints/constraints.go 2019-06-28 17:10:43.000000000 +0000 @@ -140,6 +140,11 @@ return v.CpuCores != nil && *v.CpuCores > 0 } +// HasRootDisk returns true if the contraints.Value specifies a RootDisk size. +func (v *Value) HasRootDisk() bool { + return v.RootDisk != nil && *v.RootDisk > 0 +} + // HasRootDiskSource returns true if the constraints.Value specifies a // source for its root disk. func (v *Value) HasRootDiskSource() bool { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/constraints/constraints_test.go juju-core-2.6.5/src/github.com/juju/juju/core/constraints/constraints_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/constraints/constraints_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/constraints/constraints_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -489,6 +489,15 @@ c.Check(con.HasRootDiskSource(), jc.IsFalse) } +func (s *ConstraintsSuite) TestHasRootDisk(c *gc.C) { + con := constraints.MustParse("root-disk=32G") + c.Check(con.HasRootDisk(), jc.IsTrue) + con = constraints.MustParse("root-disk=") + c.Check(con.HasRootDisk(), jc.IsFalse) + con = constraints.MustParse("root-disk-source=pilgrim") + c.Check(con.HasRootDisk(), jc.IsFalse) +} + func (s *ConstraintsSuite) TestIsEmpty(c *gc.C) { con := constraints.Value{} c.Check(&con, jc.Satisfies, constraints.IsEmpty) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/crossmodel/offerurl.go juju-core-2.6.5/src/github.com/juju/juju/core/crossmodel/offerurl.go --- juju-core-2.6.2/src/github.com/juju/juju/core/crossmodel/offerurl.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/crossmodel/offerurl.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package crossmodel - -import ( - "fmt" - "regexp" - "strings" - - "github.com/juju/errors" - "gopkg.in/juju/names.v2" -) - -// OfferURL represents the location of an offered application and its -// associated exported endpoints. -type OfferURL struct { - // Source represents where the offer is hosted. - // If empty, the model is another model in the same controller. - Source string // "" or "" or "" - - // User is the user whose namespace in which the offer is made. - // Where a model is specified, the user is the model owner. - User string - - // ModelName is the name of the model providing the exported endpoints. - // It is only used for local URLs or for specifying models in the same - // controller. - ModelName string - - // ApplicationName is the name of the application providing the exported endpoints. - ApplicationName string -} - -// Path returns the path component of the URL. -func (u *OfferURL) Path() string { - var parts []string - if u.User != "" { - parts = append(parts, u.User) - } - if u.ModelName != "" { - parts = append(parts, u.ModelName) - } - path := strings.Join(parts, "/") - path = fmt.Sprintf("%s.%s", path, u.ApplicationName) - if u.Source == "" { - return path - } - return fmt.Sprintf("%s:%s", u.Source, path) -} - -func (u *OfferURL) String() string { - return u.Path() -} - -// AsLocal returns a copy of the URL with an empty (local) source. -func (u *OfferURL) AsLocal() *OfferURL { - localURL := *u - localURL.Source = "" - return &localURL -} - -// HasEndpoint returns whether this offer URL includes an -// endpoint name in the application name. -func (u *OfferURL) HasEndpoint() bool { - return strings.Contains(u.ApplicationName, ":") -} - -// modelApplicationRegexp parses urls of the form controller:user/model.application[:relname] -var modelApplicationRegexp = regexp.MustCompile(`(/?((?P[^/]+)/)?(?P[^.]*)(\.(?P[^:]*(:.*)?))?)?`) - -//var modelApplicationRegexp = regexp.MustCompile(`(/?((?P[a-zA-Z]+)/)?(?P[a-zA-Z]+)?(\.(?P[^:]*(:[a-zA-Z]+)?))?)?`) - -// ParseOfferURL parses the specified URL string into an OfferURL. -// The URL string is of one of the forms: -// . -// .: -// /. -// /.: -// :/. -// :/.: -func ParseOfferURL(urlStr string) (*OfferURL, error) { - return parseOfferURL(urlStr) -} - -// parseOfferURL parses the specified URL string into an OfferURL. -func parseOfferURL(urlStr string) (*OfferURL, error) { - urlParts, err := parseOfferURLParts(urlStr, false) - if err != nil { - return nil, err - } - url := OfferURL(*urlParts) - return &url, nil -} - -// OfferURLParts contains various attributes of a URL. -type OfferURLParts OfferURL - -// ParseOfferURLParts parses a partial URL, filling out what parts are supplied. -// This method is used to generate a filter used to query matching offer URLs. -func ParseOfferURLParts(urlStr string) (*OfferURLParts, error) { - return parseOfferURLParts(urlStr, true) -} - -var endpointRegexp = regexp.MustCompile(`^[a-zA-Z0-9]+$`) - -func maybeParseSource(urlStr string) (source, rest string) { - parts := strings.Split(urlStr, ":") - switch len(parts) { - case 3: - return parts[0], parts[1] + ":" + parts[2] - case 2: - if endpointRegexp.MatchString(parts[1]) { - return "", urlStr - } - return parts[0], parts[1] - } - return "", urlStr -} - -func parseOfferURLParts(urlStr string, allowIncomplete bool) (*OfferURLParts, error) { - var result OfferURLParts - source, urlParts := maybeParseSource(urlStr) - - valid := !strings.HasPrefix(urlStr, ":") - valid = valid && modelApplicationRegexp.MatchString(urlParts) - if valid { - result.Source = source - result.User = modelApplicationRegexp.ReplaceAllString(urlParts, "$user") - result.ModelName = modelApplicationRegexp.ReplaceAllString(urlParts, "$model") - result.ApplicationName = modelApplicationRegexp.ReplaceAllString(urlParts, "$application") - } - if !valid || strings.Contains(result.ModelName, "/") || strings.Contains(result.ApplicationName, "/") { - // TODO(wallyworld) - update error message when we support multi-controller and JAAS CMR - return nil, errors.Errorf("application offer URL has invalid form, must be [.: %q", urlStr) - } - if !allowIncomplete && result.ModelName == "" { - return nil, errors.Errorf("application offer URL is missing model") - } - if !allowIncomplete && result.ApplicationName == "" { - return nil, errors.Errorf("application offer URL is missing application") - } - - // Application name part may contain a relation name part, so strip that bit out - // before validating the name. - appName := strings.Split(result.ApplicationName, ":")[0] - // Validate the resulting URL part values. - if result.User != "" && !names.IsValidUser(result.User) { - return nil, errors.NotValidf("user name %q", result.User) - } - if result.ModelName != "" && !names.IsValidModelName(result.ModelName) { - return nil, errors.NotValidf("model name %q", result.ModelName) - } - if appName != "" && !names.IsValidApplication(appName) { - return nil, errors.NotValidf("application name %q", appName) - } - return &result, nil -} - -// MakeURL constructs an offer URL from the specified components. -func MakeURL(user, model, application, controller string) string { - base := fmt.Sprintf("%s/%s.%s", user, model, application) - if controller == "" { - return base - } - return fmt.Sprintf("%s:%s", controller, base) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/crossmodel/offerurl_test.go juju-core-2.6.5/src/github.com/juju/juju/core/crossmodel/offerurl_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/crossmodel/offerurl_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/crossmodel/offerurl_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package crossmodel_test - -import ( - "fmt" - "regexp" - "strings" - - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/juju/core/crossmodel" -) - -type OfferURLSuite struct{} - -var _ = gc.Suite(&OfferURLSuite{}) - -var urlTests = []struct { - s, err string - exact string - url *crossmodel.OfferURL -}{{ - s: "controller:user/modelname.applicationname", - url: &crossmodel.OfferURL{"controller", "user", "modelname", "applicationname"}, -}, { - s: "controller:user/modelname.applicationname:rel", - url: &crossmodel.OfferURL{"controller", "user", "modelname", "applicationname:rel"}, -}, { - s: "modelname.applicationname", - url: &crossmodel.OfferURL{"", "", "modelname", "applicationname"}, -}, { - s: "modelname.applicationname:rel", - url: &crossmodel.OfferURL{"", "", "modelname", "applicationname:rel"}, -}, { - s: "user/modelname.applicationname:rel", - url: &crossmodel.OfferURL{"", "user", "modelname", "applicationname:rel"}, -}, { - s: "/modelname.applicationname", - url: &crossmodel.OfferURL{"", "", "modelname", "applicationname"}, - exact: "modelname.applicationname", -}, { - s: "/modelname.applicationname:rel", - url: &crossmodel.OfferURL{"", "", "modelname", "applicationname:rel"}, - exact: "modelname.applicationname:rel", -}, { - s: "user/modelname.applicationname", - url: &crossmodel.OfferURL{"", "user", "modelname", "applicationname"}, -}, { - s: "controller:modelname", - err: `application offer URL is missing application`, -}, { - s: "controller:user/modelname", - err: `application offer URL is missing application`, -}, { - s: "model", - err: `application offer URL is missing application`, -}, { - s: "/user/model", - err: `application offer URL is missing application`, -}, { - s: "model.application@bad", - err: `application name "application@bad" not valid`, -}, { - s: "user[bad/model.application", - err: `user name "user\[bad" not valid`, -}, { - s: "user/[badmodel.application", - err: `model name "\[badmodel" not valid`, -}} - -func (s *OfferURLSuite) TestParseURL(c *gc.C) { - for i, t := range urlTests { - c.Logf("test %d: %q", i, t.s) - url, err := crossmodel.ParseOfferURL(t.s) - - match := t.s - if t.exact != "" { - match = t.exact - } - if t.url != nil { - c.Assert(err, gc.IsNil) - c.Check(url, gc.DeepEquals, t.url) - c.Check(url.String(), gc.Equals, match) - } - if t.err != "" { - t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) - c.Check(err, gc.ErrorMatches, t.err) - c.Check(url, gc.IsNil) - } - } -} - -var urlPartsTests = []struct { - s, err string - url *crossmodel.OfferURLParts -}{{ - s: "controller:/user/modelname.applicationname", - url: &crossmodel.OfferURLParts{"controller", "user", "modelname", "applicationname"}, -}, { - s: "user/modelname.applicationname", - url: &crossmodel.OfferURLParts{"", "user", "modelname", "applicationname"}, -}, { - s: "user/modelname", - url: &crossmodel.OfferURLParts{"", "user", "modelname", ""}, -}, { - s: "modelname.application", - url: &crossmodel.OfferURLParts{"", "", "modelname", "application"}, -}, { - s: "controller:/modelname", - url: &crossmodel.OfferURLParts{"controller", "", "modelname", ""}, -}, { - s: "controller:", - url: &crossmodel.OfferURLParts{Source: "controller"}, -}, { - s: "", - url: &crossmodel.OfferURLParts{}, -}, { - s: "user/prod/applicationname/extra", - err: `application offer URL has invalid form, must be \[.: "user/prod/applicationname/extra"`, -}, { - s: "controller:/user/modelname.application@bad", - err: `application name "application@bad" not valid`, -}, { - s: "controller:/user[bad/modelname.application", - err: `user name "user\[bad" not valid`, -}, { - s: ":foo", - err: `application offer URL has invalid form, must be \[.: $URL`, -}} - -func (s *OfferURLSuite) TestParseURLParts(c *gc.C) { - for i, t := range urlPartsTests { - c.Logf("test %d: %q", i, t.s) - url, err := crossmodel.ParseOfferURLParts(t.s) - - if t.url != nil { - c.Check(err, gc.IsNil) - c.Check(url, gc.DeepEquals, t.url) - } - if t.err != "" { - t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) - c.Assert(err, gc.ErrorMatches, t.err) - c.Assert(url, gc.IsNil) - } - } -} - -func (s *OfferURLSuite) TestHasEndpoint(c *gc.C) { - url, err := crossmodel.ParseOfferURL("model.application:endpoint") - c.Assert(err, jc.ErrorIsNil) - c.Check(url.HasEndpoint(), jc.IsTrue) - url, err = crossmodel.ParseOfferURL("model.application") - c.Assert(err, jc.ErrorIsNil) - c.Check(url.HasEndpoint(), jc.IsFalse) - url, err = crossmodel.ParseOfferURL("controller:/user/model.application:thing") - c.Assert(err, jc.ErrorIsNil) - c.Check(url.HasEndpoint(), jc.IsTrue) - url, err = crossmodel.ParseOfferURL("controller:/user/model.application") - c.Assert(err, jc.ErrorIsNil) - c.Check(url.HasEndpoint(), jc.IsFalse) -} - -func (s *OfferURLSuite) TestMakeURL(c *gc.C) { - url := crossmodel.MakeURL("user", "model", "app", "") - c.Assert(url, gc.Equals, "user/model.app") - url = crossmodel.MakeURL("user", "model", "app", "ctrl") - c.Assert(url, gc.Equals, "ctrl:user/model.app") -} - -func (s *OfferURLSuite) TestAsLocal(c *gc.C) { - url, err := crossmodel.ParseOfferURL("source:model.application:endpoint") - c.Assert(err, jc.ErrorIsNil) - expected, err := crossmodel.ParseOfferURL("model.application:endpoint") - c.Assert(err, jc.ErrorIsNil) - original := *url - c.Assert(url.AsLocal(), gc.DeepEquals, expected) - c.Assert(*url, gc.DeepEquals, original) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/lease/store.go juju-core-2.6.5/src/github.com/juju/juju/core/lease/store.go --- juju-core-2.6.2/src/github.com/juju/juju/core/lease/store.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/lease/store.go 2019-06-28 17:10:43.000000000 +0000 @@ -37,6 +37,13 @@ // Supplying any lease keys will filter the return for those requested. Leases(keys ...Key) map[Key]Info + // LeaseGroup returns a snapshot of all of the leases for a + // particular namespace/model combination. This is useful for + // reporting holder information for a model, and can often be + // implemented more efficiently than getting all leases when there + // are many models. + LeaseGroup(namespace, modelUUID string) map[Key]Info + // Refresh reads all lease state from the database. Refresh() error diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/fsm.go juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/fsm.go --- juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/fsm.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/fsm.go 2019-06-28 17:10:43.000000000 +0000 @@ -258,6 +258,25 @@ } } +// LeaseGroup returns all leases matching the namespace and model - +// when there are many models this is more efficient than getting all +// the leases and filtering by model. +func (f *FSM) LeaseGroup(getLocalTime func() time.Time, namespace, modelUUID string) map[lease.Key]lease.Info { + f.mu.Lock() + defer f.mu.Unlock() + gKey := groupKey{namespace: namespace, modelUUID: modelUUID} + entries, found := f.groups[gKey] + if !found { + return nil + } + localTime := getLocalTime() + results := make(map[lease.Key]lease.Info, len(entries)) + for key, entry := range entries { + results[key] = f.infoFromEntry(localTime, key, entry) + } + return results +} + // Pinned returns all of the currently known lease pins and applications // requiring the pinned behaviour. func (f *FSM) Pinned() map[lease.Key][]string { @@ -583,9 +602,6 @@ return errors.NotValidf("setTime with model UUID") } if c.Lease != "" { - if c.Holder == "" { - return errors.NotValidf("%s with empty holder", c.Operation) - } return errors.NotValidf("setTime with lease") } if c.PinEntity != "" { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/fsm_test.go juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/fsm_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/fsm_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/fsm_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -490,6 +490,53 @@ ) } +func (s *fsmSuite) TestLeaseGroup(c *gc.C) { + c.Assert(s.apply(c, raftlease.Command{ + Version: 1, + Operation: raftlease.OperationClaim, + Namespace: "ns", + ModelUUID: "model", + Lease: "lease", + Holder: "me", + Duration: time.Second, + }).Error(), jc.ErrorIsNil) + c.Assert(s.apply(c, raftlease.Command{ + Version: 1, + Operation: raftlease.OperationClaim, + Namespace: "ns", + ModelUUID: "model", + Lease: "lease2", + Holder: "me", + Duration: 5 * time.Second, + }).Error(), jc.ErrorIsNil) + c.Assert(s.apply(c, raftlease.Command{ + Version: 1, + Operation: raftlease.OperationClaim, + Namespace: "ns", + ModelUUID: "model2", + Lease: "lease", + Holder: "you", + Duration: 4 * time.Second, + }).Error(), jc.ErrorIsNil) + + c.Assert( + s.fsm.LeaseGroup(timeDelegate(zero), "ns", "model"), + gc.DeepEquals, + map[lease.Key]lease.Info{ + {"ns", "model", "lease"}: { + Holder: "me", + Expiry: offset(time.Second), + }, + {"ns", "model", "lease2"}: { + Holder: "me", + Expiry: offset(5 * time.Second), + }, + }, + ) + res := s.fsm.LeaseGroup(timeDelegate(zero), "ns", "model3") + c.Assert(res, gc.HasLen, 0) +} + func (s *fsmSuite) TestLeasesPinnedFutureExpiry(c *gc.C) { c.Assert(s.apply(c, raftlease.Command{ Version: 1, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/store.go juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/store.go --- juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/store.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/store.go 2019-06-28 17:10:43.000000000 +0000 @@ -60,9 +60,11 @@ // ReadonlyFSM defines the methods of the lease FSM the store can use // - any writes must go through the hub. type ReadonlyFSM interface { - // Leases receives a func for retrieving time, because it needs to be - // determined after potential lock-waiting to be accurate. + // Leases and LeaseGroup receive a func for retrieving time, + // because it needs to be determined after potential lock-waiting + // to be accurate. Leases(func() time.Time, ...lease.Key) map[lease.Key]lease.Info + LeaseGroup(func() time.Time, string, string) map[lease.Key]lease.Info GlobalTime() time.Time Pinned() map[lease.Key][]string } @@ -141,12 +143,22 @@ // Leases is part of lease.Store. func (s *Store) Leases(keys ...lease.Key) map[lease.Key]lease.Info { leaseMap := s.fsm.Leases(s.config.Clock.Now, keys...) - // Add trapdoors into the information from the FSM. + s.addTrapdoors(leaseMap) + return leaseMap +} + +// LeaseGroup is part of Lease.Store. +func (s *Store) LeaseGroup(namespace, modelUUID string) map[lease.Key]lease.Info { + leaseMap := s.fsm.LeaseGroup(s.config.Clock.Now, namespace, modelUUID) + s.addTrapdoors(leaseMap) + return leaseMap +} + +func (s *Store) addTrapdoors(leaseMap map[lease.Key]lease.Info) { for k, v := range leaseMap { v.Trapdoor = s.config.Trapdoor(k, v.Holder) leaseMap[k] = v } - return leaseMap } // Refresh is part of lease.Store. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/store_test.go juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/store_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/raftlease/store_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/raftlease/store_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -356,6 +356,42 @@ c.Check(s.fsm.Calls()[0].Args[1], jc.SameContents, []lease.Key{lease1, lease2}) } +func (s *storeSuite) TestLeaseGroup(c *gc.C) { + in5Seconds := s.clock.Now().Add(5 * time.Second) + in10Seconds := s.clock.Now().Add(10 * time.Second) + lease1 := lease.Key{"quam", "olim", "abrahe"} + lease2 := lease.Key{"la", "cry", "mosa"} + s.fsm.leases[lease1] = lease.Info{ + Holder: "verdi", + Expiry: in10Seconds, + } + s.fsm.leases[lease2] = lease.Info{ + Holder: "mozart", + Expiry: in5Seconds, + } + result := s.store.LeaseGroup("ns", "model") + c.Assert(len(result), gc.Equals, 2) + s.fsm.CheckCall(c, 0, "LeaseGroup", s.clock.Now(), "ns", "model") + + r1 := result[lease1] + c.Assert(r1.Holder, gc.Equals, "verdi") + c.Assert(r1.Expiry, gc.Equals, in10Seconds) + + // Can't compare trapdoors directly. + var out string + err := r1.Trapdoor(0, &out) + c.Assert(err, jc.ErrorIsNil) + c.Assert(out, gc.Equals, "{quam olim abrahe} held by verdi") + + r2 := result[lease2] + c.Assert(r2.Holder, gc.Equals, "mozart") + c.Assert(r2.Expiry, gc.Equals, in5Seconds) + + err = r2.Trapdoor(0, &out) + c.Assert(err, jc.ErrorIsNil) + c.Assert(out, gc.Equals, "{la cry mosa} held by mozart") +} + func (s *storeSuite) TestPin(c *gc.C) { machine := names.NewMachineTag("0").String() s.handleHubRequest(c, @@ -811,6 +847,11 @@ return f.leases } +func (f *fakeFSM) LeaseGroup(t func() time.Time, ns, uuid string) map[lease.Key]lease.Info { + f.AddCall("LeaseGroup", t(), ns, uuid) + return f.leases +} + func (f *fakeFSM) Pinned() map[lease.Key][]string { f.AddCall("Pinned") return f.pinned diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/settings/settings.go juju-core-2.6.5/src/github.com/juju/juju/core/settings/settings.go --- juju-core-2.6.2/src/github.com/juju/juju/core/settings/settings.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/settings/settings.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,7 +5,6 @@ import ( "fmt" - "reflect" "github.com/juju/errors" "gopkg.in/juju/charm.v6" @@ -137,10 +136,8 @@ // then we know that the setting was reset to its original value. // If this setting is subsequently reinstated, it is possible to lose the // original "from" value if master is updated in the meantime. - // So we maintain a no-op entry (same from/to) in order to retain the old + // So we maintain an entry with the same to/from in order to retain the old // value from when the configuration setting was first touched. - // These values are not shown to an operator who views a "diff" - // for the branch. for key, old := range m { res = append(res, MakeModification(key, old.OldValue, old.OldValue)) } @@ -148,18 +145,14 @@ return res, nil } -// CurrentSettings returns the current effective values indicated by this set -// of changes. It uses the input default settings to return a value for items -// that have been deleted. -func (c ItemChanges) CurrentSettings(defaults charm.Settings) map[string]interface{} { +// EffectiveChanges returns the effective changes resulting from the +// application of these changes to the input defaults. +func (c ItemChanges) EffectiveChanges(defaults charm.Settings) map[string]interface{} { result := make(map[string]interface{}) for _, change := range c { key := change.Key switch { - case change.IsModification() && reflect.DeepEqual(change.OldValue, change.NewValue): - // These are placeholders that we do not apply. - // See comment in ApplyDeltaSource, above. case change.IsDeletion(): result[key] = defaults[key] default: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/settings/settings_test.go juju-core-2.6.5/src/github.com/juju/juju/core/settings/settings_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/settings/settings_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/settings/settings_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -93,12 +93,11 @@ } } -func (*settingsSuite) TestCurrentSettings(c *gc.C) { +func (*settingsSuite) TestEffectiveSettings(c *gc.C) { changes := ItemChanges{ MakeAddition("key1", "new-val"), MakeModification("key2", "old-val", "other-val"), MakeDeletion("key3", "old-deleted-val"), - MakeModification("key4", "same-value-ignored", "same-value-ignored"), } defaults := map[string]interface{}{ @@ -111,5 +110,5 @@ "key2": "other-val", "key3": "default-deleted-val", } - c.Check(changes.CurrentSettings(defaults), gc.DeepEquals, exp) + c.Check(changes.EffectiveChanges(defaults), gc.DeepEquals, exp) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/status/status.go juju-core-2.6.5/src/github.com/juju/juju/core/status/status.go --- juju-core-2.6.2/src/github.com/juju/juju/core/status/status.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/status/status.go 2019-06-28 17:10:43.000000000 +0000 @@ -332,6 +332,7 @@ Available, Busy, Destroying, + Suspended, // For model, this means that its cloud credential is invalid and model will not be doing any cloud calls. Error: return true default: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/core/status/status_test.go juju-core-2.6.5/src/github.com/juju/juju/core/status/status_test.go --- juju-core-2.6.2/src/github.com/juju/juju/core/status/status_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/core/status/status_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -3,6 +3,7 @@ package status_test import ( + jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "github.com/juju/juju/core/status" @@ -49,3 +50,51 @@ c.Assert(v.status.KnownModificationStatus(), gc.Equals, v.valid) } } + +func (s *StatusSuite) TestValidModelStatus(c *gc.C) { + for _, v := range []status.Status{ + status.Available, + status.Busy, + status.Destroying, + status.Error, + status.Suspended, + } { + c.Assert(status.ValidModelStatus(v), jc.IsTrue, gc.Commentf("status %q is not valid for a model", v)) + } +} + +func (s *StatusSuite) TestInvalidModelStatus(c *gc.C) { + for _, v := range []status.Status{ + status.Active, + status.Allocating, + status.Applied, + status.Attached, + status.Attaching, + status.Blocked, + status.Broken, + status.Detached, + status.Detaching, + status.Down, + status.Empty, + status.Executing, + status.Failed, + status.Idle, + status.Joined, + status.Joining, + status.Lost, + status.Maintenance, + status.Pending, + status.Provisioning, + status.ProvisioningError, + status.Rebooting, + status.Running, + status.Suspending, + status.Started, + status.Stopped, + status.Terminated, + status.Unknown, + status.Waiting, + } { + c.Assert(status.ValidModelStatus(v), jc.IsFalse, gc.Commentf("status %q is valid for a model", v)) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/environs/broker.go juju-core-2.6.5/src/github.com/juju/juju/environs/broker.go --- juju-core-2.6.2/src/github.com/juju/juju/environs/broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/environs/broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -162,6 +162,9 @@ // AllInstances returns all instances currently known to the broker. AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) + // AllRunningInstances returns all running, available instances currently known to the broker. + AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) + // MaintainInstance is used to run actions on jujud startup for existing // instances. It is currently only used to ensure that LXC hosts have the // correct network configuration. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/environs/cloudspec.go juju-core-2.6.5/src/github.com/juju/juju/environs/cloudspec.go --- juju-core-2.6.2/src/github.com/juju/juju/environs/cloudspec.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/environs/cloudspec.go 2019-06-28 17:10:43.000000000 +0000 @@ -74,9 +74,11 @@ if err != nil { return CloudSpec{}, errors.Annotate(err, "getting cloud region definition") } - cloudSpec.Endpoint = cloudRegion.Endpoint - cloudSpec.IdentityEndpoint = cloudRegion.IdentityEndpoint - cloudSpec.StorageEndpoint = cloudRegion.StorageEndpoint + if !cloudRegion.IsEmpty() { + cloudSpec.Endpoint = cloudRegion.Endpoint + cloudSpec.IdentityEndpoint = cloudRegion.IdentityEndpoint + cloudSpec.StorageEndpoint = cloudRegion.StorageEndpoint + } } return cloudSpec, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/environs/manual/winrmprovisioner/winrmprovisioner.go juju-core-2.6.5/src/github.com/juju/juju/environs/manual/winrmprovisioner/winrmprovisioner.go --- juju-core-2.6.2/src/github.com/juju/juju/environs/manual/winrmprovisioner/winrmprovisioner.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/environs/manual/winrmprovisioner/winrmprovisioner.go 2019-06-28 17:10:43.000000000 +0000 @@ -141,7 +141,7 @@ logger.Infof("Trying http client as user %s on %s", args.Host, args.User) if err = args.WinRM.Client.Ping(); err != nil { - logger.Debugf("WinRM unsecure listener is not enabled on %s", args.Host) + logger.Debugf("WinRM insecure listener is not enabled on %s", args.Host) return errors.Annotatef(err, "cannot provision, because all winrm default connections failed") } @@ -149,7 +149,7 @@ logger.Infof("Trying to enable https client certificate authentication") if args.WinRM.Client, err = enableCertAuth(args); err != nil { logger.Infof("Cannot enable client auth cert authentication for winrm") - logger.Infof("Reverting back to usecure client interaction") + logger.Infof("Reverting back to insecure client interaction") args.WinRM.Client = defClient return nil } @@ -160,8 +160,8 @@ return nil } - logger.Infof("Winrm https connection is broken, can't retrive a response") - logger.Infof("Reverting back to usecure client interactions") + logger.Infof("Winrm https connection is broken, cannot retrieve a response") + logger.Infof("Reverting back to insecure client interactions") args.WinRM.Client = defClient return nil @@ -413,7 +413,7 @@ return hc, series, nil } -// initHC it will initialize the hardware characterisrics struct with the +// initHC it will initialize the hardware characteristics struct with the // parsed and checked info slice string // info description : // - info[0] the arch of the machine diff -Nru juju-core-2.6.2/src/github.com/juju/juju/environs/testing/package_mock.go juju-core-2.6.5/src/github.com/juju/juju/environs/testing/package_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/environs/testing/package_mock.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/environs/testing/package_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,22 +5,24 @@ package testing import ( - gomock "github.com/golang/mock/gomock" - jsonschema "github.com/juju/jsonschema" - cloud "github.com/juju/juju/cloud" - constraints "github.com/juju/juju/core/constraints" - instance "github.com/juju/juju/core/instance" - environs "github.com/juju/juju/environs" - config "github.com/juju/juju/environs/config" - context "github.com/juju/juju/environs/context" - instances "github.com/juju/juju/environs/instances" - network "github.com/juju/juju/network" - storage "github.com/juju/juju/storage" - version "github.com/juju/version" + "io" + "reflect" + + "github.com/golang/mock/gomock" + "github.com/juju/jsonschema" + "github.com/juju/version" environschema_v1 "gopkg.in/juju/environschema.v1" names_v2 "gopkg.in/juju/names.v2" - io "io" - reflect "reflect" + + "github.com/juju/juju/cloud" + "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/instance" + "github.com/juju/juju/environs" + "github.com/juju/juju/environs/config" + "github.com/juju/juju/environs/context" + "github.com/juju/juju/environs/instances" + "github.com/juju/juju/network" + "github.com/juju/juju/storage" ) // MockEnvironProvider is a mock of EnvironProvider interface @@ -726,6 +728,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockEnviron)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockEnviron) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockEnvironMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockEnviron)(nil).AllRunningInstances), arg0) +} + // Bootstrap mocks base method func (m *MockEnviron) Bootstrap(arg0 environs.BootstrapContext, arg1 context.ProviderCallContext, arg2 environs.BootstrapParams) (*environs.BootstrapResult, error) { ret := m.ctrl.Call(m, "Bootstrap", arg0, arg1, arg2) @@ -1357,6 +1372,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockNetworkingEnviron)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockNetworkingEnviron) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockNetworkingEnvironMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockNetworkingEnviron)(nil).AllRunningInstances), arg0) +} + // AllocateContainerAddresses mocks base method func (m *MockNetworkingEnviron) AllocateContainerAddresses(arg0 context.ProviderCallContext, arg1 instance.Id, arg2 names_v2.MachineTag, arg3 []network.InterfaceInfo) ([]network.InterfaceInfo, error) { ret := m.ctrl.Call(m, "AllocateContainerAddresses", arg0, arg1, arg2, arg3) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/feature/flags.go juju-core-2.6.5/src/github.com/juju/juju/feature/flags.go --- juju-core-2.6.2/src/github.com/juju/juju/feature/flags.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/feature/flags.go 2019-06-28 17:10:43.000000000 +0000 @@ -61,3 +61,7 @@ // MultiCloud tells Juju to allow a different IAAS cloud to the one the controller // was bootstrapped on to be added to the controller. const MultiCloud = "multi-cloud" + +// CMRAwareBundles allows Juju to recognize and handle offer and saas blocks +// when deploying bundles. +const CMRAwareBundles = "bundle-cmr" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/application_config_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/application_config_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/application_config_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/application_config_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -61,7 +61,8 @@ unit, err := app.AddUnit(state.AddUnitParams{}) c.Assert(err, jc.ErrorIsNil) - unit.SetCharmURL(s.charm.URL()) + err = unit.SetCharmURL(s.charm.URL()) + c.Assert(err, jc.ErrorIsNil) password, err := utils.RandomPassword() c.Assert(err, jc.ErrorIsNil) @@ -69,11 +70,11 @@ c.Assert(err, jc.ErrorIsNil) st := s.OpenAPIAs(c, unit.Tag(), password) - uniteer, err := st.Uniter() + uniter, err := st.Uniter() c.Assert(err, jc.ErrorIsNil) - c.Assert(uniteer, gc.NotNil) + c.Assert(uniter, gc.NotNil) - s.apiUnit, err = uniteer.Unit(unit.Tag().(names.UnitTag)) + s.apiUnit, err = uniter.Unit(unit.Tag().(names.UnitTag)) c.Assert(err, jc.ErrorIsNil) // Ensure both outputs have all charm config keys @@ -151,6 +152,10 @@ } func (s *ApplicationConfigSuite) assertSameConfigOutput(c *gc.C, expectedValues settingsMap) { + // Let the model settle to ensure cache population. + s.State.StartSync() + s.WaitForModelWatchersIdle(c, s.State.ModelUUID()) + s.assertJujuConfigOutput(c, s.configCommandOutput(c, s.appName), expectedValues) s.assertHookOutput(c, s.getHookOutput(c), expectedValues) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_application_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_application_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_application_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -118,3 +118,12 @@ url: "" `[1:]) } + +func (s *CmdApplicationSuite) TestRemoveApplication(c *gc.C) { + s.setupApplications(c) + + ctx, err := cmdtesting.RunCommand(c, application.NewRemoveApplicationCommand(), "wordpress") + c.Assert(err, jc.ErrorIsNil) + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") + c.Assert(cmdtesting.Stderr(ctx), gc.Equals, "removing application wordpress\n") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -144,7 +144,7 @@ life: alive status: current: available - since: just now + since: .* access: admin last-connection: just now sla-owner: admin diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_deploy_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_deploy_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_deploy_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_deploy_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,22 +20,22 @@ func (s *cmdDeploySuite) TestLocalDeploySuccess(c *gc.C) { ch := testcharms.Repo.CharmDir("storage-filesystem-subordinate") // has hooks - ctx, err := runCommand(c, "deploy", ch.Path, "--series", "quantal") + ctx, err := runCommand(c, "deploy", ch.Path, "--series", "bionic") c.Assert(err, jc.ErrorIsNil) - c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `Deploying charm "local:quantal/storage-filesystem-subordinate-1"`) + c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `Deploying charm "local:bionic/storage-filesystem-subordinate-1"`) c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") - savedCh, err := s.State.Charm(charm.MustParseURL("local:quantal/storage-filesystem-subordinate-1")) + savedCh, err := s.State.Charm(charm.MustParseURL("local:bionic/storage-filesystem-subordinate-1")) c.Assert(err, jc.ErrorIsNil) c.Assert(savedCh, gc.NotNil) } func (s *cmdDeploySuite) TestLocalDeployFailNoHook(c *gc.C) { ch := testcharms.Repo.CharmDir("category") // has no hooks - ctx, err := runCommand(c, "deploy", ch.Path, "--series", "quantal") + ctx, err := runCommand(c, "deploy", ch.Path, "--series", "bionic") c.Assert(err, gc.NotNil) c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `invalid charm "category": has no hooks`) c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") - _, err = s.State.Charm(charm.MustParseURL("local:quantal/category")) + _, err = s.State.Charm(charm.MustParseURL("local:bionic/category")) c.Assert(err, jc.Satisfies, errors.IsNotFound) } @@ -46,18 +46,18 @@ func (s *cmdDeploySuite) TestLocalDeployLXDProfileSuccess(c *gc.C) { ch := testcharms.Repo.CharmDir("lxd-profile-subordinate") // has hooks - ctx, err := runCommand(c, "deploy", ch.Path, "--series", "quantal") + ctx, err := runCommand(c, "deploy", ch.Path, "--series", "bionic") c.Assert(err, jc.ErrorIsNil) - c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `Deploying charm "local:quantal/lxd-profile-subordinate-0"`) + c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `Deploying charm "local:bionic/lxd-profile-subordinate-0"`) c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") - savedCh, err := s.State.Charm(charm.MustParseURL("local:quantal/lxd-profile-subordinate-0")) + savedCh, err := s.State.Charm(charm.MustParseURL("local:bionic/lxd-profile-subordinate-0")) c.Assert(err, jc.ErrorIsNil) c.Assert(savedCh, gc.NotNil) } func (s *cmdDeploySuite) TestLocalDeployLXDProfileWithBadConfigSuccess(c *gc.C) { ch := testcharms.Repo.CharmDir("lxd-profile-subordinate-fail") // has hooks - ctx, err := runCommand(c, "deploy", ch.Path, "--series", "quantal") + ctx, err := runCommand(c, "deploy", ch.Path, "--series", "bionic") c.Assert(err, gc.ErrorMatches, "cmd: error out silently") c.Assert(cmdtesting.Stderr(ctx), jc.Contains, `ERROR invalid lxd-profile.yaml: contains device type "unix-disk"`) c.Assert(cmdtesting.Stdout(ctx), gc.Equals, "") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_dumplogs_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_dumplogs_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/cmd_juju_dumplogs_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/cmd_juju_dumplogs_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,7 +13,6 @@ "github.com/juju/loggo" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "gopkg.in/juju/names.v2" "github.com/juju/juju/agent" "github.com/juju/juju/cmd/jujud/agent/agenttest" @@ -56,7 +55,7 @@ for i := 0; i < 3; i++ { err := w.Log([]state.LogRecord{{ Time: t, - Entity: names.NewMachineTag("42"), + Entity: "machine-42", Version: version.Current, Module: "module", Location: "location", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/featuretests/dblog_test.go juju-core-2.6.5/src/github.com/juju/juju/featuretests/dblog_test.go --- juju-core-2.6.2/src/github.com/juju/juju/featuretests/dblog_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/featuretests/dblog_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -178,7 +178,7 @@ t := time.Date(2015, 6, 23, 13, 8, 49, 0, time.UTC) err := dbLogger.Log([]state.LogRecord{{ Time: t, - Entity: names.NewMachineTag("99"), + Entity: "not-a-tag", Version: version.Current, Module: "juju.foo", Location: "code.go:42", @@ -186,7 +186,7 @@ Message: "all is well", }, { Time: t.Add(time.Second), - Entity: names.NewMachineTag("99"), + Entity: "not-a-tag", Version: version.Current, Module: "juju.bar", Location: "go.go:99", @@ -217,7 +217,7 @@ // Read the 2 lines that are in the logs collection. assertMessage(common.LogMessage{ - Entity: "machine-99", + Entity: "not-a-tag", Timestamp: t, Severity: "INFO", Module: "juju.foo", @@ -225,7 +225,7 @@ Message: "all is well", }) assertMessage(common.LogMessage{ - Entity: "machine-99", + Entity: "not-a-tag", Timestamp: t.Add(time.Second), Severity: "ERROR", Module: "juju.bar", @@ -236,7 +236,7 @@ // Now write and observe another log. This should be read from the oplog. err = dbLogger.Log([]state.LogRecord{{ Time: t.Add(2 * time.Second), - Entity: names.NewMachineTag("99"), + Entity: "not-a-tag", Version: version.Current, Module: "ju.jitsu", Location: "no.go:3", @@ -244,7 +244,7 @@ Message: "beep beep", }}) assertMessage(common.LogMessage{ - Entity: "machine-99", + Entity: "not-a-tag", Timestamp: t.Add(2 * time.Second), Severity: "WARNING", Module: "ju.jitsu", @@ -263,7 +263,8 @@ dbLogger := state.NewDbLogger(s.State) defer dbLogger.Close() - entity := names.NewMachineTag("99") + entity := "not-a-tag" + version := version.Current t1 := time.Date(2015, 6, 23, 13, 8, 49, 100, time.UTC) // Check that start time has subsecond resolution. @@ -320,7 +321,7 @@ } } assertMessage(common.LogMessage{ - Entity: "machine-99", + Entity: "not-a-tag", Timestamp: t3, Severity: "ERROR", Module: "juju.bar", @@ -328,7 +329,7 @@ Message: "born ruffians", }) assertMessage(common.LogMessage{ - Entity: "machine-99", + Entity: "not-a-tag", Timestamp: t4, Severity: "WARNING", Module: "juju.baz", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/describeapi_mock.go juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/describeapi_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/describeapi_mock.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/describeapi_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,94 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/juju/generate/schemagen/gen (interfaces: APIServer,Registry) + +// Package gen is a generated GoMock package. +package gen + +import ( + gomock "github.com/golang/mock/gomock" + facade "github.com/juju/juju/apiserver/facade" + reflect "reflect" +) + +// MockAPIServer is a mock of APIServer interface +type MockAPIServer struct { + ctrl *gomock.Controller + recorder *MockAPIServerMockRecorder +} + +// MockAPIServerMockRecorder is the mock recorder for MockAPIServer +type MockAPIServerMockRecorder struct { + mock *MockAPIServer +} + +// NewMockAPIServer creates a new mock instance +func NewMockAPIServer(ctrl *gomock.Controller) *MockAPIServer { + mock := &MockAPIServer{ctrl: ctrl} + mock.recorder = &MockAPIServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockAPIServer) EXPECT() *MockAPIServerMockRecorder { + return m.recorder +} + +// AllFacades mocks base method +func (m *MockAPIServer) AllFacades() Registry { + ret := m.ctrl.Call(m, "AllFacades") + ret0, _ := ret[0].(Registry) + return ret0 +} + +// AllFacades indicates an expected call of AllFacades +func (mr *MockAPIServerMockRecorder) AllFacades() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllFacades", reflect.TypeOf((*MockAPIServer)(nil).AllFacades)) +} + +// MockRegistry is a mock of Registry interface +type MockRegistry struct { + ctrl *gomock.Controller + recorder *MockRegistryMockRecorder +} + +// MockRegistryMockRecorder is the mock recorder for MockRegistry +type MockRegistryMockRecorder struct { + mock *MockRegistry +} + +// NewMockRegistry creates a new mock instance +func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry { + mock := &MockRegistry{ctrl: ctrl} + mock.recorder = &MockRegistryMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder { + return m.recorder +} + +// GetType mocks base method +func (m *MockRegistry) GetType(arg0 string, arg1 int) (reflect.Type, error) { + ret := m.ctrl.Call(m, "GetType", arg0, arg1) + ret0, _ := ret[0].(reflect.Type) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetType indicates an expected call of GetType +func (mr *MockRegistryMockRecorder) GetType(arg0, arg1 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetType", reflect.TypeOf((*MockRegistry)(nil).GetType), arg0, arg1) +} + +// List mocks base method +func (m *MockRegistry) List() []facade.Description { + ret := m.ctrl.Call(m, "List") + ret0, _ := ret[0].([]facade.Description) + return ret0 +} + +// List indicates an expected call of List +func (mr *MockRegistryMockRecorder) List() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRegistry)(nil).List)) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/generator.go juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/generator.go --- juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/generator.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/generator.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package gen + +import ( + "reflect" + + "github.com/bcsaller/jsonschema" + "github.com/juju/errors" + + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/rpc/rpcreflect" +) + +//go:generate mockgen -package gen -destination describeapi_mock.go github.com/juju/juju/generate/schemagen/gen APIServer,Registry +type APIServer interface { + AllFacades() Registry +} + +type Registry interface { + List() []facade.Description + GetType(name string, version int) (reflect.Type, error) +} + +// Generate a FacadeSchema from the APIServer +func Generate(client APIServer) ([]FacadeSchema, error) { + registry := client.AllFacades() + facades := registry.List() + result := make([]FacadeSchema, len(facades)) + for i, facade := range facades { + // select the latest version from the facade list + version := facade.Versions[len(facade.Versions)-1] + + result[i].Name = facade.Name + result[i].Version = version + + kind, err := registry.GetType(facade.Name, version) + if err != nil { + return nil, errors.Annotatef(err, "getting type for facade %s at version %d", facade.Name, version) + } + objType := rpcreflect.ObjTypeOf(kind) + result[i].Schema = jsonschema.ReflectFromObjType(objType) + } + return result, nil +} + +type FacadeSchema struct { + Name string + Version int + Schema *jsonschema.Schema +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/generator_test.go juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/generator_test.go --- juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/generator_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/generator_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package gen + +import ( + "reflect" + + "github.com/bcsaller/jsonschema" + gomock "github.com/golang/mock/gomock" + "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/rpc/rpcreflect" +) + +type GenSuite struct { + testing.IsolationSuite + + apiServer *MockAPIServer + registry *MockRegistry +} + +var _ = gc.Suite(&GenSuite{}) + +func (s *GenSuite) TestResult(c *gc.C) { + defer s.setup(c).Finish() + + s.scenario(c, + s.expectList, + s.expectGetType, + ) + result, err := Generate(s.apiServer) + c.Check(err, jc.ErrorIsNil) + + objtype := rpcreflect.ObjTypeOf(reflect.TypeOf(ResourcesFacade{})) + c.Check(result, gc.DeepEquals, []FacadeSchema{ + { + Name: "Resources", + Version: 4, + Schema: jsonschema.ReflectFromObjType(objtype), + }, + }) +} + +func (s *GenSuite) setup(c *gc.C) *gomock.Controller { + ctrl := gomock.NewController(c) + + s.apiServer = NewMockAPIServer(ctrl) + s.registry = NewMockRegistry(ctrl) + + return ctrl +} + +func (s *GenSuite) scenario(c *gc.C, behaviours ...func()) { + for _, b := range behaviours { + b() + } +} + +func (s *GenSuite) expectList() { + aExp := s.apiServer.EXPECT() + aExp.AllFacades().Return(s.registry) + + rExp := s.registry.EXPECT() + rExp.List().Return([]facade.Description{ + { + Name: "Resources", + Versions: []int{1, 2, 3, 4}, + }, + }) +} + +type ResourcesFacade struct{} + +func (ResourcesFacade) Resources(params []string) ([]string, error) { + return nil, nil +} + +func (s *GenSuite) expectGetType() { + rExp := s.registry.EXPECT() + rExp.GetType("Resources", 4).Return(reflect.TypeOf(ResourcesFacade{}), nil) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/package_test.go juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/package_test.go --- juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/gen/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/gen/package_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package gen_test + +import ( + stdtesting "testing" + + "github.com/juju/juju/testing" +) + +func TestPackage(t *stdtesting.T) { + testing.MgoTestPackage(t) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/schemagen.go juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/schemagen.go --- juju-core-2.6.2/src/github.com/juju/juju/generate/schemagen/schemagen.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/generate/schemagen/schemagen.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + + "github.com/juju/juju/apiserver" + "github.com/juju/juju/generate/schemagen/gen" +) + +func main() { + // the first argument here will be the name of the binary, so we ignore + // argument 0 when looking for the filepath. + if len(os.Args) != 2 { + fmt.Fprintln(os.Stderr, "Expected one argument: filepath of json schema to save.") + os.Exit(1) + } + + result, err := gen.Generate(apiServerShim{}) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + jsonSchema, err := json.MarshalIndent(result, "", " ") + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + err = ioutil.WriteFile(os.Args[1], jsonSchema, 0644) + if err != nil { + fmt.Println(err) + os.Exit(1) + } +} + +type apiServerShim struct{} + +func (apiServerShim) AllFacades() gen.Registry { + return apiserver.AllFacades() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/Gopkg.lock juju-core-2.6.5/src/github.com/juju/juju/Gopkg.lock --- juju-core-2.6.2/src/github.com/juju/juju/Gopkg.lock 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/Gopkg.lock 2019-06-28 17:10:43.000000000 +0000 @@ -99,6 +99,13 @@ revision = "f0300d1749da6fa982027e449ec0c7a145510c3c" [[projects]] + digest = "1:5defd223161d396ecc83945a7015431b321fce3d0656de212b601c72eae52959" + name = "github.com/bcsaller/jsonschema" + packages = ["."] + pruneopts = "" + revision = "66506e52db051b5e238aa63ec4dad0a790fbc236" + +[[projects]] digest = "1:de184b64adb3054bea074db0b1be1327c7dc3aaa04e3fd6cb01f62f339caecd5" name = "github.com/beorn7/perks" packages = ["quantile"] @@ -444,11 +451,11 @@ revision = "b99631de12cf04a906c1d4e4ec54fb86eae5863d" [[projects]] - digest = "1:9aceaa11417d9c5b31c0e9f47094739723046525efbb932381fe50a674a943f7" + digest = "1:de54a8a2f94ace7552f36b0eca53166f3751886e338cf5953e192d2e30123de5" name = "github.com/juju/bundlechanges" packages = ["."] pruneopts = "" - revision = "a15b892a41663fc698e6fb81c9e3d9e72fbe5c9c" + revision = "bb96ad9a5018f64e67f46f63496580c8956b4fbf" [[projects]] digest = "1:f720ea29e073a9a7109a5080f32753292dc8616a22a905876d425cc64c21bd8d" @@ -481,11 +488,11 @@ revision = "9be91dc79b7c185fa8b08e7ceceee40562055c83" [[projects]] - digest = "1:4a55f4e5a5f1e62e9bce9a18e6eca5324fdd52eac49a6bbadeb7928006ca1fc8" + digest = "1:9146a31e6c2252fd2b49741aa48619521515dab364e28a8df4385dbb6995c9ac" name = "github.com/juju/description" packages = ["."] pruneopts = "" - revision = "2f1dd3b325dc9708836d56063783a7ac72c71c3f" + revision = "adb93fec16ac45ed5e262d94f8dfe5f71210ea3f" [[projects]] digest = "1:594030c0f0ed3842773b68708d4f9716d809556b9c631460051f99b15057512d" @@ -584,14 +591,14 @@ revision = "a0ef8b74ebcffeeff9fc374854deb4af388f037e" [[projects]] - digest = "1:3be464a55a419d4c22383388f1204a9597c6cdc41d67ca4bc08848e688585279" + digest = "1:e460f07bec03866640127c47aae303167e9c79ee426c5fab03c180001eb4a39f" name = "github.com/juju/loggo" packages = [ ".", "loggocolor", ] pruneopts = "" - revision = "8232ab8918d91c72af1a9fb94d3edbe31d88b790" + revision = "6e530bcce5d8e1b51b8e5ee7f08a455cd0a8c2e5" [[projects]] digest = "1:8d1ee4a52b3d31b061d381552b5b31aa73f5c8cf96d8ce2322e0715ac47c87f0" @@ -623,14 +630,14 @@ revision = "5b81707e882b8293e6cf77854b4cd49f29776e11" [[projects]] - digest = "1:b1458f0d8143b434e0a31f1555844988bbda406b598b2e685e4cd101b3f3a7b3" + digest = "1:3e72155e0539d15e73b75829b9ba0878bd633ae44b5f4c34ed94b16038042032" name = "github.com/juju/os" packages = [ ".", "series", ] pruneopts = "" - revision = "0ffd1641ec10b98d99eabb23729a2156244da119" + revision = "88a4c6ac59c1950f118f058d920204c9182b9927" [[projects]] digest = "1:8fd6c21ba9a864b949672e63800d1bd71a3d8ac8e085cc22143b97f1261ad634" @@ -1031,7 +1038,7 @@ version = "v1.0.0-rc1" [[projects]] - digest = "1:5b6cfb1e5aa514a8ea62ebbda2f23874e5aa86fa1792f2c6f1643dc7538f7f45" + digest = "1:a5f72b318ab8d863ccb8c16468eeff36cafb6357d9f1f90197df7ca7f53dbe5e" name = "github.com/oracle/oci-go-sdk" packages = [ "common", @@ -1039,7 +1046,7 @@ "identity", ] pruneopts = "" - revision = "ad5c34ed0cf8169d6817e2a37ec3e4521f856368" + revision = "72941f7f9bfa6550f640b797fde43b19b1574911" [[projects]] branch = "master" @@ -1403,7 +1410,7 @@ version = "v0.2.3" [[projects]] - digest = "1:3bc94878ebb5ec72f58047fc1a613de37ba4ef2b0c152480c2b6400fa3a875a8" + digest = "1:116113ad2ba26a24f3c81618696697566a4c54603f5bcb028759de859059fa55" name = "gopkg.in/goose.v2" packages = [ ".", @@ -1429,7 +1436,7 @@ "testservices/swiftservice", ] pruneopts = "" - revision = "13b769d3462eedac5f8ec2458f8e61a0dfe54d51" + revision = "f18d0f2f8f9bc5b5234a338670210c4bf4328ab4" [[projects]] digest = "1:445becf3878aa9bd50dfa972bd65f974ed2468c09350ab9ce28b1e4adce464df" @@ -1461,7 +1468,7 @@ revision = "51fa6e26128d74e445c72d3a91af555151cc3654" [[projects]] - digest = "1:f6560765e17f77f08ebd7358a026f4ce6c2829123ce6f81b97e90aee8efb1613" + digest = "1:87acf5bcd274b72ff707bdd18abe2c3a19429ffc542035c2e4425571cdd0c780" name = "gopkg.in/juju/charm.v6" packages = [ ".", @@ -1469,7 +1476,7 @@ "resource", ] pruneopts = "" - revision = "b4861dc361873d2618454bcfb8656c6cb77fdf69" + revision = "52b617a34c5a360391bb84d0e7fe40912141ff17" [[projects]] digest = "1:86df7d2874a5250cf64324e2ce4e88fea552aa1f5c1a3f065599bd1f381ce939" @@ -1547,7 +1554,7 @@ revision = "fd59336b4621bc2a70bf96d9e2f49954115ad19b" [[projects]] - digest = "1:deb1b0b9f4c4a65246fc1cd82b9d9a3c2ac834a04ef899055853d44770e4c31d" + digest = "1:5081ff05b4471731df7fa7457083397c2663791cd5809858a899306cdfe29b63" name = "gopkg.in/juju/worker.v1" packages = [ ".", @@ -1557,7 +1564,7 @@ "workertest", ] pruneopts = "" - revision = "187c8117684679e0e261b1d6f488a404d1d093c9" + revision = "40da96d5fd22ba01076f56ba5fc6aa06315153c5" [[projects]] digest = "1:01aef8078808543c15a4cc0e669d92d37215564600e19ebabbd694939b727977" @@ -1871,6 +1878,7 @@ "github.com/altoros/gosigma/mock", "github.com/armon/go-metrics", "github.com/armon/go-metrics/prometheus", + "github.com/bcsaller/jsonschema", "github.com/bmizerany/pat", "github.com/coreos/go-systemd/dbus", "github.com/coreos/go-systemd/unit", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/Gopkg.toml juju-core-2.6.5/src/github.com/juju/juju/Gopkg.toml --- juju-core-2.6.2/src/github.com/juju/juju/Gopkg.toml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/Gopkg.toml 2019-06-28 17:10:43.000000000 +0000 @@ -58,11 +58,11 @@ name = "github.com/hashicorp/raft-boltdb" [[constraint]] - revision = "a15b892a41663fc698e6fb81c9e3d9e72fbe5c9c" + revision = "bb96ad9a5018f64e67f46f63496580c8956b4fbf" name = "github.com/juju/bundlechanges" [[constraint]] - revision = "2f1dd3b325dc9708836d56063783a7ac72c71c3f" + revision = "adb93fec16ac45ed5e262d94f8dfe5f71210ea3f" name = "github.com/juju/description" [[constraint]] @@ -90,7 +90,7 @@ name = "github.com/juju/naturalsort" [[constraint]] - revision = "0ffd1641ec10b98d99eabb23729a2156244da119" + revision = "88a4c6ac59c1950f118f058d920204c9182b9927" name = "github.com/juju/os" [[constraint]] @@ -131,7 +131,7 @@ [[constraint]] name = "github.com/oracle/oci-go-sdk" - revision = "ad5c34ed0cf8169d6817e2a37ec3e4521f856368" + revision = "72941f7f9bfa6550f640b797fde43b19b1574911" [[constraint]] revision = "8c3190dff075bf5442c9eedbf8f8ed6144a099e7" @@ -147,7 +147,7 @@ [[constraint]] name = "gopkg.in/juju/charm.v6" - revision = "b4861dc361873d2618454bcfb8656c6cb77fdf69" + revision = "52b617a34c5a360391bb84d0e7fe40912141ff17" [[constraint]] revision = "7778a447283bd71109671c20818544514e16e9d9" @@ -312,7 +312,7 @@ [[constraint]] name = "github.com/juju/loggo" - revision = "8232ab8918d91c72af1a9fb94d3edbe31d88b790" + revision = "6e530bcce5d8e1b51b8e5ee7f08a455cd0a8c2e5" [[override]] name = "github.com/juju/lru" @@ -488,7 +488,7 @@ [[constraint]] name = "gopkg.in/goose.v2" - revision = "13b769d3462eedac5f8ec2458f8e61a0dfe54d51" + revision = "f18d0f2f8f9bc5b5234a338670210c4bf4328ab4" [[override]] name = "gopkg.in/httprequest.v1" @@ -500,7 +500,7 @@ [[constraint]] name = "gopkg.in/juju/worker.v1" - revision = "187c8117684679e0e261b1d6f488a404d1d093c9" + revision = "40da96d5fd22ba01076f56ba5fc6aa06315153c5" [[override]] name = "gopkg.in/macaroon-bakery.v1" @@ -535,3 +535,7 @@ [[constraint]] name = "k8s.io/apiextensions-apiserver" revision = "4d05e43ad98c1edcf2f52291685bd9bbc12fd2cd" + +[[constraint]] + revision = "66506e52db051b5e238aa63ec4dad0a790fbc236" + name = "github.com/bcsaller/jsonschema" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/Makefile juju-core-2.6.5/src/github.com/juju/juju/Makefile --- juju-core-2.6.2/src/github.com/juju/juju/Makefile 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/Makefile 2019-06-28 17:10:43.000000000 +0000 @@ -58,7 +58,7 @@ $(GOPATH)/bin/dep ensure -vendor-only $(verbose) endif -build: dep go-build +build: dep rebuild-schema go-build release-build: dep go-build @@ -73,7 +73,7 @@ test: dep go test $(CHECK_ARGS) -test.timeout=$(TEST_TIMEOUT) $(PROJECT_PACKAGES) -check.v -install: dep go-install +install: dep rebuild-schema go-install clean: go clean -n -r --cache --testcache $(PROJECT_PACKAGES) @@ -114,6 +114,15 @@ rebuild-dependencies: dep ensure -v -no-vendor $(dep-update) +rebuild-schema: + @echo "Generating facade schema..." +ifdef SCHEMA_PATH + @go run ./generate/schemagen/schemagen.go "$(SCHEMA_PATH)" +else + @go run ./generate/schemagen/schemagen.go \ + ./apiserver/facades/schema.json +endif + # Install packages required to develop Juju and run tests. The stable # PPA includes the required mongodb-server binaries. install-dependencies: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/network/address.go juju-core-2.6.5/src/github.com/juju/juju/network/address.go --- juju-core-2.6.2/src/github.com/juju/juju/network/address.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/network/address.go 2019-06-28 17:10:43.000000000 +0000 @@ -653,10 +653,10 @@ // because it can be used both as an IPv4 or IPv6 endpoint (e.g., in // IPv6-only networks). func ResolvableHostnames(addrs []Address) []Address { - resolveableAddrs := make([]Address, 0, len(addrs)) + resolvableAddrs := make([]Address, 0, len(addrs)) for _, addr := range addrs { if addr.Value == "localhost" || net.ParseIP(addr.Value) != nil { - resolveableAddrs = append(resolveableAddrs, addr) + resolvableAddrs = append(resolvableAddrs, addr) continue } _, err := netLookupIP(addr.Value) @@ -664,9 +664,9 @@ logger.Infof("removing unresolvable address %q: %v", addr.Value, err) continue } - resolveableAddrs = append(resolveableAddrs, addr) + resolvableAddrs = append(resolvableAddrs, addr) } - return resolveableAddrs + return resolvableAddrs } // MergedAddresses provides a single list of addresses without duplicates diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/config.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/config.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/config.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/config.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "strings" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-08-01/network" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" "github.com/juju/errors" "github.com/juju/schema" @@ -15,8 +16,15 @@ ) const ( + // configAttrStorageAccountType mirrors the storage SKU name in the Azure SDK + // + // The term "storage account" has been replaced with "SKU name" in recent + // Azure SDK, but we keep it to maintain backwards-compatibility. configAttrStorageAccountType = "storage-account-type" + // configAttrLoadBalancerSkuName mirrors the LoadBalancerSkuName type in the Azure SDK + configAttrLoadBalancerSkuName = "load-balancer-sku-name" + // The below bits are internal book-keeping things, rather than // configuration. Config is just what we have to work with. @@ -26,11 +34,13 @@ ) var configFields = schema.Fields{ - configAttrStorageAccountType: schema.String(), + configAttrStorageAccountType: schema.String(), + configAttrLoadBalancerSkuName: schema.String(), } var configDefaults = schema.Defaults{ - configAttrStorageAccountType: string(storage.StandardLRS), + configAttrStorageAccountType: string(storage.StandardLRS), + configAttrLoadBalancerSkuName: string(network.LoadBalancerSkuNameStandard), } var immutableConfigAttributes = []string{ @@ -39,11 +49,26 @@ type azureModelConfig struct { *config.Config - storageAccountType string + storageAccountType string + loadBalancerSkuName string } -var knownStorageAccountTypes = []string{ - "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", +// knownStorageAccountTypes returns a list of valid storage SKU names. +// +// The term "account type" is is used in previous versions of the Azure SDK. +func knownStorageAccountTypes() (accountTypes []string) { + for _, name := range storage.PossibleSkuNameValues() { + accountTypes = append(accountTypes, string(name)) + } + return accountTypes +} + +// knownLoadBalancerSkuNames returns a list of valid load balancer SKU names. +func knownLoadBalancerSkuNames() (skus []string) { + for _, name := range network.PossibleLoadBalancerSkuNameValues() { + skus = append(skus, string(name)) + } + return skus } // Validate ensures that the provided configuration is valid for this @@ -114,13 +139,31 @@ if !isKnownStorageAccountType(storageAccountType) { return nil, errors.Errorf( "invalid storage account type %q, expected one of: %q", - storageAccountType, knownStorageAccountTypes, + storageAccountType, knownStorageAccountTypes(), ) } + loadBalancerSkuName, ok := validated[configAttrLoadBalancerSkuName].(string) + if ok { + loadBalancerSkuNameTitle := strings.Title(loadBalancerSkuName) + if loadBalancerSkuName != loadBalancerSkuNameTitle { + loadBalancerSkuName = loadBalancerSkuNameTitle + logger.Infof("using %q for config parameter %s", loadBalancerSkuName, configAttrLoadBalancerSkuName) + } + if !isKnownLoadBalancerSkuName(loadBalancerSkuName) { + return nil, errors.Errorf( + "invalid load balancer SKU name %q, expected one of: %q", + loadBalancerSkuName, knownLoadBalancerSkuNames(), + ) + } + } else { + loadBalancerSkuName = string(network.LoadBalancerSkuNameStandard) + } + azureConfig := &azureModelConfig{ newCfg, storageAccountType, + loadBalancerSkuName, } return azureConfig, nil } @@ -128,11 +171,22 @@ // isKnownStorageAccountType reports whether or not the given string identifies // a known storage account type. func isKnownStorageAccountType(t string) bool { - for _, knownStorageAccountType := range knownStorageAccountTypes { + for _, knownStorageAccountType := range knownStorageAccountTypes() { if t == knownStorageAccountType { return true } } + return false +} + +// isKnownLoadBalancerSkuName reports whether or not the given string +// a valid storage SKU within the Azure SDK +func isKnownLoadBalancerSkuName(n string) bool { + for _, skuName := range knownLoadBalancerSkuNames() { + if n == skuName { + return true + } + } return false } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/config_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/config_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/config_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/config_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -42,7 +42,14 @@ func (s *configSuite) TestValidateInvalidStorageAccountType(c *gc.C) { s.assertConfigInvalid( c, testing.Attrs{"storage-account-type": "savings"}, - `invalid storage account type "savings", expected one of: \["Standard_LRS" "Standard_GRS" "Standard_RAGRS" "Standard_ZRS" "Premium_LRS"\]`, + `invalid storage account type "savings", expected one of: \["Premium_LRS" "Premium_ZRS" "Standard_GRS" "Standard_LRS" "Standard_RAGRS" "Standard_ZRS"\]`, + ) +} + +func (s *configSuite) TestValidateInvalidLoadBalancerSkuName(c *gc.C) { + s.assertConfigInvalid( + c, testing.Attrs{"load-balancer-sku-name": "premium"}, + `invalid load balancer SKU name "Premium", expected one of: \["Basic" "Standard"\]`, ) } @@ -71,6 +78,19 @@ c.Assert(err, gc.ErrorMatches, `cannot change immutable "storage-account-type" config \(Standard_LRS -> Premium_LRS\)`) } +func (s *configSuite) TestValidateLoadBalancerSkuNameCanChange(c *gc.C) { + cfgOld := makeTestModelConfig(c, testing.Attrs{"load-balancer-sku-name": "Standard"}) + _, err := s.provider.Validate(cfgOld, cfgOld) + c.Assert(err, jc.ErrorIsNil) + + cfgNew := makeTestModelConfig(c, testing.Attrs{"load-balancer-sku-name": "Basic"}) + _, err = s.provider.Validate(cfgNew, cfgOld) + c.Assert(err, jc.ErrorIsNil) + + _, err = s.provider.Validate(cfgOld, cfgNew) + c.Assert(err, jc.ErrorIsNil) +} + func (s *configSuite) assertConfigValid(c *gc.C, attrs testing.Attrs) { cfg := makeTestModelConfig(c, attrs) _, err := s.provider.Validate(cfg, nil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -495,6 +495,7 @@ } if seriesOS == os.Windows { if instanceSpec.InstanceType.RootDisk < windowsMinRootDiskMB { + logger.Infof("root disk size has been increased to 127GiB") instanceSpec.InstanceType.RootDisk = windowsMinRootDiskMB } } @@ -654,7 +655,7 @@ ) var ( availabilitySetProperties interface{} - availabilityStorageOptions *storage.Sku + availabilityStorageOptions armtemplates.Sku ) if maybeStorageAccount == nil { // This model uses managed disks; we must create @@ -669,9 +670,7 @@ PlatformFaultDomainCount: to.Int32Ptr(maxFaultDomains(env.location)), } // Availability needs to be 'Aligned' to support managed disks. - availabilityStorageOptions = &storage.Sku{ - Name: "Aligned", - } + availabilityStorageOptions.Name = "Aligned" } resources = append(resources, armtemplates.Resource{ APIVersion: computeAPIVersion, @@ -680,7 +679,7 @@ Location: env.location, Tags: envTags, Properties: availabilitySetProperties, - StorageSku: availabilityStorageOptions, + Sku: &availabilityStorageOptions, }) availabilitySetSubResource = &compute.SubResource{ ID: to.StringPtr(availabilitySetId), @@ -690,16 +689,20 @@ publicIPAddressName := vmName + "-public-ip" publicIPAddressId := fmt.Sprintf(`[resourceId('Microsoft.Network/publicIPAddresses', '%s')]`, publicIPAddressName) + publicIPAddressAllocationMethod := network.Static + if env.config.loadBalancerSkuName == string(network.LoadBalancerSkuNameBasic) { + publicIPAddressAllocationMethod = network.Dynamic // preserve the settings that were used in Juju 2.4 and earlier + } resources = append(resources, armtemplates.Resource{ APIVersion: networkAPIVersion, Type: "Microsoft.Network/publicIPAddresses", Name: publicIPAddressName, Location: env.location, Tags: vmTags, - StorageSku: &storage.Sku{Name: "Standard", Tier: "Regional"}, + Sku: &armtemplates.Sku{Name: env.config.loadBalancerSkuName}, Properties: &network.PublicIPAddressPropertiesFormat{ PublicIPAddressVersion: network.IPv4, - PublicIPAllocationMethod: network.Static, + PublicIPAllocationMethod: publicIPAddressAllocationMethod, }, }) @@ -1532,6 +1535,11 @@ return env.allInstances(ctx, env.resourceGroup, true /* refresh addresses */, false /* all instances */) } +// AllRunningInstances is specified in the InstanceBroker interface. +func (env *azureEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return env.AllInstances(ctx) +} + // allInstances returns all of the instances in the given resource group, // and optionally ensures that each instance's addresses are up-to-date. func (env *azureEnviron) allInstances( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environprovider.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environprovider.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environprovider.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environprovider.go 2019-06-28 17:10:43.000000000 +0000 @@ -65,6 +65,10 @@ // AzureCLI is the interface the to Azure CLI (az) command. AzureCLI AzureCLI + + // LoadBalancerSkuName is the load balancer SKU name. + // Legal values are determined by the Azure SDK. + LoadBalancerSkuName string } // Validate validates the Azure provider configuration. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environ_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environ_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/environ_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/environ_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -522,7 +522,7 @@ sender.AppendResponse(mocks.NewResponseWithContent("{}")) s.sender = azuretesting.Senders{sender} s.requests = nil - env.AllInstances(s.callCtx) // trigger a query + env.AllRunningInstances(s.callCtx) // trigger a query c.Assert(s.requests, gc.HasLen, 1) c.Assert(s.requests[0].URL.Host, gc.Equals, "api.azurestack.local") @@ -534,7 +534,7 @@ s.requests = nil c.Assert(s.invalidatedCredential, jc.IsFalse) - env.AllInstances(s.callCtx) // trigger a query + env.AllRunningInstances(s.callCtx) // trigger a query c.Assert(s.requests, gc.HasLen, 1) c.Assert(s.requests[0].URL.Host, gc.Equals, "api.azurestack.local") c.Assert(s.invalidatedCredential, jc.IsTrue) @@ -987,9 +987,7 @@ Name: storageAccountName, Location: "westus", Tags: to.StringMap(s.envTags), - StorageSku: &storage.Sku{ - Name: storage.SkuName("Standard_LRS"), - }, + Sku: &armtemplates.Sku{Name: "Standard_LRS"}, }) vmDependsOn = append(vmDependsOn, `[resourceId('Microsoft.Storage/storageAccounts', '`+storageAccountName+`')]`, @@ -1008,15 +1006,13 @@ ) var ( availabilitySetProperties interface{} - availabilityStorageOptions *storage.Sku + availabilityStorageOptions armtemplates.Sku ) if !args.unmanagedStorage { availabilitySetProperties = &compute.AvailabilitySetProperties{ PlatformFaultDomainCount: to.Int32Ptr(3), } - availabilityStorageOptions = &storage.Sku{ - Name: "Aligned", - } + availabilityStorageOptions.Name = "Aligned" } templateResources = append(templateResources, armtemplates.Resource{ APIVersion: computeAPIVersion, @@ -1025,7 +1021,7 @@ Location: "westus", Tags: to.StringMap(s.envTags), Properties: availabilitySetProperties, - StorageSku: availabilityStorageOptions, + Sku: &availabilityStorageOptions, }) availabilitySetSubResource = &compute.SubResource{ ID: to.StringPtr(availabilitySetId), @@ -1059,7 +1055,7 @@ PublicIPAllocationMethod: network.Static, PublicIPAddressVersion: "IPv4", }, - StorageSku: &storage.Sku{Name: "Standard", Tier: "Regional"}, + Sku: &armtemplates.Sku{Name: "Standard"}, }, { APIVersion: networkAPIVersion, Type: "Microsoft.Network/networkInterfaces", @@ -1334,7 +1330,7 @@ }) } -func (s *environSuite) TestAllInstancesResourceGroupNotFound(c *gc.C) { +func (s *environSuite) TestAllRunningInstancesResourceGroupNotFound(c *gc.C) { env := s.openEnviron(c) azure.SetRetries(env) sender := mocks.NewSender() @@ -1342,11 +1338,11 @@ "resource group not found", http.StatusNotFound, ), 2) s.sender = azuretesting.Senders{sender} - _, err := env.AllInstances(s.callCtx) + _, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) } -func (s *environSuite) TestAllInstancesIgnoresCommonDeployment(c *gc.C) { +func (s *environSuite) TestAllRunningInstancesIgnoresCommonDeployment(c *gc.C) { env := s.openEnviron(c) dependencies := []resources.Dependency{{ @@ -1365,7 +1361,7 @@ s.makeSender("/deployments", result), } - instances, err := env.AllInstances(s.callCtx) + instances, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 0) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/instance_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/instance_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/instance_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/instance_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -597,6 +597,15 @@ c.Assert(instances[1].Id(), gc.Equals, instance.Id("machine-1")) } +func (s *instanceSuite) TestAllRunningInstances(c *gc.C) { + s.sender = s.getInstancesSender() + instances, err := s.env.AllRunningInstances(s.callCtx) + c.Assert(err, jc.ErrorIsNil) + c.Assert(instances, gc.HasLen, 2) + c.Assert(instances[0].Id(), gc.Equals, instance.Id("machine-0")) + c.Assert(instances[1].Id(), gc.Equals, instance.Id("machine-1")) +} + func (s *instanceSuite) TestControllerInstances(c *gc.C) { *(*(*s.deployments[0].Properties.Dependencies)[0].DependsOn)[0].ResourceName = "juju-controller" s.sender = s.getInstancesSender() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/internal/armtemplates/template.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/internal/armtemplates/template.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/internal/armtemplates/template.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/internal/armtemplates/template.go 2019-06-28 17:10:43.000000000 +0000 @@ -3,8 +3,6 @@ package armtemplates -import "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" - const ( schema = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" contentVersion = "1.0.0.0" @@ -29,6 +27,13 @@ return m, nil } +// Sku represents an Azure SKU. Each API (compute/networking/storage) +// defines its own SKU types, but we use a common type because we +// don't require many fields. +type Sku struct { + Name string `json:"name,omitempty"` +} + // Resource describes a template resource. For information on the // individual fields, see https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/. type Resource struct { @@ -43,5 +48,5 @@ Resources []Resource `json:"resources,omitempty"` // Non-uniform attributes. - StorageSku *storage.Sku `json:"sku,omitempty"` + Sku *Sku `json:"sku,omitempty"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/storage.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/storage.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/storage.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/storage.go 2019-06-28 17:10:43.000000000 +0000 @@ -1001,8 +1001,6 @@ Name: accountName, Location: location, Tags: envTags, - StorageSku: &armstorage.Sku{ - Name: armstorage.SkuName(accountType), - }, + Sku: &armtemplates.Sku{Name: accountType}, } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/azure/upgrades_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/azure/upgrades_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/azure/upgrades_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/azure/upgrades_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,7 +9,6 @@ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-08-01/network" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" "github.com/Azure/go-autorest/autorest/mocks" "github.com/Azure/go-autorest/autorest/to" jc "github.com/juju/testing/checkers" @@ -174,9 +173,7 @@ Type: "Microsoft.Storage/storageAccounts", Name: storageAccountName, Location: "westus", - StorageSku: &storage.Sku{ - Name: storage.SkuName("Standard_LRS"), - }, + Sku: &armtemplates.Sku{Name: "Standard_LRS"}, }} var actual resources.Deployment diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/cloudsigma/environinstance.go juju-core-2.6.5/src/github.com/juju/juju/provider/cloudsigma/environinstance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/cloudsigma/environinstance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/cloudsigma/environinstance.go 2019-06-28 17:10:43.000000000 +0000 @@ -98,15 +98,24 @@ // AllInstances returns all instances currently known to the broker. func (env *environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return env.instancesForMethod(ctx, "AllInstances") +} + +// AllRunningInstances returns all running, available instances currently known to the broker. +func (env *environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return env.instancesForMethod(ctx, "AllRunningInstances") +} + +func (env *environ) instancesForMethod(ctx context.ProviderCallContext, method string) ([]instances.Instance, error) { // Please note that this must *not* return instances that have not been // allocated as part of this environment -- if it does, juju will see they // are not tracked in state, assume they're stale/rogue, and shut them down. - logger.Tracef("environ.AllInstances...") + logger.Tracef("environ.%v...", method) servers, err := env.client.instances() if err != nil { - logger.Tracef("environ.AllInstances failed: %v", err) + logger.Tracef("environ.%v failed: %v", method, err) return nil, err } @@ -117,7 +126,7 @@ } if logger.LogLevel() <= loggo.TRACE { - logger.Tracef("All instances, len = %d:", len(instances)) + logger.Tracef("%v, len = %d:", method, len(instances)) for _, instance := range instances { logger.Tracef("... id: %q, status: %q", instance.Id(), instance.Status(ctx)) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/cloudsigma/environinstance_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/cloudsigma/environinstance_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/cloudsigma/environinstance_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/cloudsigma/environinstance_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -93,7 +93,7 @@ func (s *environInstanceSuite) TestInstances(c *gc.C) { env := s.createEnviron(c, nil) - instances, err := env.AllInstances(s.callCtx) + instances, err := env.AllRunningInstances(s.callCtx) c.Assert(instances, gc.NotNil) c.Assert(err, gc.IsNil) c.Check(instances, gc.HasLen, 0) @@ -103,7 +103,7 @@ addTestClientServer(c, jujuMetaInstanceServer, "other-model") addTestClientServer(c, jujuMetaInstanceController, "other-model") - instances, err = env.AllInstances(s.callCtx) + instances, err = env.AllRunningInstances(s.callCtx) c.Assert(instances, gc.NotNil) c.Assert(err, gc.IsNil) c.Check(instances, gc.HasLen, 2) @@ -149,7 +149,7 @@ environ := s.createEnviron(c, nil) - instances, err := environ.AllInstances(s.callCtx) + instances, err := environ.AllRunningInstances(s.callCtx) c.Assert(instances, gc.IsNil) c.Assert(err, gc.NotNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/availabilityzones.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/availabilityzones.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/availabilityzones.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/availabilityzones.go 2019-06-28 17:10:43.000000000 +0000 @@ -84,12 +84,12 @@ // ordered by name. // // If the specified group is empty, then it will behave as if the result of -// AllInstances were provided. +// AllRunningInstances were provided. func AvailabilityZoneAllocations( env ZonedEnviron, ctx context.ProviderCallContext, group []instance.Id, ) ([]AvailabilityZoneInstances, error) { if len(group) == 0 { - instances, err := env.AllInstances(ctx) + instances, err := env.AllRunningInstances(ctx) if err != nil { return nil, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/availabilityzones_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/availabilityzones_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/availabilityzones_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/availabilityzones_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -51,7 +51,7 @@ } } -func (s *AvailabilityZoneSuite) TestAvailabilityZoneAllocationsAllInstances(c *gc.C) { +func (s *AvailabilityZoneSuite) TestAvailabilityZoneAllocationsAllRunningInstances(c *gc.C) { var called int s.PatchValue(&s.env.instanceAvailabilityZoneNames, func(ctx context.ProviderCallContext, ids []instance.Id) ([]string, error) { c.Assert(ids, gc.DeepEquals, []instance.Id{"inst0", "inst1", "inst2"}) @@ -72,7 +72,7 @@ }}) } -func (s *AvailabilityZoneSuite) TestAvailabilityZoneAllocationsAllInstancesErrors(c *gc.C) { +func (s *AvailabilityZoneSuite) TestAvailabilityZoneAllocationsAllRunningInstancesErrors(c *gc.C) { resultErr := fmt.Errorf("oh noes") s.PatchValue(&s.env.allInstances, func(context.ProviderCallContext) ([]instances.Instance, error) { return nil, resultErr diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/instance_configurator.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/instance_configurator.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/instance_configurator.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/instance_configurator.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,6 +20,7 @@ // Implementations of this interface should provide a way to configure external // IP allocation and add firewall functionality. +//go:generate mockgen -package mocks -destination mocks/instance_configurator.go github.com/juju/juju/provider/common InstanceConfigurator type InstanceConfigurator interface { // Close all ports. @@ -117,9 +118,6 @@ cmds := ConfigureExternalIpAddressCommands(apiPort) output, err := c.runCommand(strings.Join(cmds, "\n")) if err != nil { - return errors.Errorf("failed to drop all ports: %s", output) - } - if err != nil { return errors.Errorf("failed to allocate external IP address: %s", output) } logger.Tracef("configure external ip address output: %s", output) @@ -139,7 +137,7 @@ output, err := c.runCommand(strings.Join(cmds, "\n")) if err != nil { - return errors.Errorf("failed to configure ports on external network: %s", output) + return errors.Annotatef(err, "configuring ports for address %q: %s", ipAddress, output) } logger.Tracef("change ports output: %s", output) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/mocks/instance_configurator.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/mocks/instance_configurator.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/mocks/instance_configurator.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/mocks/instance_configurator.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,83 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/juju/provider/common (interfaces: InstanceConfigurator) + +// Package mocks is a generated GoMock package. +package mocks + +import ( + gomock "github.com/golang/mock/gomock" + network "github.com/juju/juju/network" + reflect "reflect" +) + +// MockInstanceConfigurator is a mock of InstanceConfigurator interface +type MockInstanceConfigurator struct { + ctrl *gomock.Controller + recorder *MockInstanceConfiguratorMockRecorder +} + +// MockInstanceConfiguratorMockRecorder is the mock recorder for MockInstanceConfigurator +type MockInstanceConfiguratorMockRecorder struct { + mock *MockInstanceConfigurator +} + +// NewMockInstanceConfigurator creates a new mock instance +func NewMockInstanceConfigurator(ctrl *gomock.Controller) *MockInstanceConfigurator { + mock := &MockInstanceConfigurator{ctrl: ctrl} + mock.recorder = &MockInstanceConfiguratorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockInstanceConfigurator) EXPECT() *MockInstanceConfiguratorMockRecorder { + return m.recorder +} + +// ChangeIngressRules mocks base method +func (m *MockInstanceConfigurator) ChangeIngressRules(arg0 string, arg1 bool, arg2 []network.IngressRule) error { + ret := m.ctrl.Call(m, "ChangeIngressRules", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// ChangeIngressRules indicates an expected call of ChangeIngressRules +func (mr *MockInstanceConfiguratorMockRecorder) ChangeIngressRules(arg0, arg1, arg2 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChangeIngressRules", reflect.TypeOf((*MockInstanceConfigurator)(nil).ChangeIngressRules), arg0, arg1, arg2) +} + +// ConfigureExternalIpAddress mocks base method +func (m *MockInstanceConfigurator) ConfigureExternalIpAddress(arg0 int) error { + ret := m.ctrl.Call(m, "ConfigureExternalIpAddress", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// ConfigureExternalIpAddress indicates an expected call of ConfigureExternalIpAddress +func (mr *MockInstanceConfiguratorMockRecorder) ConfigureExternalIpAddress(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigureExternalIpAddress", reflect.TypeOf((*MockInstanceConfigurator)(nil).ConfigureExternalIpAddress), arg0) +} + +// DropAllPorts mocks base method +func (m *MockInstanceConfigurator) DropAllPorts(arg0 []int, arg1 string) error { + ret := m.ctrl.Call(m, "DropAllPorts", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DropAllPorts indicates an expected call of DropAllPorts +func (mr *MockInstanceConfiguratorMockRecorder) DropAllPorts(arg0, arg1 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DropAllPorts", reflect.TypeOf((*MockInstanceConfigurator)(nil).DropAllPorts), arg0, arg1) +} + +// FindIngressRules mocks base method +func (m *MockInstanceConfigurator) FindIngressRules() ([]network.IngressRule, error) { + ret := m.ctrl.Call(m, "FindIngressRules") + ret0, _ := ret[0].([]network.IngressRule) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FindIngressRules indicates an expected call of FindIngressRules +func (mr *MockInstanceConfiguratorMockRecorder) FindIngressRules() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindIngressRules", reflect.TypeOf((*MockInstanceConfigurator)(nil).FindIngressRules)) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/mocks/zoned_environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/mocks/zoned_environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/mocks/zoned_environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/mocks/zoned_environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,17 +5,19 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" - constraints "github.com/juju/juju/core/constraints" - instance "github.com/juju/juju/core/instance" - environs "github.com/juju/juju/environs" - config "github.com/juju/juju/environs/config" - context "github.com/juju/juju/environs/context" - instances "github.com/juju/juju/environs/instances" - common "github.com/juju/juju/provider/common" - storage "github.com/juju/juju/storage" - version "github.com/juju/version" - reflect "reflect" + "reflect" + + "github.com/golang/mock/gomock" + "github.com/juju/version" + + "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/instance" + "github.com/juju/juju/environs" + "github.com/juju/juju/environs/config" + "github.com/juju/juju/environs/context" + "github.com/juju/juju/environs/instances" + "github.com/juju/juju/provider/common" + "github.com/juju/juju/storage" ) // MockZonedEnviron is a mock of ZonedEnviron interface @@ -66,6 +68,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockZonedEnviron)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockZonedEnviron) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockZonedEnvironMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockZonedEnviron)(nil).AllRunningInstances), arg0) +} + // AvailabilityZones mocks base method func (m *MockZonedEnviron) AvailabilityZones(arg0 context.ProviderCallContext) ([]common.AvailabilityZone, error) { ret := m.ctrl.Call(m, "AvailabilityZones", arg0) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/common/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/common/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/common/mock_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/common/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -47,6 +47,10 @@ return env.allInstances(ctx) } +func (env *mockEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return env.allInstances(ctx) +} + func (env *mockEnviron) Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error) { return env.instances(ctx, ids) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/dummy/environs.go juju-core-2.6.5/src/github.com/juju/juju/provider/dummy/environs.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/dummy/environs.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/dummy/environs.go 2019-06-28 17:10:43.000000000 +0000 @@ -1601,8 +1601,16 @@ } func (e *environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return e.instancesForMethod(ctx, "AllInstances") +} + +func (e *environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return e.instancesForMethod(ctx, "AllRunningInstances") +} + +func (e *environ) instancesForMethod(ctx context.ProviderCallContext, method string) ([]instances.Instance, error) { defer delay() - if err := e.checkBroken("AllInstances"); err != nil { + if err := e.checkBroken(method); err != nil { return nil, err } var insts []instances.Instance diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/dummy/leasestore.go juju-core-2.6.5/src/github.com/juju/juju/provider/dummy/leasestore.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/dummy/leasestore.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/dummy/leasestore.go 2019-06-28 17:10:43.000000000 +0000 @@ -135,6 +135,21 @@ return results } +// LeaseGroup is part of lease.Store. +func (s *leaseStore) LeaseGroup(namespace, modelUUID string) map[lease.Key]lease.Info { + leases := s.Leases() + if len(leases) == 0 { + return leases + } + results := make(map[lease.Key]lease.Info) + for key, info := range leases { + if key.Namespace == namespace && key.ModelUUID == modelUUID { + results[key] = info + } + } + return results +} + // Refresh is part of lease.Store. func (s *leaseStore) Refresh() error { return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -583,7 +583,7 @@ } switch { - case subnetErr != nil && errors.IsNotFound(subnetErr): + case isNotFoundError(subnetErr): return nil, errors.Trace(subnetErr) case subnetErr != nil: return nil, errors.Annotatef(maybeConvertCredentialError(subnetErr, ctx), "getting subnets for zone %q", availabilityZone) @@ -1182,6 +1182,14 @@ // AllInstances is part of the environs.InstanceBroker interface. func (e *environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // We want to return everything we find here except for instances that are + // "shutting-down" - they are on the way to be terminated - or already "terminated". + // From https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html + return e.AllInstancesByState(ctx, "rebooting", "pending", "running", "stopping", "stopped") +} + +// AllRunningInstances is part of the environs.InstanceBroker interface. +func (e *environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { return e.AllInstancesByState(ctx, "pending", "running") } @@ -1191,7 +1199,7 @@ // NOTE(axw) we use security group filtering here because instances // start out untagged. If Juju were to abort after starting an instance, // but before tagging it, it would be leaked. We only need to do this - // for AllInstances, as it is the result of AllInstances that is used + // for AllRunningInstances, as it is the result of AllRunningInstances that is used // in "harvesting" unknown instances by the provisioner. // // One possible alternative is to modify ec2.RunInstances to allow the @@ -1654,7 +1662,6 @@ // SecurityGroupCleaner defines provider instance methods needed to delete // a security group. type SecurityGroupCleaner interface { - // DeleteSecurityGroup deletes security group on the provider. DeleteSecurityGroup(group ec2.SecurityGroup) (resp *ec2.SimpleResp, err error) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/live_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/live_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/live_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/live_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -145,7 +145,7 @@ func (t *LiveTests) TestControllerInstances(c *gc.C) { t.BootstrapOnce(c) - allInsts, err := t.Env.AllInstances(t.callCtx) + allInsts, err := t.Env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(allInsts, gc.HasLen, 1) // bootstrap instance bootstrapInstId := allInsts[0].Id() @@ -163,7 +163,7 @@ func (t *LiveTests) TestInstanceGroups(c *gc.C) { t.BootstrapOnce(c) - allInsts, err := t.Env.AllInstances(t.callCtx) + allInsts, err := t.Env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(allInsts, gc.HasLen, 1) // bootstrap instance bootstrapInstId := allInsts[0].Id() @@ -281,7 +281,7 @@ insts, err := t.Env.Instances(t.callCtx, instIds) c.Assert(err, jc.ErrorIsNil) c.Assert(instIds, jc.SameContents, idsFromInsts(insts)) - allInsts, err = t.Env.AllInstances(t.callCtx) + allInsts, err = t.Env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) // ignore the bootstrap instance for i, inst := range allInsts { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/local_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/local_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/local_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/local_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -381,7 +381,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(instanceIds, gc.HasLen, 1) - insts, err := env.AllInstances(t.callCtx) + insts, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(insts[0].Id(), gc.Equals, instanceIds[0]) @@ -459,7 +459,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(instanceIds, gc.HasLen, 1) - insts, err := env.AllInstances(t.callCtx) + insts, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(insts[0].Id(), gc.Equals, instanceIds[0]) @@ -529,7 +529,7 @@ c.Assert(err, jc.ErrorIsNil) t.BaseSuite.PatchValue(ec2.DeleteSecurityGroupInsistently, deleteSecurityGroupForTestFunc) - insts, err := env.AllInstances(t.callCtx) + insts, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) idsToStop := make([]instance.Id, len(insts)+1) for i, one := range insts { @@ -587,7 +587,7 @@ func (t *localServerSuite) TestInstanceSecurityGroupsWitheInstanceStatusFilter(c *gc.C) { env := t.prepareAndBootstrap(c) - insts, err := env.AllInstances(t.callCtx) + insts, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) ids := make([]instance.Id, len(insts)) for i, one := range insts { @@ -676,7 +676,7 @@ c.Assert(volumeResults[0].Error, jc.ErrorIsNil) assertInstances := func(expect ...instance.Id) { - insts, err := env.AllInstances(t.callCtx) + insts, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) ids := make([]instance.Id, len(insts)) for i, inst := range insts { @@ -1757,7 +1757,7 @@ func (t *localServerSuite) TestInstanceTags(c *gc.C) { env := t.prepareAndBootstrap(c) - instances, err := env.AllInstances(t.callCtx) + instances, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) @@ -1773,7 +1773,7 @@ func (t *localServerSuite) TestRootDiskTags(c *gc.C) { env := t.prepareAndBootstrap(c) - instances, err := env.AllInstances(t.callCtx) + instances, err := env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) @@ -1799,7 +1799,7 @@ func (s *localServerSuite) TestBootstrapInstanceConstraints(c *gc.C) { env := s.prepareAndBootstrap(c) - inst, err := env.AllInstances(s.callCtx) + inst, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(inst, gc.HasLen, 1) ec2inst := ec2.InstanceEC2(inst[0]) @@ -1816,7 +1816,7 @@ func (s *localServerSuite) TestAdoptResources(c *gc.C) { controllerEnv := s.prepareAndBootstrap(c) - controllerInsts, err := controllerEnv.AllInstances(s.callCtx) + controllerInsts, err := controllerEnv.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(controllerInsts, gc.HasLen, 1) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/provider.go juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/provider.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/provider.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/provider.go 2019-06-28 17:10:43.000000000 +0000 @@ -231,9 +231,9 @@ case "SignatureDoesNotMatch": return convert(common.CredentialNotValidf(err, badKeys)) case "OptInRequired": - return errors.Annotate(err, unauthorized) + return convert(common.CredentialNotValidf(err, unauthorized)) case "UnauthorizedOperation": - return errors.Annotate(err, unauthorized) + return convert(common.CredentialNotValidf(err, unauthorized)) default: // This error is unrelated to access keys, account or credentials... return err diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/provider_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/provider_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/ec2/provider_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/ec2/provider_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -172,7 +172,7 @@ } { err := ec2.MaybeConvertCredentialError(&ec2cloud.Error{Code: code}, context.NewCloudCallContext()) c.Assert(err, gc.NotNil) - c.Assert(err, gc.Not(jc.Satisfies), common.IsCredentialNotValid) + c.Assert(err, jc.Satisfies, common.IsCredentialNotValid) c.Assert(err.Error(), jc.Contains, fmt.Sprintf("\nPlease subscribe to the requested Amazon service. \n"+ "You are currently not authorized to use it.\n"+ "New Amazon accounts might take some time to be activated while \n"+ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/credentials.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/credentials.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/credentials.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/credentials.go 2019-06-28 17:10:43.000000000 +0000 @@ -52,7 +52,7 @@ cloud.JSONFileAuthType: {{ Name: credAttrFile, CredentialAttr: cloud.CredentialAttr{ - Description: "path to the .json file containing your Google Compute Engine project credentials", + Description: "path to the .json file containing a service account key for your project\n(detailed instructions available at https://discourse.jujucharms.com/t/1508).\nPath", FilePath: true, }, }}, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_broker.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_broker.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -300,6 +300,26 @@ // AllInstances implements environs.InstanceBroker. func (env *environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // We want all statuses here except for "terminated" - these instances are truly dead to us. + // According to https://cloud.google.com/compute/docs/instances/instance-life-cycle + // there are now only "provisioning", "staging", "running", "stopping" and "terminated" states. + // The others might have been needed for older versions of gce... Keeping here for potential + // backward compatibility. + nonLiveStatuses := []string{ + google.StatusDone, + google.StatusDown, + google.StatusProvisioning, + google.StatusStopped, + google.StatusStopping, + google.StatusUp, + } + filters := append(instStatuses, nonLiveStatuses...) + instances, err := getInstances(env, ctx, filters...) + return instances, errors.Trace(err) +} + +// AllRunningInstances implements environs.InstanceBroker. +func (env *environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { instances, err := getInstances(env, ctx) return instances, errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_broker_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_broker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_broker_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_broker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -283,10 +283,10 @@ c.Check(*hwc.RootDisk, gc.Equals, uint64(15360)) } -func (s *environBrokerSuite) TestAllInstances(c *gc.C) { +func (s *environBrokerSuite) TestAllRunningInstances(c *gc.C) { s.FakeEnviron.Insts = []instances.Instance{s.Instance} - insts, err := s.Env.AllInstances(s.CallCtx) + insts, err := s.Env.AllRunningInstances(s.CallCtx) c.Assert(err, jc.ErrorIsNil) c.Check(insts, jc.DeepEquals, []instances.Instance{s.Instance}) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_instance.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_instance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/environ_instance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/environ_instance.go 2019-06-28 17:10:43.000000000 +0000 @@ -67,13 +67,16 @@ return results, err } -var getInstances = func(env *environ, ctx context.ProviderCallContext) ([]instances.Instance, error) { - return env.instances(ctx) +var getInstances = func(env *environ, ctx context.ProviderCallContext, statusFilters ...string) ([]instances.Instance, error) { + return env.instances(ctx, statusFilters...) } -func (env *environ) gceInstances(ctx context.ProviderCallContext) ([]google.Instance, error) { +func (env *environ) gceInstances(ctx context.ProviderCallContext, statusFilters ...string) ([]google.Instance, error) { prefix := env.namespace.Prefix() - instances, err := env.gce.Instances(prefix, instStatuses...) + if len(statusFilters) == 0 { + statusFilters = instStatuses + } + instances, err := env.gce.Instances(prefix, statusFilters...) return instances, google.HandleCredentialError(errors.Trace(err), ctx) } @@ -82,8 +85,8 @@ // "juju--machine-*". This is important because otherwise juju // will see they are not tracked in state, assume they're stale/rogue, // and shut them down. -func (env *environ) instances(ctx context.ProviderCallContext) ([]instances.Instance, error) { - gceInstances, err := env.gceInstances(ctx) +func (env *environ) instances(ctx context.ProviderCallContext, statusFilters ...string) ([]instances.Instance, error) { + gceInstances, err := env.gceInstances(ctx, statusFilters...) err = errors.Trace(err) // Turn google.Instance values into *environInstance values, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_instance.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_instance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_instance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_instance.go 2019-06-28 17:10:43.000000000 +0000 @@ -90,16 +90,19 @@ func (gce *Connection) removeInstance(id, zone string) error { err := gce.raw.RemoveInstance(gce.projectID, zone, id) if err != nil { + if IsNotFound(err) { + return nil + } // TODO(ericsnow) Try removing the firewall anyway? return errors.Trace(err) } fwname := id err = gce.raw.RemoveFirewall(gce.projectID, fwname) - if errors.IsNotFound(err) { - return nil - } if err != nil { + if IsNotFound(err) { + return nil + } return errors.Trace(err) } return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_instance_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_instance_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_instance_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_instance_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -118,12 +118,13 @@ func (s *connSuite) TestConnectionAddInstanceWaitFailed(c *gc.C) { s.FakeConn.Instance = &s.RawInstanceFull - failure := s.NewWaitError(nil, errors.New("unknown")) + cause := errors.New("unknown") + failure := s.NewWaitError(nil, cause) s.FakeConn.Err = failure err := google.ConnAddInstance(s.Conn, &s.RawInstance, "mtype", "a-zone") - c.Check(errors.Cause(err), gc.Equals, failure) + c.Check(errors.Cause(err), gc.Equals, cause) } func (s *connSuite) TestConnectionAddInstanceGetFailed(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_network.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_network.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/conn_network.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/conn_network.go 2019-06-28 17:10:43.000000000 +0000 @@ -21,7 +21,7 @@ // returned. func (gce Connection) firewallRules(fwname string) (ruleSet, error) { firewalls, err := gce.raw.GetFirewalls(gce.projectID, fwname) - if errors.IsNotFound(err) { + if IsNotFound(err) { return make(ruleSet), nil } if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/errors.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/errors.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/errors.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/errors.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "strings" "github.com/juju/errors" + "google.golang.org/api/googleapi" "github.com/juju/juju/environs/context" ) @@ -90,27 +91,48 @@ return false } - // http/url.Error is constructed with status code in mind and, at the time of writing for go-1.10, - // contains response status code and description in error.Error. - // We have to examine the error message to determine whether the error is related to authentication failure. - if cause, ok := errors.Cause(err).(*url.Error); ok { - for code, desc := range AuthorisationFailureStatusCodes { + var cause error + switch e := errors.Cause(err).(type) { + case *url.Error: + cause = e + case *googleapi.Error: + cause = e + default: + return false + } + + for code, descs := range AuthorisationFailureStatusCodes { + for _, desc := range descs { if strings.Contains(cause.Error(), fmt.Sprintf(": %v %v", code, desc)) { return true } } } return false - } -// AuthorisationFailureStatusCodes contains http status code nad description that signify authorisation difficulties. -var AuthorisationFailureStatusCodes = map[int]string{ - http.StatusUnauthorized: "Unauthorized", - http.StatusPaymentRequired: "Payment Required", - http.StatusForbidden: "Forbidden", - http.StatusProxyAuthRequired: "Proxy Auth Required", +// AuthorisationFailureStatusCodes contains http status code and +// description that signify authorisation difficulties. +// +// Google does not always use standard HTTP descriptions, which +// is why a single status code can map to multiple descriptions. +var AuthorisationFailureStatusCodes = map[int][]string{ + http.StatusUnauthorized: {"Unauthorized"}, + http.StatusPaymentRequired: {"Payment Required"}, + http.StatusForbidden: {"Forbidden", "Access Not Configured"}, + http.StatusProxyAuthRequired: {"Proxy Auth Required"}, // OAuth 2.0 also implements RFC#6749, so we need to cater for specific BadRequest errors. // https://tools.ietf.org/html/rfc6749#section-5.2 - http.StatusBadRequest: "Bad Request", + http.StatusBadRequest: {"Bad Request"}, +} + +// IsNotFound reports if given error is of 'not found' type. +func IsNotFound(err error) bool { + if err == nil { + return false + } + if gerr, ok := errors.Cause(err).(*googleapi.Error); ok { + return gerr.Code == http.StatusNotFound + } + return errors.IsNotFound(errors.Cause(err)) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/errors_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/errors_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/errors_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/errors_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -61,11 +61,20 @@ google.HandleCredentialError(s.googleError, ctx) c.Assert(called, jc.IsFalse) - for code, desc := range google.AuthorisationFailureStatusCodes { - called = false - s.internalError.SetMessage(code, desc) + for code, descs := range google.AuthorisationFailureStatusCodes { + for _, desc := range descs { + called = false + s.internalError.SetMessage(code, desc) + google.HandleCredentialError(s.googleError, ctx) + c.Assert(called, jc.IsTrue) + } + } + + called = false + for code := range google.AuthorisationFailureStatusCodes { + s.internalError.SetMessage(code, "Some strange error") google.HandleCredentialError(s.googleError, ctx) - c.Assert(called, jc.IsTrue) + c.Assert(called, jc.IsFalse) } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/export_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,6 +18,7 @@ FirewallSpec = firewallSpec ExtractAddresses = extractAddresses NewRuleSetFromRules = newRuleSetFromRules + MatchesPrefix = matchesPrefix ) func SetRawConn(conn *Connection, raw rawConnectionWrapper) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/network_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/network_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/network_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/network_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -59,12 +59,16 @@ func (s *networkSuite) TestFirewallSpec(c *gc.C) { ports := map[string][]corenetwork.PortRange{ - "tcp": {{FromPort: 80, ToPort: 81}, {FromPort: 8888, ToPort: 8888}}, - "udp": {{FromPort: 1234, ToPort: 1234}}, + "tcp": {{FromPort: 80, ToPort: 81}, {FromPort: 8888, ToPort: 8888}}, + "udp": {{FromPort: 1234, ToPort: 1234}}, + "icmp": {{FromPort: -1, ToPort: -1}}, } fw := google.FirewallSpec("spam", "target", []string{"192.168.1.0/24", "10.0.0.0/24"}, ports) allowed := []*compute.FirewallAllowed{{ + IPProtocol: "icmp", + Ports: []string{}, + }, { IPProtocol: "tcp", Ports: []string{"80-81", "8888"}, }, { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/raw.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/raw.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/raw.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/raw.go 2019-06-28 17:10:43.000000000 +0000 @@ -100,8 +100,7 @@ // We are guaranteed the insert failed at the point. return errors.Annotate(err, "sending new instance request") } - - err = rc.waitOperation(projectID, operation, attemptsLong) + err = rc.waitOperation(projectID, operation, attemptsLong, logOperationErrors) return errors.Trace(err) } @@ -111,11 +110,14 @@ if err != nil { return errors.Trace(err) } - - err = rc.waitOperation(projectID, operation, attemptsLong) + err = rc.waitOperation(projectID, operation, attemptsLong, returnNotFoundOperationErrors) return errors.Trace(err) } +func matchesPrefix(firewallName, namePrefix string) bool { + return firewallName == namePrefix || strings.HasPrefix(firewallName, namePrefix+"-") +} + func (rc *rawConn) GetFirewalls(projectID, namePrefix string) ([]*compute.Firewall, error) { call := rc.Firewalls.List(projectID) firewallList, err := call.Do() @@ -128,7 +130,7 @@ } var result []*compute.Firewall for _, fw := range firewallList.Items { - if strings.HasPrefix(fw.Name, namePrefix) { + if matchesPrefix(fw.Name, namePrefix) { result = append(result, fw) } } @@ -141,8 +143,7 @@ if err != nil { return errors.Trace(err) } - - err = rc.waitOperation(projectID, operation, attemptsLong) + err = rc.waitOperation(projectID, operation, attemptsLong, logOperationErrors) return errors.Trace(err) } @@ -152,11 +153,37 @@ if err != nil { return errors.Trace(err) } - - err = rc.waitOperation(projectID, operation, attemptsLong) + err = rc.waitOperation(projectID, operation, attemptsLong, logOperationErrors) return errors.Trace(err) } +type handleOperationErrors func(operation *compute.Operation) error + +func returnNotFoundOperationErrors(operation *compute.Operation) error { + if operation.Error != nil { + result := waitError{operation, nil} + for _, err := range operation.Error.Errors { + if err.Code == "RESOURCE_NOT_FOUND" { + result.cause = errors.NotFoundf("%v: resource", err.Message) + continue + } + logger.Errorf("GCE operation error: (%s) %s", err.Code, err.Message) + } + return result + } + return nil +} + +func logOperationErrors(operation *compute.Operation) error { + if operation.Error != nil { + for _, err := range operation.Error.Errors { + logger.Errorf("GCE operation error: (%s) %s", err.Code, err.Message) + } + return waitError{operation, nil} + } + return nil +} + func (rc *rawConn) RemoveFirewall(projectID, name string) error { call := rc.Firewalls.Delete(projectID, name) operation, err := call.Do() @@ -164,7 +191,7 @@ return errors.Trace(convertRawAPIError(err)) } - err = rc.waitOperation(projectID, operation, attemptsLong) + err = rc.waitOperation(projectID, operation, attemptsLong, returnNotFoundOperationErrors) return errors.Trace(convertRawAPIError(err)) } @@ -212,7 +239,7 @@ if err != nil { return errors.Annotate(err, "could not create a new disk") } - return errors.Trace(rc.waitOperation(project, op, attemptsLong)) + return errors.Trace(rc.waitOperation(project, op, attemptsLong, logOperationErrors)) } func (rc *rawConn) ListDisks(project string) ([]*compute.Disk, error) { @@ -242,7 +269,7 @@ if err != nil { return errors.Annotatef(err, "could not delete disk %q", id) } - return errors.Trace(rc.waitOperation(project, op, attemptsLong)) + return errors.Trace(rc.waitOperation(project, op, attemptsLong, returnNotFoundOperationErrors)) } func (rc *rawConn) GetDisk(project, zone, id string) (*compute.Disk, error) { @@ -303,6 +330,13 @@ return fmt.Sprintf("GCE operation %q failed", err.op.Name) } +func (err waitError) Cause() error { + if err.cause != nil { + return err.cause + } + return err +} + func isWaitError(err error) bool { _, ok := err.(*waitError) return ok @@ -343,7 +377,7 @@ // attempts) and may time out. // // TODO(katco): 2016-08-09: lp:1611427 -func (rc *rawConn) waitOperation(projectID string, op *compute.Operation, attempts utils.AttemptStrategy) error { +func (rc *rawConn) waitOperation(projectID string, op *compute.Operation, attempts utils.AttemptStrategy, f handleOperationErrors) error { // TODO(perrito666) 2016-05-02 lp:1558657 started := time.Now() logger.Infof("GCE operation %q, waiting...", op.Name) @@ -363,11 +397,8 @@ err := errors.Errorf("timed out after %d seconds", time.Now().Sub(started)/time.Second) return waitError{op, err} } - if op.Error != nil { - for _, err := range op.Error.Errors { - logger.Errorf("GCE operation error: (%s) %s", err.Code, err.Message) - } - return waitError{op, nil} + if err := f(op); err != nil { + return err } logger.Infof("GCE operation %q finished", op.Name) @@ -390,7 +421,7 @@ if err != nil { return errors.Trace(err) } - err = rc.waitOperation(projectID, op, attemptsLong) + err = rc.waitOperation(projectID, op, attemptsLong, logOperationErrors) return errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/raw_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/raw_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/raw_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/raw_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,8 +19,9 @@ // TODO(katco): 2016-08-09: lp:1611427 strategy utils.AttemptStrategy - callCount int - opCallErr error + handleOperationErrorsF handleOperationErrors + callCount int + opCallErr error } var _ = gc.Suite(&rawConnSuite{}) @@ -45,6 +46,7 @@ s.callCount++ return s.op, s.opCallErr }) + s.handleOperationErrorsF = logOperationErrors } func (s *rawConnSuite) TestConnectionCheckOperationError(c *gc.C) { @@ -88,7 +90,7 @@ func (s *rawConnSuite) TestConnectionWaitOperation(c *gc.C) { original := &compute.Operation{} - err := s.rawConn.waitOperation("proj", original, s.strategy) + err := s.rawConn.waitOperation("proj", original, s.strategy, s.handleOperationErrorsF) c.Check(err, jc.ErrorIsNil) c.Check(s.callCount, gc.Equals, 1) @@ -98,7 +100,7 @@ original := &compute.Operation{ Status: StatusDone, } - err := s.rawConn.waitOperation("proj", original, s.strategy) + err := s.rawConn.waitOperation("proj", original, s.strategy, s.handleOperationErrorsF) c.Check(err, jc.ErrorIsNil) c.Check(s.callCount, gc.Equals, 0) @@ -115,7 +117,7 @@ }) original := &compute.Operation{} - err := s.rawConn.waitOperation("proj", original, s.strategy) + err := s.rawConn.waitOperation("proj", original, s.strategy, s.handleOperationErrorsF) c.Check(err, jc.ErrorIsNil) c.Check(s.callCount, gc.Equals, 2) @@ -123,7 +125,7 @@ func (s *rawConnSuite) TestConnectionWaitOperationTimeout(c *gc.C) { s.op.Status = StatusRunning - err := s.rawConn.waitOperation("proj", s.op, s.strategy) + err := s.rawConn.waitOperation("proj", s.op, s.strategy, s.handleOperationErrorsF) c.Check(err, gc.ErrorMatches, ".* timed out .*") c.Check(s.callCount, gc.Equals, 4) @@ -133,7 +135,7 @@ s.opCallErr = errors.New("") original := &compute.Operation{} - err := s.rawConn.waitOperation("proj", original, s.strategy) + err := s.rawConn.waitOperation("proj", original, s.strategy, s.handleOperationErrorsF) c.Check(err, gc.ErrorMatches, ".*") c.Check(s.callCount, gc.Equals, 1) @@ -144,8 +146,27 @@ s.op.Name = "testing-wait-operation-error" original := &compute.Operation{} - err := s.rawConn.waitOperation("proj", original, s.strategy) + err := s.rawConn.waitOperation("proj", original, s.strategy, s.handleOperationErrorsF) c.Check(err, gc.ErrorMatches, `.* "testing-wait-operation-error" .*`) c.Check(s.callCount, gc.Equals, 1) } + +type firewallNameSuite struct{} + +var _ = gc.Suite(&firewallNameSuite{}) + +func (s *firewallNameSuite) TestSimplePattern(c *gc.C) { + res := MatchesPrefix("juju-3-123", "juju-3") + c.Assert(res, gc.Equals, true) +} + +func (s *firewallNameSuite) TestExactMatch(c *gc.C) { + res := MatchesPrefix("juju-3", "juju-3") + c.Assert(res, gc.Equals, true) +} + +func (s *firewallNameSuite) TestThatJujuMachineIDsDoNotCollide(c *gc.C) { + res := MatchesPrefix("juju-30-123", "juju-3") + c.Assert(res, gc.Equals, false) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/ruleset.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/ruleset.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/ruleset.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/ruleset.go 2019-06-28 17:10:43.000000000 +0000 @@ -218,6 +218,11 @@ // for the given protocol. func (pp protocolPorts) portStrings(protocol string) []string { var result []string + // Google doesn't permit a range of ports for the ICMP protocol + // https://web.archive.org/web/20190521045119/https://cloud.google.com/vpc/docs/firewalls#protocols_and_ports + if protocol == "icmp" { + return result + } ports := pp[protocol] for _, pr := range ports { portStr := fmt.Sprintf("%d", pr.FromPort) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/ruleset_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/ruleset_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/google/ruleset_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/google/ruleset_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -25,7 +25,8 @@ rule2 := network.MustNewIngressRule("tcp", 80, 80) rule3 := network.MustNewIngressRule("tcp", 79, 81) rule4 := network.MustNewIngressRule("udp", 5123, 8099, "192.168.1.0/24") - return newRuleSetFromRules(rule1, rule2, rule3, rule4) + rule5 := network.MustNewIngressRule("icmp", -1, -1) + return newRuleSetFromRules(rule1, rule2, rule3, rule4, rule5) } func (s *RuleSetSuite) TestNewRuleSetFromRules(c *gc.C) { @@ -34,7 +35,8 @@ "b42e18366a": &firewall{ SourceCIDRs: []string{"0.0.0.0/0"}, AllowedPorts: protocolPorts{ - "tcp": []corenetwork.PortRange{{8000, 8099, "tcp"}, {80, 80, "tcp"}, {79, 81, "tcp"}}, + "tcp": []corenetwork.PortRange{{8000, 8099, "tcp"}, {80, 80, "tcp"}, {79, 81, "tcp"}}, + "icmp": []corenetwork.PortRange{{-1, -1, "icmp"}}, }, }, "d01a825c13": &firewall{ @@ -171,7 +173,8 @@ c.Assert(fw, gc.DeepEquals, &firewall{ SourceCIDRs: []string{"0.0.0.0/0"}, AllowedPorts: protocolPorts{ - "tcp": []corenetwork.PortRange{{8000, 8099, "tcp"}, {80, 80, "tcp"}, {79, 81, "tcp"}}, + "tcp": []corenetwork.PortRange{{8000, 8099, "tcp"}, {80, 80, "tcp"}, {79, 81, "tcp"}}, + "icmp": []corenetwork.PortRange{{-1, -1, "icmp"}}, }, }) fw, ok = ruleset.matchSourceCIDRs([]string{"1.2.3.0/24"}) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/gce/testing_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/gce/testing_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/gce/testing_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/gce/testing_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -435,7 +435,7 @@ Spec *instances.InstanceSpec } -func (fe *fakeEnviron) GetInstances(env *environ, ctx context.ProviderCallContext) ([]instances.Instance, error) { +func (fe *fakeEnviron) GetInstances(env *environ, ctx context.ProviderCallContext, statusFilters ...string) ([]instances.Instance, error) { fe.addCall("GetInstances", FakeCallArgs{ "switch": env, }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/joyent/environ_instance.go juju-core-2.6.5/src/github.com/juju/juju/provider/joyent/environ_instance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/joyent/environ_instance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/joyent/environ_instance.go 2019-06-28 17:10:43.000000000 +0000 @@ -191,7 +191,19 @@ return "tag." + aKey } +// AllInstances implements environs.InstanceBroker. func (env *joyentEnviron) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // From https://apidocs.joyent.com/cloudapi/#appendix-a-machine-states. + return env.filteredInstances(ctx, "provisioning", "running", "stopping", "stopped", "deleted", "failed") +} + +// AllRunningInstances implements environs.InstanceBroker. +func (env *joyentEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + return env.filteredInstances(ctx, "provisioning", "running") +} + +// AllRunningInstances implements environs.InstanceBroker. +func (env *joyentEnviron) filteredInstances(ctx context.ProviderCallContext, statusFilters ...string) ([]instances.Instance, error) { instances := []instances.Instance{} filter := cloudapi.NewFilter() @@ -203,8 +215,16 @@ return nil, errors.Annotate(err, "cannot retrieve instances") } + match := func(current string) bool { + for _, one := range statusFilters { + if strings.EqualFold(current, one) { + return true + } + } + return false + } for _, m := range machines { - if strings.EqualFold(m.State, "provisioning") || strings.EqualFold(m.State, "running") { + if match(m.State) { copy := m instances = append(instances, &joyentInstance{machine: ©, env: env}) } @@ -223,7 +243,7 @@ instances := make([]instances.Instance, len(ids)) found := 0 - allInstances, err := env.AllInstances(ctx) + allInstances, err := env.AllRunningInstances(ctx) if err != nil { return nil, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/joyent/local_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/joyent/local_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/joyent/local_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/joyent/local_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -328,7 +328,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(instanceIds, gc.HasLen, 1) - insts, err := env.AllInstances(s.callCtx) + insts, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(instanceIds[0], gc.Equals, insts[0].Id()) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/lxd/environ_broker.go juju-core-2.6.5/src/github.com/juju/juju/provider/lxd/environ_broker.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/lxd/environ_broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/lxd/environ_broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -324,6 +324,12 @@ return instances, errors.Trace(err) } +// AllRunningInstances implements environs.InstanceBroker. +func (env *environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // We can only get Alive containers from lxd api which means that "all" is the same as "running". + return env.AllInstances(ctx) +} + // StopInstances implements environs.InstanceBroker. func (env *environ) StopInstances(ctx context.ProviderCallContext, instances ...instance.Id) error { prefix := env.namespace.Prefix() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -2076,11 +2076,17 @@ return nil } -// AllInstances returns all the instances.Instance in this provider. +// AllInstances implements environs.InstanceBroker. func (env *maasEnviron) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { return env.acquiredInstances(ctx, nil) } +// AllRunningInstances implements environs.InstanceBroker. +func (env *maasEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // We always get all instances here, so "all" is the same as "running". + return env.AllInstances(ctx) +} + // Storage is defined by the Environ interface. func (env *maasEnviron) Storage() storage.Storage { env.ecfgMutex.Lock() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environprovider_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environprovider_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environprovider_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environprovider_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -142,7 +142,7 @@ c.Assert(err, jc.ErrorIsNil) suite.addNode(`{"system_id":"test-allocated"}`) - _, err = env.AllInstances(suite.callCtx) + _, err = env.AllRunningInstances(suite.callCtx) c.Assert(err, jc.ErrorIsNil) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -101,17 +101,17 @@ c.Check(instances, gc.IsNil) } -func (suite *environSuite) TestAllInstances(c *gc.C) { +func (suite *environSuite) TestAllRunningInstances(c *gc.C) { id := suite.addNode(allocatedNode) - instances, err := suite.makeEnviron().AllInstances(suite.callCtx) + instances, err := suite.makeEnviron().AllRunningInstances(suite.callCtx) c.Check(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) c.Assert(instances[0].Id(), gc.Equals, id) } -func (suite *environSuite) TestAllInstancesReturnsEmptySliceIfNoInstance(c *gc.C) { - instances, err := suite.makeEnviron().AllInstances(suite.callCtx) +func (suite *environSuite) TestAllRunningInstancesReturnsEmptySliceIfNoInstance(c *gc.C) { + instances, err := suite.makeEnviron().AllRunningInstances(suite.callCtx) c.Check(err, jc.ErrorIsNil) c.Check(instances, gc.HasLen, 0) @@ -172,7 +172,7 @@ instanceIds, err := env.ControllerInstances(suite.callCtx, suite.controllerUUID) c.Assert(err, jc.ErrorIsNil) c.Assert(instanceIds, gc.HasLen, 1) - insts, err := env.AllInstances(suite.callCtx) + insts, err := env.AllRunningInstances(suite.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(insts[0].Id(), gc.Equals, instanceIds[0]) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/maas/maas2_environ_whitebox_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/maas/maas2_environ_whitebox_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/maas/maas2_environ_whitebox_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/maas/maas2_environ_whitebox_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -114,11 +114,11 @@ return env } -func (suite *maas2EnvironSuite) TestAllInstances(c *gc.C) { +func (suite *maas2EnvironSuite) TestAllRunningInstances(c *gc.C) { env := suite.makeEnvironWithMachines( c, []string{}, []string{"tuco", "tio", "gus"}, ) - result, err := env.AllInstances(suite.callCtx) + result, err := env.AllRunningInstances(suite.callCtx) c.Assert(err, jc.ErrorIsNil) expectedMachines := set.NewStrings("tuco", "tio", "gus") actualMachines := set.NewStrings() @@ -128,10 +128,10 @@ c.Assert(actualMachines, gc.DeepEquals, expectedMachines) } -func (suite *maas2EnvironSuite) TestAllInstancesError(c *gc.C) { +func (suite *maas2EnvironSuite) TestAllRunningInstancesError(c *gc.C) { controller := &fakeController{machinesError: errors.New("Something terrible!")} env := suite.makeEnviron(c, controller) - _, err := env.AllInstances(suite.callCtx) + _, err := env.AllRunningInstances(suite.callCtx) c.Assert(err, gc.ErrorMatches, "Something terrible!") } @@ -2250,7 +2250,7 @@ instanceIds, err := env.ControllerInstances(suite.callCtx, suite.controllerUUID) c.Assert(err, jc.ErrorIsNil) c.Assert(instanceIds, gc.HasLen, 1) - insts, err := env.AllInstances(suite.callCtx) + insts, err := env.AllRunningInstances(suite.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(insts[0].Id(), gc.Equals, instanceIds[0]) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/manual/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/manual/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/manual/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/manual/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -74,10 +74,17 @@ return errNoStopInstance } +// AllInstances implements environs.InstanceBroker. func (e *manualEnviron) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { return e.Instances(ctx, []instance.Id{BootstrapInstanceId}) } +// AllRunningInstances implements environs.InstanceBroker. +func (e *manualEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // All instances and all running instance is the same for manual. + return e.AllInstances(ctx) +} + func (e *manualEnviron) envConfig() (cfg *environConfig) { e.mu.Lock() cfg = e.cfg @@ -241,10 +248,8 @@ // DestroyController implements the Environ interface. func (e *manualEnviron) DestroyController(ctx context.ProviderCallContext, controllerUUID string) error { script := ` -# Signal the jujud process to stop, then check it has done so before cleaning-up -# after it. +# Signal the jujud process to stop, then check it has done so. set -x -touch %[1]s stopped=0 function wait_for_jujud { @@ -269,19 +274,14 @@ [[ $stopped -ne 1 ]] && { # If jujud didn't stop nicely, we kill it hard here. - %[2]spkill -SIGKILL jujud && wait_for_jujud + %[1]spkill -SIGKILL jujud && wait_for_jujud } [[ $stopped -ne 1 ]] && { - echo jujud removal failed + echo stopping jujud failed logger --id $(ps -o pid,cmd,state -p $(pgrep jujud) | awk 'NR != 1 {printf("Process %%d (%%s) has state %%s\n", $1, $2, $3)}') exit 1 } -service %[3]s stop && logger --id stopped %[3]s -apt-get -y purge juju-mongo* -apt-get -y autoremove -rm -f /etc/init/juju* -rm -f /etc/systemd/system{,/multi-user.target.wants}/juju* -rm -fr %[4]s %[5]s +service %[2]s stop && logger --id stopped %[2]s exit 0 ` var diagnostics string @@ -295,17 +295,8 @@ } script = fmt.Sprintf( script, - // WARNING: this is linked with the use of uninstallFile in - // the agent package. Don't change it without extreme care, - // and handling for mismatches with already-deployed agents. - utils.ShQuote(path.Join( - agent.DefaultPaths.DataDir, - agent.UninstallFile, - )), diagnostics, mongo.ServiceName, - utils.ShQuote(agent.DefaultPaths.DataDir), - utils.ShQuote(agent.DefaultPaths.LogDir), ) logger.Tracef("destroy controller script: %s", script) stdout, stderr, err := runSSHCommand( @@ -317,7 +308,21 @@ return err } -func (*manualEnviron) PrecheckInstance(context.ProviderCallContext, environs.PrecheckInstanceParams) error { +func (e *manualEnviron) PrecheckInstance(ctx context.ProviderCallContext, params environs.PrecheckInstanceParams) error { + validator, err := e.ConstraintsValidator(ctx) + if err != nil { + return err + } + + if _, err = validator.Validate(params.Constraints); err != nil { + return err + } + + // Fix for #1829559 + if params.Placement == "" { + return nil + } + return errors.New(`use "juju add-machine ssh:[user@]" to provision machines`) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/manual/environ_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/manual/environ_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/manual/environ_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/manual/environ_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -86,10 +86,8 @@ c.Assert(host, gc.Equals, "ubuntu@hostname") c.Assert(command, gc.DeepEquals, []string{"sudo", "/bin/bash"}) c.Assert(stdin, gc.Equals, ` -# Signal the jujud process to stop, then check it has done so before cleaning-up -# after it. +# Signal the jujud process to stop, then check it has done so. set -x -touch '/var/lib/juju/uninstall-agent' stopped=0 function wait_for_jujud { @@ -117,16 +115,11 @@ pkill -SIGKILL jujud && wait_for_jujud } [[ $stopped -ne 1 ]] && { - echo jujud removal failed + echo stopping jujud failed logger --id $(ps -o pid,cmd,state -p $(pgrep jujud) | awk 'NR != 1 {printf("Process %d (%s) has state %s\n", $1, $2, $3)}') exit 1 } service juju-db stop && logger --id stopped juju-db -apt-get -y purge juju-mongo* -apt-get -y autoremove -rm -f /etc/init/juju* -rm -f /etc/systemd/system{,/multi-user.target.wants}/juju* -rm -fr '/var/lib/juju' '/var/log/juju' exit 0 `) return resultStdout, "", resultErr @@ -190,6 +183,29 @@ c.Assert(err, jc.ErrorIsNil) } +func (s *environSuite) TestPrecheck(c *gc.C) { + // Patch os.Args so it appears that we're running in "jujud", and then + // patch the host arch so it looks like we're running amd64. + s.PatchValue(&os.Args, []string{"/some/where/containing/jujud", "whatever"}) + s.PatchValue(&arch.HostArch, func() string { return arch.AMD64 }) + + constraint := constraints.MustParse("arch=amd64") + + // Prechecks with an explicit placement should fail + err := s.env.PrecheckInstance(s.callCtx, environs.PrecheckInstanceParams{ + Placement: "42", + Constraints: constraint, + }) + c.Assert(err, gc.Not(gc.IsNil)) + c.Assert(err.Error(), gc.Equals, `use "juju add-machine ssh:[user@]" to provision machines`) + + // Prechecks with no placement should work if the constraints match + err = s.env.PrecheckInstance(s.callCtx, environs.PrecheckInstanceParams{ + Constraints: constraint, + }) + c.Assert(err, jc.ErrorIsNil) +} + type controllerInstancesSuite struct { baseEnvironSuite } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -445,13 +445,10 @@ } switch operatingSystem { case os.Ubuntu: - fwCmd := fmt.Sprintf( - "/sbin/iptables -I INPUT -p tcp --dport %d -j ACCEPT", apiPort) - cloudcfg.AddRunCmd(fwCmd) + cloudcfg.AddRunCmd(fmt.Sprintf("/sbin/iptables -I INPUT -p tcp --dport %d -j ACCEPT", apiPort)) cloudcfg.AddScripts("/etc/init.d/netfilter-persistent save") case os.CentOS: - fwCmd := fmt.Sprintf("firewall-cmd --zone=public --add-port=%d/tcp --permanent", apiPort) - cloudcfg.AddRunCmd(fwCmd) + cloudcfg.AddRunCmd(fmt.Sprintf("firewall-cmd --zone=public --add-port=%d/tcp --permanent", apiPort)) cloudcfg.AddRunCmd("firewall-cmd --reload") } return cloudcfg, nil @@ -585,9 +582,9 @@ return nil, errors.Annotate(err, "cannot make user data") } - var rootDiskSizeGB int + var rootDiskSizeGB int64 if args.Constraints.RootDisk != nil { - rootDiskSizeGB = int(*args.Constraints.RootDisk) / 1024 + rootDiskSizeGB = int64(*args.Constraints.RootDisk) / 1024 if int(*args.Constraints.RootDisk) < MinVolumeSizeMB { logger.Warningf( "selected disk size is too small (%d MB). Setting root disk size to minimum volume size (%d MB)", @@ -752,6 +749,13 @@ return ret, nil } +// AllRunningInstances implements environs.InstanceBroker. +func (e *Environ) AllRunningInstances(ctx envcontext.ProviderCallContext) ([]instances.Instance, error) { + // e.allInstances() returns all but 'terminated' instances already, so + // "all instances is the same as "all running" instances here. + return e.AllInstances(ctx) +} + // MaintainInstance implements environs.InstanceBroker. func (e *Environ) MaintainInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) error { return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/environ_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/environ_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/environ_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/environ_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -777,7 +777,7 @@ } -func (e *environSuite) TestAllInstances(c *gc.C) { +func (e *environSuite) TestAllRunningInstances(c *gc.C) { ctrl := e.patchEnv(c) defer ctrl.Finish() @@ -785,12 +785,12 @@ context.Background(), e.listInstancesRequest).Return( e.listInstancesResponse, nil) - ids, err := e.env.AllInstances(nil) + ids, err := e.env.AllRunningInstances(nil) c.Assert(err, gc.IsNil) c.Check(len(ids), gc.Equals, 2) } -func (e *environSuite) TestAllInstancesExtraUnrelatedInstance(c *gc.C) { +func (e *environSuite) TestAllRunningInstancesExtraUnrelatedInstance(c *gc.C) { ctrl := e.patchEnv(c) defer ctrl.Finish() @@ -804,7 +804,7 @@ context.Background(), e.listInstancesRequest).Return( e.listInstancesResponse, nil) - ids, err := e.env.AllInstances(nil) + ids, err := e.env.AllRunningInstances(nil) c.Assert(err, gc.IsNil) c.Check(len(ids), gc.Equals, 2) } @@ -1091,7 +1091,7 @@ } func (e *environSuite) setupDeleteVolumesExpectations() { - size := 50 + size := int64(50) volumes := []ociCore.Volume{ { Id: makeStringPointer("fakeVolumeID1"), diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/export_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -3,18 +3,19 @@ package oci -import "github.com/juju/clock" +import ( + "github.com/juju/clock" + "github.com/juju/juju/provider/common" + "github.com/oracle/oci-go-sdk/core" +) var ( InstanceTypes = instanceTypes RefreshImageCache = refreshImageCache - FindInstanceSpec = findInstanceSpec - GetImageType = getImageType ShapeSpecs = shapeSpecs SetImageCache = setImageCache NewInstance = newInstance MaxPollIterations = &maxPollIterations - PollTime = &pollTime AllProtocols = allProtocols OciStorageProviderType = ociStorageProviderType OciVolumeType = ociVolumeType @@ -25,3 +26,15 @@ func (e *Environ) SetClock(clock clock.Clock) { e.clock = clock } + +func NewInstanceWithConfigurator( + raw core.Instance, env *Environ, factory func(string) common.InstanceConfigurator, +) (*ociInstance, error) { + i, err := newInstance(raw, env) + if err != nil { + return nil, err + } + + i.newInstanceConfigurator = factory + return i, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/instance.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/instance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/instance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/instance.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,14 +12,14 @@ "github.com/juju/errors" "github.com/juju/juju/core/status" + ociCore "github.com/oracle/oci-go-sdk/core" "github.com/juju/juju/core/instance" envcontext "github.com/juju/juju/environs/context" "github.com/juju/juju/environs/instances" "github.com/juju/juju/network" - "github.com/juju/juju/provider/oci/common" - - ociCore "github.com/oracle/oci-go-sdk/core" + "github.com/juju/juju/provider/common" + ocicommon "github.com/juju/juju/provider/oci/common" ) const ( @@ -31,12 +31,15 @@ ) type ociInstance struct { - arch string + raw ociCore.Instance instType *instances.InstanceType env *Environ - mutex sync.Mutex + arch string etag *string - raw ociCore.Instance + + newInstanceConfigurator func(string) common.InstanceConfigurator + + mutex sync.Mutex } type vnicWithIndex struct { @@ -46,9 +49,9 @@ var _ instances.Instance = (*ociInstance)(nil) var maxPollIterations = 30 -var pollTime time.Duration = 10 * time.Second +var pollTime = 10 * time.Second -var statusMap map[ociCore.InstanceLifecycleStateEnum]status.Status = map[ociCore.InstanceLifecycleStateEnum]status.Status{ +var statusMap = map[ociCore.InstanceLifecycleStateEnum]status.Status{ ociCore.InstanceLifecycleStateProvisioning: status.Provisioning, ociCore.InstanceLifecycleStateRunning: status.Running, ociCore.InstanceLifecycleStateStarting: status.Provisioning, @@ -66,13 +69,13 @@ "Instance response does not contain an ID", ) } - instance := &ociInstance{ - raw: raw, - env: env, - arch: "amd64", - } - return instance, nil + return &ociInstance{ + raw: raw, + env: env, + arch: "amd64", + newInstanceConfigurator: common.NewSshInstanceConfigurator, + }, nil } // SetInstance sets the raw property of ociInstance{} @@ -93,7 +96,7 @@ // Status implements instances.Instance func (o *ociInstance) Status(ctx envcontext.ProviderCallContext) instance.Status { if err := o.refresh(); err != nil { - common.HandleCredentialError(err, ctx) + ocicommon.HandleCredentialError(err, ctx) return instance.Status{} } state, ok := statusMap[o.raw.LifecycleState] @@ -135,8 +138,8 @@ if err != nil { return nil, errors.Trace(err) } - addresses := []network.Address{} + var addresses []network.Address for _, val := range vnics { if val.Vnic.PrivateIp != nil { privateAddress := network.Address{ @@ -161,7 +164,7 @@ // Addresses implements instances.Instance func (o *ociInstance) Addresses(ctx envcontext.ProviderCallContext) ([]network.Address, error) { addresses, err := o.getAddresses() - common.HandleCredentialError(err, ctx) + ocicommon.HandleCredentialError(err, ctx) return addresses, err } @@ -180,7 +183,7 @@ for { addresses, err := o.Addresses(ctx) if err != nil { - common.HandleCredentialError(err, ctx) + ocicommon.HandleCredentialError(err, ctx) return errors.Trace(err) } if iteration >= maxPollIterations { @@ -217,7 +220,7 @@ } response, err := o.env.Compute.TerminateInstance(context.Background(), request) if err != nil && !o.env.isNotFound(response.RawResponse) { - common.HandleCredentialError(err, ctx) + ocicommon.HandleCredentialError(err, ctx) return err } iteration := 0 @@ -226,7 +229,7 @@ if errors.IsNotFound(err) { break } - common.HandleCredentialError(err, ctx) + ocicommon.HandleCredentialError(err, ctx) return err } logger.Infof("Waiting for machine to transition to Terminating: %s", o.raw.LifecycleState) @@ -304,3 +307,62 @@ o.raw = response.Instance return nil } + +// OpenPorts (InstanceFirewaller) ensures that the input ingress rule is +// permitted for machine with the input ID. +func (o *ociInstance) OpenPorts( + ctx envcontext.ProviderCallContext, _ string, rules []network.IngressRule, +) error { + client, err := o.getInstanceConfigurator(ctx) + if err != nil { + return errors.Trace(err) + } + return errors.Trace(client.ChangeIngressRules("", true, rules)) +} + +// OpenPorts (InstanceFirewaller) ensures that the input ingress rule is +// restricted for machine with the input ID. +func (o *ociInstance) ClosePorts( + ctx envcontext.ProviderCallContext, _ string, rules []network.IngressRule, +) error { + client, err := o.getInstanceConfigurator(ctx) + if err != nil { + return errors.Trace(err) + } + return errors.Trace(client.ChangeIngressRules("", false, rules)) +} + +// IngressRules (InstanceFirewaller) returns the ingress rules that have been +// applied to the input machine ID. +func (o *ociInstance) IngressRules( + ctx envcontext.ProviderCallContext, _ string, +) ([]network.IngressRule, error) { + client, err := o.getInstanceConfigurator(ctx) + if err != nil { + return nil, errors.Trace(err) + } + + rules, err := client.FindIngressRules() + return rules, errors.Trace(err) +} + +func (o *ociInstance) getInstanceConfigurator( + ctx envcontext.ProviderCallContext, +) (common.InstanceConfigurator, error) { + addresses, err := o.Addresses(ctx) + if err != nil { + return nil, errors.Trace(err) + } + + // Try to find a public address. + // Different models use different VCNs (and therefore subnets), + // so the cloud-local IPs are no good if a controller is trying to + // configure an instance in another model. + for _, addr := range addresses { + if addr.Scope == network.ScopePublic { + return o.newInstanceConfigurator(addr.Value), nil + } + } + + return nil, errors.NotFoundf("public address for instance %q", o.Id()) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/instance_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/instance_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/instance_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/instance_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,14 +7,16 @@ "context" "strings" - gomock "github.com/golang/mock/gomock" - gc "gopkg.in/check.v1" - + "github.com/golang/mock/gomock" ociCore "github.com/oracle/oci-go-sdk/core" + gc "gopkg.in/check.v1" "github.com/juju/juju/core/instance" + corenetwork "github.com/juju/juju/core/network" "github.com/juju/juju/core/status" "github.com/juju/juju/network" + "github.com/juju/juju/provider/common" + "github.com/juju/juju/provider/common/mocks" "github.com/juju/juju/provider/oci" ) @@ -172,3 +174,31 @@ c.Check(addresses[0].Scope, gc.Equals, network.ScopeCloudLocal) c.Check(addresses[1].Scope, gc.Equals, network.ScopePublic) } + +func (i *instanceSuite) TestInstanceConfiguratorUsesPublicAddress(c *gc.C) { + ctrl := i.patchEnv(c) + defer ctrl.Finish() + + vnicID := "fakeVnicId" + i.setupListVnicsExpectations(i.testInstanceID, vnicID) + + rules := []network.IngressRule{{ + PortRange: corenetwork.PortRange{ + FromPort: 1234, + ToPort: 1234, + Protocol: "tcp", + }, + }} + + ic := mocks.NewMockInstanceConfigurator(ctrl) + ic.EXPECT().ChangeIngressRules("", true, rules).Return(nil) + + factory := func(addr string) common.InstanceConfigurator { + c.Assert(addr, gc.Equals, "2.2.2.2") + return ic + } + + inst, err := oci.NewInstanceWithConfigurator(*i.ociInstance, i.env, factory) + c.Assert(err, gc.IsNil) + c.Assert(inst.OpenPorts(nil, "", rules), gc.IsNil) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/networking.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/networking.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/networking.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/networking.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/errors" "github.com/juju/utils/set" + ociCore "github.com/oracle/oci-go-sdk/core" "gopkg.in/juju/names.v2" "github.com/juju/juju/core/instance" @@ -21,8 +22,6 @@ "github.com/juju/juju/environs/tags" "github.com/juju/juju/network" providerCommon "github.com/juju/juju/provider/oci/common" - - ociCore "github.com/oracle/oci-go-sdk/core" ) const ( @@ -50,9 +49,8 @@ resourcePollTimeout = 5 * time.Minute ) -func (e *Environ) vcnName(controllerUUID, modelUUID string) *string { - name := fmt.Sprintf("%s-%s-%s", VcnNamePrefix, controllerUUID, modelUUID) - return &name +func (e *Environ) vcnName(controllerUUID, modelUUID string) string { + return fmt.Sprintf("%s-%s-%s", VcnNamePrefix, controllerUUID, modelUUID) } func (e *Environ) getVCNStatus(vcnID *string) (string, error) { @@ -114,7 +112,7 @@ } func (e *Environ) secListName(controllerUUID, modelUUID string) string { - return fmt.Sprintf("juju-seclist-%s-%s", controllerUUID, modelUUID) + return fmt.Sprintf("%s-%s-%s", SecListNamePrefix, controllerUUID, modelUUID) } func (e *Environ) ensureVCN(controllerUUID, modelUUID string) (ociCore.Vcn, error) { @@ -127,11 +125,12 @@ } name := e.vcnName(controllerUUID, modelUUID) - logger.Debugf("creating new VCN %s", *name) + logger.Debugf("creating new VCN %s", name) + vcnDetails := ociCore.CreateVcnDetails{ CidrBlock: e.ecfg().addressSpace(), CompartmentId: e.ecfg().compartmentID(), - DisplayName: name, + DisplayName: &name, FreeformTags: map[string]string{ tags.JujuController: controllerUUID, tags.JujuModel: modelUUID, @@ -146,6 +145,7 @@ return ociCore.Vcn{}, errors.Trace(err) } logger.Debugf("VCN %s created. Waiting for status: %s", *result.Vcn.Id, string(ociCore.VcnLifecycleStateAvailable)) + err = e.waitForResourceStatus( e.getVCNStatus, result.Vcn.Id, string(ociCore.VcnLifecycleStateAvailable), @@ -157,7 +157,7 @@ return vcn, nil } -func (e *Environ) getSeclistStatus(resourceID *string) (string, error) { +func (e *Environ) getSecurityListStatus(resourceID *string) (string, error) { request := ociCore.GetSecurityListRequest{ SecurityListId: resourceID, } @@ -165,7 +165,7 @@ response, err := e.Firewall.GetSecurityList(context.Background(), request) if err != nil { if e.isNotFound(response.RawResponse) { - return "", errors.NotFoundf("seclist: %q", *resourceID) + return "", errors.NotFoundf("security list: %q", *resourceID) } else { return "", errors.Trace(err) } @@ -173,37 +173,34 @@ return string(response.SecurityList.LifecycleState), nil } -func (e *Environ) allSecurityLists(controllerUUID, modelUUID string, vcnid *string) ([]ociCore.SecurityList, error) { - ret := []ociCore.SecurityList{} +// jujuSecurityLists returns the security lists for the input VCN +// that were created by juju. +func (e *Environ) jujuSecurityLists(vcnId *string) ([]ociCore.SecurityList, error) { + var ret []ociCore.SecurityList + request := ociCore.ListSecurityListsRequest{ CompartmentId: e.ecfg().compartmentID(), - VcnId: vcnid, + VcnId: vcnId, } response, err := e.Firewall.ListSecurityLists(context.Background(), request) if err != nil { return nil, errors.Trace(err) } + if len(response.Items) == 0 { - return ret, errors.NotFoundf("security lists for vcn: %q", *vcnid) + return ret, errors.NotFoundf("security lists for vcn: %q", *vcnId) } for _, val := range response.Items { - tag, ok := val.FreeformTags[tags.JujuController] - if !ok || tag != controllerUUID { + if !strings.HasPrefix(*val.DisplayName, SecListNamePrefix) { continue } - if modelUUID != "" { - tag, ok = val.FreeformTags[tags.JujuModel] - if !ok || tag != modelUUID { - continue - } - } ret = append(ret, val) } return ret, nil } -func (e *Environ) getSecurityList(controllerUUID, modelUUID string, vcnid *string) (ociCore.SecurityList, error) { - seclist, err := e.allSecurityLists(controllerUUID, modelUUID, vcnid) +func (e *Environ) getSecurityList(controllerUUID, modelUUID string, vcnId *string) (ociCore.SecurityList, error) { + seclist, err := e.jujuSecurityLists(vcnId) if err != nil { return ociCore.SecurityList{}, errors.Trace(err) } @@ -213,7 +210,7 @@ } if len(seclist) == 0 { - return ociCore.SecurityList{}, errors.NotFoundf("security lists for vcn: %q", *vcnid) + return ociCore.SecurityList{}, errors.NotFoundf("security lists for vcn: %q", *vcnId) } return seclist[0], nil @@ -228,9 +225,11 @@ return seclist, nil } - prefix := AllowAllPrefix name := e.secListName(controllerUUID, modelUUID) + logger.Debugf("creating new security list %s", name) + // Hopefully just temporary, open all ingress/egress ports + prefix := AllowAllPrefix details := ociCore.CreateSecurityListDetails{ CompartmentId: e.ecfg().compartmentID(), VcnId: vcnid, @@ -261,9 +260,11 @@ if err != nil { return ociCore.SecurityList{}, errors.Trace(err) } + logger.Debugf("security list %s created. Waiting for status: %s", + *response.SecurityList.Id, string(ociCore.SecurityListLifecycleStateAvailable)) err = e.waitForResourceStatus( - e.getSeclistStatus, response.SecurityList.Id, + e.getSecurityListStatus, response.SecurityList.Id, string(ociCore.SecurityListLifecycleStateAvailable), resourcePollTimeout) if err != nil { @@ -360,7 +361,9 @@ return string(response.Subnet.LifecycleState), nil } -func (e *Environ) createSubnet(controllerUUID, modelUUID, ad, cidr string, vcnID *string, seclists []string, routeRableID *string) (ociCore.Subnet, error) { +func (e *Environ) createSubnet( + controllerUUID, modelUUID, ad, cidr string, vcnID *string, seclists []string, routeTableId *string, +) (ociCore.Subnet, error) { displayName := fmt.Sprintf("juju-%s-%s-%s", ad, controllerUUID, modelUUID) compartment := e.ecfg().compartmentID() // TODO(gsamfira): maybe "local" would be better? @@ -370,7 +373,7 @@ CompartmentId: compartment, VcnId: vcnID, DisplayName: &displayName, - RouteTableId: routeRableID, + RouteTableId: routeTableId, SecurityListIds: seclists, FreeformTags: map[string]string{ tags.JujuController: controllerUUID, @@ -396,7 +399,14 @@ return response.Subnet, nil } -func (e *Environ) ensureSubnets(ctx envcontext.ProviderCallContext, vcn ociCore.Vcn, secList ociCore.SecurityList, controllerUUID, modelUUID string, routeTableID *string) (map[string][]ociCore.Subnet, error) { +func (e *Environ) ensureSubnets( + ctx envcontext.ProviderCallContext, + vcn ociCore.Vcn, + secList ociCore.SecurityList, + controllerUUID string, + modelUUID string, + routeTableId *string, +) (map[string][]ociCore.Subnet, error) { az, err := e.AvailabilityZones(ctx) if err != nil { providerCommon.HandleCredentialError(err, ctx) @@ -431,7 +441,8 @@ providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } - newSubnet, err := e.createSubnet(controllerUUID, modelUUID, ad, newIPNet, vcn.Id, []string{*secList.Id}, routeTableID) + newSubnet, err := e.createSubnet( + controllerUUID, modelUUID, ad, newIPNet, vcn.Id, []string{*secList.Id}, routeTableId) if err != nil { providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) @@ -446,7 +457,9 @@ // ensureNetworksAndSubnets creates VCNs, security lists and subnets that will // be used throughout the life-cycle of this juju deployment. -func (e *Environ) ensureNetworksAndSubnets(ctx envcontext.ProviderCallContext, controllerUUID, modelUUID string) (map[string][]ociCore.Subnet, error) { +func (e *Environ) ensureNetworksAndSubnets( + ctx envcontext.ProviderCallContext, controllerUUID, modelUUID string, +) (map[string][]ociCore.Subnet, error) { // if we have the subnets field populated, it means we already checked/created // the necessary resources. Simply return. if e.subnets != nil { @@ -454,7 +467,6 @@ } vcn, err := e.ensureVCN(controllerUUID, modelUUID) if err != nil { - providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } @@ -470,13 +482,11 @@ // For now, we open all ports until we decide how to properly take care of this. secList, err := e.ensureSecurityList(controllerUUID, modelUUID, vcn.Id) if err != nil { - providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } ig, err := e.ensureInternetGateway(controllerUUID, modelUUID, vcn.Id) if err != nil { - providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } @@ -485,19 +495,18 @@ prefix := AllowAllPrefix routeRules := []ociCore.RouteRule{ { - CidrBlock: &prefix, + Destination: &prefix, + DestinationType: ociCore.RouteRuleDestinationTypeCidrBlock, NetworkEntityId: ig.Id, }, } routeTable, err := e.ensureRouteTable(controllerUUID, modelUUID, vcn.Id, routeRules) if err != nil { - providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } subnets, err := e.ensureSubnets(ctx, vcn, secList, controllerUUID, modelUUID, routeTable.Id) if err != nil { - providerCommon.HandleCredentialError(err, ctx) return nil, errors.Trace(err) } // TODO(gsamfira): should we use a lock here? @@ -529,12 +538,13 @@ } } if len(errorMessages) > 0 { - return errors.Errorf("the following errors occurred while cleaning up subnets: %q", strings.Join(errorMessages, "\n")) + return errors.Errorf("the following errors occurred while cleaning up subnets: %q", + strings.Join(errorMessages, "\n")) } return nil } -func (e *Environ) removeSeclist(secLists []ociCore.SecurityList) error { +func (e *Environ) removeSecurityLists(secLists []ociCore.SecurityList) error { for _, secList := range secLists { if secList.Id == nil { return nil @@ -548,7 +558,7 @@ return nil } err = e.waitForResourceStatus( - e.getSeclistStatus, secList.Id, + e.getSecurityListStatus, secList.Id, string(ociCore.SecurityListLifecycleStateTerminated), resourcePollTimeout) if !errors.IsNotFound(err) { @@ -586,7 +596,6 @@ // destroying the environment, and only after destroying any resources that may be attached // to a network. func (e *Environ) cleanupNetworksAndSubnets(controllerUUID, modelUUID string) error { - vcns, err := e.allVCNs(controllerUUID, modelUUID) if err != nil { return errors.Trace(err) @@ -605,12 +614,11 @@ return errors.Trace(err) } - secList, err := e.allSecurityLists(controllerUUID, modelUUID, vcn.Id) + secLists, err := e.jujuSecurityLists(vcn.Id) if err != nil { return errors.Trace(err) } - - if err := e.removeSeclist(secList); err != nil { + if err := e.removeSecurityLists(secLists); err != nil { return errors.Trace(err) } @@ -665,9 +673,8 @@ return response.Items[0], nil } -func (e *Environ) internetGatewayName(controllerUUID, modelUUID string) *string { - name := fmt.Sprintf("%s-%s-%s", InternetGatewayPrefix, controllerUUID, modelUUID) - return &name +func (e *Environ) internetGatewayName(controllerUUID, modelUUID string) string { + return fmt.Sprintf("%s-%s-%s", InternetGatewayPrefix, controllerUUID, modelUUID) } func (e *Environ) ensureInternetGateway(controllerUUID, modelUUID string, vcnID *string) (ociCore.InternetGateway, error) { @@ -679,12 +686,15 @@ return ig, nil } + name := e.internetGatewayName(controllerUUID, modelUUID) + logger.Debugf("creating new internet gateway %s", name) + enabled := true details := ociCore.CreateInternetGatewayDetails{ VcnId: vcnID, CompartmentId: e.ecfg().compartmentID(), IsEnabled: &enabled, - DisplayName: e.internetGatewayName(controllerUUID, modelUUID), + DisplayName: &name, } request := ociCore.CreateInternetGatewayRequest{ @@ -747,14 +757,16 @@ return nil } -func (e *Environ) allRouteTables(controllerUUID, modelUUID string, vcnID *string) ([]ociCore.RouteTable, error) { - ret := []ociCore.RouteTable{} - if vcnID == nil { - return ret, errors.Errorf("vcnID may not be nil") +// jujuRouteTables returns the route tables for the input VCN +// that were created by juju. +func (e *Environ) jujuRouteTables(vcnId *string) ([]ociCore.RouteTable, error) { + var ret []ociCore.RouteTable + if vcnId == nil { + return ret, errors.Errorf("vcnId may not be nil") } request := ociCore.ListRouteTablesRequest{ CompartmentId: e.ecfg().compartmentID(), - VcnId: vcnID, + VcnId: vcnId, } response, err := e.Networking.ListRouteTables(context.Background(), request) @@ -763,24 +775,16 @@ } for _, val := range response.Items { - tag, ok := val.FreeformTags[tags.JujuController] - if !ok || tag != controllerUUID { + if !strings.HasPrefix(*val.DisplayName, RouteTablePrefix) { continue } - if modelUUID != "" { - tag, ok = val.FreeformTags[tags.JujuModel] - if !ok || tag != modelUUID { - continue - } - } ret = append(ret, val) - } return ret, nil } -func (e *Environ) getRouteTable(controllerUUID, modelUUID string, vcnID *string) (ociCore.RouteTable, error) { - routeTables, err := e.allRouteTables(controllerUUID, modelUUID, vcnID) +func (e *Environ) getRouteTable(vcnId *string) (ociCore.RouteTable, error) { + routeTables, err := e.jujuRouteTables(vcnId) if err != nil { return ociCore.RouteTable{}, errors.Trace(err) } @@ -790,15 +794,14 @@ } if len(routeTables) == 0 { - return ociCore.RouteTable{}, errors.NotFoundf("route table for VCN %q", *vcnID) + return ociCore.RouteTable{}, errors.NotFoundf("route table for VCN %q", *vcnId) } return routeTables[0], nil } -func (e *Environ) routeTableName(controllerUUID, modelUUID string) *string { - name := fmt.Sprintf("%s-%s-%s", RouteTablePrefix, controllerUUID, modelUUID) - return &name +func (e *Environ) routeTableName(controllerUUID, modelUUID string) string { + return fmt.Sprintf("%s-%s-%s", RouteTablePrefix, controllerUUID, modelUUID) } func (e *Environ) getRouteTableStatus(resourceID *string) (string, error) { @@ -820,8 +823,10 @@ return string(response.RouteTable.LifecycleState), nil } -func (e *Environ) ensureRouteTable(controllerUUID, modelUUID string, vcnID *string, routeRules []ociCore.RouteRule) (ociCore.RouteTable, error) { - if rt, err := e.getRouteTable(controllerUUID, modelUUID, vcnID); err != nil { +func (e *Environ) ensureRouteTable( + controllerUUID, modelUUID string, vcnId *string, routeRules []ociCore.RouteRule, +) (ociCore.RouteTable, error) { + if rt, err := e.getRouteTable(vcnId); err != nil { if !errors.IsNotFound(err) { return ociCore.RouteTable{}, errors.Trace(err) } @@ -829,11 +834,14 @@ return rt, nil } + name := e.routeTableName(controllerUUID, modelUUID) + logger.Debugf("creating new route table %s", name) + details := ociCore.CreateRouteTableDetails{ - VcnId: vcnID, + VcnId: vcnId, CompartmentId: e.ecfg().compartmentID(), RouteRules: routeRules, - DisplayName: e.routeTableName(controllerUUID, modelUUID), + DisplayName: &name, FreeformTags: map[string]string{ tags.JujuController: controllerUUID, tags.JujuModel: modelUUID, @@ -848,21 +856,23 @@ if err != nil { return ociCore.RouteTable{}, errors.Trace(err) } + logger.Debugf("route table %s created. Waiting for status: %s", + *response.RouteTable.Id, string(ociCore.RouteTableLifecycleStateAvailable)) if err := e.waitForResourceStatus( e.getRouteTableStatus, response.RouteTable.Id, string(ociCore.RouteTableLifecycleStateAvailable), - resourcePollTimeout); err != nil { - + resourcePollTimeout, + ); err != nil { return ociCore.RouteTable{}, errors.Trace(err) } return response.RouteTable, nil } -func (e *Environ) deleteRouteTable(controllerUUID, modelUUID string, vcnID *string) error { - rts, err := e.allRouteTables(controllerUUID, modelUUID, vcnID) +func (e *Environ) deleteRouteTable(controllerUUID, modelUUID string, vcnId *string) error { + rts, err := e.jujuRouteTables(vcnId) if err != nil { if !errors.IsNotFound(err) { return err diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/storage_volumes.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/storage_volumes.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/storage_volumes.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/storage_volumes.go 2019-06-28 17:10:43.000000000 +0000 @@ -108,7 +108,7 @@ } volTags[tags.JujuModel] = v.modelUUID - size := int(p.Size) + size := int64(p.Size) requestDetails := ociCore.CreateVolumeDetails{ AvailabilityDomain: &availabilityZone, CompartmentId: v.env.ecfg().compartmentID(), @@ -428,8 +428,8 @@ req := ociCore.DetachVolumeRequest{ VolumeAttachmentId: volAttach.GetId(), } - _, nestedErr := v.computeAPI.DetachVolume(context.Background(), req) - if nestedErr != nil { + res, nestedErr := v.computeAPI.DetachVolume(context.Background(), req) + if nestedErr != nil && !v.env.isNotFound(res.RawResponse) { logger.Warningf("failed to cleanup volume attachment: %v", volAttach.GetId()) return } @@ -625,8 +625,8 @@ VolumeAttachmentId: attachment.Id, } - _, err := v.computeAPI.DetachVolume(context.Background(), request) - if err != nil { + res, err := v.computeAPI.DetachVolume(context.Background(), request) + if err != nil && !v.env.isNotFound(res.RawResponse) { if isAuthFailure(err, ctx) { credErr = err common.HandleCredentialError(err, ctx) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oci/storage_volumes_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/oci/storage_volumes_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oci/storage_volumes_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oci/storage_volumes_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -53,7 +53,7 @@ return source } -func (s *storageVolumeSuite) setupCreateVolumesExpectations(tag names.VolumeTag, size int) { +func (s *storageVolumeSuite) setupCreateVolumesExpectations(tag names.VolumeTag, size int64) { name := tag.String() volTags := map[string]string{ tags.JujuModel: s.env.Config().UUID(), @@ -151,7 +151,7 @@ c.Assert(results, gc.HasLen, 0) } -func (s *storageVolumeSuite) setupListVolumesExpectations(size int) map[string]ociCore.Volume { +func (s *storageVolumeSuite) setupListVolumesExpectations(size int64) map[string]ociCore.Volume { volTags := map[string]string{ tags.JujuModel: s.env.Config().UUID(), } @@ -250,7 +250,7 @@ c.Assert(err, gc.IsNil) } -func (s *storageVolumeSuite) setupDeleteVolumesExpectations(size int, id string) { +func (s *storageVolumeSuite) setupDeleteVolumesExpectations(size int64, id string) { volumes := s.setupListVolumesExpectations(size) request := ociCore.DeleteVolumeRequest{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/cinder.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/cinder.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/cinder.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/cinder.go 2019-06-28 17:10:43.000000000 +0000 @@ -107,7 +107,7 @@ client := env.clientUnlocked if env.volumeURL == nil { url, err := getVolumeEndpointURL(client, env.cloudUnlocked.Region) - if errors.IsNotFound(err) { + if IsNotFoundError(err) { // No volume endpoint found; Cinder is not supported. return nil, errors.NotSupportedf("volumes") } else if err != nil { @@ -407,7 +407,7 @@ return false, nil }) if err != nil { - if errors.IsNotFound(err) { + if IsNotFoundError(err) { // The volume wasn't found; nothing // to destroy, so we're done. return nil @@ -595,7 +595,7 @@ func detachVolume(instanceId, volumeId string, storageAdapter OpenstackStorage) error { err := storageAdapter.DetachVolume(instanceId, volumeId) - if err != nil && !errors.IsNotFound(err) { + if err != nil && !IsNotFoundError(err) { return errors.Trace(err) } // The volume was successfully detached, or was @@ -603,6 +603,10 @@ return nil } +func IsNotFoundError(err error) bool { + return errors.IsNotFound(err) || gooseerrors.IsNotFound(err) +} + func findAttachment(volId string, attachments []nova.VolumeAttachment) *nova.VolumeAttachment { for _, attachment := range attachments { if attachment.VolumeId == volId { @@ -683,7 +687,7 @@ func (ga *openstackStorageAdapter) GetVolume(volumeId string) (*cinder.Volume, error) { resp, err := ga.cinderClient.GetVolume(volumeId) if err != nil { - if gooseerrors.IsNotFound(err) { + if IsNotFoundError(err) { return nil, errors.NotFoundf("volume %q", volumeId) } return nil, err @@ -699,7 +703,7 @@ // DeleteVolume is part of the OpenstackStorage interface. func (ga *openstackStorageAdapter) DeleteVolume(volumeId string) error { if err := ga.cinderClient.DeleteVolume(volumeId); err != nil { - if gooseerrors.IsNotFound(err) { + if IsNotFoundError(err) { return errors.NotFoundf("volume %q", volumeId) } return err @@ -710,7 +714,7 @@ // DetachVolume is part of the OpenstackStorage interface. func (ga *openstackStorageAdapter) DetachVolume(serverId, attachmentId string) error { if err := ga.novaClient.DetachVolume(serverId, attachmentId); err != nil { - if gooseerrors.IsNotFound(err) { + if IsNotFoundError(err) { return errors.NewNotFound(nil, fmt.Sprintf("volume %q is not attached to server %q", attachmentId, serverId, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/credentials.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/credentials.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/credentials.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/credentials.go 2019-06-28 17:10:43.000000000 +0000 @@ -146,7 +146,7 @@ func (c OpenstackCredentials) detectCredential() (*cloud.Credential, string, string, error) { creds, err := identity.CredentialsFromEnv() if err != nil { - return nil, "", "", errors.Errorf("failed to retrive cred from env : %v", err) + return nil, "", "", errors.Errorf("failed to retrieve credential from env : %v", err) } if creds.TenantName == "" { logger.Debugf("neither OS_TENANT_NAME nor OS_PROJECT_NAME environment variable not set") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/image.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/image.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/image.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/image.go 2019-06-28 17:10:43.000000000 +0000 @@ -35,7 +35,7 @@ // The instance type comes from querying the flavors supported by the deployment. func findInstanceSpec( e *Environ, - ic *instances.InstanceConstraint, + ic instances.InstanceConstraint, imageMetadata []*imagemetadata.ImageMetadata, ) (*instances.InstanceSpec, error) { // First construct all available instance types from the supported flavors. @@ -44,6 +44,15 @@ if err != nil { return nil, err } + + if ic.Constraints.HasRootDiskSource() && *ic.Constraints.RootDiskSource == "volume" { + // When the root disk is a volume (i.e. cinder block volume) + // we don't want to match on RootDisk size. If an instance requires + // a very large root disk we don't want to select a larger instance type + // to fit a disk that won't be local to the instance. + ic.Constraints.RootDisk = nil + } + // Not all needed information is available in flavors, // for e.g. architectures or virtualisation types. // For these properties, we assume that all instance types support @@ -71,7 +80,7 @@ } images := instances.ImageMetadataToImages(imageMetadata) - spec, err := instances.FindInstanceSpec(images, ic, allInstanceTypes) + spec, err := instances.FindInstanceSpec(images, &ic, allInstanceTypes) if err != nil { return nil, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/init.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/init.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/init.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/init.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,16 @@ const ( providerType = "openstack" + + // Default root disk size when root-disk-source is volume. + defaultRootDiskSize = 30 * 1024 // 30 GiB +) + +const ( + // BlockDeviceMapping source volume type for cinder block device. + rootDiskSourceVolume = "volume" + // BlockDeviceMapping source volume type for local block device. + rootDiskSourceLocal = "local" ) func init() { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/local_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/local_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/local_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/local_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -746,7 +746,7 @@ } func assertInstanceIds(c *gc.C, env environs.Environ, callCtx context.ProviderCallContext, expected ...instance.Id) { - insts, err := env.AllInstances(callCtx) + insts, err := env.AllRunningInstances(callCtx) c.Assert(err, jc.ErrorIsNil) instIds := make([]instance.Id, len(insts)) for i, inst := range insts { @@ -952,7 +952,7 @@ c.Assert(err, jc.ErrorIsNil) } -func (s *localServerSuite) TestAllInstancesFloatingIP(c *gc.C) { +func (s *localServerSuite) TestAllRunningInstancesFloatingIP(c *gc.C) { env := s.openEnviron(c, coretesting.Attrs{ "network": "private_999", "use-floating-ip": true, @@ -965,7 +965,7 @@ c.Assert(err, jc.ErrorIsNil) }() - insts, err := env.AllInstances(s.callCtx) + insts, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) for _, inst := range insts { c.Assert(*openstack.InstanceFloatingIP(inst), gc.Equals, fmt.Sprintf("10.0.0.%v", inst.Id())) @@ -1102,7 +1102,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(ids, gc.HasLen, 1) - insts, err := s.env.AllInstances(s.callCtx) + insts, err := s.env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(insts, gc.HasLen, 1) c.Check(insts[0].Id(), gc.Equals, ids[0]) @@ -1335,7 +1335,8 @@ consB := constraints.MustParse("instance-type=m1.small") cons, err := validator.Merge(consA, consB) c.Assert(err, jc.ErrorIsNil) - c.Assert(cons, gc.DeepEquals, constraints.MustParse("arch=amd64 instance-type=m1.small")) + // NOTE: root-disk and instance-type constraints are checked by PrecheckInstance. + c.Assert(cons, gc.DeepEquals, constraints.MustParse("arch=amd64 instance-type=m1.small root-disk=10G")) } func (s *localServerSuite) TestFindImageInstanceConstraint(c *gc.C) { @@ -1434,6 +1435,13 @@ c.Assert(err, gc.ErrorMatches, `invalid Openstack flavour "m1.large" specified`) } +func (s *localServerSuite) TestPrecheckInstanceInvalidRootDiskConstraint(c *gc.C) { + env := s.Open(c, s.env.Config()) + cons := constraints.MustParse("instance-type=m1.small root-disk=10G") + err := env.PrecheckInstance(s.callCtx, environs.PrecheckInstanceParams{Series: supportedversion.SupportedLTS(), Constraints: cons}) + c.Assert(err, gc.ErrorMatches, `constraint root-disk cannot be specified with instance-type unless constraint root-disk-source=volume`) +} + func (t *localServerSuite) TestPrecheckInstanceAvailZone(c *gc.C) { placement := "zone=test-available" err := t.env.PrecheckInstance(t.callCtx, environs.PrecheckInstanceParams{Series: supportedversion.SupportedLTS(), Placement: placement}) @@ -1901,7 +1909,7 @@ Config: cfg, }) c.Assert(err, jc.ErrorIsNil) - _, err = env.AllInstances(s.callCtx) + _, err = env.AllRunningInstances(s.callCtx) c.Assert(err, gc.IsNil) } @@ -1923,7 +1931,7 @@ Config: cfg, }) c.Assert(err, jc.ErrorIsNil) - _, err = env.AllInstances(s.callCtx) + _, err = env.AllRunningInstances(s.callCtx) c.Assert(err, gc.ErrorMatches, "(.|\n)*x509: certificate signed by unknown authority") } @@ -2070,17 +2078,17 @@ c.Assert(err, gc.ErrorMatches, `cannot remove "some-file": swift container name is empty`) } -func (s *localServerSuite) TestAllInstancesIgnoresOtherMachines(c *gc.C) { +func (s *localServerSuite) TestAllRunningInstancesIgnoresOtherMachines(c *gc.C) { err := bootstrapEnv(c, s.env) c.Assert(err, jc.ErrorIsNil) // Check that we see 1 instance in the environment - insts, err := s.env.AllInstances(s.callCtx) + insts, err := s.env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Check(insts, gc.HasLen, 1) // Now start a machine 'manually' in the same account, with a similar - // but not matching name, and ensure it isn't seen by AllInstances + // but not matching name, and ensure it isn't seen by AllRunningInstances // See bug #1257481, for how similar names were causing them to get // listed (and thus destroyed) at the wrong time existingModelName := s.TestConfig["name"] @@ -2103,7 +2111,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(servers, gc.HasLen, 2) - insts, err = s.env.AllInstances(s.callCtx) + insts, err = s.env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Check(insts, gc.HasLen, 1) } @@ -2384,11 +2392,115 @@ c.Assert(err, gc.ErrorMatches, `cannot create instance in zone "az2", as this will prevent attaching the requested disks in zone "az1"`) } +// novaInstaceStartedWithOpts exposes run server options used to start an instance. +type novaInstaceStartedWithOpts interface { + NovaInstanceStartedWithOpts() *nova.RunServerOpts +} + +func (t *localServerSuite) TestStartInstanceVolumeRootBlockDevice(c *gc.C) { + // diskSizeGiB should be equal to the openstack.defaultRootDiskSize + diskSizeGiB := 30 + + err := bootstrapEnv(c, t.env) + c.Assert(err, jc.ErrorIsNil) + + cons, err := constraints.Parse("root-disk-source=volume") + c.Assert(err, jc.ErrorIsNil) + + res, err := testing.StartInstanceWithParams(t.env, t.callCtx, "1", environs.StartInstanceParams{ + ControllerUUID: t.ControllerUUID, + Constraints: cons, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(res, gc.NotNil) + + runOpts := res.Instance.(novaInstaceStartedWithOpts).NovaInstanceStartedWithOpts() + c.Assert(runOpts, gc.NotNil) + c.Assert(runOpts.BlockDeviceMappings, gc.NotNil) + deviceMapping := runOpts.BlockDeviceMappings[0] + c.Assert(deviceMapping, jc.DeepEquals, nova.BlockDeviceMapping{ + BootIndex: 0, + UUID: "1", + SourceType: "image", + DestinationType: "volume", + DeleteOnTermination: true, + VolumeSize: diskSizeGiB, + }) +} + +func (t *localServerSuite) TestStartInstanceVolumeRootBlockDeviceSized(c *gc.C) { + diskSizeGiB := 10 + + err := bootstrapEnv(c, t.env) + c.Assert(err, jc.ErrorIsNil) + + cons, err := constraints.Parse("root-disk-source=volume root-disk=10G") + c.Assert(err, jc.ErrorIsNil) + + res, err := testing.StartInstanceWithParams(t.env, t.callCtx, "1", environs.StartInstanceParams{ + ControllerUUID: t.ControllerUUID, + Constraints: cons, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(res, gc.NotNil) + + c.Assert(res.Hardware.RootDisk, gc.NotNil) + c.Assert(*res.Hardware.RootDisk, gc.Equals, uint64(diskSizeGiB*1024)) + + runOpts := res.Instance.(novaInstaceStartedWithOpts).NovaInstanceStartedWithOpts() + c.Assert(runOpts, gc.NotNil) + c.Assert(runOpts.BlockDeviceMappings, gc.NotNil) + deviceMapping := runOpts.BlockDeviceMappings[0] + c.Assert(deviceMapping, jc.DeepEquals, nova.BlockDeviceMapping{ + BootIndex: 0, + UUID: "1", + SourceType: "image", + DestinationType: "volume", + DeleteOnTermination: true, + VolumeSize: diskSizeGiB, + }) +} + +func (t *localServerSuite) TestStartInstanceLocalRootBlockDevice(c *gc.C) { + err := bootstrapEnv(c, t.env) + c.Assert(err, jc.ErrorIsNil) + + cons, err := constraints.Parse("root-disk=1G") + c.Assert(err, jc.ErrorIsNil) + c.Assert(cons.HasRootDisk(), jc.IsTrue) + c.Assert(*cons.RootDisk, gc.Equals, uint64(1024)) + + res, err := testing.StartInstanceWithParams(t.env, t.callCtx, "1", environs.StartInstanceParams{ + ControllerUUID: t.ControllerUUID, + Constraints: cons, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(res, gc.NotNil) + + c.Assert(res.Hardware.RootDisk, gc.NotNil) + // Check local disk requirements are met. + c.Assert(*res.Hardware.RootDisk, jc.GreaterThan, uint64(1024-1)) + + runOpts := res.Instance.(novaInstaceStartedWithOpts).NovaInstanceStartedWithOpts() + c.Assert(runOpts, gc.NotNil) + c.Assert(runOpts.BlockDeviceMappings, gc.NotNil) + deviceMapping := runOpts.BlockDeviceMappings[0] + c.Assert(deviceMapping, jc.DeepEquals, nova.BlockDeviceMapping{ + BootIndex: 0, + UUID: "1", + SourceType: "image", + DestinationType: "local", + DeleteOnTermination: true, + // VolumeSize is 0 when a local disk is used. + VolumeSize: 0, + }) +} + func (t *localServerSuite) TestInstanceTags(c *gc.C) { err := bootstrapEnv(c, t.env) c.Assert(err, jc.ErrorIsNil) - instances, err := t.env.AllInstances(t.callCtx) + instances, err := t.env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) @@ -2409,7 +2521,7 @@ assertMetadata := func(extraKey, extraValue string) { // Refresh instance - instances, err := t.env.AllInstances(t.callCtx) + instances, err := t.env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) c.Assert( @@ -2424,7 +2536,7 @@ ) } - instances, err := t.env.AllInstances(t.callCtx) + instances, err := t.env.AllRunningInstances(t.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.HasLen, 1) @@ -2549,7 +2661,7 @@ } func (s *localServerSuite) checkInstanceTags(c *gc.C, env environs.Environ, expectedController string) { - instances, err := env.AllInstances(s.callCtx) + instances, err := env.AllRunningInstances(s.callCtx) c.Assert(err, jc.ErrorIsNil) c.Assert(instances, gc.Not(gc.HasLen), 0) for _, instance := range instances { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/provider.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/provider.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/provider.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/provider.go 2019-06-28 17:10:43.000000000 +0000 @@ -205,7 +205,7 @@ // return return a region using them. creds, err := identity.CredentialsFromEnv() if err != nil { - return nil, errors.Errorf("failed to retrive cred from env : %v", err) + return nil, errors.Errorf("failed to retrieve credential from env : %v", err) } if creds.Region == "" { return nil, errors.NewNotFound(nil, "OS_REGION_NAME environment variable not set") @@ -327,6 +327,15 @@ serverDetail *nova.ServerDetail // floatingIP is non-nil iff use-floating-ip is true. floatingIP *string + + // runOpts is only set in the response from StartInstance. + runOpts *nova.RunServerOpts +} + +// NovaInstanceStartedWithOpts exposes run options used to start an instance. +// Used by unit testing. +func (inst *openstackInstance) NovaInstanceStartedWithOpts() *nova.RunServerOpts { + return inst.runOpts } func (inst *openstackInstance) String() string { @@ -402,6 +411,18 @@ // tags not currently supported on openstack } hc.AvailabilityZone = &inst.serverDetail.AvailabilityZone + // If the instance was started with a volume block device mapping, select the first + // boot disk as the reported RootDisk size. + if inst.runOpts != nil { + for _, blockDevice := range inst.runOpts.BlockDeviceMappings { + if blockDevice.BootIndex == 0 && + blockDevice.DestinationType == rootDiskSourceVolume { + rootDiskSize := uint64(blockDevice.VolumeSize * 1024) + hc.RootDisk = &rootDiskSize + break + } + } + } return hc } @@ -527,7 +548,8 @@ validator := constraints.NewValidator() validator.RegisterConflicts( []string{constraints.InstanceType}, - []string{constraints.Mem, constraints.RootDisk, constraints.Cores}) + []string{constraints.Mem, constraints.Cores}) + // NOTE: RootDiskSource and RootDisk constraints are validated in PrecheckInstance. validator.RegisterUnsupported(unsupportedConstraints) novaClient := e.nova() flavors, err := novaClient.ListFlavorsDetail() @@ -541,6 +563,7 @@ } validator.RegisterVocabulary(constraints.InstanceType, instTypeNames) validator.RegisterVocabulary(constraints.VirtType, []string{"kvm", "lxd"}) + validator.RegisterVocabulary(constraints.RootDiskSource, []string{rootDiskSourceVolume}) return validator, nil } @@ -637,22 +660,37 @@ if _, err := e.deriveAvailabilityZone(ctx, args.Placement, args.VolumeAttachments); err != nil { return errors.Trace(err) } - if !args.Constraints.HasInstanceType() { - return nil - } - // Constraint has an instance-type constraint so let's see if it is valid. - novaClient := e.nova() - flavors, err := novaClient.ListFlavorsDetail() - if err != nil { - common.HandleCredentialError(IsAuthorisationFailure, err, ctx) - return err - } - for _, flavor := range flavors { - if flavor.Name == *args.Constraints.InstanceType { - return nil + usingVolumeRootDisk := false + if args.Constraints.HasRootDiskSource() && args.Constraints.HasRootDisk() && + *args.Constraints.RootDiskSource == rootDiskSourceVolume { + usingVolumeRootDisk = true + } + if args.Constraints.HasRootDisk() && args.Constraints.HasInstanceType() && !usingVolumeRootDisk { + return errors.Errorf("constraint %s cannot be specified with %s unless constraint %s=%s", + constraints.RootDisk, constraints.InstanceType, + constraints.RootDiskSource, rootDiskSourceVolume) + } + if args.Constraints.HasInstanceType() { + // Constraint has an instance-type constraint so let's see if it is valid. + novaClient := e.nova() + flavors, err := novaClient.ListFlavorsDetail() + if err != nil { + common.HandleCredentialError(IsAuthorisationFailure, err, ctx) + return err + } + flavorFound := false + for _, flavor := range flavors { + if flavor.Name == *args.Constraints.InstanceType { + flavorFound = true + break + } + } + if !flavorFound { + return errors.Errorf("invalid Openstack flavour %q specified", *args.Constraints.InstanceType) } } - return errors.Errorf("invalid Openstack flavour %q specified", *args.Constraints.InstanceType) + + return nil } // PrepareForBootstrap is part of the Environ interface. @@ -1055,7 +1093,7 @@ series := args.Tools.OneSeries() arches := args.Tools.Arches() - spec, err := findInstanceSpec(e, &instances.InstanceConstraint{ + spec, err := findInstanceSpec(e, instances.InstanceConstraint{ Region: e.cloud().Region, Series: series, Arches: arches, @@ -1266,13 +1304,16 @@ var opts = nova.RunServerOpts{ Name: machineName, FlavorId: spec.InstanceType.Id, - ImageId: spec.Image.Id, UserData: userData, SecurityGroupNames: novaGroupNames, Networks: networks, Metadata: args.InstanceConfig.Tags, AvailabilityZone: args.AvailabilityZone, } + err = e.configureRootDisk(ctx, args, spec, &opts) + if err != nil { + return nil, common.ZoneIndependentError(err) + } e.configurator.ModifyRunServerOptions(&opts) server, err := tryStartNovaInstance(shortAttempt, e.nova(), opts) @@ -1300,6 +1341,7 @@ serverDetail: detail, arch: &spec.Image.Arch, instType: &spec.InstanceType, + runOpts: &opts, } logger.Infof("started instance %q", inst.Id()) withPublicIP := e.ecfg().useFloatingIP() @@ -1338,6 +1380,43 @@ }, nil } +func (e *Environ) configureRootDisk(ctx context.ProviderCallContext, args environs.StartInstanceParams, + spec *instances.InstanceSpec, runOpts *nova.RunServerOpts) error { + rootDiskSource := rootDiskSourceLocal + if args.Constraints.HasRootDiskSource() { + rootDiskSource = *args.Constraints.RootDiskSource + } + rootDiskMapping := nova.BlockDeviceMapping{ + BootIndex: 0, + UUID: spec.Image.Id, + SourceType: "image", + // NB constraints.RootDiskSource in the case of OpenStack represents + // the type of block device to use. Either "local" to represent a local + // block device or "volume" to represent a block device from the cinder + // block storage service. + DestinationType: rootDiskSource, + DeleteOnTermination: true, + } + switch rootDiskSource { + case rootDiskSourceLocal: + runOpts.ImageId = spec.Image.Id + case rootDiskSourceVolume: + size := uint64(0) + if args.Constraints.HasRootDisk() { + size = *args.Constraints.RootDisk + } + if size <= 0 { + size = defaultRootDiskSize + } + sizeGB := common.MiBToGiB(size) + rootDiskMapping.VolumeSize = int(sizeGB) + default: + return errors.Errorf("invalid %s %s", constraints.RootDiskSource, rootDiskSource) + } + runOpts.BlockDeviceMappings = []nova.BlockDeviceMapping{rootDiskMapping} + return nil +} + func (e *Environ) deriveAvailabilityZone( ctx context.ProviderCallContext, placement string, @@ -1466,7 +1545,7 @@ return wantedServers, nil } // List all instances in the environment. - instances, err := e.AllInstances(ctx) + instances, err := e.AllRunningInstances(ctx) if err != nil { common.HandleCredentialError(IsAuthorisationFailure, err, ctx) return nil, err @@ -1527,7 +1606,7 @@ foundServers, err = e.listServers(ctx, ids) if err != nil { logger.Debugf("error listing servers: %v", err) - if !gooseerrors.IsNotFound(err) { + if !IsNotFoundError(err) { common.HandleCredentialError(IsAuthorisationFailure, err, ctx) return nil, err } @@ -1662,6 +1741,13 @@ return instances, nil } +// AllRunningInstances returns all running, available instances in this environment. +func (e *Environ) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // e.allInstances(...) already handles all instances irrespective of the state, so + // here 'all' is also 'all running'. + return e.AllInstances(ctx) +} + // allControllerManagedInstances returns all instances managed by this // environment's controller, matching the optionally specified filter. func (e *Environ) allControllerManagedInstances(ctx context.ProviderCallContext, controllerUUID string, updateFloatingIPAddresses bool) ([]instances.Instance, error) { @@ -1861,7 +1947,7 @@ novaClient := e.nova() for _, id := range ids { err := novaClient.DeleteServer(string(id)) - if gooseerrors.IsNotFound(err) { + if IsNotFoundError(err) { err = nil } if err != nil && firstErr == nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/series_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/series_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/series_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/series_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -492,7 +492,7 @@ imageMetadata []*imagemetadata.ImageMetadata, ) (spec *instances.InstanceSpec, err error) { env := e.(*Environ) - return findInstanceSpec(env, &instances.InstanceConstraint{ + return findInstanceSpec(env, instances.InstanceConstraint{ Series: series, Arches: []string{arch}, Region: env.cloud().Region, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/storage.go juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/storage.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/openstack/storage.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/openstack/storage.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,7 +11,6 @@ jujuerrors "github.com/juju/errors" "github.com/juju/utils" - gooseerrors "gopkg.in/goose.v2/errors" "gopkg.in/goose.v2/swift" "github.com/juju/juju/environs/storage" @@ -182,7 +181,7 @@ // maybeNotFound returns a errors.NotFoundError if the root cause of the specified error is due to a file or // container not being found. func maybeNotFound(err error) (error, bool) { - if err != nil && gooseerrors.IsNotFound(err) { + if err != nil && IsNotFoundError(err) { return jujuerrors.NewNotFound(err, ""), true } return err, false diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oracle/environ.go juju-core-2.6.5/src/github.com/juju/juju/provider/oracle/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oracle/environ.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oracle/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -606,6 +606,13 @@ return ret, nil } +// AllRunningInstances is part of the InstanceBroker interface. +func (o *OracleEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]envinstance.Instance, error) { + // o.allInstances(...) already handles all instances irrespective of the state, so + // here 'all' is also 'all running'. + return o.AllInstances(ctx) +} + func (o *OracleEnviron) allInstances(tagFilter tagValue) ([]*oracleInstance, error) { filter := []oci.Filter{ { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/oracle/environ_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/oracle/environ_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/oracle/environ_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/oracle/environ_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -222,8 +222,8 @@ c.Assert(err, gc.IsNil) } -func (e *environSuite) TestAllInstances(c *gc.C) { - _, err := e.env.AllInstances(e.callCtx) +func (e *environSuite) TestAllRunningInstances(c *gc.C) { + _, err := e.env.AllRunningInstances(e.callCtx) c.Assert(err, gc.IsNil) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/rackspace/environ_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/rackspace/environ_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/rackspace/environ_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/rackspace/environ_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -222,6 +222,11 @@ return nil, nil } +func (e *fakeEnviron) AllRunningInstances(callCtx context.ProviderCallContext) ([]instances.Instance, error) { + e.Push("AllRunningInstances", callCtx) + return nil, nil +} + func (e *fakeEnviron) MaintainInstance(callCtx context.ProviderCallContext, args environs.StartInstanceParams) error { e.Push("MaintainInstance", callCtx, args) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_broker.go juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_broker.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_broker.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_broker.go 2019-06-28 17:10:43.000000000 +0000 @@ -192,7 +192,7 @@ cons.RootDisk = &minRootDisk } defaultDatastore := env.ecfg.datastore() - if cons.RootDiskSource == nil || *cons.RootDiskSource == "" { + if (cons.RootDiskSource == nil || *cons.RootDiskSource == "") && defaultDatastore != "" { cons.RootDiskSource = &defaultDatastore } @@ -296,6 +296,20 @@ return results, err } +// AllRunningInstances implements environs.InstanceBroker. +func (env *environ) AllRunningInstances(ctx context.ProviderCallContext) (instances []instances.Instance, err error) { + // AllInstances() already handles all instances irrespective of the state, so + // here 'all' is also 'all running'. + return env.AllInstances(ctx) +} + +// AllRunningInstances implements environs.InstanceBroker. +func (env *sessionEnviron) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + // AllInstances() already handles all instances irrespective of the state, so + // here 'all' is also 'all running'. + return env.AllInstances(ctx) +} + // StopInstances implements environs.InstanceBroker. func (env *environ) StopInstances(ctx context.ProviderCallContext, ids ...instance.Id) error { return env.withSession(ctx, func(env *sessionEnviron) error { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -467,3 +467,30 @@ return s.env.StopInstances(ctx, "vm-0") }) } + +func (s *environBrokerSuite) TestStartInstanceNoDatastoreSetting(c *gc.C) { + startInstArgs := s.createStartInstanceArgs(c) + res, err := s.env.StartInstance(s.callCtx, startInstArgs) + c.Assert(err, jc.ErrorIsNil) + + s.client.CheckCallNames(c, "ComputeResources", "ResourcePools", "ResourcePools", "CreateVirtualMachine", "Close") + call := s.client.Calls()[3] + c.Assert(call.Args, gc.HasLen, 2) + c.Assert(call.Args[0], gc.Implements, new(context.Context)) + c.Assert(call.Args[1], gc.FitsTypeOf, vsphereclient.CreateVirtualMachineParams{}) + + createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams) + + var expected *string + c.Assert(createVMArgs.Constraints.RootDiskSource, gc.Equals, expected) + + var ( + arch = "amd64" + rootDisk = common.MinRootDiskSizeGiB("trusty") * 1024 + ) + c.Assert(res.Hardware, jc.DeepEquals, &instance.HardwareCharacteristics{ + Arch: &arch, + RootDisk: &rootDisk, + RootDiskSource: nil, + }) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_instance.go juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_instance.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/environ_instance.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/environ_instance.go 2019-06-28 17:10:43.000000000 +0000 @@ -33,7 +33,7 @@ return nil, environs.ErrNoInstances } - allInstances, err := env.AllInstances(ctx) + allInstances, err := env.AllRunningInstances(ctx) if err != nil { return nil, errors.Annotate(err, "failed to get instances") } @@ -73,7 +73,7 @@ // ControllerInstances is part of the environs.Environ interface. func (env *sessionEnviron) ControllerInstances(ctx context.ProviderCallContext, controllerUUID string) ([]instance.Id, error) { - instances, err := env.AllInstances(ctx) + instances, err := env.AllRunningInstances(ctx) if err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm.go juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm.go 2019-06-28 17:10:43.000000000 +0000 @@ -392,8 +392,9 @@ ctx context.Context, args CreateVirtualMachineParams, ) (*mo.Datastore, error) { - // Select a datastore. If the user specified one, use that; otherwise - // choose the first one in the list that is accessible. + // Select a datastore. If the user specified one, use that. When no datastore + // is provided and there is only datastore accessible, use that. Otherwise return + // an error and ask for guidance. refs := make([]types.ManagedObjectReference, len(args.ComputeResource.Datastore)) for i, ds := range args.ComputeResource.Datastore { refs[i] = ds.Reference() @@ -402,23 +403,47 @@ if err := c.client.Retrieve(ctx, refs, nil, &datastores); err != nil { return nil, errors.Annotate(err, "retrieving datastore details") } + + var accessibleDatastores []mo.Datastore + var datastoreNames []string + for _, ds := range datastores { + if ds.Summary.Accessible { + accessibleDatastores = append(accessibleDatastores, ds) + datastoreNames = append(datastoreNames, ds.Name) + } else { + c.logger.Debugf("datastore %s is inaccessible", ds.Name) + } + } + + if len(accessibleDatastores) == 0 { + return nil, errors.New("no accessible datastores available") + } + if args.Constraints.RootDiskSource != nil { dsName := *args.Constraints.RootDiskSource c.logger.Debugf("desired datasource %q", dsName) + c.logger.Debugf("accessible datasources %q", datastoreNames) for _, ds := range datastores { - c.logger.Debugf("seen %q", ds.Name) if ds.Name == dsName { + c.logger.Infof("selecting datastore %s", ds.Name) return &ds, nil } } - return nil, errors.Errorf("could not find datastore %q", dsName) + datastoreNamesMsg := fmt.Sprintf("%q", datastoreNames) + datastoreNamesMsg = strings.Trim(datastoreNamesMsg, "[]") + datastoreNames = strings.Split(datastoreNamesMsg, " ") + datastoreNamesMsg = strings.Join(datastoreNames, ", ") + return nil, errors.Errorf("could not find datastore %q, datastore(s) accessible: %s", dsName, datastoreNamesMsg) } - for _, ds := range datastores { - if ds.Summary.Accessible { - c.logger.Debugf("using datastore %q", ds.Name) - return &ds, nil - } + + if len(accessibleDatastores) == 1 { + ds := accessibleDatastores[0] + c.logger.Infof("selecting datastore %s", ds.Name) + return &ds, nil + } else if len(accessibleDatastores) > 1 { + return nil, errors.Errorf("no datastore provided and multiple available: %q", strings.Join(datastoreNames, ", ")) } + return nil, errors.New("could not find an accessible datastore") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm_test.go juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm_test.go --- juju-core-2.6.2/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/provider/vsphere/internal/vsphereclient/createvm_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -251,7 +251,7 @@ client := s.newFakeClient(&s.roundTripper, "dc0") _, err := client.CreateVirtualMachine(context.Background(), args) - c.Assert(err, gc.ErrorMatches, `could not find datastore "datastore3"`) + c.Assert(err, gc.ErrorMatches, `could not find datastore "datastore3", datastore\(s\) accessible: "datastore2"`) } func (s *clientSuite) TestCreateVirtualMachineDatastoreNoneAccessible(c *gc.C) { @@ -263,7 +263,53 @@ client := s.newFakeClient(&s.roundTripper, "dc0") _, err := client.CreateVirtualMachine(context.Background(), args) - c.Assert(err, gc.ErrorMatches, "could not find an accessible datastore") + c.Assert(err, gc.ErrorMatches, "no accessible datastores available") +} + +func (s *clientSuite) TestCreateVirtualMachineDatastoreNotFoundWithMultipleAvailable(c *gc.C) { + args := baseCreateVirtualMachineParams(c) + datastore := "datastore3" + args.Constraints.RootDiskSource = &datastore + + s.roundTripper.updateContents("FakeDatastore1", + []types.ObjectContent{{ + Obj: types.ManagedObjectReference{ + Type: "Datastore", + Value: "FakeDatastore1", + }, + PropSet: []types.DynamicProperty{ + {Name: "name", Val: "datastore1"}, + {Name: "summary.accessible", Val: true}, + }, + }}, + ) + + client := s.newFakeClient(&s.roundTripper, "dc0") + _, err := client.CreateVirtualMachine(context.Background(), args) + c.Assert(err, gc.ErrorMatches, `could not find datastore "datastore3", datastore\(s\) accessible: "datastore1", "datastore2"`) +} + +func (s *clientSuite) TestCreateVirtualMachineDatastoreNotFoundWithNoAvailable(c *gc.C) { + args := baseCreateVirtualMachineParams(c) + datastore := "datastore3" + args.Constraints.RootDiskSource = &datastore + + s.roundTripper.updateContents("FakeDatastore2", + []types.ObjectContent{{ + Obj: types.ManagedObjectReference{ + Type: "Datastore", + Value: "FakeDatastore2", + }, + PropSet: []types.DynamicProperty{ + {Name: "name", Val: "datastore2"}, + {Name: "summary.accessible", Val: false}, + }, + }}, + ) + + client := s.newFakeClient(&s.roundTripper, "dc0") + _, err := client.CreateVirtualMachine(context.Background(), args) + c.Assert(err, gc.ErrorMatches, `no accessible datastores available`) } func (s *clientSuite) TestCreateVirtualMachineMultipleNetworksSpecifiedFirstDefault(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/scripts/golinters.bash juju-core-2.6.5/src/github.com/juju/juju/scripts/golinters.bash --- juju-core-2.6.2/src/github.com/juju/juju/scripts/golinters.bash 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/scripts/golinters.bash 2019-06-28 17:10:43.000000000 +0000 @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2013 Canonical Ltd. +# Copyright 2019 Canonical Ltd. # Licensed under the AGPLv3, see LICENCE file for details. exitstatus=0 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/scripts/schema.bash juju-core-2.6.5/src/github.com/juju/juju/scripts/schema.bash --- juju-core-2.6.2/src/github.com/juju/juju/scripts/schema.bash 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/scripts/schema.bash 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright 2019 Canonical Ltd. +# Licensed under the AGPLv3, see LICENCE file for details. +current_schema_sha=$(git show HEAD:apiserver/facades/schema.json | shasum -a 1 | awk '{ print $1 }') +tmpfile=$(mktemp /tmp/schema-XXXXX) +make SCHEMA_PATH=$tmpfile rebuild-schema +new_schema_sha=$(cat $tmpfile | shasum -a 1 | awk '{ print $1 }') + +if [ $current_schema_sha != $new_schema_sha ]; then + (>&2 echo "Error: facades schema is not in sync. Run 'make rebuild-schema' and commit source.") + exit 1 +fi diff -Nru juju-core-2.6.2/src/github.com/juju/juju/scripts/verify.bash juju-core-2.6.5/src/github.com/juju/juju/scripts/verify.bash --- juju-core-2.6.2/src/github.com/juju/juju/scripts/verify.bash 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/scripts/verify.bash 2019-06-28 17:10:43.000000000 +0000 @@ -12,7 +12,7 @@ VERSION=`go version | awk '{print $3}'` echo "go version $VERSION" -FILES=`find * -name '*.go' -not -name '.#*' | grep -v vendor/ | grep -v acceptancetests/` +FILES=`find * -name '*.go' -not -name '.#*' -not -name '*_mock.go' | grep -v vendor/ | grep -v acceptancetests/` echo "checking: dependency files ..." dep check @@ -79,6 +79,14 @@ echo "ignoring: golinters ..." fi +INCLUDE_SCHEMA="${INCLUDE_SCHEMA:-1}" +if [ -n "$INCLUDE_SCHEMA" ]; then + echo "checking: schema ..." + ./scripts/schema.bash +else + echo "ignoring: schema ..." +fi + echo "checking: go build ..." go build $(go list github.com/juju/juju/... | grep -v /vendor/) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/scripts/win-installer/setup.iss juju-core-2.6.5/src/github.com/juju/juju/scripts/win-installer/setup.iss --- juju-core-2.6.2/src/github.com/juju/juju/scripts/win-installer/setup.iss 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/scripts/win-installer/setup.iss 2019-06-28 17:10:43.000000000 +0000 @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Juju" -#define MyAppVersion "2.6.2" +#define MyAppVersion "2.6.5" #define MyAppPublisher "Canonical, Ltd" #define MyAppURL "http://jujucharms.com/" #define MyAppExeName "juju.exe" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/snap/snapcraft.yaml juju-core-2.6.5/src/github.com/juju/juju/snap/snapcraft.yaml --- juju-core-2.6.2/src/github.com/juju/juju/snap/snapcraft.yaml 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/snap/snapcraft.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -1,5 +1,5 @@ name: juju -version: 2.6.2 +version: 2.6.5 summary: juju client description: Through the use of charms, juju provides you with shareable, re-usable, and repeatable expressions of devops best practices. confinement: classic diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/address.go juju-core-2.6.5/src/github.com/juju/juju/state/address.go --- juju-core-2.6.2/src/github.com/juju/juju/state/address.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/address.go 2019-06-28 17:10:43.000000000 +0000 @@ -322,11 +322,12 @@ // stuff at some point. We want to use juju-specific network names // that point to existing documents in the networks collection. type address struct { - Value string `bson:"value"` - AddressType string `bson:"addresstype"` - Scope string `bson:"networkscope,omitempty"` - Origin string `bson:"origin,omitempty"` - SpaceName string `bson:"spacename,omitempty"` + Value string `bson:"value"` + AddressType string `bson:"addresstype"` + Scope string `bson:"networkscope,omitempty"` + Origin string `bson:"origin,omitempty"` + SpaceName string `bson:"spacename,omitempty"` + SpaceProviderId string `bson:"spaceid,omitempty"` } // Origin specifies where an address comes from, whether it was reported by a @@ -346,11 +347,12 @@ // out of the network type, here for Address with a given Origin. func fromNetworkAddress(netAddr network.Address, origin Origin) address { return address{ - Value: netAddr.Value, - AddressType: string(netAddr.Type), - Scope: string(netAddr.Scope), - Origin: string(origin), - SpaceName: string(netAddr.SpaceName), + Value: netAddr.Value, + AddressType: string(netAddr.Type), + Scope: string(netAddr.Scope), + Origin: string(origin), + SpaceName: string(netAddr.SpaceName), + SpaceProviderId: string(netAddr.SpaceProviderId), } } @@ -358,10 +360,11 @@ // as network type, here for Address. func (addr *address) networkAddress() network.Address { return network.Address{ - Value: addr.Value, - Type: network.AddressType(addr.AddressType), - Scope: network.Scope(addr.Scope), - SpaceName: network.SpaceName(addr.SpaceName), + Value: addr.Value, + Type: network.AddressType(addr.AddressType), + Scope: network.Scope(addr.Scope), + SpaceName: network.SpaceName(addr.SpaceName), + SpaceProviderId: network.Id(addr.SpaceProviderId), } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/address_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/address_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/address_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/address_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -121,3 +121,23 @@ } c.Assert(hostsPortsEqual(first, second), jc.IsTrue) } + +func (s *AddressEqualitySuite) TestAddressConversion(c *gc.C) { + machineAddress := network.Address{ + Value: "foo", + Type: network.IPv4Address, + Scope: network.ScopePublic, + } + stateAddress := fromNetworkAddress(machineAddress, "machine") + c.Assert(machineAddress, jc.DeepEquals, stateAddress.networkAddress()) + + providerAddress := network.Address{ + Value: "bar", + Type: network.IPv4Address, + Scope: network.ScopePublic, + SpaceName: "test-space", + SpaceProviderId: "666", + } + stateAddress = fromNetworkAddress(providerAddress, "provider") + c.Assert(providerAddress, jc.DeepEquals, stateAddress.networkAddress()) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/allcollections.go juju-core-2.6.5/src/github.com/juju/juju/state/allcollections.go --- juju-core-2.6.2/src/github.com/juju/juju/state/allcollections.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/allcollections.go 2019-06-28 17:10:43.000000000 +0000 @@ -177,7 +177,12 @@ // This collection holds workload metrics reported by certain charms // for passing onward to other tools. - metricsC: {global: true}, + metricsC: { + global: true, + indexes: []mgo.Index{{ + Key: []string{"model-uuid", "sent"}, + }}, + }, // This collection holds persistent state for the metrics manager. metricsManagerC: {global: true}, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/allwatcher.go juju-core-2.6.5/src/github.com/juju/juju/state/allwatcher.go --- juju-core-2.6.2/src/github.com/juju/juju/state/allwatcher.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/allwatcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -101,6 +101,8 @@ collection.docType = reflect.TypeOf(backingRemoteApplication{}) case applicationOffersC: collection.docType = reflect.TypeOf(backingApplicationOffer{}) + case generationsC: + collection.docType = reflect.TypeOf(backingGeneration{}) default: panic(errors.Errorf("unknown collection %q", collName)) } @@ -240,6 +242,7 @@ Id: m.Id, Life: multiwatcher.Life(m.Life.String()), Series: m.Series, + ContainerType: m.ContainerType, Jobs: paramsJobsFromJobs(m.Jobs), SupportedContainers: m.SupportedContainers, SupportedContainersKnown: m.SupportedContainersKnown, @@ -542,25 +545,12 @@ if err != nil { return errors.Annotatef(err, "reading application status for key %s", key) } - if err == nil { - info.Status = multiwatcher.StatusInfo{ - Current: applicationStatus.Status, - Message: applicationStatus.Message, - Data: normaliseStatusData(applicationStatus.Data), - Since: applicationStatus.Since, - } - } else { - // TODO(wallyworld) - bug http://pad.lv/1451283 - // return an error here once we figure out what's happening - // Not sure how status can even return NotFound as it is created - // with the application initially. For now, we'll log the error as per - // the above and return Unknown. - now := st.clock().Now() - info.Status = multiwatcher.StatusInfo{ - Current: status.Unknown, - Since: &now, - Data: normaliseStatusData(nil), - } + + info.Status = multiwatcher.StatusInfo{ + Current: applicationStatus.Status, + Message: applicationStatus.Message, + Data: normaliseStatusData(applicationStatus.Data), + Since: applicationStatus.Since, } } else { // The entry already exists, so preserve the current status. @@ -612,7 +602,13 @@ } if ch.LXDProfile != nil && !ch.LXDProfile.Empty() { - info.LXDProfile = toMulitwatcherProfile(ch.LXDProfile) + info.LXDProfile = toMultiwatcherProfile(ch.LXDProfile) + } + + if ch.Config != nil { + if ds := ch.Config.DefaultSettings(); len(ds) > 0 { + info.DefaultConfig = ds + } } store.Update(info) @@ -632,7 +628,7 @@ return ch.DocID } -func toMulitwatcherProfile(profile *charm.LXDProfile) *multiwatcher.Profile { +func toMultiwatcherProfile(profile *charm.LXDProfile) *multiwatcher.Profile { unescapedProfile := unescapeLXDProfile(profile) return &multiwatcher.Profile{ Config: unescapedProfile.Config, @@ -959,7 +955,7 @@ info0 = &newInfo case *multiwatcher.MachineInfo: newInfo := *info - // lets dissambiguate between juju machine agent and provider instance statuses. + // lets disambiguate between juju machine agent and provider instance statuses. if strings.HasSuffix(id, "#instance") { newInfo.InstanceStatus = s.toStatusInfo() } else { @@ -994,11 +990,23 @@ // Retrieve the unit. unit, err := st.Unit(newInfo.Name) if err != nil { + if errors.IsNotFound(err) { + // It is possible that the event processing is happening slower + // than reality and a missing unit isn't that terrible. + logger.Debugf("unit %q not in DB", newInfo.Name) + return nil + } return errors.Annotatef(err, "cannot retrieve unit %q", newInfo.Name) } // A change in a unit's status might also affect its application. application, err := unit.Application() if err != nil { + if errors.IsNotFound(err) { + // It is possible that the event processing is happening slower + // than reality and a missing application isn't that terrible. + logger.Debugf("application for unit %q not in DB", newInfo.Name) + return nil + } return errors.Trace(err) } applicationId, ok := backingEntityIdForGlobalKey(st.ModelUUID(), application.globalKey()) @@ -1325,6 +1333,66 @@ } } +type backingGeneration generationDoc + +func (g *backingGeneration) updated(st *State, store *multiwatcherStore, id string) error { + // Convert the state representation of config deltas + // to the multiwatcher representation. + var cfg map[string][]multiwatcher.ItemChange + if len(g.Config) > 0 { + cfg = make(map[string][]multiwatcher.ItemChange, len(g.Config)) + for app, deltas := range g.Config { + d := make([]multiwatcher.ItemChange, len(deltas)) + for i, delta := range deltas { + d[i] = multiwatcher.ItemChange{ + Type: delta.Type, + Key: delta.Key, + OldValue: delta.OldValue, + NewValue: delta.NewValue, + } + } + cfg[app] = d + } + } + + // Make a copy of the AssignedUnits map. + assigned := make(map[string][]string, len(g.AssignedUnits)) + for k, v := range g.AssignedUnits { + units := make([]string, len(v)) + copy(units, v) + assigned[k] = units + } + + info := &multiwatcher.GenerationInfo{ + ModelUUID: st.ModelUUID(), + Id: st.localID(id), + Name: g.Name, + AssignedUnits: assigned, + Config: cfg, + Created: g.Created, + CreatedBy: g.CreatedBy, + Completed: g.Completed, + CompletedBy: g.CompletedBy, + GenerationId: g.GenerationId, + } + store.Update(info) + return nil + +} + +func (g *backingGeneration) removed(store *multiwatcherStore, modelUUID, id string, _ *State) error { + store.Remove(multiwatcher.EntityId{ + Kind: "generation", + ModelUUID: modelUUID, + Id: id, + }) + return nil +} + +func (g *backingGeneration) mongoId() string { + return g.DocId +} + // backingEntityDoc is implemented by the documents in // collections that the allWatcherStateBacking watches. type backingEntityDoc interface { @@ -1354,6 +1422,7 @@ blocksC, charmsC, constraintsC, + generationsC, instanceDataC, machinesC, openedPortsC, @@ -1439,6 +1508,7 @@ applicationsC, charmsC, constraintsC, + generationsC, instanceDataC, modelsC, machinesC, @@ -1524,10 +1594,11 @@ st, err := b.getState(modelUUID) if err != nil { - if exists, modelErr := b.st.ModelExists(modelUUID); exists && modelErr == nil { - // The entity's model is gone so remove the entity - // from the store. - doc.removed(all, modelUUID, id, nil) + // The state pool will return a not found error if the model is + // in the process of being removed. + if errors.IsNotFound(err) { + // The entity's model is gone so remove the entity from the store. + _ = doc.removed(all, modelUUID, id, nil) return nil } return errors.Trace(err) // prioritise getState error diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/allwatcher_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/allwatcher_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/allwatcher_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/allwatcher_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -44,6 +44,7 @@ _ backingEntityDoc = (*backingOpenedPorts)(nil) _ backingEntityDoc = (*backingAction)(nil) _ backingEntityDoc = (*backingBlock)(nil) + _ backingEntityDoc = (*backingGeneration)(nil) ) var dottedConfig = ` @@ -155,9 +156,10 @@ }) add(&multiwatcher.CharmInfo{ - ModelUUID: modelUUID, - CharmURL: applicationCharmURL(wordpress).String(), - Life: multiwatcher.Life("alive"), + ModelUUID: modelUUID, + CharmURL: applicationCharmURL(wordpress).String(), + Life: multiwatcher.Life("alive"), + DefaultConfig: map[string]interface{}{"blog-title": "My Title"}, }) logging := AddTestingApplication(c, st, "logging", AddTestingCharm(c, st, "logging")) @@ -632,6 +634,10 @@ testChangeApplicationOffers(c, s.performChangeTestCases) } +func (s *allWatcherStateSuite) TestChangeGenerations(c *gc.C) { + testChangeGenerations(c, s.performChangeTestCases) +} + func (s *allWatcherStateSuite) TestChangeActions(c *gc.C) { changeTestFuncs := []changeTestFunc{ func(c *gc.C, st *State) changeTestCase { @@ -1127,9 +1133,10 @@ }, }, { Entity: &multiwatcher.CharmInfo{ - ModelUUID: s.state.ModelUUID(), - CharmURL: "local:quantal/quantal-wordpress-3", - Life: multiwatcher.Life("alive"), + ModelUUID: s.state.ModelUUID(), + CharmURL: "local:quantal/quantal-wordpress-3", + Life: multiwatcher.Life("alive"), + DefaultConfig: map[string]interface{}{"blog-title": "My Title"}, }, }, { Entity: &multiwatcher.ApplicationInfo{ @@ -1379,6 +1386,26 @@ return NewAllModelWatcherStateBacking(s.state, s.pool) } +func (s *allModelWatcherStateSuite) TestMissingModelNotError(c *gc.C) { + b := s.NewAllModelWatcherStateBacking() + defer b.Release() + all := newStore() + + dyingModel := "fake-uuid" + st, err := s.pool.Get(dyingModel) + c.Assert(err, jc.ErrorIsNil) + defer st.Release() + + removed, err := s.pool.Remove(dyingModel) + c.Assert(err, jc.ErrorIsNil) + c.Assert(removed, jc.IsFalse) + + // If the state pool is in the process of removing a model, it will + // return a NotFound error. + err = b.Changed(all, watcher.Change{C: modelsC, Id: dyingModel}) + c.Assert(err, jc.ErrorIsNil) +} + // performChangeTestCases runs a passed number of test cases for changes. func (s *allModelWatcherStateSuite) performChangeTestCases(c *gc.C, changeTestFuncs []changeTestFunc) { for i, changeTestFunc := range changeTestFuncs { @@ -1793,15 +1820,20 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(m10.Id(), gc.Equals, "0") + // Add a branch. + c.Assert(st1.AddBranch("new-branch", "test-user"), jc.ErrorIsNil) + br, err := st1.Branch("new-branch") + c.Assert(br, gc.NotNil) + now := st0.clock().Now() backing := s.NewAllModelWatcherStateBacking() tw := newTestWatcher(backing, st0, c) defer tw.Stop() - // Expect to see events for the already created models and - // machines first. - deltas := tw.All(4) + // Expect to see events for the already created models, + // machines and branch first. + deltas := tw.All(5) checkDeltasEqual(c, deltas, []multiwatcher.Delta{{ Entity: &multiwatcher.ModelInfo{ ModelUUID: model0.UUID(), @@ -1882,6 +1914,14 @@ HasVote: false, WantsVote: false, }, + }, { + Entity: &multiwatcher.GenerationInfo{ + ModelUUID: st1.ModelUUID(), + Id: "0", + Name: "new-branch", + AssignedUnits: map[string][]string{}, + CreatedBy: "test-user", + }, }}) // Destroy a machine and make sure that's seen. @@ -1966,9 +2006,11 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(m20.Id(), gc.Equals, "0") + c.Assert(br.AssignUnit(wu.Name()), jc.ErrorIsNil) + // Look for the state changes from the allwatcher. later := st2.clock().Now() - deltas = tw.All(9) + deltas = tw.All(10) expectedRemoveMachineEntity := &multiwatcher.MachineInfo{ ModelUUID: st1.ModelUUID(), @@ -2063,9 +2105,10 @@ }, }, { Entity: &multiwatcher.CharmInfo{ - ModelUUID: st1.ModelUUID(), - CharmURL: "local:quantal/quantal-wordpress-3", - Life: multiwatcher.Life("alive"), + ModelUUID: st1.ModelUUID(), + CharmURL: "local:quantal/quantal-wordpress-3", + Life: multiwatcher.Life("alive"), + DefaultConfig: map[string]interface{}{"blog-title": "My Title"}, }, }, { Removed: true, @@ -2145,6 +2188,14 @@ HasVote: false, WantsVote: false, }, + }, { + Entity: &multiwatcher.GenerationInfo{ + ModelUUID: st1.ModelUUID(), + Id: "0", + Name: "new-branch", + AssignedUnits: map[string][]string{wordpress.Name(): {wu.Name()}}, + CreatedBy: "test-user", + }, }} checkDeltasEqual(c, deltas, expectedDeltas) @@ -2924,18 +2975,19 @@ }} }, func(c *gc.C, st *State) changeTestCase { - charm := AddTestingCharm(c, st, "wordpress") + ch := AddTestingCharm(c, st, "wordpress") return changeTestCase{ about: "charm is added if it's in backing but not in Store", change: watcher.Change{ C: "charms", - Id: st.docID(charm.URL().String()), + Id: st.docID(ch.URL().String()), }, expectContents: []multiwatcher.EntityInfo{ &multiwatcher.CharmInfo{ - ModelUUID: st.ModelUUID(), - CharmURL: charm.URL().String(), - Life: multiwatcher.Life("alive"), + ModelUUID: st.ModelUUID(), + CharmURL: ch.URL().String(), + Life: multiwatcher.Life("alive"), + DefaultConfig: map[string]interface{}{"blog-title": "My Title"}, }}} }, } @@ -4046,6 +4098,91 @@ runChangeTests(c, changeTestFuncs) } +func testChangeGenerations(c *gc.C, runChangeTests func(*gc.C, []changeTestFunc)) { + changeTestFuncs := []changeTestFunc{ + func(c *gc.C, st *State) changeTestCase { + return changeTestCase{ + about: "no change if generation absent from state and store", + change: watcher.Change{ + C: "generations", + Id: st.docID("does-not-exist"), + }} + }, + func(c *gc.C, st *State) changeTestCase { + return changeTestCase{ + about: "generation is removed if not in backing", + initialContents: []multiwatcher.EntityInfo{ + &multiwatcher.GenerationInfo{ + ModelUUID: st.ModelUUID(), + Id: "to-be-removed", + }, + }, + change: watcher.Change{ + C: "generations", + Id: st.docID("to-be-removed"), + }, + } + }, + func(c *gc.C, st *State) changeTestCase { + c.Assert(st.AddBranch("new-branch", "some-user"), jc.ErrorIsNil) + branch, err := st.Branch("new-branch") + c.Assert(err, jc.ErrorIsNil) + + return changeTestCase{ + about: "generation is added if in backing but not in store", + change: watcher.Change{ + C: "generations", + Id: st.docID(branch.doc.DocId), + }, + expectContents: []multiwatcher.EntityInfo{ + &multiwatcher.GenerationInfo{ + ModelUUID: st.ModelUUID(), + Id: st.localID(branch.doc.DocId), + Name: "new-branch", + AssignedUnits: map[string][]string{}, + CreatedBy: "some-user", + }}, + } + }, + func(c *gc.C, st *State) changeTestCase { + c.Assert(st.AddBranch("new-branch", "some-user"), jc.ErrorIsNil) + branch, err := st.Branch("new-branch") + c.Assert(err, jc.ErrorIsNil) + + app := AddTestingApplication(c, st, "wordpress", AddTestingCharm(c, st, "wordpress")) + u, err := app.AddUnit(AddUnitParams{}) + c.Assert(err, jc.ErrorIsNil) + + c.Assert(branch.AssignUnit(u.Name()), jc.ErrorIsNil) + + return changeTestCase{ + about: "generation is updated if in backing and in store", + change: watcher.Change{ + C: "generations", + Id: st.docID(branch.doc.DocId), + }, + initialContents: []multiwatcher.EntityInfo{ + &multiwatcher.GenerationInfo{ + ModelUUID: st.ModelUUID(), + Id: st.localID(branch.doc.DocId), + Name: "new-branch", + AssignedUnits: map[string][]string{}, + CreatedBy: "some-user", + }}, + expectContents: []multiwatcher.EntityInfo{ + &multiwatcher.GenerationInfo{ + ModelUUID: st.ModelUUID(), + Id: st.localID(branch.doc.DocId), + Name: "new-branch", + AssignedUnits: map[string][]string{app.Name(): {u.Name()}}, + CreatedBy: "some-user", + }}, + } + }, + } + runChangeTests(c, changeTestFuncs) +} + func newTestAllWatcher(st *State, c *gc.C) *testWatcher { return newTestWatcher(newAllWatcherStateBacking(st, WatchParams{IncludeOffers: false}), st, c) } @@ -4133,7 +4270,7 @@ func (tw *testWatcher) AssertChanges(c *gc.C, expected int) { var count int tw.st.StartSync() - maxWait := tw.st.clock().After(testing.LongWait) + maxWait := time.After(testing.LongWait) done: for { select { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/application.go juju-core-2.6.5/src/github.com/juju/juju/state/application.go --- juju-core-2.6.2/src/github.com/juju/juju/state/application.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/application.go 2019-06-28 17:10:43.000000000 +0000 @@ -212,7 +212,12 @@ a.doc.Life = Dying } }() - return a.st.ApplyOperation(a.DestroyOperation()) + op := a.DestroyOperation() + err = a.st.ApplyOperation(op) + if len(op.Errors) != 0 { + logger.Warningf("operational errors destroying application %v: %v", a.Name(), op.Errors) + } + return err } // DestroyOperation returns a model operation that will destroy the application. @@ -263,17 +268,38 @@ case errAlreadyDying: return nil, jujutxn.ErrNoOperations case nil: - return ops, nil - } - if op.Force { - logger.Warningf("forcing destroy application for %v despite error %v", op.app.Name(), err) - return ops, nil + if len(op.Errors) == 0 { + return ops, nil + } + if op.Force { + logger.Debugf("forcing application removal") + return ops, nil + } + // Should be impossible to reach as--by convention--we return an error and + // an empty ops slice when a force-able error occurs and we're running !op.Force + err = errors.Errorf("errors encountered: %q", op.Errors) } return nil, err } // Done is part of the ModelOperation interface. func (op *DestroyApplicationOperation) Done(err error) error { + if err == nil { + return err + } + connected, err2 := applicationHasConnectedOffers(op.app.st, op.app.Name()) + if err2 != nil { + err = errors.Trace(err2) + } else if connected { + rels, err2 := op.app.st.AllRelations() + if err2 != nil { + err = errors.Trace(err2) + } + err = errors.Errorf("application is used by %d offer%s", len(rels), plural(len(rels))) + } else { + err = errors.NewNotSupported(err, "change to the application detected") + } + return errors.Annotatef(err, "cannot destroy application %q", op.app) } @@ -340,25 +366,42 @@ } ops = append(ops, resOps...) - // We can't delete an application if it is being offered. - // TODO (anastasiamac 2019-03-29) Should we force remove applications with offers now? + // We can't delete an application if it is being offered, + // unless those offers have no relations. if !op.RemoveOffers { countOp, n, err := countApplicationOffersRefOp(op.app.st, op.app.Name()) if err != nil { - if !op.Force { + return nil, errors.Trace(err) + } + if n == 0 { + ops = append(ops, countOp) + } else { + connected, err := applicationHasConnectedOffers(op.app.st, op.app.Name()) + if err != nil { return nil, errors.Trace(err) } - op.AddError(err) - } else { - if n != 0 { - err = errors.Errorf("application is used by %d offer%s", n, plural(n)) - if !op.Force { - return nil, err - } - op.AddError(err) + if connected { + return nil, errors.Errorf("application is used by %d offer%s", n, plural(n)) } - // When we are forcing, regardless of the error and offer count, we want this countOp added. - ops = append(ops, countOp) + // None of our offers are connected, + // it's safe to remove them. + removeOfferOps, err := removeApplicationOffersOps(op.app.st, op.app.Name()) + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, removeOfferOps...) + ops = append(ops, txn.Op{ + C: applicationsC, + Id: op.app.doc.DocID, + Assert: bson.D{ + // We're using the txn-revno here because relationcount is too + // coarse-grained for what we need. Using the revno will + // create false positives during concurrent updates of the + // model, but eliminates the possibility of it entering + // an inconsistent state. + {"txn-revno", op.app.doc.TxnRevno}, + }, + }) } } @@ -1456,34 +1499,48 @@ // This is used on CAAS models. func (a *Application) ChangeScale(scaleChange int) (int, error) { newScale := a.doc.DesiredScale + scaleChange + logger.Tracef("ChangeScale DesiredScale %v, scaleChange %v, newScale %v", a.doc.DesiredScale, scaleChange, newScale) if newScale < 0 { return a.doc.DesiredScale, errors.NotValidf("cannot remove more units than currently exist") } buildTxn := func(attempt int) ([]txn.Op, error) { if attempt > 0 { + if err := a.Refresh(); err != nil { + return nil, errors.Trace(err) + } alive, err := isAlive(a.st, applicationsC, a.doc.DocID) if err != nil { return nil, errors.Trace(err) } else if !alive { return nil, applicationNotAliveErr } - if err := a.Refresh(); err != nil { - return nil, errors.Trace(err) - } newScale = a.doc.DesiredScale + scaleChange if newScale < 0 { return nil, errors.NotValidf("cannot remove more units than currently exist") } } - return []txn.Op{{ + ops := []txn.Op{{ C: applicationsC, Id: a.doc.DocID, - Assert: bson.D{{"life", Alive}, + Assert: bson.D{ + {"life", Alive}, {"charmurl", a.doc.CharmURL}, {"unitcount", a.doc.UnitCount}, - {"scale", a.doc.DesiredScale}}, + {"scale", a.doc.DesiredScale}, + }, Update: bson.D{{"$set", bson.D{{"scale", newScale}}}}, - }}, nil + }} + + cloudSvcDoc := cloudServiceDoc{ + DocID: a.globalKey(), + DesiredScaleProtected: true, + } + cloudSvcOp, err := buildCloudServiceOps(a.st, cloudSvcDoc) + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, cloudSvcOp...) + return ops, nil } if err := a.st.db().Run(buildTxn); err != nil { return a.doc.DesiredScale, errors.Errorf("cannot set scale for application %q to %v: %v", a, newScale, onAbort(err, applicationNotAliveErr)) @@ -1494,30 +1551,67 @@ // SetScale sets the application's desired scale value. // This is used on CAAS models. -func (a *Application) SetScale(scale int) error { +func (a *Application) SetScale(scale int, generation int64, force bool) error { if scale < 0 { return errors.NotValidf("application scale %d", scale) } + svcInfo, err := a.ServiceInfo() + if err != nil && !errors.IsNotFound(err) { + return errors.Trace(err) + } + if err == nil { + logger.Tracef( + "SetScale DesiredScaleProtected %v, DesiredScale %v -> %v, Generation %v -> %v", + svcInfo.DesiredScaleProtected(), a.doc.DesiredScale, scale, svcInfo.Generation(), generation, + ) + if svcInfo.DesiredScaleProtected() && !force && scale != a.doc.DesiredScale { + return errors.Forbiddenf("SetScale(%d) without force while desired scale %d is not applied yet", scale, a.doc.DesiredScale) + } + if !force && generation < svcInfo.Generation() { + return errors.Forbiddenf( + "application generation %d can not be reverted to %d", svcInfo.Generation(), generation, + ) + } + } + buildTxn := func(attempt int) ([]txn.Op, error) { if attempt > 0 { + if err := a.Refresh(); err != nil { + return nil, errors.Trace(err) + } alive, err := isAlive(a.st, applicationsC, a.doc.DocID) if err != nil { return nil, errors.Trace(err) } else if !alive { return nil, applicationNotAliveErr } - if err := a.Refresh(); err != nil { - return nil, errors.Trace(err) - } } - return []txn.Op{{ + ops := []txn.Op{{ C: applicationsC, Id: a.doc.DocID, - Assert: bson.D{{"life", Alive}, + Assert: bson.D{ + {"life", Alive}, {"charmurl", a.doc.CharmURL}, - {"unitcount", a.doc.UnitCount}}, + {"unitcount", a.doc.UnitCount}, + }, Update: bson.D{{"$set", bson.D{{"scale", scale}}}}, - }}, nil + }} + cloudSvcDoc := cloudServiceDoc{ + DocID: a.globalKey(), + } + if force { + // scale from cli. + cloudSvcDoc.DesiredScaleProtected = true + } else { + // scale from cluster always has a valid generation (>= current generation). + cloudSvcDoc.Generation = generation + } + cloudSvcOp, err := buildCloudServiceOps(a.st, cloudSvcDoc) + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, cloudSvcOp...) + return ops, nil } if err := a.st.db().Run(buildTxn); err != nil { return errors.Errorf("cannot set scale for application %q to %v: %v", a, scale, onAbort(err, applicationNotAliveErr)) @@ -3009,12 +3103,12 @@ // ServiceInfo returns information about this application's cloud service. // This is only used for CAAS models. -func (a *Application) ServiceInfo() (CloudService, error) { +func (a *Application) ServiceInfo() (CloudServicer, error) { svc, err := a.st.CloudService(a.Name()) if err != nil { - return CloudService{}, errors.Trace(err) + return nil, errors.Trace(err) } - return *svc, nil + return svc, nil } // UnitCount returns the of number of units for this application. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/applicationoffers.go juju-core-2.6.5/src/github.com/juju/juju/state/applicationoffers.go --- juju-core-2.6.2/src/github.com/juju/juju/state/applicationoffers.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/applicationoffers.go 2019-06-28 17:10:43.000000000 +0000 @@ -176,7 +176,7 @@ // When 'force' is set on the operation, this call will return needed operations // and accumulate all operational errors encountered in the operation. // If the 'force' is not set, any error will be fatal and no operations will be returned. - switch ops, err := op.internalRemove(offer); err { + switch ops, err := op.internalRemove(offer, attempt); err { case errRefresh: case errAlreadyDying: return nil, jujutxn.ErrNoOperations @@ -207,13 +207,13 @@ func (s *applicationOffers) Remove(offerName string, force bool) error { op := s.RemoveOfferOperation(offerName, force) err := s.st.ApplyOperation(op) - // TODO (anastasiamac 2019-04-10) we can surfacing these errors to the user. - // These are non-fatal operational errors that occurred during force and are - // collected in the operation, op.Errors. + if len(op.Errors) != 0 { + logger.Warningf("operational errors removing offer %v: %v", offerName, op.Errors) + } return err } -func (op *RemoveOfferOperation) internalRemove(offer *crossmodel.ApplicationOffer) ([]txn.Op, error) { +func (op *RemoveOfferOperation) internalRemove(offer *crossmodel.ApplicationOffer, attempt int) ([]txn.Op, error) { // Load the application before counting the connections // so we can do a consistency check on relation count. app, err := op.offers.st.Application(offer.ApplicationName) @@ -262,6 +262,13 @@ return nil, err } + logger.Debugf("forcing cleanup of remote application %v", remoteApp.Name()) + remoteAppOps, err := remoteApp.DestroyOperation(op.Force).Build(attempt) + if err != nil && err != jujutxn.ErrNoOperations { + op.AddError(err) + } + ops = append(ops, remoteAppOps...) + // Force any remote units to leave scope so the offer // can be cleaned up. logger.Debugf("forcing cleanup of units for %v", remoteApp.Name()) @@ -273,9 +280,6 @@ for _, ru := range remoteUnits { leaveScopeOps, err := ru.leaveScopeForcedOps(&op.ForcedOperation) if err != nil && err != jujutxn.ErrNoOperations { - if !op.Force { - return nil, errors.Trace(err) - } op.AddError(err) } ops = append(ops, leaveScopeOps...) @@ -312,6 +316,37 @@ return ops, nil } +// applicationOffersDocs returns the offer docs for the given application +func applicationOffersDocs(st *State, application string) ([]applicationOfferDoc, error) { + applicationOffersCollection, closer := st.db().GetCollection(applicationOffersC) + defer closer() + query := bson.D{{"application-name", application}} + var docs []applicationOfferDoc + if err := applicationOffersCollection.Find(query).All(&docs); err != nil { + return nil, errors.Annotatef(err, "reading application %q offers", application) + } + return docs, nil +} + +// applicationHasConnectedOffers returns true when any of the the application's +// offers have connections +func applicationHasConnectedOffers(st *State, application string) (bool, error) { + offers, err := applicationOffersDocs(st, application) + if err != nil { + return false, errors.Trace(err) + } + for _, offer := range offers { + connections, err := st.OfferConnections(offer.OfferUUID) + if err != nil { + return false, errors.Trace(err) + } + if len(connections) > 0 { + return true, nil + } + } + return false, nil +} + // removeApplicationOffersOps returns txn.Ops that will remove all offers for // the specified application. No assertions on the application or the offer // connections are made; the caller is responsible for ensuring that offer @@ -330,20 +365,15 @@ if n == 0 { return []txn.Op{countRefsOp}, nil } - - applicationOffersCollection, closer := st.db().GetCollection(applicationOffersC) - defer closer() - query := bson.D{{"application-name", application}} - var docs []applicationOfferDoc - if err := applicationOffersCollection.Find(query).All(&docs); err != nil { - return nil, errors.Annotatef(err, "reading application %q offers", application) + docs, err := applicationOffersDocs(st, application) + if err != nil { + return nil, errors.Trace(err) } - var ops []txn.Op for _, doc := range docs { ops = append(ops, txn.Op{ C: applicationOffersC, - Id: doc.OfferName, + Id: doc.DocID, Assert: txn.DocExists, Remove: true, }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/applicationoffers_test.go juju-core-2.6.5/src/github.com/juju/juju/state/applicationoffers_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/applicationoffers_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/applicationoffers_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "github.com/juju/errors" jc "github.com/juju/testing/checkers" + "github.com/juju/txn" gc "gopkg.in/check.v1" "gopkg.in/juju/charm.v6" "gopkg.in/juju/names.v2" @@ -21,6 +22,7 @@ type applicationOffersSuite struct { ConnSuite + mysql *state.Application } var _ = gc.Suite(&applicationOffersSuite{}) @@ -28,7 +30,7 @@ func (s *applicationOffersSuite) SetUpTest(c *gc.C) { s.ConnSuite.SetUpTest(c) ch := s.AddTestingCharm(c, "mysql") - s.AddTestingApplication(c, "mysql", ch) + s.mysql = s.AddTestingApplication(c, "mysql", ch) } func (s *applicationOffersSuite) createDefaultOffer(c *gc.C) crossmodel.ApplicationOffer { @@ -47,6 +49,22 @@ return *offer } +func (s *applicationOffersSuite) TestDetectingOfferConnections(c *gc.C) { + connected, err := state.ApplicationHasConnectedOffers(s.State, "mysql") + c.Assert(err, jc.ErrorIsNil) + c.Check(connected, jc.IsFalse) + + offer := s.createDefaultOffer(c) + connected, err = state.ApplicationHasConnectedOffers(s.State, "mysql") + c.Assert(err, jc.ErrorIsNil) + c.Check(connected, jc.IsFalse) + + s.addOfferConnection(c, offer.OfferUUID) + connected, err = state.ApplicationHasConnectedOffers(s.State, "mysql") + c.Assert(err, jc.ErrorIsNil) + c.Check(connected, jc.IsTrue) +} + func (s *applicationOffersSuite) TestEndpoints(c *gc.C) { offer := s.createDefaultOffer(c) _, err := state.ApplicationOfferEndpoint(offer, "foo") @@ -477,8 +495,8 @@ c.Assert(err, gc.ErrorMatches, `cannot update application offer "mysql": application offer "hosted-mysql" not found`) } -func (s *applicationOffersSuite) addOfferConnection(c *gc.C, offerUUID string) { - _, err := s.State.AddRemoteApplication(state.AddRemoteApplicationParams{ +func (s *applicationOffersSuite) addOfferConnection(c *gc.C, offerUUID string) *state.RemoteApplication { + app, err := s.State.AddRemoteApplication(state.AddRemoteApplicationParams{ Name: "wordpress", SourceModel: testing.ModelTag, Endpoints: []charm.Relation{{ @@ -500,9 +518,70 @@ Username: "admin", SourceModelUUID: testing.ModelTag.Id(), }) + + return app +} + +func (s *applicationOffersSuite) TestRemoveOffersSucceedsWithZeroConnections(c *gc.C) { + s.createDefaultOffer(c) + ao := state.NewApplicationOffers(s.State) + err := ao.Remove("hosted-mysql", false) + c.Assert(err, jc.ErrorIsNil) + _, err = ao.ApplicationOffer("hosted-mysql") + c.Assert(err, jc.Satisfies, errors.IsNotFound) + + err = s.mysql.Refresh() + c.Assert(err, jc.ErrorIsNil) + assertNoOffersRef(c, s.State, "mysql") +} + +func (s *applicationOffersSuite) TestRemoveApplicationSucceedsWithZeroConnections(c *gc.C) { + s.createDefaultOffer(c) + + err := s.mysql.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = s.mysql.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertNoOffersRef(c, s.State, "mysql") } -func (s *applicationOffersSuite) TestRemoveOffersWithConnections(c *gc.C) { +func (s *applicationOffersSuite) TestRemoveApplicationSucceedsWithZeroConnectionsRace(c *gc.C) { + addOffer := func() { + s.createDefaultOffer(c) + } + defer state.SetBeforeHooks(c, s.State, addOffer).Check() + err := s.mysql.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = s.mysql.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertNoOffersRef(c, s.State, "mysql") +} + +func (s *applicationOffersSuite) TestRemoveApplicationFailsWithOfferWithConnections(c *gc.C) { + offer := s.createDefaultOffer(c) + s.addOfferConnection(c, offer.OfferUUID) + + err := s.mysql.Destroy() + c.Assert(err, gc.ErrorMatches, `cannot destroy application "mysql": application is used by 1 offer`) + err = s.mysql.Refresh() + c.Assert(err, jc.ErrorIsNil) + assertOffersRef(c, s.State, "mysql", 1) +} + +func (s *applicationOffersSuite) TestRemoveApplicationFailsWithOfferWithConnectionsRace(c *gc.C) { + addConnectedOffer := func() { + offer := s.createDefaultOffer(c) + s.addOfferConnection(c, offer.OfferUUID) + } + defer state.SetBeforeHooks(c, s.State, addConnectedOffer).Check() + err := s.mysql.Destroy() + c.Assert(err, gc.ErrorMatches, `cannot destroy application "mysql": application is used by 1 offer`) + err = s.mysql.Refresh() + c.Assert(err, jc.ErrorIsNil) + assertOffersRef(c, s.State, "mysql", 1) +} + +func (s *applicationOffersSuite) TestRemoveOffersFailsWithConnections(c *gc.C) { offer := s.createDefaultOffer(c) s.addOfferConnection(c, offer.OfferUUID) ao := state.NewApplicationOffers(s.State) @@ -510,6 +589,35 @@ c.Assert(err, gc.ErrorMatches, `cannot delete application offer "hosted-mysql": offer has 1 relation`) } +func (s *applicationOffersSuite) TestRemoveOffersFailsWithConnectionsRace(c *gc.C) { + offer := s.createDefaultOffer(c) + ao := state.NewApplicationOffers(s.State) + addOfferConnection := func() { + c.Logf("adding connection to %s", offer.OfferUUID) + s.addOfferConnection(c, offer.OfferUUID) + } + defer state.SetBeforeHooks(c, s.State, addOfferConnection).Check() + + err := ao.Remove("hosted-mysql", false) + c.Assert(err, gc.ErrorMatches, `cannot delete application offer "hosted-mysql": offer has 1 relation`) +} + +func (s *applicationOffersSuite) TestRemoveOffersSucceedsWhenLocalRelationAdded(c *gc.C) { + offer := s.createDefaultOffer(c) + s.AddTestingApplication(c, "local-wordpress", s.AddTestingCharm(c, "wordpress")) + _, err := s.State.Application(offer.ApplicationName) + eps, err := s.State.InferEndpoints("local-wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddRelation(eps...) + c.Assert(err, jc.ErrorIsNil) + ao := state.NewApplicationOffers(s.State) + + err = ao.Remove(offer.OfferName, false) + c.Assert(err, jc.ErrorIsNil) + _, err = ao.ApplicationOffer("hosted-mysql") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + func (s *applicationOffersSuite) assertInScope(c *gc.C, relUnit *state.RelationUnit, inScope bool) { ok, err := relUnit.InScope() c.Assert(err, jc.ErrorIsNil) @@ -531,6 +639,8 @@ }}, }) c.Assert(err, jc.ErrorIsNil) + wordpress, err := s.State.RemoteApplication("remote-wordpress") + c.Assert(err, jc.ErrorIsNil) wordpressEP, err := rwordpress.Endpoint("db") c.Assert(err, jc.ErrorIsNil) @@ -559,11 +669,48 @@ ao := state.NewApplicationOffers(s.State) err = ao.Remove("hosted-mysql", true) c.Assert(err, jc.ErrorIsNil) + _, err = ao.ApplicationOffer("hosted-mysql") + c.Assert(err, jc.Satisfies, errors.IsNotFound) conn, err := s.State.OfferConnections(offer.OfferUUID) c.Assert(err, jc.ErrorIsNil) c.Assert(conn, gc.HasLen, 0) s.assertInScope(c, wpru, false) s.assertInScope(c, mysqlru, true) + err = wordpress.Refresh() + c.Assert(err, jc.ErrorIsNil) + assertLife(c, wordpress, state.Dying) +} + +func (s *applicationOffersSuite) TestRemovingApplicationFailsRace(c *gc.C) { + s.createDefaultOffer(c) + wp := s.AddTestingApplication(c, "local-wordpress", s.AddTestingCharm(c, "wordpress")) + eps, err := s.State.InferEndpoints(wp.Name(), s.mysql.Name()) + + addRelation := func() { + _, err := s.State.AddRelation(eps...) + c.Assert(err, jc.ErrorIsNil) + } + + rmRelations := func() { + rels, err := s.State.AllRelations() + c.Assert(err, jc.ErrorIsNil) + + for _, rel := range rels { + err = rel.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = s.mysql.Refresh() + c.Assert(err, jc.ErrorIsNil) + } + } + + bumpTxnRevno := txn.TestHook{Before: addRelation, After: rmRelations} + defer state.SetTestHooks(c, s.State, bumpTxnRevno, bumpTxnRevno, bumpTxnRevno).Check() + + err = s.mysql.Destroy() + c.Assert(err, jc.Satisfies, errors.IsNotSupported) + c.Assert(err, gc.ErrorMatches, "cannot destroy application.*") + s.mysql.Refresh() + assertOffersRef(c, s.State, "mysql", 1) } func (s *applicationOffersSuite) TestRemoveOffersWithConnectionsRace(c *gc.C) { @@ -637,6 +784,8 @@ err = ao.Remove(offer.OfferName, false) c.Assert(err, jc.ErrorIsNil) + _, err = ao.ApplicationOffer("hosted-mysql") + c.Assert(err, jc.Satisfies, errors.IsNotFound) err = app.Destroy() c.Assert(err, jc.ErrorIsNil) wc.AssertOneChange() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/application_test.go juju-core-2.6.5/src/github.com/juju/juju/state/application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/application_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/application_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -65,6 +65,15 @@ c.Assert(dirty, jc.IsTrue) } +func (s *ApplicationSuite) removeOfferConnections(c *gc.C, offer crossmodel.ApplicationOffer) { + jujudb := s.MgoSuite.Session.DB("juju") + offerConnectionsCollection := jujudb.C(state.OfferConnectionsC) + + info, err := offerConnectionsCollection.RemoveAll(bson.M{"offer-uuid": offer.OfferUUID}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(info.Matched, gc.Equals, info.Removed) +} + func (s *ApplicationSuite) assertNoCleanup(c *gc.C) { dirty, err := s.State.NeedsCleanup() c.Assert(err, jc.ErrorIsNil) @@ -196,7 +205,7 @@ func (s *ApplicationSuite) TestCAASSetCharm(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) @@ -221,7 +230,7 @@ func (s *ApplicationSuite) TestCAASSetCharmNewDeploymentFails(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) @@ -238,7 +247,7 @@ interface: http requires: db: - interface: mysql + interface: mysql series: - kubernetes deployment: @@ -270,9 +279,9 @@ }) c.Assert(err, jc.ErrorIsNil) - settings, err := s.mysql.CharmConfig(model.GenerationMaster) + cfg, err := s.mysql.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) - c.Assert(settings, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{"key": "value"})) + c.Assert(cfg, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{"key": "value"})) newCh = s.AddConfigCharm(c, "mysql", newStringConfig, 3) err = s.mysql.SetCharm(state.SetCharmConfig{ @@ -281,9 +290,9 @@ }) c.Assert(err, jc.ErrorIsNil) - settings, err = s.mysql.CharmConfig(model.GenerationMaster) + cfg, err = s.mysql.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) - c.Assert(settings, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ + c.Assert(cfg, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ "key": "value", "other": "one", })) @@ -299,24 +308,24 @@ }) c.Assert(err, jc.ErrorIsNil) - settings, err := s.mysql.CharmConfig(model.GenerationMaster) + cfg, err := s.mysql.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) // Update the next generation settings. - settings["key"] = "next-gen-value" - c.Assert(s.mysql.UpdateCharmConfig("new-branch", settings), jc.ErrorIsNil) + cfg["key"] = "next-gen-value" + c.Assert(s.mysql.UpdateCharmConfig("new-branch", cfg), jc.ErrorIsNil) // Settings for the next generation reflect the change. - settings, err = s.mysql.CharmConfig("new-branch") + cfg, err = s.mysql.CharmConfig("new-branch") c.Assert(err, jc.ErrorIsNil) - c.Assert(settings, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ + c.Assert(cfg, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ "key": "next-gen-value", })) // Settings for the current generation are as set with charm. - settings, err = s.mysql.CharmConfig(model.GenerationMaster) + cfg, err = s.mysql.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) - c.Assert(settings, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ + c.Assert(cfg, jc.DeepEquals, s.combinedSettings(newCh, charm.Settings{ "key": "value", })) } @@ -682,13 +691,14 @@ sch, _, err := app.Charm() c.Assert(err, jc.ErrorIsNil) c.Assert(sch.URL(), gc.DeepEquals, expectCh.URL()) - settings, err := app.CharmConfig(model.GenerationMaster) + + chConfig, err := app.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) expected := s.combinedSettings(sch, expectVals) if len(expected) == 0 { - c.Assert(settings, gc.HasLen, 0) + c.Assert(chConfig, gc.HasLen, 0) } else { - c.Assert(settings, gc.DeepEquals, expected) + c.Assert(chConfig, gc.DeepEquals, expected) } err = app.Destroy() @@ -720,6 +730,7 @@ c.Assert(err, jc.ErrorIsNil) err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) s.mysql = s.AddTestingApplication(c, "mysql", s.charm) unit, err = s.mysql.AddUnit(state.AddUnitParams{}) c.Assert(err, jc.ErrorIsNil) @@ -1138,11 +1149,11 @@ c.Assert(err, gc.ErrorMatches, t.err) } else { c.Assert(err, jc.ErrorIsNil) - settings, err := app.CharmConfig(model.GenerationMaster) + cfg, err := app.CharmConfig(model.GenerationMaster) c.Assert(err, jc.ErrorIsNil) appConfig := t.expect expected := s.combinedSettings(sch, appConfig) - c.Assert(settings, gc.DeepEquals, expected) + c.Assert(cfg, gc.DeepEquals, expected) } err = app.Destroy() c.Assert(err, jc.ErrorIsNil) @@ -1611,18 +1622,11 @@ c.Assert(err, jc.ErrorIsNil) assertOffersRef(c, s.State, "mysql", 1) - // Trying to destroy the app while there is an offer fails. - err = s.mysql.Destroy() - c.Assert(err, gc.ErrorMatches, `cannot destroy application "mysql": application is used by 1 offer`) - assertOffersRef(c, s.State, "mysql", 1) - - // Remove the last offer and the app can be destroyed. - err = ao.Remove("mysql-offer", false) - c.Assert(err, jc.ErrorIsNil) - assertNoOffersRef(c, s.State, "mysql") - + // Trying to destroy the app while there is an offer + // succeeds when that offer has no connections err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) assertNoOffersRef(c, s.State, "mysql") } @@ -1653,7 +1657,7 @@ op.RemoveOffers = true err = s.State.ApplyOperation(op) c.Assert(err, jc.ErrorIsNil) - + assertRemoved(c, s.mysql) assertNoOffersRef(c, s.State, "mysql") offers, err := ao.AllApplicationOffers() @@ -1675,8 +1679,30 @@ defer state.SetBeforeHooks(c, s.State, addOffer).Check() err := s.mysql.Destroy() - c.Assert(err, gc.ErrorMatches, `cannot destroy application "mysql": application is used by 1 offer`) - assertOffersRef(c, s.State, "mysql", 1) + c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) + assertNoOffersRef(c, s.State, "mysql") +} + +func (s *ApplicationSuite) TestOffersRefRaceWithForce(c *gc.C) { + addOffer := func() { + ao := state.NewApplicationOffers(s.State) + _, err := ao.AddOffer(crossmodel.AddApplicationOfferArgs{ + OfferName: "hosted-mysql", + ApplicationName: "mysql", + Endpoints: map[string]string{"server": "server"}, + Owner: s.Owner.Id(), + }) + c.Assert(err, jc.ErrorIsNil) + } + defer state.SetBeforeHooks(c, s.State, addOffer).Check() + + op := s.mysql.DestroyOperation() + op.Force = true + err := s.State.ApplyOperation(op) + c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) + assertNoOffersRef(c, s.State, "mysql") } const mysqlBaseMeta = ` @@ -1732,6 +1758,7 @@ // Check state consistency by attempting to destroy the application. err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) // Check the peer relations got destroyed as well. for _, rel := range rels { @@ -1960,8 +1987,7 @@ err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) - err = s.mysql.Refresh() - c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertRemoved(c, s.mysql) } func (s *ApplicationSuite) TestSetPassword(c *gc.C) { @@ -2001,6 +2027,7 @@ c.Assert(err, jc.ErrorIsNil) err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertLife(c, s.mysql, state.Dying) err = s.mysql.ClearExposed() c.Assert(err, gc.ErrorMatches, notAliveErr) err = s.mysql.SetExposed() @@ -2078,6 +2105,7 @@ c.Assert(err, jc.ErrorIsNil) err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertLife(c, s.mysql, state.Dying) _, err = s.mysql.AddUnit(state.AddUnitParams{}) c.Assert(err, gc.ErrorMatches, `cannot add unit to application "mysql": application is not found or not alive`) c.Assert(u.EnsureDead(), jc.ErrorIsNil) @@ -2090,7 +2118,7 @@ func (s *ApplicationSuite) TestAddCAASUnit(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) @@ -2139,7 +2167,7 @@ func (s *ApplicationSuite) TestAgentTools(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) @@ -2214,6 +2242,7 @@ preventUnitDestroyRemove(c, unit) err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertLife(c, s.mysql, state.Dying) _, err = s.mysql.AllUnits() c.Assert(err, jc.ErrorIsNil) _, err = s.State.Unit("mysql/0") @@ -2404,6 +2433,7 @@ // Destroy mysql, and check units are not touched. err := s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertLife(c, s.mysql, state.Dying) for _, unit := range units { assertLife(c, unit, state.Alive) } @@ -2470,8 +2500,8 @@ // Ensure storage constraints and settings are now gone. _, err = state.AppStorageConstraints(app) c.Assert(err, jc.Satisfies, errors.IsNotFound) - settings := state.GetApplicationCharmConfig(s.State, app) - err = settings.Read() + cfg := state.GetApplicationCharmConfig(s.State, app) + err = cfg.Read() c.Assert(err, jc.Satisfies, errors.IsNotFound) } @@ -2479,6 +2509,8 @@ s.assertNoCleanup(c) err := s.mysql.Destroy() + c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) // Check a cleanup doc was added. s.assertNeedsCleanup(c) @@ -2511,6 +2543,7 @@ // Detroy the application. err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) // Cleanup should be registered but not yet run. s.assertNeedsCleanup(c) @@ -2539,6 +2572,7 @@ // Detroy the application. err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertRemoved(c, s.mysql) // No cleanup required for placeholder resources. state.AssertNoCleanupsWithKind(c, s.State, "resourceBlob") @@ -2549,8 +2583,7 @@ // fails nicely. err := s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) - err = s.mysql.Refresh() - c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertRemoved(c, s.mysql) _, err = s.State.Unit("mysql/0") c.Assert(err, gc.ErrorMatches, `unit "mysql/0" not found`) } @@ -2584,8 +2617,7 @@ // that the constraints are deleted... err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) - err = s.mysql.Refresh() - c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertRemoved(c, s.mysql) // ...but we can check that old constraints do not affect new applications // with matching names. @@ -2628,6 +2660,7 @@ c.Assert(err, jc.ErrorIsNil) err = s.mysql.Destroy() c.Assert(err, jc.ErrorIsNil) + assertLife(c, s.mysql, state.Dying) cons1 := constraints.MustParse("mem=1G") err = s.mysql.SetConstraints(cons1) c.Assert(err, gc.ErrorMatches, `cannot set constraints: application is not found or not alive`) @@ -3583,8 +3616,7 @@ op.RemoveOffers = true err = s.State.ApplyOperation(op) c.Assert(err, jc.ErrorIsNil) - err = appConfig.Read() - c.Assert(err, jc.Satisfies, errors.IsNotFound) + assertRemoved(c, s.mysql) } type CAASApplicationSuite struct { @@ -3862,16 +3894,35 @@ } func (s *CAASApplicationSuite) TestInvalidScale(c *gc.C) { - err := s.app.SetScale(-1) + err := s.app.SetScale(-1, 0, true) c.Assert(err, gc.ErrorMatches, "application scale -1 not valid") + + // set scale without force for caas workers - a new Generation is required. + err = s.app.SetScale(3, 0, false) + c.Assert(err, jc.Satisfies, errors.IsForbidden) } func (s *CAASApplicationSuite) TestSetScale(c *gc.C) { - err := s.app.SetScale(5) + // set scale with force for CLI - DesiredScaleProtected set to true. + err := s.app.SetScale(5, 0, true) + c.Assert(err, jc.ErrorIsNil) + err = s.app.Refresh() + c.Assert(err, jc.ErrorIsNil) + c.Assert(s.app.GetScale(), gc.Equals, 5) + svcInfo, err := s.app.ServiceInfo() + c.Assert(err, jc.ErrorIsNil) + c.Assert(svcInfo.DesiredScaleProtected(), jc.IsTrue) + + // set scale without force for caas workers - a new Generation is required. + err = s.app.SetScale(5, 1, false) c.Assert(err, jc.ErrorIsNil) err = s.app.Refresh() c.Assert(err, jc.ErrorIsNil) c.Assert(s.app.GetScale(), gc.Equals, 5) + svcInfo, err = s.app.ServiceInfo() + c.Assert(err, jc.ErrorIsNil) + c.Assert(svcInfo.DesiredScaleProtected(), jc.IsFalse) + c.Assert(svcInfo.Generation(), jc.DeepEquals, int64(1)) } func (s *CAASApplicationSuite) TestInvalidChangeScale(c *gc.C) { @@ -3903,16 +3954,16 @@ wc := testing.NewNotifyWatcherC(c, s.State, w) wc.AssertOneChange() - err := s.app.SetScale(5) + err := s.app.SetScale(5, 0, true) c.Assert(err, jc.ErrorIsNil) wc.AssertOneChange() // Set to same value, no change. - err = s.app.SetScale(5) + err = s.app.SetScale(5, 0, true) c.Assert(err, jc.ErrorIsNil) wc.AssertNoChange() - err = s.app.SetScale(6) + err = s.app.SetScale(6, 0, true) c.Assert(err, jc.ErrorIsNil) wc.AssertOneChange() @@ -3929,7 +3980,7 @@ func (s *CAASApplicationSuite) TestRewriteStatusHistory(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) @@ -4032,7 +4083,7 @@ func (s *ApplicationSuite) TestSetOperatorStatus(c *gc.C) { st := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "caas-model", - Type: state.ModelTypeCAAS, CloudRegion: "", + Type: state.ModelTypeCAAS, }) defer st.Close() f := factory.NewFactory(st, s.StatePool) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/caasmodel_test.go juju-core-2.6.5/src/github.com/juju/juju/state/caasmodel_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/caasmodel_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/caasmodel_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -157,9 +157,9 @@ c.Assert(fs, gc.HasLen, 0) } -func (s *CAASModelSuite) TestCAASModelsCantHaveCloudRegion(c *gc.C) { +func (s *CAASModelSuite) TestCAASModelWrongCloudRegion(c *gc.C) { cfg, _ := s.createTestModelConfig(c) - _, st, err := s.Controller.NewModel(state.ModelArgs{ + _, _, err := s.Controller.NewModel(state.ModelArgs{ Type: state.ModelTypeCAAS, CloudName: "dummy", CloudRegion: "fork", @@ -167,8 +167,7 @@ Owner: names.NewUserTag("test@remote"), StorageProviderRegistry: provider.CommonStorageProviders(), }) - c.Assert(err, jc.ErrorIsNil) - defer st.Close() + c.Assert(err, gc.ErrorMatches, `region "fork" not found \(expected one of \["dotty.region" "dummy-region" "nether-region" "unused-region"\]\)`) } func (s *CAASModelSuite) TestDestroyControllerAndHostedCAASModels(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cleanup.go juju-core-2.6.5/src/github.com/juju/juju/state/cleanup.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cleanup.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cleanup.go 2019-06-28 17:10:43.000000000 +0000 @@ -41,6 +41,7 @@ cleanupApplicationsForDyingModel cleanupKind = "applications" cleanupDyingMachine cleanupKind = "dyingMachine" cleanupForceDestroyedMachine cleanupKind = "machine" + cleanupForceRemoveMachine cleanupKind = "forceRemoveMachine" cleanupAttachmentsForDyingStorage cleanupKind = "storageAttachments" cleanupAttachmentsForDyingVolume cleanupKind = "volumeAttachments" cleanupAttachmentsForDyingFilesystem cleanupKind = "filesystemAttachments" @@ -175,6 +176,8 @@ err = st.cleanupDyingMachine(doc.Prefix, args) case cleanupForceDestroyedMachine: err = st.cleanupForceDestroyedMachine(doc.Prefix, args) + case cleanupForceRemoveMachine: + err = st.cleanupForceRemoveMachine(doc.Prefix, args) case cleanupAttachmentsForDyingStorage: err = st.cleanupAttachmentsForDyingStorage(doc.Prefix, args) case cleanupAttachmentsForDyingVolume: @@ -326,10 +329,8 @@ // TODO (force 2019-4-24) However, we should not break out here but continue with other machines. return errors.Trace(errors.Annotatef(err, "could not destroy manual machine %v", m.Id())) } - return nil + continue } - // TODO (force 2019-04-26) Should this always be ForceDestroy or only when - // 'destroy-model --force' is specified?... if err := m.ForceDestroy(args.MaxWait); err != nil { err = errors.Annotatef(err, "while destroying machine %v is", m.Id()) // TODO (force 2019-4-24) we should not break out here but continue with other machines. @@ -420,7 +421,11 @@ op := app.DestroyOperation() op.DestroyStorage = destroyStorage op.Force = force - return st.ApplyOperation(op) + err = st.ApplyOperation(op) + if len(op.Errors) != 0 { + logger.Warningf("operational errors cleaning up application %v: %v", applicationname, op.Errors) + } + return err } // cleanupApplicationsForDyingModel sets all applications to Dying, if they are @@ -463,7 +468,11 @@ op.RemoveOffers = true op.Force = force op.MaxWait = args.MaxWait - if err := st.ApplyOperation(op); err != nil { + err := st.ApplyOperation(op) + if len(op.Errors) != 0 { + logger.Warningf("operational errors removing application %v for dying model %v: %v", application.Name(), st.ModelUUID(), op.Errors) + } + if err != nil { return errors.Trace(err) } } @@ -483,9 +492,11 @@ force := args.Force != nil && *args.Force for iter.Next(&remoteApp.doc) { - // TODO (force 2019-4-24) There may be some operational errors. - // Do something with with them. - if _, err := remoteApp.DestroyWithForce(force, args.MaxWait); err != nil { + errs, err := remoteApp.DestroyWithForce(force, args.MaxWait) + if len(errs) != 0 { + logger.Warningf("operational errors removing remote application %v for dying model %v: %v", remoteApp.Name(), st.ModelUUID(), errs) + } + if err != nil { return errors.Trace(err) } } @@ -539,7 +550,12 @@ op.DestroyStorage = destroyStorage op.Force = force op.MaxWait = maxWait - if err := st.ApplyOperation(op); err != nil { + err := st.ApplyOperation(op) + if len(op.Errors) != 0 { + logger.Warningf("operational errors destroying unit %v for dying application %v: %v", unit.Name(), applicationname, op.Errors) + } + + if err != nil { return errors.Trace(err) } } @@ -723,7 +739,10 @@ logger.Warningf("couldn't get relation unit for %q in %q: %v", unit, relation, err) continue } - _, err = ru.LeaveScopeWithForce(true, maxWait) + errs, err := ru.LeaveScopeWithForce(true, maxWait) + if len(errs) != 0 { + logger.Warningf("operational errors cleaning up force destroyed unit %v in relation %v: %v", unit, relation, errs) + } if err != nil { logger.Warningf("unit %q couldn't leave scope of relation %q: %v", unitId, relation, err) } @@ -953,16 +972,24 @@ // cleanupDyingMachine marks resources owned by the machine as dying, to ensure // they are cleaned up as well. func (st *State) cleanupDyingMachine(machineId string, cleanupArgs []bson.Raw) error { - var force bool - switch n := len(cleanupArgs); n { - case 0: - // Old cleanups have no args, so follow the old behaviour. - case 1: + var ( + force bool + maxWait time.Duration + ) + argCount := len(cleanupArgs) + if argCount > 2 { + return errors.Errorf("expected 0-1 arguments, got %d", argCount) + } + // Old cleanups have no args, so use the default values. + if argCount >= 1 { if err := cleanupArgs[0].Unmarshal(&force); err != nil { return errors.Annotate(err, "unmarshalling cleanup arg 'force'") } - default: - return errors.Errorf("expected 0-1 arguments, got %d", n) + } + if argCount >= 2 { + if err := cleanupArgs[1].Unmarshal(&maxWait); err != nil { + return errors.Annotate(err, "unmarshalling cleanup arg 'maxWait'") + } } machine, err := st.Machine(machineId) if errors.IsNotFound(err) { @@ -970,7 +997,18 @@ } else if err != nil { return err } - return cleanupDyingMachineResources(machine, force) + err = cleanupDyingMachineResources(machine, force) + if err != nil { + return errors.Trace(err) + } + // If we're forcing, schedule a fallback cleanup to remove the + // machine if the provisioner has gone AWOL - the main case here + // is if the cloud credential is invalid so the provisioner is + // stopped. + if force { + st.scheduleForceCleanup(cleanupForceRemoveMachine, machineId, maxWait) + } + return nil } // cleanupForceDestroyedMachine systematically destroys and removes all entities @@ -1068,7 +1106,7 @@ // again -- which it *probably* will anyway -- the issue can be resolved by // force-destroying the machine again; that's better than adding layer // upon layer of complication here. - if err := machine.EnsureDead(); err != nil { + if err := machine.advanceLifecycle(Dead, true, maxWait); err != nil { return errors.Trace(err) } removePortsOps, err := machine.removePortsOps() @@ -1078,11 +1116,25 @@ if err := st.db().RunTransaction(removePortsOps); err != nil { return errors.Trace(err) } + + // Note that we do *not* remove the machine immediately: we leave + // it for the provisioner to clean up, so that we don't end up + // with an unreferenced instance that would otherwise be ignored + // when in provisioner-safe-mode. return nil +} - // Note that we do *not* remove the machine entirely: we leave it for the - // provisioner to clean up, so that we don't end up with an unreferenced - // instance that would otherwise be ignored when in provisioner-safe-mode. +// cleanupForceRemoveMachine is a backstop to remove a force-destroyed +// machine after a certain amount of time if it hasn't gone away +// already. +func (st *State) cleanupForceRemoveMachine(machineId string, cleanupArgs []bson.Raw) error { + machine, err := st.Machine(machineId) + if errors.IsNotFound(err) { + return nil + } else if err != nil { + return errors.Trace(err) + } + return machine.Remove() } // cleanupContainers recursively calls cleanupForceDestroyedMachine on the supplied diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cleanup_test.go juju-core-2.6.5/src/github.com/juju/juju/state/cleanup_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cleanup_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cleanup_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -224,15 +224,15 @@ s.assertNeedsCleanup(c) // Clean up, and check that the unit has been removed... - s.assertCleanupCount(c, 3) + s.assertCleanupCount(c, 4) assertRemoved(c, pr.u0) // ...and the unit has departed relation scope... assertNotJoined(c, pr.ru0) - // ...but that the machine remains, and is Dead, ready for removal by the - // provisioner. - assertLife(c, machine, state.Dead) + // ...and the machine has been removed (since model destroy does a + // force-destroy on the machine). + c.Assert(machine.Refresh(), jc.Satisfies, errors.IsNotFound) assertLife(c, manualMachine, state.Dying) assertLife(c, stateMachine, state.Alive) } @@ -343,12 +343,12 @@ s.assertDoesNotNeedCleanup(c) // Force machine destruction, check cleanup queued. - err = machine.ForceDestroy(dontWait) + err = machine.ForceDestroy(time.Minute) c.Assert(err, jc.ErrorIsNil) s.assertNeedsCleanup(c) // Clean up, and check that the unit has been removed... - s.assertCleanupCount(c, 2) + s.assertCleanupCountDirty(c, 2) assertRemoved(c, pr.u0) // ...and the unit has departed relation scope... @@ -378,7 +378,7 @@ m.SetHasVote(true) } s.assertDoesNotNeedCleanup(c) - err = machine.ForceDestroy(dontWait) + err = machine.ForceDestroy(time.Minute) c.Assert(err, jc.ErrorIsNil) // The machine should no longer want the vote, should be forced to not have the vote, and forced to not be a // controller member anymore @@ -395,9 +395,12 @@ s.assertCleanupRuns(c) c.Assert(machine.SetHasVote(false), jc.ErrorIsNil) // However, if we remove the vote, it can be cleaned up. - // ForceDestroy sets up a cleanupForceDestroyedMachine, which calls EnsureDead which sets up a cleanupDyingMachine - // so it takes 2 cleanup runs to run clear - s.assertCleanupCount(c, 2) + // ForceDestroy sets up a cleanupForceDestroyedMachine, which + // calls advanceLifecycle(Dead) which sets up a + // cleanupDyingMachine, which in turn creates a delayed + // cleanupForceRemoveMachine. + // Run the first two. + s.assertCleanupCountDirty(c, 2) // After we've run the cleanup for the controller machine, the machine should be dead, and it should not be // present in the other documents. assertLife(c, machine, state.Dead) @@ -438,9 +441,11 @@ c.Assert(sa.Life(), gc.Equals, state.Alive) // destroy machine and run cleanups - err = machine.ForceDestroy(dontWait) + err = machine.ForceDestroy(time.Minute) c.Assert(err, jc.ErrorIsNil) - s.assertCleanupCount(c, 2) + + // Run cleanups to remove the unit and make the machine dead. + s.assertCleanupCountDirty(c, 2) // After running the cleanups, the storage attachment should // have been removed; the storage instance should be floating, @@ -455,8 +460,9 @@ // Check that the unit has been removed. assertRemoved(c, u) - // check no cleanups - s.assertDoesNotNeedCleanup(c) + s.Clock.Advance(time.Minute) + // Check that the last cleanup to remove the machine runs. + s.assertCleanupCount(c, 1) } func (s *CleanupSuite) TestCleanupForceDestroyedMachineWithContainer(c *gc.C) { @@ -486,18 +492,18 @@ s.assertDoesNotNeedCleanup(c) // Force removal of the top-level machine. - err = machine.ForceDestroy(dontWait) + err = machine.ForceDestroy(time.Minute) c.Assert(err, jc.ErrorIsNil) s.assertNeedsCleanup(c) // And do it again, just to check that the second cleanup doc for the same // machine doesn't cause problems down the line. - err = machine.ForceDestroy(dontWait) + err = machine.ForceDestroy(time.Minute) c.Assert(err, jc.ErrorIsNil) s.assertNeedsCleanup(c) // Clean up, and check that the container has been removed... - s.assertCleanupCount(c, 2) + s.assertCleanupCountDirty(c, 2) err = container.Refresh() c.Assert(err, jc.Satisfies, errors.IsNotFound) @@ -518,6 +524,34 @@ assertLife(c, machine, state.Dead) } +func (s *CleanupSuite) TestForceDestroyMachineSchedulesRemove(c *gc.C) { + machine, err := s.State.AddMachine("quantal", state.JobHostUnits) + c.Assert(err, jc.ErrorIsNil) + err = machine.SetProvisioned("inst-id", "", "fake_nonce", nil) + c.Assert(err, jc.ErrorIsNil) + + s.assertDoesNotNeedCleanup(c) + + err = machine.ForceDestroy(time.Minute) + c.Assert(err, jc.ErrorIsNil) + s.assertNeedsCleanup(c) + + s.assertCleanupRuns(c) + + assertLifeIs(c, machine, state.Dead) + + // Running a cleanup pass succeeds but doesn't get rid of cleanups + // because there's a scheduled one. + s.assertCleanupRuns(c) + assertLifeIs(c, machine, state.Dead) + s.assertNeedsCleanup(c) + + s.Clock.Advance(time.Minute) + s.assertCleanupCount(c, 1) + err = machine.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + func (s *CleanupSuite) TestCleanupDyingUnit(c *gc.C) { // Create active unit, in a relation. prr := newProReqRelation(c, &s.ConnSuite, charm.ScopeGlobal) @@ -960,13 +994,13 @@ }) c.Assert(err, jc.ErrorIsNil) - opErrs, err := unit.DestroyWithForce(true, dontWait) + opErrs, err := unit.DestroyWithForce(true, time.Minute) c.Assert(err, jc.ErrorIsNil) c.Assert(opErrs, gc.IsNil) // The unit should be dying, and there's a deferred cleanup to // endeaden it. - assertUnitLife(c, unit, state.Dying) + assertLifeIs(c, unit, state.Dying) s.assertNeedsCleanup(c) // dyingUnit @@ -976,16 +1010,20 @@ // forceDestroyedUnit s.assertCleanupRuns(c) - assertUnitLife(c, unit, state.Dead) + assertLifeIs(c, unit, state.Dead) s.Clock.Advance(time.Minute) // forceRemoveUnit s.assertCleanupRuns(c) assertUnitRemoved(c, unit) - // After this there are two cleanups remaining: removedUnit, - // dyingMachine. - s.assertCleanupCount(c, 2) + // After this there are three cleanups remaining: removedUnit, + // dyingMachine, forceRemoveMachine (but the last is delayed a + // minute). + s.assertCleanupCountDirty(c, 2) + + s.Clock.Advance(time.Minute) + s.assertCleanupCount(c, 1) } func (s *CleanupSuite) TestForceDestroyUnitDestroysSubordinates(c *gc.C) { @@ -1009,8 +1047,8 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(opErrs, gc.IsNil) - assertUnitLife(c, unit, state.Dying) - assertUnitLife(c, subordinate, state.Alive) + assertLifeIs(c, unit, state.Dying) + assertLifeIs(c, subordinate, state.Alive) s.assertNeedsCleanup(c) // dyingUnit(mysql/0) @@ -1022,16 +1060,16 @@ // finally succeeds. s.assertNextCleanup(c, "forceDestroyUnit(mysql/0)") - assertUnitLife(c, subordinate, state.Dying) - assertUnitLife(c, unit, state.Dying) + assertLifeIs(c, subordinate, state.Dying) + assertLifeIs(c, unit, state.Dying) // dyingUnit(logging/0) runs and schedules the force cleanup. s.assertNextCleanup(c, "dyingUnit(logging/0)") // forceDestroyUnit(logging/0) sets it to dead. s.assertNextCleanup(c, "forceDestroyUnit(logging/0)") - assertUnitLife(c, subordinate, state.Dead) - assertUnitLife(c, unit, state.Dying) + assertLifeIs(c, subordinate, state.Dead) + assertLifeIs(c, unit, state.Dying) // forceRemoveUnit(logging/0) runs s.assertNextCleanup(c, "forceRemoveUnit(logging/0)") @@ -1039,15 +1077,15 @@ // Now forceDestroyUnit(mysql/0) can run successfully and make the unit dead s.assertNextCleanup(c, "forceRemoveUnit(mysql/0)") - assertUnitLife(c, unit, state.Dead) + assertLifeIs(c, unit, state.Dead) // forceRemoveUnit s.assertNextCleanup(c, "forceRemoveUnit") assertUnitRemoved(c, unit) - // After this there are two cleanups remaining: removedUnit, - // dyingMachine. - s.assertCleanupCount(c, 2) + // After this there are three cleanups remaining: removedUnit, + // dyingMachine, forceRemoveMachine. + s.assertCleanupCount(c, 3) } func (s *CleanupSuite) TestForceDestroyUnitLeavesRelations(c *gc.C) { @@ -1067,7 +1105,7 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(opErrs, gc.IsNil) - assertUnitLife(c, unit, state.Dying) + assertLifeIs(c, unit, state.Dying) assertUnitInScope(c, unit, prr.rel, true) // dyingUnit schedules forceDestroyedUnit @@ -1075,16 +1113,16 @@ // ...which leaves the scope for its relations. s.assertCleanupRuns(c) - assertUnitLife(c, unit, state.Dead) + assertLifeIs(c, unit, state.Dead) assertUnitInScope(c, unit, prr.rel, false) // forceRemoveUnit s.assertCleanupRuns(c) assertUnitRemoved(c, unit) - // After this there are two cleanups remaining: removedUnit, - // dyingMachine. - s.assertCleanupCount(c, 2) + // After this there are three cleanups remaining: removedUnit, + // dyingMachine, forceRemoveMachine. + s.assertCleanupCount(c, 3) } func (s *CleanupSuite) TestForceDestroyUnitRemovesStorageAttachments(c *gc.C) { @@ -1155,8 +1193,8 @@ assertUnitRemoved(c, u) // After this there are two cleanups remaining: removedUnit, - // dyingMachine. - s.assertCleanupCount(c, 2) + // dyingMachine, forceRemoveMachine. + s.assertCleanupCount(c, 3) } func (s *CleanupSuite) assertCleanupRuns(c *gc.C) { @@ -1186,6 +1224,17 @@ s.assertDoesNotNeedCleanup(c) } +// assertCleanupCountDirty is the same as assertCleanupCount, but it +// checks that there are still cleanups to run. +func (s *CleanupSuite) assertCleanupCountDirty(c *gc.C, count int) { + for i := 0; i < count; i++ { + c.Logf("checking cleanups %d", i) + s.assertNeedsCleanup(c) + s.assertCleanupRuns(c) + } + s.assertNeedsCleanup(c) +} + // assertNextCleanup tracks that the next cleanup runs, and logs what cleanup we are expecting. func (s *CleanupSuite) assertNextCleanup(c *gc.C, message string) { c.Logf("expect cleanup: %s", message) @@ -1193,10 +1242,15 @@ s.assertCleanupRuns(c) } -func assertUnitLife(c *gc.C, unit *state.Unit, expected state.Life) { - err := unit.Refresh() +type lifeChecker interface { + Refresh() error + Life() state.Life +} + +func assertLifeIs(c *gc.C, thing lifeChecker, expected state.Life) { + err := thing.Refresh() c.Assert(err, jc.ErrorIsNil) - c.Assert(unit.Life(), gc.Equals, expected) + c.Assert(thing.Life(), gc.Equals, expected) } func assertUnitRemoved(c *gc.C, unit *state.Unit) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cloudcredentials.go juju-core-2.6.5/src/github.com/juju/juju/state/cloudcredentials.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cloudcredentials.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cloudcredentials.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,7 @@ "gopkg.in/mgo.v2/txn" "github.com/juju/juju/cloud" + "github.com/juju/juju/core/status" "github.com/juju/juju/permission" ) @@ -110,27 +111,69 @@ return credentials, nil } +func (st *State) modelsToRevert(tag names.CloudCredentialTag) (map[*Model]func() error, error) { + revert := map[*Model]func() error{} + credentialModels, err := st.modelsWithCredential(tag) + if err != nil && !errors.IsNotFound(err) { + return revert, errors.Annotatef(err, "getting models for credential %v", tag) + } + for _, m := range credentialModels { + one, closer, err := st.model(m.UUID) + if err != nil { + // Something has gone wrong with this model... keep going. + logger.Warningf("model %v error: %v", m.UUID, err) + continue + } + modelStatus, err := one.Status() + if err != nil { + return revert, errors.Trace(err) + } + // We only interested if the models are currently suspended. + if modelStatus.Status == status.Suspended { + revert[one] = closer + continue + } + // We still need to close models that did not make the cut. + defer closer() + } + return revert, nil +} + // UpdateCloudCredential adds or updates a cloud credential with the given tag. func (st *State) UpdateCloudCredential(tag names.CloudCredentialTag, credential cloud.Credential) error { credentials := map[names.CloudCredentialTag]Credential{ tag: convertCloudCredentialToState(tag, credential), } annotationMsg := "updating cloud credentials" + + existing, err := st.CloudCredential(tag) + if err != nil && !errors.IsNotFound(err) { + return errors.Annotatef(err, "fetching cloud credentials") + } + exists := err == nil + var revert map[*Model]func() error + if exists { + // Existing credential will become valid after this call, and + // the model status of all models that use it will be reverted. + if existing.Invalid != credential.Invalid && !credential.Invalid { + revert, err = st.modelsToRevert(tag) + if err != nil { + logger.Warningf("could not figure out if models for credential %v need to revert: %v", tag.Id(), err) + } + } + } + buildTxn := func(attempt int) ([]txn.Op, error) { cloudName := tag.Cloud().Id() - cloud, err := st.Cloud(cloudName) + aCloud, err := st.Cloud(cloudName) if err != nil { return nil, errors.Trace(err) } - ops, err := validateCloudCredentials(cloud, credentials) + ops, err := validateCloudCredentials(aCloud, credentials) if err != nil { return nil, errors.Trace(err) } - _, err = st.CloudCredential(tag) - if err != nil && !errors.IsNotFound(err) { - return nil, errors.Maskf(err, "fetching cloud credentials") - } - if err == nil { + if exists { ops = append(ops, updateCloudCredentialOp(tag, credential)) } else { annotationMsg = "creating cloud credential" @@ -144,6 +187,58 @@ if err := st.db().Run(buildTxn); err != nil { return errors.Annotate(err, annotationMsg) } + if len(revert) > 0 { + for m, closer := range revert { + if err := m.maybeRevertModelStatus(); err != nil { + logger.Warningf("could not revert status for model %v: %v", m.UUID(), err) + } + defer closer() + } + } + return nil +} + +func (st *State) model(uuid string) (*Model, func() error, error) { + closer := func() error { return nil } + // We explicitly don't start the workers. + modelState, err := st.newStateNoWorkers(uuid) + if err != nil { + // This model could have been removed. + if errors.IsNotFound(err) { + return nil, closer, nil + } + return nil, closer, errors.Trace(err) + } + + closer = func() error { return modelState.Close() } + m, err := modelState.Model() + if err != nil { + return nil, closer, errors.Trace(err) + } + return m, closer, nil +} + +func (m *Model) maybeRevertModelStatus() error { + // I don't know where you've been before you got here - get a clean slate. + err := m.Refresh() + if err != nil { + logger.Warningf("could not refresh model %v to revert its status: %v", m.UUID(), err) + } + modelStatus, err := m.Status() + if err != nil { + return errors.Trace(err) + } + if modelStatus.Status != status.Suspended { + doc := statusDoc{ + Status: modelStatus.Status, + StatusInfo: modelStatus.Message, + Updated: timeOrNow(nil, m.st.clock()).UnixNano(), + } + + if _, err = probablyUpdateStatusHistory(m.st.db(), m.globalKey(), doc); err != nil { + return errors.Trace(err) + } + } return nil } @@ -348,8 +443,7 @@ return credentials, nil } -// CredentialModels returns all models that use given cloud credential. -func (st *State) CredentialModels(tag names.CloudCredentialTag) (map[string]string, error) { +func (st *State) modelsWithCredential(tag names.CloudCredentialTag) ([]modelDoc, error) { coll, cleanup := st.db().GetCollection(modelsC) defer cleanup() @@ -366,9 +460,18 @@ if len(docs) == 0 { return nil, errors.NotFoundf("models that use cloud credentials %q", tag.Id()) } + return docs, nil +} + +// CredentialModels returns all models that use given cloud credential. +func (st *State) CredentialModels(tag names.CloudCredentialTag) (map[string]string, error) { + models, err := st.modelsWithCredential(tag) + if err != nil { + return nil, err + } - results := make(map[string]string, len(docs)) - for _, model := range docs { + results := make(map[string]string, len(models)) + for _, model := range models { results[model.UUID] = model.Name } return results, nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cloudcredentials_test.go juju-core-2.6.5/src/github.com/juju/juju/state/cloudcredentials_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cloudcredentials_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cloudcredentials_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,8 +13,10 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/cloud" + "github.com/juju/juju/core/status" "github.com/juju/juju/state" statetesting "github.com/juju/juju/state/testing" + "github.com/juju/juju/testing/factory" ) type CloudCredentialsSuite struct { @@ -112,6 +114,118 @@ c.Assert(out, jc.DeepEquals, expected) } +func assertCredentialCreated(c *gc.C, testSuite ConnSuite) (string, *state.User, names.CloudCredentialTag) { + owner := testSuite.Factory.MakeUser(c, &factory.UserParams{ + Password: "secret", + Name: "bob", + }) + + cloudName := "stratus" + err := testSuite.State.AddCloud(cloud.Cloud{ + Name: cloudName, + Type: "low", + AuthTypes: cloud.AuthTypes{cloud.AccessKeyAuthType, cloud.UserPassAuthType}, + Regions: []cloud.Region{{Name: "dummy-region", Endpoint: "endpoint"}}, + }, owner.Name()) + c.Assert(err, jc.ErrorIsNil) + + tag := createCredential(c, testSuite, cloudName, owner.Name(), "foobar") + return cloudName, owner, tag +} + +func createCredential(c *gc.C, testSuite ConnSuite, cloudName, userName, credentialName string) names.CloudCredentialTag { + cred := cloud.NewCredential(cloud.AccessKeyAuthType, map[string]string{ + "foo": "foo val", + "bar": "bar val", + }) + tag := names.NewCloudCredentialTag(fmt.Sprintf("%v/%v/%v", cloudName, userName, credentialName)) + err := testSuite.State.UpdateCloudCredential(tag, cred) + c.Assert(err, jc.ErrorIsNil) + return tag +} + +func assertModelCreated(c *gc.C, testSuite ConnSuite, cloudName string, credentialTag names.CloudCredentialTag, owner names.Tag, modelName string) string { + // Test model needs to be on the test cloud for all validation to pass. + modelState := testSuite.Factory.MakeModel(c, &factory.ModelParams{ + Name: modelName, + CloudCredential: credentialTag, + Owner: owner, + CloudName: cloudName, + }) + defer modelState.Close() + testModel, err := modelState.Model() + c.Assert(err, jc.ErrorIsNil) + assertModelStatus(c, testSuite.StatePool, testModel.UUID(), status.Available) + return testModel.UUID() +} + +func assertModelSuspended(c *gc.C, testSuite ConnSuite) (names.CloudCredentialTag, string) { + // 1. Create a credential + cloudName, credentialOwner, credentialTag := assertCredentialCreated(c, testSuite) + + // 2. Create model on the test cloud with test credential + modelUUID := assertModelCreated(c, testSuite, cloudName, credentialTag, credentialOwner.Tag(), "model-for-cloud") + + // 3. update credential to be invalid and check model is suspended + cred := cloud.NewCredential(cloud.AccessKeyAuthType, map[string]string{ + "foo": "foo val", + "bar": "bar val", + }) + cred.Invalid = true + cred.InvalidReason = "because it is really really invalid" + err := testSuite.State.UpdateCloudCredential(credentialTag, cred) + c.Assert(err, jc.ErrorIsNil) + assertModelStatus(c, testSuite.StatePool, modelUUID, status.Suspended) + + return credentialTag, modelUUID +} + +func assertModelStatus(c *gc.C, pool *state.StatePool, testModelUUID string, expectedStatus status.Status) { + aModel, helper, err := pool.GetModel(testModelUUID) + c.Assert(err, jc.ErrorIsNil) + defer helper.Release() + modelStatus, err := aModel.Status() + c.Assert(err, jc.ErrorIsNil) + c.Assert(modelStatus.Status, gc.DeepEquals, expectedStatus) +} + +func (s *CloudCredentialsSuite) TestUpdateCloudCredentialsTouchesCredentialModels(c *gc.C) { + // This test checks that models are affected when their credential validity is changed... + // 1. create a credential + // 2. set a model to use it + // 3. update credential to be invalid and check model is suspended + // 4. update credential bar its validity, check no changes in model state + // 5. mark credential as valid and check that model is unsuspended + + // 1.2.3. + tag, testModelUUID := assertModelSuspended(c, s.ConnSuite) + + // 4. + storedCred, err := s.State.CloudCredential(tag) + c.Assert(err, jc.ErrorIsNil) + c.Assert(storedCred.IsValid(), jc.IsFalse) + + cred := cloud.NewCredential(cloud.UserPassAuthType, map[string]string{ + "user": "bob's nephew", + "password": "simple", + }) + cred.Revoked = true + // all other credential attributes remain unchanged + cred.Invalid = storedCred.Invalid + cred.InvalidReason = storedCred.InvalidReason + + err = s.State.UpdateCloudCredential(tag, cred) + c.Assert(err, jc.ErrorIsNil) + assertModelStatus(c, s.StatePool, testModelUUID, status.Suspended) + + // 5. + cred.Invalid = !storedCred.Invalid + cred.InvalidReason = "" + err = s.State.UpdateCloudCredential(tag, cred) + c.Assert(err, jc.ErrorIsNil) + assertModelStatus(c, s.StatePool, testModelUUID, status.Available) +} + func (s *CloudCredentialsSuite) assertCredentialInvalidated(c *gc.C, tag names.CloudCredentialTag) { err := s.State.AddCloud(cloud.Cloud{ Name: "stratus", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cloudservice.go juju-core-2.6.5/src/github.com/juju/juju/state/cloudservice.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cloudservice.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cloudservice.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,6 +19,12 @@ // Addresses returns the service addresses. Addresses() []network.Address + + // Generation returns the service config generation. + Generation() int64 + + // DesiredScaleProtected indicates if current desired scale in application has been applied to the cluster. + DesiredScaleProtected() bool } // CloudService is an implementation of CloudService. @@ -33,6 +39,16 @@ ProviderId string `bson:"provider-id"` Addresses []address `bson:"addresses"` + + // Generation is the version of current service configuration. + // It prevents the scale updated to replicas of the older/previous gerenations of deployment/statefulset. + // Currently only DesiredScale is versioned. + Generation int64 `bson:"generation"` + + // DesiredScaleProtected indicates if the desired scale needs to be applied to k8s cluster. + // It prevents the desired scale requested from CLI by user incidentally updated by + // k8s cluster replicas before having a chance to be applied/deployed. + DesiredScaleProtected bool `bson:"desired-scale-protected"` } func newCloudService(st *State, doc *cloudServiceDoc) *CloudService { @@ -43,21 +59,31 @@ return svc } -// Id implements CloudService. +// Id implements CloudServicer. func (c *CloudService) Id() string { return c.doc.DocID } -// ProviderId implements CloudService. +// ProviderId implements CloudServicer. func (c *CloudService) ProviderId() string { return c.doc.ProviderId } -// Addresses implements CloudService. +// Addresses implements CloudServicer. func (c *CloudService) Addresses() []network.Address { return networkAddresses(c.doc.Addresses) } +// Generation implements CloudServicer. +func (c *CloudService) Generation() int64 { + return c.doc.Generation +} + +// DesiredScaleProtected implements CloudServicer. +func (c *CloudService) DesiredScaleProtected() bool { + return c.doc.DesiredScaleProtected +} + func (c *CloudService) cloudServiceDoc() (*cloudServiceDoc, error) { coll, closer := c.st.db().GetCollection(cloudServicesC) defer closer() @@ -94,8 +120,9 @@ return errors.Trace(err) } -func (c *CloudService) saveServiceOps(doc cloudServiceDoc) ([]txn.Op, error) { - existing, err := c.cloudServiceDoc() +func buildCloudServiceOps(st *State, doc cloudServiceDoc) ([]txn.Op, error) { + svc := newCloudService(st, &doc) + existing, err := svc.cloudServiceDoc() if err != nil && !errors.IsNotFound(err) { return nil, errors.Trace(err) } @@ -107,20 +134,34 @@ Insert: doc, }}, nil } + patchFields := bson.D{} + addField := func(elm bson.DocElem) { + patchFields = append(patchFields, elm) + } + providerIdToAssert := existing.ProviderId + if doc.ProviderId != "" { + addField(bson.DocElem{"provider-id", doc.ProviderId}) + providerIdToAssert = doc.ProviderId + } + if len(doc.Addresses) > 0 { + addField(bson.DocElem{"addresses", doc.Addresses}) + } + if doc.Generation > existing.Generation { + addField(bson.DocElem{"generation", doc.Generation}) + } + if doc.DesiredScaleProtected != existing.DesiredScaleProtected { + addField(bson.DocElem{"desired-scale-protected", doc.DesiredScaleProtected}) + } return []txn.Op{{ C: cloudServicesC, Id: existing.DocID, Assert: bson.D{{"$or", []bson.D{ - {{"provider-id", doc.ProviderId}}, + {{"provider-id", providerIdToAssert}}, + {{"provider-id", ""}}, {{"provider-id", bson.D{{"$exists", false}}}}, }}}, Update: bson.D{ - {"$set", - bson.D{ - {"provider-id", doc.ProviderId}, - {"addresses", doc.Addresses}, - }, - }, + {"$set", patchFields}, }, }}, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/cloud_test.go juju-core-2.6.5/src/github.com/juju/juju/state/cloud_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/cloud_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/cloud_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -292,6 +292,7 @@ otherSt := s.Factory.MakeCAASModel(c, &factory.ModelParams{ CloudName: lowCloud.Name, + CloudRegion: "region1", CloudCredential: credTag, Owner: otherModelOwner.UserTag, ConfigAttrs: testing.Attrs{ @@ -318,6 +319,7 @@ defer state.SetBeforeHooks(c, s.State, func() { otherSt := s.Factory.MakeCAASModel(c, &factory.ModelParams{ CloudName: lowCloud.Name, + CloudRegion: "region1", CloudCredential: credTag, Owner: otherModelOwner.UserTag, ConfigAttrs: testing.Attrs{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/controller_test.go juju-core-2.6.5/src/github.com/juju/juju/state/controller_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/controller_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/controller_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,12 +36,13 @@ controller.JujuHASpace, controller.JujuManagementSpace, controller.AuditLogExcludeMethods, + // TODO(thumper): remove MaxLogsAge and MaxLogsSize in 2.7 branch. + controller.MaxLogsAge, + controller.MaxLogsSize, controller.MaxPruneTxnBatchSize, controller.MaxPruneTxnPasses, controller.PruneTxnQueryCount, controller.PruneTxnSleepTime, - controller.MaxLogsSize, - controller.MaxLogsAge, controller.CAASOperatorImagePath, controller.CAASImageRepo, controller.CharmStoreURL, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/enableha.go juju-core-2.6.5/src/github.com/juju/juju/state/enableha.go --- juju-core-2.6.2/src/github.com/juju/juju/state/enableha.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/enableha.go 2019-06-28 17:10:43.000000000 +0000 @@ -184,18 +184,20 @@ ) ([]txn.Op, ControllersChanges, error) { var ops []txn.Op var change ControllersChanges + for _, m := range intent.promote { ops = append(ops, promoteControllerOps(m)...) change.Promoted = append(change.Promoted, m.doc.Id) } + for _, m := range intent.convert { ops = append(ops, convertControllerOps(m)...) change.Converted = append(change.Converted, m.doc.Id) } - // Use any placement directives that have been provided - // when adding new machines, until the directives have - // been all used up. Ignore constraints for provided machines. - // Set up a helper function to do the work required. + + // Use any placement directives that have been provided when adding new + // machines, until the directives have been all used up. + // Ignore constraints for provided machines. placementCount := 0 getPlacementConstraints := func() (string, constraints.Value) { if placementCount >= len(intent.placement) { @@ -205,6 +207,7 @@ placementCount++ return result, constraints.Value{} } + mdocs := make([]*machineDoc, intent.newCount) for i := range mdocs { placement, cons := getPlacementConstraints() @@ -224,8 +227,8 @@ mdocs[i] = mdoc ops = append(ops, addOps...) change.Added = append(change.Added, mdoc.Id) - } + for _, m := range intent.maintain { tag, err := names.ParseTag(m.Tag().String()) if err != nil { @@ -258,15 +261,21 @@ func (st *State) enableHAIntentions(info *ControllerInfo, placement []string) (*enableHAIntent, error) { var intent enableHAIntent for _, s := range placement { - // TODO(natefinch): unscoped placements shouldn't ever get here (though - // they do currently). We should fix up the CLI to always add a scope - // to placements and then we can remove the need to deal with unscoped - // placements. + // TODO(natefinch): Unscoped placements can end up here, though they + // should not. We should fix up the CLI to always add a scope, + // then we can remove the need to deal with unscoped placements. + + // Append unscoped placements to the intentions. + // These will be used if/when adding new controllers is required. + // These placements will be interpreted as availability zones. p, err := instance.ParsePlacement(s) if err == instance.ErrPlacementScopeMissing { intent.placement = append(intent.placement, s) continue } + + // Placements for machines are "consumed" by appending such machines as + // candidates for promotion to controllers. if err == nil && p.Scope == instance.MachineScope { if names.IsContainerMachine(p.Directive) { return nil, errors.New("container placement directives not supported") @@ -280,7 +289,6 @@ return nil, errors.Errorf("machine for placement directive %q is already a controller", s) } intent.convert = append(intent.convert, m) - intent.placement = append(intent.placement, s) continue } return nil, errors.Errorf("unsupported placement directive %q", s) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/enableha_test.go juju-core-2.6.5/src/github.com/juju/juju/state/enableha_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/enableha_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/enableha_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -35,12 +35,12 @@ func (s *EnableHASuite) TestEnableHAAddsNewMachines(c *gc.C) { ids := make([]string, 3) - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) ids[0] = m0.Id() // Add a non-controller machine just to make sure. - _, err = s.State.AddMachine("quantal", state.JobHostUnits) + _, err = s.State.AddMachine("bionic", state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) s.assertControllerInfo(c, []string{"0"}, []string{"0"}, nil) @@ -48,7 +48,7 @@ cons := constraints.Value{ Mem: newUint64(100), } - changes, err := s.State.EnableHA(3, cons, "quantal", nil) + changes, err := s.State.EnableHA(3, cons, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) @@ -70,20 +70,20 @@ func (s *EnableHASuite) TestEnableHATo(c *gc.C) { ids := make([]string, 3) - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) ids[0] = m0.Id() // Add two non-controller machines. - _, err = s.State.AddMachine("quantal", state.JobHostUnits) + _, err = s.State.AddMachine("bionic", state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) - _, err = s.State.AddMachine("quantal", state.JobHostUnits) + _, err = s.State.AddMachine("bionic", state.JobHostUnits) c.Assert(err, jc.ErrorIsNil) s.assertControllerInfo(c, []string{"0"}, []string{"0"}, nil) - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", []string{"1", "2"}) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", []string{"1", "2"}) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 0) c.Assert(changes.Converted, gc.HasLen, 2) @@ -104,6 +104,42 @@ s.assertControllerInfo(c, ids, ids, nil) } +func (s *EnableHASuite) TestEnableHAToPartial(c *gc.C) { + ids := make([]string, 3) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) + c.Assert(err, jc.ErrorIsNil) + ids[0] = m0.Id() + + // Add one non-controller machine. + _, err = s.State.AddMachine("bionic", state.JobHostUnits) + c.Assert(err, jc.ErrorIsNil) + + s.assertControllerInfo(c, []string{"0"}, []string{"0"}, nil) + + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", []string{"1"}) + c.Assert(err, jc.ErrorIsNil) + + // One machine is converted (existing machine with placement), + // and another is added to make up the 3. + c.Assert(changes.Converted, gc.HasLen, 1) + c.Assert(changes.Added, gc.HasLen, 1) + + for i := 1; i < 3; i++ { + m, err := s.State.Machine(fmt.Sprint(i)) + c.Assert(err, jc.ErrorIsNil) + c.Assert(m.Jobs(), gc.DeepEquals, []state.MachineJob{ + state.JobHostUnits, + state.JobManageModel, + }) + gotCons, err := m.Constraints() + c.Assert(err, jc.ErrorIsNil) + c.Assert(gotCons, gc.DeepEquals, constraints.Value{}) + c.Assert(m.WantsVote(), jc.IsTrue) + ids[i] = m.Id() + } + s.assertControllerInfo(c, ids, ids, nil) +} + func newUint64(i uint64) *uint64 { return &i } @@ -132,7 +168,7 @@ func (s *EnableHASuite) TestEnableHASamePlacementAsNewCount(c *gc.C) { placement := []string{"p1", "p2", "p3"} - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", placement) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", placement) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, []string{"p1", "p2", "p3"}) @@ -140,7 +176,7 @@ func (s *EnableHASuite) TestEnableHAMorePlacementThanNewCount(c *gc.C) { placement := []string{"p1", "p2", "p3", "p4"} - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", placement) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", placement) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, []string{"p1", "p2", "p3"}) @@ -148,7 +184,7 @@ func (s *EnableHASuite) TestEnableHALessPlacementThanNewCount(c *gc.C) { placement := []string{"p1", "p2"} - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", placement) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", placement) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, []string{"p1", "p2"}) @@ -156,12 +192,12 @@ func (s *EnableHASuite) TestEnableHAMockBootstrap(c *gc.C) { // Testing based on lp:1748275 - Juju HA fails due to demotion of Machine 0 - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) err = m0.SetHasVote(true) c.Assert(err, jc.ErrorIsNil) - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) c.Assert(changes.Maintained, gc.DeepEquals, []string{"0"}) @@ -169,13 +205,13 @@ } func (s *EnableHASuite) TestEnableHADefaultsTo3(c *gc.C) { - changes, err := s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) // Mark machine 0 as being removed, and then run it again s.progressControllerToDead(c, "0") - changes, err = s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.DeepEquals, []string{"3"}) @@ -209,7 +245,7 @@ } func (s *EnableHASuite) TestEnableHAGoesToNextOdd(c *gc.C) { - changes, err := s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -223,30 +259,30 @@ // still bring us back to 3 s.progressControllerToDead(c, "0") s.assertControllerInfo(c, []string{"1", "2"}, []string{"1", "2"}, nil) - changes, err = s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) // We should try to get back to 3 again, since we only have 2 voting machines c.Check(changes.Added, gc.DeepEquals, []string{"3"}) s.assertControllerInfo(c, []string{"1", "2", "3"}, []string{"1", "2", "3"}, nil) // Doing it again with 0, should be a no-op, still going to '3' - changes, err = s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Check(changes.Added, gc.HasLen, 0) s.assertControllerInfo(c, []string{"1", "2", "3"}, []string{"1", "2", "3"}, nil) // Now if we go up to 5, and drop down to 4, we should again go to 5 - changes, err = s.State.EnableHA(5, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(5, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) sort.Strings(changes.Added) c.Check(changes.Added, gc.DeepEquals, []string{"4", "5"}) s.assertControllerInfo(c, []string{"1", "2", "3", "4", "5"}, []string{"1", "2", "3", "4", "5"}, nil) s.progressControllerToDead(c, "1") s.assertControllerInfo(c, []string{"2", "3", "4", "5"}, []string{"2", "3", "4", "5"}, nil) - changes, err = s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Check(changes.Added, gc.DeepEquals, []string{"6"}) s.assertControllerInfo(c, []string{"2", "3", "4", "5", "6"}, []string{"2", "3", "4", "5", "6"}, nil) // And again 0 should be treated as 5, and thus a no-op - changes, err = s.State.EnableHA(0, constraints.Value{}, "quantal", nil) + changes, err = s.State.EnableHA(0, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Check(changes.Added, gc.HasLen, 0) s.assertControllerInfo(c, []string{"2", "3", "4", "5", "6"}, []string{"2", "3", "4", "5", "6"}, nil) @@ -254,7 +290,7 @@ func (s *EnableHASuite) TestEnableHAConcurrentSame(c *gc.C) { defer state.SetBeforeHooks(c, s.State, func() { - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) // The outer EnableHA call will allocate IDs 0..2, // and the inner one 3..5. @@ -263,7 +299,7 @@ s.assertControllerInfo(c, expected, expected, nil) }).Check() - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.DeepEquals, []string{"0", "1", "2"}) s.assertControllerInfo(c, []string{"3", "4", "5"}, []string{"3", "4", "5"}, nil) @@ -275,7 +311,7 @@ func (s *EnableHASuite) TestEnableHAConcurrentLess(c *gc.C) { defer state.SetBeforeHooks(c, s.State, func() { - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) // The outer EnableHA call will initially allocate IDs 0..4, @@ -288,7 +324,7 @@ // machines 0..4, and fail due to the concurrent change. It will then // allocate machines 8..9 to make up the difference from the concurrent // EnableHA call. - changes, err := s.State.EnableHA(5, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(5, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) expected := []string{"5", "6", "7", "8", "9"} @@ -301,7 +337,7 @@ func (s *EnableHASuite) TestEnableHAConcurrentMore(c *gc.C) { defer state.SetBeforeHooks(c, s.State, func() { - changes, err := s.State.EnableHA(5, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(5, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 5) // The outer EnableHA call will allocate IDs 0..2, @@ -314,7 +350,7 @@ // machines 0..2, and fail due to the concurrent change. It will then // find that the number of voting machines in state is greater than // what we're attempting to ensure, and fail. - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, gc.ErrorMatches, "failed to create new controller machines: cannot reduce controller count") c.Assert(changes.Added, gc.HasLen, 0) @@ -324,7 +360,7 @@ } func (s *EnableHASuite) TestWatchControllerInfo(c *gc.C) { - _, err := s.State.AddMachine("quantal", state.JobManageModel) + _, err := s.State.AddMachine("bionic", state.JobManageModel) c.Assert(err, jc.ErrorIsNil) s.WaitForModelWatchersIdle(c, s.Model.UUID()) @@ -343,7 +379,7 @@ MachineIds: []string{"0"}, }) - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) @@ -359,11 +395,11 @@ } func (s *EnableHASuite) TestDestroyFromHA(c *gc.C) { - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) err = m0.Destroy() c.Assert(err, gc.ErrorMatches, "machine 0 is the only controller machine") - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -375,14 +411,14 @@ } func (s *EnableHASuite) TestForceDestroyFromHA(c *gc.C) { - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) err = m0.SetHasVote(true) c.Assert(err, jc.ErrorIsNil) // ForceDestroy must be blocked if there is only 1 machine. err = m0.ForceDestroy(dontWait) c.Assert(err, gc.ErrorMatches, "machine 0 is the only controller machine") - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -395,9 +431,9 @@ } func (s *EnableHASuite) TestDestroyRaceLastController(c *gc.C) { - m0, err := s.State.AddMachine("quantal", state.JobHostUnits, state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobHostUnits, state.JobManageModel) c.Assert(err, jc.ErrorIsNil) - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 2) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -431,7 +467,7 @@ } func (s *EnableHASuite) TestRemoveControllerMachineOneMachine(c *gc.C) { - m0, err := s.State.AddMachine("quantal", state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobManageModel) m0.SetHasVote(true) m0.SetWantsVote(true) err = s.State.RemoveControllerMachine(m0) @@ -446,9 +482,9 @@ } func (s *EnableHASuite) TestRemoveControllerMachine(c *gc.C) { - m0, err := s.State.AddMachine("quantal", state.JobManageModel) + m0, err := s.State.AddMachine("bionic", state.JobManageModel) m0.SetHasVote(true) - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Check(changes.Added, gc.HasLen, 2) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -464,7 +500,7 @@ } func (s *EnableHASuite) TestRemoveControllerMachineVoteRace(c *gc.C) { - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) @@ -489,7 +525,7 @@ } func (s *EnableHASuite) TestRemoveControllerMachineRace(c *gc.C) { - changes, err := s.State.EnableHA(3, constraints.Value{}, "quantal", nil) + changes, err := s.State.EnableHA(3, constraints.Value{}, "bionic", nil) c.Assert(err, jc.ErrorIsNil) c.Assert(changes.Added, gc.HasLen, 3) s.assertControllerInfo(c, []string{"0", "1", "2"}, []string{"0", "1", "2"}, nil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/export_test.go juju-core-2.6.5/src/github.com/juju/juju/state/export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -41,6 +41,7 @@ MachinesC = machinesC ModelEntityRefsC = modelEntityRefsC ApplicationsC = applicationsC + OfferConnectionsC = offerConnectionsC EndpointBindingsC = endpointBindingsC ControllersC = controllersC UsersC = usersC @@ -52,20 +53,21 @@ ) var ( - BinarystorageNew = &binarystorageNew - ImageStorageNewStorage = &imageStorageNewStorage - MachineIdLessThan = machineIdLessThan - GetOrCreatePorts = getOrCreatePorts - GetPorts = getPorts - CombineMeterStatus = combineMeterStatus - ApplicationGlobalKey = applicationGlobalKey - CloudGlobalKey = cloudGlobalKey - RegionSettingsGlobalKey = regionSettingsGlobalKey - ModelGlobalKey = modelGlobalKey - MergeBindings = mergeBindings - UpgradeInProgressError = errUpgradeInProgress - DBCollectionSizeToInt = dbCollectionSizeToInt - NewEntityWatcher = newEntityWatcher + BinarystorageNew = &binarystorageNew + ImageStorageNewStorage = &imageStorageNewStorage + MachineIdLessThan = machineIdLessThan + GetOrCreatePorts = getOrCreatePorts + GetPorts = getPorts + CombineMeterStatus = combineMeterStatus + ApplicationGlobalKey = applicationGlobalKey + CloudGlobalKey = cloudGlobalKey + RegionSettingsGlobalKey = regionSettingsGlobalKey + ModelGlobalKey = modelGlobalKey + MergeBindings = mergeBindings + UpgradeInProgressError = errUpgradeInProgress + DBCollectionSizeToInt = dbCollectionSizeToInt + NewEntityWatcher = newEntityWatcher + ApplicationHasConnectedOffers = applicationHasConnectedOffers ) type ( @@ -518,7 +520,7 @@ // MakeLogDoc creates a database document for a single log message. func MakeLogDoc( - entity names.Tag, + entity string, t time.Time, module string, location string, @@ -528,7 +530,7 @@ return &logDoc{ Id: bson.NewObjectId(), Time: t.UnixNano(), - Entity: entity.String(), + Entity: entity, Version: version.Current.String(), Module: module, Location: location, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/initialize.go juju-core-2.6.5/src/github.com/juju/juju/state/initialize.go --- juju-core-2.6.2/src/github.com/juju/juju/state/initialize.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/initialize.go 2019-06-28 17:10:43.000000000 +0000 @@ -273,6 +273,10 @@ if err := st.db().RunTransaction(ops); err != nil { return nil, errors.Trace(err) } + // Initialize the logs for the newly created models + if err := InitDbLogs(st.session); err != nil { + return nil, errors.Trace(err) + } probablyUpdateStatusHistory(st.db(), modelGlobalKey, modelStatusDoc) return ctlr, nil } @@ -283,7 +287,7 @@ if err := schema.Create(session.DB(jujuDB), settings); err != nil { return errors.Trace(err) } - if err := InitDbLogs(session, modelUUID); err != nil { + if err := InitDbLogs(session); err != nil { return errors.Trace(err) } return nil @@ -371,10 +375,6 @@ } // Some values require marshalling before storage. modelCfg = config.CoerceForStorage(modelCfg) - qualifier := args.Owner.Id() - if args.Type == ModelTypeCAAS { - qualifier = args.CloudName - } ops = append(ops, createSettingsOp(settingsC, modelGlobalKey, modelCfg), createModelEntityRefsOp(modelUUID), @@ -387,7 +387,7 @@ args.MigrationMode, args.EnvironVersion, ), - createUniqueOwnerModelNameOp(qualifier, args.Config.Name()), + createUniqueOwnerModelNameOp(args.Owner, args.Config.Name()), ) ops = append(ops, modelUserOps...) return ops, modelStatusDoc, nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/lease/store.go juju-core-2.6.5/src/github.com/juju/juju/state/lease/store.go --- juju-core-2.6.2/src/github.com/juju/juju/state/lease/store.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/lease/store.go 2019-06-28 17:10:43.000000000 +0000 @@ -108,6 +108,17 @@ return leases } +// LeaseGroup is part of the lease.Store interface. For the state +// store it's identical to Leases() because each store is specific to +// a namespace/model combination. +func (store *store) LeaseGroup(namespace, modelUUID string) map[lease.Key]lease.Info { + cfg := store.config + if namespace != cfg.Namespace || modelUUID != cfg.ModelUUID { + return nil + } + return store.Leases() +} + // ClaimLease is part of the lease.Store interface. func (store *store) ClaimLease(key lease.Key, request lease.Request, _ <-chan struct{}) error { return store.request(key.Lease, request, store.claimLeaseOps, "claiming") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/lease/store_test.go juju-core-2.6.5/src/github.com/juju/juju/state/lease/store_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/lease/store_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/lease/store_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -51,7 +51,7 @@ c.Assert(err, jc.ErrorIsNil) leases := fix.Store.Leases() - c.Check(len(leases), gc.Equals, 2) + c.Check(leases, gc.HasLen, 2) c.Check(leases[key("duck")].Holder, gc.Equals, "donald") c.Check(leases[key("mouse")].Holder, gc.Equals, "mickey") } @@ -73,3 +73,23 @@ c.Check(len(leases), gc.Equals, 0) } + +func (s *StoreSuite) TestLeaseGroup(c *gc.C) { + fix := s.EasyFixture(c) + + err := fix.Store.ClaimLease(key("duck"), corelease.Request{Holder: "donald", Duration: time.Minute}, nil) + c.Assert(err, jc.ErrorIsNil) + err = fix.Store.ClaimLease(key("mouse"), corelease.Request{Holder: "mickey", Duration: time.Minute}, nil) + c.Assert(err, jc.ErrorIsNil) + + leases := fix.Store.LeaseGroup(fix.Config.Namespace, fix.Config.ModelUUID) + c.Check(leases, gc.HasLen, 2) + c.Check(leases[key("duck")].Holder, gc.Equals, "donald") + c.Check(leases[key("mouse")].Holder, gc.Equals, "mickey") + + leases = fix.Store.LeaseGroup("otherns", fix.Config.ModelUUID) + c.Assert(leases, gc.HasLen, 0) + + leases = fix.Store.LeaseGroup(fix.Config.Namespace, "othermodel") + c.Assert(leases, gc.HasLen, 0) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/logdb/buf_test.go juju-core-2.6.5/src/github.com/juju/juju/state/logdb/buf_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/logdb/buf_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/logdb/buf_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,7 +11,6 @@ "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "gopkg.in/juju/names.v2" "github.com/juju/juju/state" "github.com/juju/juju/state/logdb" @@ -57,13 +56,13 @@ const bufsz = 3 b := logdb.NewBufferedLogger(&s.mock, bufsz, time.Minute, s.clock) in := []state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "bar", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "baz", }} @@ -86,13 +85,13 @@ const bufsz = 1 b := logdb.NewBufferedLogger(&s.mock, bufsz, time.Minute, s.clock) in := []state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "bar", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "baz", }} @@ -112,10 +111,10 @@ b := logdb.NewBufferedLogger(&s.mock, bufsz, flushInterval, s.clock) in := []state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "bar", }} @@ -164,13 +163,13 @@ // until the timer triggers. b := logdb.NewBufferedLogger(&s.mock, bufsz, flushInterval, s.clock) in := []state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "bar", }, { - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "baz", }} @@ -198,7 +197,7 @@ s.mock.SetErrors(errors.New("nope")) b := logdb.NewBufferedLogger(&s.mock, 2, time.Minute, s.clock) err := b.Log([]state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }}) c.Assert(err, jc.ErrorIsNil) @@ -210,7 +209,7 @@ s.mock.SetErrors(errors.New("nope")) b := logdb.NewBufferedLogger(&s.mock, 1, time.Minute, s.clock) err := b.Log([]state.LogRecord{{ - Entity: names.NewMachineTag("0"), + Entity: "not-a-tag", Message: "foo", }}) c.Assert(err, gc.ErrorMatches, "nope") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/logs.go juju-core-2.6.5/src/github.com/juju/juju/state/logs.go --- juju-core-2.6.2/src/github.com/juju/juju/state/logs.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/logs.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,13 +18,14 @@ "github.com/juju/collections/set" "github.com/juju/errors" "github.com/juju/loggo" + "github.com/juju/utils" "github.com/juju/utils/deque" "github.com/juju/version" - "gopkg.in/juju/names.v2" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/tomb.v2" + "github.com/juju/juju/controller" "github.com/juju/juju/mongo" ) @@ -75,14 +76,130 @@ return logsCPrefix + modelUUID } -// InitDbLogs sets up the indexes for the logs collection. It should -// be called as state is opened. It is idempotent. -func InitDbLogs(session *mgo.Session, modelUUID string) error { +// InitDbLogs sets up the capped collections for the logging, along with the +// indexes for the logs collection. It should be called as state is opened. It +// is idempotent. +func InitDbLogs(session *mgo.Session) error { + // Read the capped collection size from controller config. + size, err := modelLogsSize(session) + if errors.Cause(err) == mgo.ErrNotFound { + // We are in early stages of database initialization, so nothing to do + // here. The controller model and the default model (most likely) will + // be initialized during bootstrap, and when the machine agent starts + // properly, the logs collections will be either created for them, + // or converted to capped collections. + logger.Infof("controller settings not found, early stage initialization assumed") + return nil + } else if err != nil { + return errors.Trace(err) + } + + models, err := modelUUIDs(session) + if err != nil { + return err + } + + encounteredError := false + for _, uuid := range models { + if err := InitDbLogsForModel(session, uuid, size); err != nil { + encounteredError = true + logger.Errorf("unable to initialize model logs: %v", err) + } + } + + if encounteredError { + return errors.New("one or more errors initializing logs") + } + return nil +} + +// modelLogsSize reads the model-logs-size value from the controller +// config document and returns it. If the value isn't found the default +// size value is returned. +func modelLogsSize(session *mgo.Session) (int, error) { + // This is executed very early in the opening of the database, so there + // is no State, Controller, nor StatePool objects just now. Use low level + // mgo to access the settings. + var doc settingsDoc + err := session.DB(jujuDB).C(controllersC).FindId(controllerSettingsGlobalKey).One(&doc) + if err != nil { + return 0, errors.Trace(err) + } + // During initial migration there is no guarantee that the value exists + // in the settings document. + if value, ok := doc.Settings[controller.ModelLogsSize]; ok { + if s, ok := value.(string); ok { + size, _ := utils.ParseSize(s) + if size > 0 { + // If the value is there we know it fits in an int without wrapping. + return int(size), nil + } + } + } + return controller.DefaultModelLogsSizeMB, nil +} + +// modelUUIDs returns the UUIDs of all models currently stored in the database. +// This function is called very early in the opening of the database, so it uses +// lower level mgo methods rather than any helpers from State objects. +func modelUUIDs(session *mgo.Session) ([]string, error) { + var docs []modelDoc + err := session.DB(jujuDB).C(modelsC).Find(nil).All(&docs) + if err != nil { + return nil, err + } + var result []string + for _, doc := range docs { + result = append(result, doc.UUID) + } + return result, nil +} + +// InitDbLogsForModel sets up the indexes for the logs collection for the +// specified model. It should be called as state is opened. It is idempotent. +// This function also ensures that the logs collection is capped at the right +// size. +func InitDbLogsForModel(session *mgo.Session, modelUUID string, size int) error { + // Get the collection from the logs DB. logsColl := session.DB(logsDB).C(logCollectionName(modelUUID)) + + capped, maxSize, err := getCollectionCappedInfo(logsColl) + if errors.IsNotFound(err) { + // Create the collection as a capped collection. + logger.Infof("creating logs collection for %s, capped at %v MiB", modelUUID, size) + err := logsColl.Create(&mgo.CollectionInfo{ + Capped: true, + MaxBytes: size * humanize.MiByte, + }) + if err != nil { + return errors.Trace(err) + } + } else if capped { + if maxSize == size { + // The logs collection size matches, so nothing to do here. + logger.Tracef("logs collection for %s already capped at %v MiB", modelUUID, size) + return nil + } else { + logger.Infof("resizing logs collection for %s from %d to %v MiB", modelUUID, maxSize, size) + err := convertToCapped(logsColl, size) + if err != nil { + return errors.Trace(err) + } + } + } else { + logger.Infof("converting logs collection for %s to capped with max size %v MiB", modelUUID, size) + err := convertToCapped(logsColl, size) + if err != nil { + return errors.Trace(err) + } + } + + // Ensure all the right indices are created. When converting to a capped + // collection, the indices are dropped. for _, key := range logIndexes { err := logsColl.EnsureIndex(mgo.Index{Key: key}) if err != nil { - return errors.Annotate(err, "cannot create index for logs collection") + return errors.Annotatef(err, "cannot create index for logs collection %v", logsColl.Name) } } return nil @@ -245,7 +362,7 @@ // insertion. Id: bson.NewObjectId(), Time: r.Time.UnixNano(), - Entity: r.Entity.String(), + Entity: r.Entity, Version: versionString, Module: r.Module, Location: r.Location, @@ -258,7 +375,7 @@ } func validateInputLogRecord(r LogRecord) error { - if r.Entity == nil { + if r.Entity == "" { return errors.NotValidf("missing Entity") } return nil @@ -302,7 +419,7 @@ // origin fields ModelUUID string - Entity names.Tag + Entity string Version version.Number // logging-specific fields @@ -732,17 +849,12 @@ return nil, errors.Errorf("unrecognized log level %q", doc.Level) } - entity, err := names.ParseTag(doc.Entity) - if err != nil { - return nil, errors.Annotate(err, "while parsing entity tag") - } - rec := &LogRecord{ ID: doc.Time, Time: time.Unix(0, doc.Time).UTC(), // not worth preserving TZ ModelUUID: modelUUID, - Entity: entity, + Entity: doc.Entity, Version: ver, Level: level, @@ -758,112 +870,6 @@ Debugf(string, ...interface{}) } -// PruneLogs removes old log documents in order to control the size of -// logs collection. All logs older than minLogTime are -// removed. Further removal is also performed if the logs collection -// size is greater than maxLogsMB. -func PruneLogs(st ControllerSessioner, minLogTime time.Time, maxLogsMB int, logger DebugLogger) (string, error) { - if !st.IsController() { - return "", errors.Errorf("pruning logs requires a controller state") - } - session, logsDB := initLogsSessionDB(st) - defer session.Close() - - startTime := st.clock().Now() - - logColls, err := getLogCollections(logsDB) - if err != nil { - return "", errors.Annotate(err, "failed to get log counts") - } - - pruneCounts := make(map[string]int) - - // Remove old log entries for each model. - for modelUUID, logColl := range logColls { - removeInfo, err := logColl.RemoveAll(bson.M{ - "t": bson.M{"$lt": minLogTime.UnixNano()}, - }) - if err != nil { - return "", errors.Annotate(err, "failed to prune logs by time") - } - pruneCounts[modelUUID] = removeInfo.Removed - } - - // Do further pruning if the total size of the log collections is - // over the maximum size. - var endSize string - for { - collMB, err := getCollectionTotalMB(logColls) - if err != nil { - return "", errors.Annotate(err, "failed to retrieve log counts") - } - endSize = fmt.Sprintf("logs db now %d MB", collMB) - if collMB <= maxLogsMB { - break - } - - modelUUID, count, err := findModelWithMostLogs(logColls) - if err != nil { - return "", errors.Annotate(err, "log count query failed") - } - if count < 5000 { - break // Pruning is not worthwhile - } - - // Remove the oldest 1% of log records for the model. - toRemove := int(float64(count) * 0.01) - - // Find the threshold timestammp to start removing from. - // NOTE: this assumes that there are no more logs being added - // for the time range being pruned (which should be true for - // any realistic minimum log collection size). - logColl := logColls[modelUUID] - tsQuery := logColl.Find(nil).Sort("t", "_id") - tsQuery = tsQuery.Skip(toRemove) - tsQuery = tsQuery.Select(bson.M{"t": 1}) - var doc bson.M - err = tsQuery.One(&doc) - if err != nil { - return "", errors.Annotate(err, "log pruning timestamp query failed") - } - thresholdTs := doc["t"] - - // Remove old records. - removeInfo, err := logColl.RemoveAll(bson.M{ - "t": bson.M{"$lt": thresholdTs}, - }) - if err != nil { - return "", errors.Annotate(err, "log pruning failed") - } - pruneCounts[modelUUID] += removeInfo.Removed - } - - totalRemoved := 0 - modelCount := 0 - for modelUUID, count := range pruneCounts { - if count > 0 { - totalRemoved += count - modelCount++ - logger.Debugf("pruned %d logs for model %s", count, modelUUID) - } - } - - var removed string - if totalRemoved == 0 { - removed = "no pruning necessary" - } else { - s := "s" - if modelCount == 1 { - s = "" - } - removed = fmt.Sprintf("pruned %d entries from %d model%s", totalRemoved, modelCount, s) - } - elapsed := st.clock().Now().Sub(startTime).Round(time.Millisecond) - - message := fmt.Sprintf("pruning complete after %s, %s, %s", elapsed, removed, endSize) - return message, nil -} - func initLogsSessionDB(st MongoSessioner) (*mgo.Session, *mgo.Database) { // To improve throughput, only wait for the logs to be written to // the primary. For some reason, this makes a huge difference even @@ -912,18 +918,80 @@ collectionName, size, size) } -// getCollectionMB returns the size of a MongoDB collection (in -// bytes), excluding space used by indexes. -func getCollectionMB(coll *mgo.Collection) (int, error) { +func collStats(coll *mgo.Collection) (bson.M, error) { var result bson.M err := coll.Database.Run(bson.D{ {"collStats", coll.Name}, {"scale", humanize.MiByte}, }, &result) if err != nil { + // In order to return consistent error messages across 2.4 and 3.x + // we look for the expected errors. For 2.4 we get error text like + // "ns not found", and with 3.x we get either "Database [x] not found." + // or "Collection [x.y] not found." + if strings.Contains(err.Error(), "not found") { + return nil, errors.Wrap( + err, + errors.NotFoundf("Collection [%s.%s]", coll.Database.Name, coll.Name)) + } + return nil, errors.Trace(err) + } + return result, nil +} + +func convertToCapped(coll *mgo.Collection, maxSizeMB int) error { + if maxSizeMB < 1 { + return errors.NotValidf("non-positive maxSize %v", maxSizeMB) + } + maxSizeMB *= humanize.MiByte + var result bson.M + err := coll.Database.Run(bson.D{ + {"convertToCapped", coll.Name}, + {"size", maxSizeMB}, + }, &result) + if err != nil { + return errors.Trace(err) + } + return nil +} + +// getCollectionCappedInfo returns whether or not the collection is +// capped, and the max size in MB. +func getCollectionCappedInfo(coll *mgo.Collection) (bool, int, error) { + stats, err := collStats(coll) + if err != nil { + return false, 0, errors.Trace(err) + } + // For mongo 2.4, the "capped" key is only available when it is set + // to true. For mongo 3.2 and 3.6, it is always there. + // If capped is there, but isn't a bool, we treat this as false. + capped, _ := stats["capped"].(bool) + if !capped { + return false, 0, nil + } + // For mongo 3.2 and 3.6, the value is "maxSize". For 2.4 the value + // used is "storageSize" + value, found := stats["maxSize"] + if !found { + if value, found = stats["storageSize"]; !found { + return false, 0, errors.NotValidf("no maxSize or storageSize value") + } + } + maxSize, ok := value.(int) + if !ok { + return false, 0, errors.NotValidf("size value is not an int") + } + return true, maxSize, nil +} + +// getCollectionMB returns the size of a MongoDB collection (in +// megabytes), excluding space used by indexes. +func getCollectionMB(coll *mgo.Collection) (int, error) { + stats, err := collStats(coll) + if err != nil { return 0, errors.Trace(err) } - return dbCollectionSizeToInt(result, coll.Name) + return dbCollectionSizeToInt(stats, coll.Name) } // getCollectionTotalMB returns the total size of the log collections @@ -958,34 +1026,6 @@ return result, nil } -// findModelWithMostLogs returns the modelUUID and row count for the -// collection with the most logs in the logs DB. -func findModelWithMostLogs(colls map[string]*mgo.Collection) (string, int, error) { - var maxModelUUID string - var maxCount int - for modelUUID, coll := range colls { - count, err := getRowCountForCollection(coll) - if err != nil { - return "", -1, errors.Trace(err) - } - if count > maxCount { - maxModelUUID = modelUUID - maxCount = count - } - } - return maxModelUUID, maxCount, nil -} - -// getRowCountForCollection returns the number of log records stored for a -// given model log collection. -func getRowCountForCollection(coll *mgo.Collection) (int, error) { - count, err := coll.Count() - if err != nil { - return -1, errors.Annotate(err, "failed to get log count") - } - return count, nil -} - func removeModelLogs(session *mgo.Session, modelUUID string) error { logsDB := session.DB(logsDB) logsColl := logsDB.C(logCollectionName(modelUUID)) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/logs_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/logs_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/logs_internal_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/logs_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,258 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state + +import ( + "fmt" + "time" + + "github.com/juju/errors" + "github.com/juju/loggo" + "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" +) + +type LogsInternalSuite struct { + testing.MgoSuite + testing.IsolationSuite +} + +var _ = gc.Suite(&LogsInternalSuite{}) + +func (s *LogsInternalSuite) SetUpSuite(c *gc.C) { + s.DebugMgo = true + s.MgoSuite.SetUpSuite(c) + s.IsolationSuite.SetUpSuite(c) +} + +func (s *LogsInternalSuite) TearDownSuite(c *gc.C) { + s.IsolationSuite.TearDownSuite(c) + s.MgoSuite.TearDownSuite(c) +} + +func (s *LogsInternalSuite) SetUpTest(c *gc.C) { + s.MgoSuite.SetUpTest(c) + s.IsolationSuite.SetUpTest(c) +} + +func (s *LogsInternalSuite) TearDownTest(c *gc.C) { + err := s.Session.DB("logs").DropDatabase() + c.Assert(err, jc.ErrorIsNil) + s.IsolationSuite.TearDownTest(c) + s.MgoSuite.TearDownTest(c) +} + +func (s *LogsInternalSuite) TestCollStatsForMissingDB(c *gc.C) { + coll := s.Session.DB("logs").C("missing") + _, err := collStats(coll) + + c.Assert(err.Error(), gc.Equals, "Collection [logs.missing] not found") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *LogsInternalSuite) createLogsDB(c *gc.C) *mgo.Collection { + // We create the db by writing something into a collection. + coll := s.Session.DB("logs").C("new") + err := coll.Insert(bson.M{"_id": "new"}) + c.Assert(err, jc.ErrorIsNil) + return coll +} + +func (s *LogsInternalSuite) createCapped(c *gc.C, name string, size int) *mgo.Collection { + // We create the db by writing something into a collection. + coll := s.Session.DB("logs").C(name) + err := coll.Create(&mgo.CollectionInfo{ + Capped: true, + MaxBytes: size, + }) + c.Assert(err, jc.ErrorIsNil) + return coll +} + +func (s *LogsInternalSuite) TestCollStatsForMissingCollection(c *gc.C) { + // Create a collection in the logs database to make sure the DB exists. + s.createLogsDB(c) + + coll := s.Session.DB("logs").C("missing") + _, err := collStats(coll) + + c.Assert(err.Error(), gc.Equals, "Collection [logs.missing] not found") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *LogsInternalSuite) TestCappedInfoForNormalCollection(c *gc.C) { + coll := s.createLogsDB(c) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsFalse) + c.Assert(maxSize, gc.Equals, 0) +} + +func (s *LogsInternalSuite) TestCappedInfoForCappedCollection(c *gc.C) { + // mgo MaxBytes is in bytes, whereas we query in MB + coll := s.createCapped(c, "capped", 20*1024*1024) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Assert(maxSize, gc.Equals, 20) +} + +func (s *LogsInternalSuite) dbLogger(coll *mgo.Collection) *DbLogger { + return &DbLogger{ + logsColl: coll, + modelUUID: "fake-uuid", + } +} + +func writeSomeLogs(c *gc.C, logger *DbLogger, count int) { + toWrite := make([]LogRecord, 0, count) + when := time.Now() + c.Logf("writing %d logs to the db\n", count) + for i := 0; i < count; i++ { + toWrite = append(toWrite, LogRecord{ + Time: when, + Entity: "some-entity", + Level: loggo.DEBUG, + Module: "test", + Location: "test_file.go:1234", + Message: fmt.Sprintf("test line %d", i), + }) + } + err := logger.Log(toWrite) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *LogsInternalSuite) TestLogsCollectionConversion(c *gc.C) { + coll := s.createLogsDB(c) + err := convertToCapped(coll, 5) + c.Assert(err, jc.ErrorIsNil) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Assert(maxSize, gc.Equals, 5) +} + +func (s *LogsInternalSuite) TestLogsCollectionConversionTwice(c *gc.C) { + coll := s.createLogsDB(c) + err := convertToCapped(coll, 5) + c.Assert(err, jc.ErrorIsNil) + + err = convertToCapped(coll, 10) + c.Assert(err, jc.ErrorIsNil) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Assert(maxSize, gc.Equals, 10) +} + +func (s *LogsInternalSuite) TestLogsCollectionConversionSmallerSize(c *gc.C) { + // Create a log db that has two meg of data, then convert it + // to a capped collection with a one meg limit. + coll := s.createLogsDB(c) + dbLogger := s.dbLogger(coll) + size := 0 + var err error + for size < 4 { + writeSomeLogs(c, dbLogger, 5000) + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + } + + err = convertToCapped(coll, 2) + c.Assert(err, jc.ErrorIsNil) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Assert(maxSize, gc.Equals, 2) + + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + // We don't have a LessThan or equal to, so using 3 to mean 1 or 2. + c.Assert(size, jc.LessThan, 3) + + // Check that we still have some documents in there. + docs, err := coll.Count() + c.Assert(err, jc.ErrorIsNil) + c.Assert(docs, jc.GreaterThan, 5000) +} + +func (s *LogsInternalSuite) TestLogsCollectionConversionTwiceSmallerSize(c *gc.C) { + // Create a log db that has two meg of data, then convert it + // to a capped collection with a one meg limit. + coll := s.createLogsDB(c) + dbLogger := s.dbLogger(coll) + size := 0 + var err error + for size < 4 { + writeSomeLogs(c, dbLogger, 5000) + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + } + + err = convertToCapped(coll, 10) + c.Assert(err, jc.ErrorIsNil) + + // Now resize again to 2. + err = convertToCapped(coll, 2) + c.Assert(err, jc.ErrorIsNil) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Check(maxSize, gc.Equals, 2) + + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + // We don't have a LessThan or equal to, so using 3 to mean 1 or 2. + c.Assert(size, jc.LessThan, 3) + + // Check that we still have some documents in there. + docs, err := coll.Count() + c.Assert(err, jc.ErrorIsNil) + c.Assert(docs, jc.GreaterThan, 5000) +} + +func (s *LogsInternalSuite) TestLogsCollectionConversionTwiceBiggerSize(c *gc.C) { + // Create a log db that has two meg of data, then convert it + // to a capped collection with a one meg limit. + coll := s.createLogsDB(c) + dbLogger := s.dbLogger(coll) + size := 0 + var err error + for size < 4 { + writeSomeLogs(c, dbLogger, 5000) + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + } + + err = convertToCapped(coll, 1) + c.Assert(err, jc.ErrorIsNil) + + // Now resize again to 2. + err = convertToCapped(coll, 2) + c.Assert(err, jc.ErrorIsNil) + + capped, maxSize, err := getCollectionCappedInfo(coll) + c.Assert(err, jc.ErrorIsNil) + c.Assert(capped, jc.IsTrue) + c.Check(maxSize, gc.Equals, 2) + + size, err = getCollectionMB(coll) + c.Assert(err, jc.ErrorIsNil) + // We don't have a LessThan or equal to, so using 3 to mean 1 or 2. + c.Assert(size, jc.LessThan, 3) + + // Check that we still have some documents in there. + docs, err := coll.Count() + c.Assert(err, jc.ErrorIsNil) + c.Assert(docs, jc.GreaterThan, 5000) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/logs_test.go juju-core-2.6.5/src/github.com/juju/juju/state/logs_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/logs_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/logs_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -149,14 +149,14 @@ t1 := t0.Add(time.Second) err := logger.Log([]state.LogRecord{{ Time: t0, - Entity: names.NewMachineTag("45"), + Entity: "machine-45", Module: "some.where", Location: "foo.go:99", Level: loggo.INFO, Message: "all is well", }, { Time: t1, - Entity: names.NewMachineTag("47"), + Entity: "machine-47", Module: "else.where", Location: "bar.go:42", Level: loggo.ERROR, @@ -184,122 +184,6 @@ c.Assert(docs[1]["x"], gc.Equals, "oh noes") } -func (s *LogsSuite) TestPruneLogsByTime(c *gc.C) { - dbLogger := state.NewDbLogger(s.State) - defer dbLogger.Close() - log := func(t time.Time, msg string) { - err := dbLogger.Log([]state.LogRecord{{ - Time: t, - Entity: names.NewMachineTag("22"), - Version: jujuversion.Current, - Module: "module", - Location: "loc", - Level: loggo.INFO, - Message: msg, - }}) - c.Assert(err, jc.ErrorIsNil) - } - - now := coretesting.NonZeroTime() - maxLogTime := now.Add(-time.Minute) - log(now, "keep") - log(maxLogTime.Add(time.Second), "keep") - log(maxLogTime, "keep") - log(maxLogTime.Add(-time.Second), "prune") - log(maxLogTime.Add(-(2 * time.Second)), "prune") - - noPruneMB := 100 - msg, err := state.PruneLogs(s.State, maxLogTime, noPruneMB, s.logger) - c.Assert(err, jc.ErrorIsNil) - c.Check(msg, gc.Equals, "pruning complete after 0s, pruned 2 entries from 1 model, logs db now 0 MB") - - // After pruning there should just be 3 "keep" messages left. - var docs []bson.M - err = s.logsColl.Find(nil).All(&docs) - c.Assert(err, jc.ErrorIsNil) - c.Assert(docs, gc.HasLen, 3) - for _, doc := range docs { - c.Assert(doc["x"], gc.Equals, "keep") - } -} - -func (s *LogsSuite) TestPruneLogsBySize(c *gc.C) { - // Set up 3 models and generate different amounts of logs - // for them. - now := truncateDBTime(coretesting.NonZeroTime()) - - s0 := s.State - startingLogsS0 := 10 - s.generateLogs(c, s0, now, startingLogsS0) - - s1 := s.Factory.MakeModel(c, nil) - defer s1.Close() - startingLogsS1 := 10000 - s.generateLogs(c, s1, now, startingLogsS1) - - s2 := s.Factory.MakeModel(c, nil) - defer s2.Close() - startingLogsS2 := 12000 - s.generateLogs(c, s2, now, startingLogsS2) - - // Sanity check - c.Assert(s.countLogs(c, s0), gc.Equals, startingLogsS0) - c.Assert(s.countLogs(c, s1), gc.Equals, startingLogsS1) - c.Assert(s.countLogs(c, s2), gc.Equals, startingLogsS2) - - // Prune logs collection back to 1 MiB. - tsNoPrune := coretesting.NonZeroTime().Add(-3 * 24 * time.Hour) - msg, err := state.PruneLogs(s.State, tsNoPrune, 1, s.logger) - c.Assert(err, jc.ErrorIsNil) - c.Check(msg, gc.Matches, "pruning complete after .*s, pruned \\d+ entries from 2 models, logs db now \\d+ MB") - // Logs for first model should not be touched. - c.Assert(s.countLogs(c, s0), gc.Equals, startingLogsS0) - - // Logs for second model should be pruned. - c.Assert(s.countLogs(c, s1), jc.LessThan, startingLogsS1) - c.Assert(s.countLogs(c, s1), jc.GreaterThan, 2000) - - // Logs for third model should be pruned to a similar level as - // second model. - c.Assert(s.countLogs(c, s2), jc.LessThan, startingLogsS1) - c.Assert(s.countLogs(c, s2), jc.GreaterThan, 2000) - - // Ensure that the latest log records are still there. - assertLatestTs := func(st *state.State) { - var doc bson.M - err := s.logsColl.Find(nil).Sort("-t").One(&doc) - c.Assert(err, jc.ErrorIsNil) - c.Assert(doc["t"], gc.Equals, now.UnixNano()) - } - assertLatestTs(s0) - assertLatestTs(s1) - assertLatestTs(s2) -} - -func (s *LogsSuite) generateLogs(c *gc.C, st *state.State, endTime time.Time, count int) { - dbLogger := state.NewDbLogger(st) - defer dbLogger.Close() - for i := 0; i < count; i++ { - ts := endTime.Add(-time.Duration(i) * time.Second) - err := dbLogger.Log([]state.LogRecord{{ - Time: ts, - Entity: names.NewMachineTag("0"), - Version: jujuversion.Current, - Module: "module", - Location: "loc", - Level: loggo.INFO, - Message: "message", - }}) - c.Assert(err, jc.ErrorIsNil) - } -} - -func (s *LogsSuite) countLogs(c *gc.C, st *state.State) int { - count, err := s.logCollFor(st).Count() - c.Assert(err, jc.ErrorIsNil) - return count -} - type LogTailerSuite struct { ConnWithWallClockSuite oplogColl *mgo.Collection @@ -438,48 +322,6 @@ s.checkLogTailerFiltering(c, s.otherState, state.LogTailerParams{}, writeLogs, assert) } -func (s *LogTailerSuite) TestTailingSkipsBadDocs(c *gc.C) { - writeLogs := func() { - s.writeLogs(c, s.modelUUID, 1, logTemplate{ - Entity: emptyTag{}, - }) - s.writeLogs(c, s.modelUUID, 1, logTemplate{ - Message: "good1", - }) - s.writeLogs(c, s.modelUUID, 1, logTemplate{ - Message: "good2", - }) - } - - assert := func(tailer state.LogTailer) { - messages := map[string]bool{} - defer func() { - c.Assert(messages, gc.HasLen, 2) - for m := range messages { - if m != "good1" && m != "good2" { - c.Fatalf("received message: %v", m) - } - } - }() - count := 0 - for { - select { - case log := <-tailer.Logs(): - c.Assert(log.ModelUUID, gc.Equals, s.State.ModelUUID()) - messages[log.Message] = true - count++ - c.Logf("count %d", count) - if count >= 2 { - return - } - case <-time.After(coretesting.ShortWait): - c.Fatalf("timeout waiting for logs %d", count) - } - } - } - s.checkLogTailerFiltering(c, s.State, state.LogTailerParams{}, writeLogs, assert) -} - func (s *LogTailerSuite) TestTailingLogsOnlyForOneModel(c *gc.C) { writeLogs := func() { s.writeLogs(c, s.otherUUID, 1, logTemplate{ @@ -627,9 +469,9 @@ } func (s *LogTailerSuite) TestIncludeEntity(c *gc.C) { - machine0 := logTemplate{Entity: names.NewMachineTag("0")} - foo0 := logTemplate{Entity: names.NewUnitTag("foo/0")} - foo1 := logTemplate{Entity: names.NewUnitTag("foo/1")} + machine0 := logTemplate{Entity: "machine-0"} + foo0 := logTemplate{Entity: "unit-foo-0"} + foo1 := logTemplate{Entity: "unit-foo-1"} writeLogs := func() { s.writeLogs(c, s.otherUUID, 3, machine0) s.writeLogs(c, s.otherUUID, 2, foo0) @@ -650,9 +492,9 @@ } func (s *LogTailerSuite) TestIncludeEntityWildcard(c *gc.C) { - machine0 := logTemplate{Entity: names.NewMachineTag("0")} - foo0 := logTemplate{Entity: names.NewUnitTag("foo/0")} - foo1 := logTemplate{Entity: names.NewUnitTag("foo/1")} + machine0 := logTemplate{Entity: "machine-0"} + foo0 := logTemplate{Entity: "unit-foo-0"} + foo1 := logTemplate{Entity: "unit-foo-1"} writeLogs := func() { s.writeLogs(c, s.otherUUID, 3, machine0) s.writeLogs(c, s.otherUUID, 2, foo0) @@ -672,9 +514,9 @@ } func (s *LogTailerSuite) TestExcludeEntity(c *gc.C) { - machine0 := logTemplate{Entity: names.NewMachineTag("0")} - foo0 := logTemplate{Entity: names.NewUnitTag("foo/0")} - foo1 := logTemplate{Entity: names.NewUnitTag("foo/1")} + machine0 := logTemplate{Entity: "machine-0"} + foo0 := logTemplate{Entity: "unit-foo-0"} + foo1 := logTemplate{Entity: "unit-foo-1"} writeLogs := func() { s.writeLogs(c, s.otherUUID, 3, machine0) s.writeLogs(c, s.otherUUID, 2, foo0) @@ -694,9 +536,9 @@ } func (s *LogTailerSuite) TestExcludeEntityWildcard(c *gc.C) { - machine0 := logTemplate{Entity: names.NewMachineTag("0")} - foo0 := logTemplate{Entity: names.NewUnitTag("foo/0")} - foo1 := logTemplate{Entity: names.NewUnitTag("foo/1")} + machine0 := logTemplate{Entity: "machine-0"} + foo0 := logTemplate{Entity: "unit-foo-0"} + foo1 := logTemplate{Entity: "unit-foo-1"} writeLogs := func() { s.writeLogs(c, s.otherUUID, 3, machine0) s.writeLogs(c, s.otherUUID, 2, foo0) @@ -808,7 +650,7 @@ } type logTemplate struct { - Entity names.Tag + Entity string Version version.Number Module string Location string @@ -873,8 +715,8 @@ } func (s *LogTailerSuite) normaliseLogTemplate(lt *logTemplate) { - if lt.Entity == nil { - lt.Entity = names.NewMachineTag("0") + if lt.Entity == "" { + lt.Entity = "not-a-tag" } if lt.Version == version.Zero { lt.Version = jujuversion.Current diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/machine.go juju-core-2.6.5/src/github.com/juju/juju/state/machine.go --- juju-core-2.6.2/src/github.com/juju/juju/state/machine.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/machine.go 2019-06-28 17:10:43.000000000 +0000 @@ -573,7 +573,7 @@ // If the machine has assigned units, Destroy will return // a HasAssignedUnitsError. func (m *Machine) Destroy() error { - return m.advanceLifecycle(Dying, false) + return m.advanceLifecycle(Dying, false, 0) } // ForceDestroy queues the machine for complete removal, including the @@ -601,7 +601,8 @@ // We set the machine to Dying if it isn't already dead. var machineOp txn.Op if m.Life() < Dead { - // Make sure we don't want the vote, and we are queued to be Dying + // Make sure we don't want the vote, and we are queued to be Dying. + // Since we are force deleting, life assert should be current machine's life. machineOp = txn.Op{ C: machinesC, Id: m.doc.DocID, @@ -645,7 +646,7 @@ // If the machine has assigned units, EnsureDead will return // a HasAssignedUnitsError. func (m *Machine) EnsureDead() error { - return m.advanceLifecycle(Dead, false) + return m.advanceLifecycle(Dead, false, 0) } type HasAssignedUnitsError struct { @@ -735,7 +736,7 @@ // value, or a later one, no changes will be made to remote state. If // the machine has any responsibilities that preclude a valid change in // lifecycle, it will return an error. -func (original *Machine) advanceLifecycle(life Life, force bool) (err error) { +func (original *Machine) advanceLifecycle(life Life, force bool, maxWait time.Duration) (err error) { containers, err := original.Containers() if err != nil { return err @@ -773,7 +774,7 @@ {{"principals", bson.D{{"$exists", false}}}}, }, } - cleanupOp := newCleanupOp(cleanupDyingMachine, m.doc.Id, force) + cleanupOp := newCleanupOp(cleanupDyingMachine, m.doc.Id, force, maxWait) // multiple attempts: one with original data, one with refreshed data, and a final // one intended to determine the cause of failure of the preceding attempt. buildTxn := func(attempt int) ([]txn.Op, error) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/machine_test.go juju-core-2.6.5/src/github.com/juju/juju/state/machine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/machine_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/machine_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1732,14 +1732,23 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(machine.Addresses(), gc.HasLen, 0) - addresses := network.NewAddresses("127.0.0.1", "8.8.8.8") + addresses := []network.Address{ + network.NewAddress("127.0.0.1"), + { + Value: "8.8.8.8", + Type: network.IPv4Address, + Scope: network.ScopeCloudLocal, + SpaceName: "test-space", + SpaceProviderId: "1", + }, + } err = machine.SetProviderAddresses(addresses...) c.Assert(err, jc.ErrorIsNil) err = machine.Refresh() c.Assert(err, jc.ErrorIsNil) - expectedAddresses := network.NewAddresses("8.8.8.8", "127.0.0.1") - c.Assert(machine.Addresses(), jc.DeepEquals, expectedAddresses) + network.SortAddresses(addresses) + c.Assert(machine.Addresses(), jc.DeepEquals, addresses) } func (s *MachineSuite) TestSetProviderAddressesWithContainers(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/migration_export.go juju-core-2.6.5/src/github.com/juju/juju/state/migration_export.go --- juju-core-2.6.2/src/github.com/juju/juju/state/migration_export.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/migration_export.go 2019-06-28 17:10:43.000000000 +0000 @@ -16,6 +16,7 @@ "gopkg.in/juju/names.v2" "gopkg.in/mgo.v2/bson" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/feature" "github.com/juju/juju/payload" "github.com/juju/juju/resource" @@ -41,6 +42,7 @@ SkipMachineAgentBinaries bool SkipRelationData bool SkipInstanceData bool + SkipApplicationOffers bool } // ExportPartial the current model for the State optionally skipping @@ -608,6 +610,11 @@ return errors.Trace(err) } + appOfferMap, err := e.groupOffersByApplicationName() + if err != nil { + return errors.Trace(err) + } + for _, application := range applications { applicationUnits := e.units[application.Name()] leader := leaders[application.Name()] @@ -615,7 +622,7 @@ if err != nil { return errors.Trace(err) } - if err := e.addApplication(addApplicationContext{ + appCtx := addApplicationContext{ application: application, units: applicationUnits, meterStatus: meterStatus, @@ -626,9 +633,16 @@ payloads: payloads, resources: resources, endpoingBindings: bindings, - }); err != nil { + } + + if appOfferMap != nil { + appCtx.offers = appOfferMap[application.Name()] + } + + if err := e.addApplication(appCtx); err != nil { return errors.Trace(err) } + } return nil } @@ -689,6 +703,9 @@ podSpecs map[string]string cloudServices map[string]*cloudServiceDoc cloudContainers map[string]*cloudContainerDoc + + // Offers + offers []*crossmodel.ApplicationOffer } func (e *exporter) addApplication(ctx addApplicationContext) error { @@ -746,6 +763,34 @@ args.StorageConstraints = e.storageConstraints(constraints) } exApplication := e.model.AddApplication(args) + + // Populate offer list + for _, offer := range ctx.offers { + endpoints := make([]string, 0, len(offer.Endpoints)) + for _, ep := range offer.Endpoints { + endpoints = append(endpoints, ep.Name) + } + + userMap, err := e.st.GetOfferUsers(offer.OfferUUID) + if err != nil { + return errors.Annotatef(err, "ACL for offer %s", offer.OfferName) + } + + var acl map[string]string + if len(userMap) != 0 { + acl = make(map[string]string, len(userMap)) + for user, access := range userMap { + acl[user] = accessToString(access) + } + } + + _ = exApplication.AddOffer(description.ApplicationOfferArgs{ + OfferName: offer.OfferName, + Endpoints: endpoints, + ACL: acl, + }) + } + // Find the current application status. statusArgs, err := e.statusArgs(globalKey) if err != nil { @@ -2153,6 +2198,27 @@ return nil } +func (e *exporter) groupOffersByApplicationName() (map[string][]*crossmodel.ApplicationOffer, error) { + if e.cfg.SkipApplicationOffers { + return nil, nil + } + + offerList, err := NewApplicationOffers(e.st).AllApplicationOffers() + if err != nil { + return nil, errors.Annotate(err, "listing offers") + } + + if len(offerList) == 0 { + return nil, nil + } + + appMap := make(map[string][]*crossmodel.ApplicationOffer) + for _, offer := range offerList { + appMap[offer.ApplicationName] = append(appMap[offer.ApplicationName], offer) + } + return appMap, nil +} + type storagePoolSettingsManager struct { poolmanager.SettingsManager e *exporter diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/migration_export_test.go juju-core-2.6.5/src/github.com/juju/juju/state/migration_export_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/migration_export_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/migration_export_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -7,6 +7,7 @@ "bytes" "io/ioutil" "math/rand" + "sort" "time" "github.com/juju/description" @@ -23,6 +24,7 @@ apitesting "github.com/juju/juju/api/testing" "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/lease" "github.com/juju/juju/core/status" @@ -332,6 +334,9 @@ if cons.HasRootDiskSource() { c.Assert(constraints.RootDiskSource(), gc.Equals, *cons.RootDiskSource) } + if cons.HasRootDisk() { + c.Assert(constraints.RootDisk(), gc.Equals, *cons.RootDisk) + } tools, err := machine1.AgentTools() c.Assert(err, jc.ErrorIsNil) @@ -500,6 +505,9 @@ if cons.HasRootDiskSource() { c.Assert(constraints.RootDiskSource(), gc.Equals, *cons.RootDiskSource) } + if cons.HasRootDisk() { + c.Assert(constraints.RootDisk(), gc.Equals, *cons.RootDisk) + } history := exported.StatusHistory() c.Assert(history, gc.HasLen, expectedHistoryCount) @@ -540,6 +548,81 @@ c.Assert(applications, gc.HasLen, 3) } +func (s *MigrationExportSuite) TestApplicationExposingOffers(c *gc.C) { + _ = s.Factory.MakeUser(c, &factory.UserParams{Name: "admin"}) + fooUser := s.Factory.MakeUser(c, &factory.UserParams{Name: "foo"}) + _, err := s.State.AddSpace("server", "", nil, true) + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddSpace("server-admin", "", nil, true) + c.Assert(err, jc.ErrorIsNil) + + app := s.AddTestingApplicationWithBindings(c, "mysql", + s.AddTestingCharm(c, "mysql"), + map[string]string{ + "server": "server", + "server-admin": "server-admin", + }, + ) + + stOffers := state.NewApplicationOffers(s.State) + _, err = stOffers.AddOffer( + crossmodel.AddApplicationOfferArgs{ + OfferName: "my-offer", + Owner: "admin", + ApplicationName: app.Name(), + Endpoints: map[string]string{ + "server": "server", + "server-admin": "server-admin", + }, + }, + ) + c.Assert(err, jc.ErrorIsNil) + + // Allow "foo" to consume offer + err = s.State.CreateOfferAccess( + names.NewApplicationOfferTag("my-offer"), + fooUser.UserTag(), + permission.ConsumeAccess, + ) + c.Assert(err, jc.ErrorIsNil) + + // We only care for the offers + model, err := s.State.ExportPartial(state.ExportConfig{ + SkipActions: true, + SkipAnnotations: true, + SkipCloudImageMetadata: true, + SkipCredentials: true, + SkipIPAddresses: true, + SkipSettings: true, + SkipSSHHostKeys: true, + SkipStatusHistory: true, + SkipLinkLayerDevices: true, + SkipUnitAgentBinaries: true, + SkipMachineAgentBinaries: true, + SkipRelationData: true, + SkipInstanceData: true, + }) + c.Assert(err, jc.ErrorIsNil) + + applications := model.Applications() + c.Assert(applications, gc.HasLen, 1) + + appOffers := applications[0].Offers() + c.Assert(appOffers, gc.HasLen, 1) + c.Assert(appOffers[0].OfferName(), gc.Equals, "my-offer") + + // Endpoints are generated by iterating a map so we need to sort before comparing. + endpoints := appOffers[0].Endpoints() + sort.Strings(endpoints) + c.Assert(endpoints, gc.DeepEquals, []string{"server", "server-admin"}) + + appACL := appOffers[0].ACL() + c.Assert(appACL, gc.DeepEquals, map[string]string{ + "admin": "admin", + "foo": "consume", + }) +} + func (s *MigrationExportSuite) TestUnits(c *gc.C) { s.assertMigrateUnits(c, s.State) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/migration_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/migration_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/migration_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/migration_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -244,8 +244,11 @@ "Name", // Life will always be alive, or we won't be migrating. "Life", - // ControllerUUID is recreated when the new model - // is created in the new controller (yay name changes). + // ForceDestroyed is only relevant for models that are being + // removed. + "ForceDestroyed", + // ControllerUUID is recreated when the new model is created + // in the new controller (yay name changes). "ControllerUUID", "Type", diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelcredential.go juju-core-2.6.5/src/github.com/juju/juju/state/modelcredential.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelcredential.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelcredential.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "gopkg.in/mgo.v2/txn" "github.com/juju/juju/cloud" + "github.com/juju/juju/core/status" ) // InvalidateModelCredential invalidate cloud credential for the model @@ -27,19 +28,52 @@ return nil } - return errors.Trace(st.InvalidateCloudCredential(tag, reason)) + if err := st.InvalidateCloudCredential(tag, reason); err != nil { + return errors.Trace(err) + } + if err := st.suspendCredentialModels(tag); err != nil { + // These updates are optimistic. If they fail, it's unfortunate but we are not going to stop the call. + logger.Warningf("could not suspend models that use credential %v: %v", tag.Id(), err) + } + return nil +} + +func (st *State) suspendCredentialModels(tag names.CloudCredentialTag) error { + models, err := st.modelsWithCredential(tag) + if err != nil { + return errors.Annotatef(err, "could not determine what models use credential %v", tag.Id()) + } + doc := statusDoc{ + Status: status.Suspended, + StatusInfo: "suspended since cloud credential is not valid", + Updated: timeOrNow(nil, st.clock()).UnixNano(), + } + for _, m := range models { + one, closer, err := st.model(m.UUID) + if err != nil { + // Something has gone wrong with this model... keep going. + logger.Warningf("model %v error: %v", m.UUID, err) + continue + } + defer closer() + if _, err = probablyUpdateStatusHistory(one.st.db(), one.globalKey(), doc); err != nil { + // We do not want to stop processing the rest of the models. + logger.Warningf("%v", err) + } + } + return nil } // ValidateCloudCredential validates new cloud credential for this model. func (m *Model) ValidateCloudCredential(tag names.CloudCredentialTag, credential cloud.Credential) error { - cloud, err := m.st.Cloud(m.Cloud()) + aCloud, err := m.st.Cloud(m.Cloud()) if err != nil { return errors.Annotatef(err, "getting cloud %q", m.Cloud()) } - err = validateCredentialForCloud(cloud, tag, convertCloudCredentialToState(tag, credential)) + err = validateCredentialForCloud(aCloud, tag, convertCloudCredentialToState(tag, credential)) if err != nil { - return errors.Annotatef(err, "validating credential %q for cloud %q", tag.Id(), cloud.Name) + return errors.Annotatef(err, "validating credential %q for cloud %q", tag.Id(), aCloud.Name) } return nil } @@ -47,7 +81,14 @@ // SetCloudCredential sets new cloud credential for this model. // Returned bool indicates if model credential was set. func (m *Model) SetCloudCredential(tag names.CloudCredentialTag) (bool, error) { - cloud, err := m.st.Cloud(m.Cloud()) + // If model is suspended, after this call, it may be reverted since, + // if updated, model credential will be set to a valid credential. + modelStatus, err := m.Status() + if err != nil { + return false, errors.Annotatef(err, "getting model status %q", m.UUID()) + } + revert := modelStatus.Status == status.Suspended + aCloud, err := m.st.Cloud(m.Cloud()) if err != nil { return false, errors.Annotatef(err, "getting cloud %q", m.Cloud()) } @@ -70,7 +111,7 @@ if !credential.IsValid() { return nil, errors.NotValidf("credential %q", tag.Id()) } - if err := validateCredentialForCloud(cloud, tag, credential); err != nil { + if err := validateCredentialForCloud(aCloud, tag, credential); err != nil { return nil, errors.Trace(err) } return []txn.Op{{ @@ -83,6 +124,11 @@ if err := m.st.db().Run(buildTxn); err != nil { return false, errors.Trace(err) } + if updating && revert { + if err := m.maybeRevertModelStatus(); err != nil { + logger.Warningf("could not revert status for model %v: %v", m.UUID(), err) + } + } return updating, m.Refresh() } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelcredential_test.go juju-core-2.6.5/src/github.com/juju/juju/state/modelcredential_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelcredential_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelcredential_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,10 +12,12 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/cloud" + "github.com/juju/juju/core/status" "github.com/juju/juju/state" statetesting "github.com/juju/juju/state/testing" "github.com/juju/juju/storage" "github.com/juju/juju/testing" + "github.com/juju/juju/testing/factory" ) type ModelCredentialSuite struct { @@ -246,3 +248,109 @@ c.Assert(err, jc.ErrorIsNil) return st } + +func (s *ModelCredentialSuite) TestInvalidateModelCredentialTouchesAllCredentialModels(c *gc.C) { + // This test checks that all models are affected when one of them invalidates a credential they all use... + + // 1. create a credential + cloudName, credentialOwner, credentialTag := assertCredentialCreated(c, s.ConnSuite) + + // 2. create some models to use it + modelUUIDs := make([]string, 5) + for i := 0; i < 5; i++ { + modelUUIDs[i] = assertModelCreated(c, s.ConnSuite, cloudName, credentialTag, credentialOwner.Tag(), fmt.Sprintf("model-for-cloud%v", i)) + } + + // 3. invalidate credential + oneModelState, helper, err := s.StatePool.GetModel(modelUUIDs[0]) + c.Assert(err, jc.ErrorIsNil) + defer helper.Release() + c.Assert(oneModelState.State().InvalidateModelCredential("testing invalidate for all credential models"), jc.ErrorIsNil) + + // 4. check all models are suspended + for _, uuid := range modelUUIDs { + assertModelStatus(c, s.StatePool, uuid, status.Suspended) + assertModelHistories(c, s.StatePool, uuid, status.Suspended, status.Available) + } +} + +func (s *ModelCredentialSuite) TestSetCredentialRevertsModelStatus(c *gc.C) { + // 1. create a credential + cloudName, credentialOwner, credentialTag := assertCredentialCreated(c, s.ConnSuite) + + // 2. create some models to use it + validModelStatuses := []status.Status{ + status.Available, + status.Busy, + status.Destroying, + status.Error, + } + desiredNumber := len(validModelStatuses) + + modelUUIDs := make([]string, desiredNumber) + for i := 0; i < desiredNumber; i++ { + modelUUIDs[i] = assertModelCreated(c, s.ConnSuite, cloudName, credentialTag, credentialOwner.Tag(), fmt.Sprintf("model-for-cloud%v", i)) + oneModelState, helper, err := s.StatePool.GetModel(modelUUIDs[i]) + c.Assert(err, jc.ErrorIsNil) + defer helper.Release() + if validModelStatuses[i] != status.Available { + // any model would be in 'available' status on setup. + err = oneModelState.SetStatus(status.StatusInfo{Status: validModelStatuses[i]}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(oneModelState.Refresh(), jc.ErrorIsNil) + } + if i == desiredNumber-1 { + // 3. invalidate credential on last model + c.Assert(oneModelState.State().InvalidateModelCredential("testing"), jc.ErrorIsNil) + } + } + + // 4. check model is suspended + for i := 0; i < desiredNumber; i++ { + assertModelStatus(c, s.StatePool, modelUUIDs[i], status.Suspended) + if validModelStatuses[i] == status.Available { + assertModelHistories(c, s.StatePool, modelUUIDs[i], status.Suspended, status.Available) + } else { + assertModelHistories(c, s.StatePool, modelUUIDs[i], status.Suspended, validModelStatuses[i], status.Available) + } + } + + // 5. create another credential on the same cloud + owner := s.Factory.MakeUser(c, &factory.UserParams{ + Password: "secret", + Name: "uncle", + }) + anotherCredentialTag := createCredential(c, s.ConnSuite, cloudName, owner.Name(), "barfoo") + + for i := 0; i < desiredNumber; i++ { + oneModelState, helper, err := s.StatePool.GetModel(modelUUIDs[i]) + c.Assert(err, jc.ErrorIsNil) + defer helper.Release() + + isSet, err := oneModelState.SetCloudCredential(anotherCredentialTag) + c.Assert(err, jc.ErrorIsNil) + c.Assert(isSet, jc.IsTrue) + + // 5. Check model status is reverted + if validModelStatuses[i] == status.Available { + assertModelStatus(c, s.StatePool, modelUUIDs[i], status.Available) + assertModelHistories(c, s.StatePool, modelUUIDs[i], status.Available, status.Suspended, status.Available) + } else { + assertModelStatus(c, s.StatePool, modelUUIDs[i], validModelStatuses[i]) + assertModelHistories(c, s.StatePool, modelUUIDs[i], validModelStatuses[i], status.Suspended, validModelStatuses[i], status.Available) + } + } +} + +func assertModelHistories(c *gc.C, pool *state.StatePool, testModelUUID string, expected ...status.Status) []status.StatusInfo { + aModel, helper, err := pool.GetModel(testModelUUID) + c.Assert(err, jc.ErrorIsNil) + defer helper.Release() + statusHistories, err := aModel.StatusHistory(status.StatusHistoryFilter{Size: 100}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(statusHistories, gc.HasLen, len(expected)) + for i, one := range expected { + c.Assert(statusHistories[i].Status, gc.Equals, one) + } + return statusHistories +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelgeneration.go juju-core-2.6.5/src/github.com/juju/juju/state/modelgeneration.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelgeneration.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelgeneration.go 2019-06-28 17:10:43.000000000 +0000 @@ -364,25 +364,25 @@ return nil, errors.Trace(err) } } + if g.IsCompleted() { if g.GenerationId() == 0 { return nil, errors.New("branch was already aborted") } return nil, jujutxn.ErrNoOperations } + now, err := g.st.ControllerTimestamp() if err != nil { return nil, errors.Trace(err) } - - // Add all units who's applications have changed. - assigned := g.AssignedUnits() - for app := range assigned { - units, err := appUnitNames(g.st, app) - if err != nil { - return nil, errors.Trace(err) - } - assigned[app] = units + assigned, err := g.assignedWithAllUnits() + if err != nil { + return nil, errors.Trace(err) + } + ops, err := g.commitConfigTxnOps() + if err != nil { + return nil, errors.Trace(err) } // Get the new sequence as late as we can. @@ -400,21 +400,19 @@ // As a proxy for checking that the generation has not changed, // Assert that the txn rev-no has not changed since we materialised // this generation object. - ops := []txn.Op{ - { - C: generationsC, - Id: g.doc.DocId, - Assert: bson.D{{"txn-revno", g.doc.TxnRevno}}, - Update: bson.D{ - {"$set", bson.D{ - {"assigned-units", assigned}, - {"completed", now.Unix()}, - {"completed-by", userName}, - {"generation-id", newGenId}, - }}, - }, + ops = append(ops, txn.Op{ + C: generationsC, + Id: g.doc.DocId, + Assert: bson.D{{"txn-revno", g.doc.TxnRevno}}, + Update: bson.D{ + {"$set", bson.D{ + {"assigned-units", assigned}, + {"completed", now.Unix()}, + {"completed-by", userName}, + {"generation-id", newGenId}, + }}, }, - } + }) return ops, nil } @@ -424,7 +422,107 @@ return newGenId, nil } -// TODO (manadart 2019-03-19): Implement Abort(). +// assignedWithAllUnits generates a new value for the branch's +// AssignedUnits field, to indicate that all units of changed applications +// are tracking the branch. +func (g *Generation) assignedWithAllUnits() (map[string][]string, error) { + assigned := g.AssignedUnits() + for app := range assigned { + units, err := appUnitNames(g.st, app) + if err != nil { + return nil, errors.Trace(err) + } + assigned[app] = units + } + return assigned, nil +} + +// commitConfigTxnOps iterates over all the applications with configuration +// deltas, determines their effective new settings, then gathers the +// operations representing the changes so that they can all be applied in a +// single transaction. +func (g *Generation) commitConfigTxnOps() ([]txn.Op, error) { + var ops []txn.Op + for appName, delta := range g.Config() { + if len(delta) == 0 { + continue + } + app, err := g.st.Application(appName) + if err != nil { + return nil, errors.Trace(err) + } + + // Apply the branch delta to the application's charm config settings. + cfg, err := readSettings(g.st.db(), settingsC, app.charmConfigKey()) + if err != nil { + return nil, errors.Trace(err) + } + cfg.applyChanges(delta) + + _, updates := cfg.settingsUpdateOps() + // Assert that the settings document has not changed underneath us + // in addition to appending the field changes. + if len(updates) > 0 { + ops = append(ops, cfg.assertUnchangedOp()) + ops = append(ops, updates...) + } + } + return ops, nil +} + +// Abort marks the generation as completed however no value is assigned from +// the generation sequence. +func (g *Generation) Abort(userName string) error { + buildTxn := func(attempt int) ([]txn.Op, error) { + if attempt > 0 { + if err := g.Refresh(); err != nil { + return nil, errors.Trace(err) + } + } + + if g.IsCompleted() { + if g.GenerationId() > 0 { + return nil, errors.New("branch was already committed") + } + return nil, jujutxn.ErrNoOperations + } + + // Must have no assigned units. + assigned := g.AssignedUnits() + for _, units := range assigned { + if len(units) > 0 { + return nil, errors.New("branch has assigned units") + } + } + + // Must not have upgraded charm of tracked application. + // TODO (hml) 2019-06-26 + // Implement cannot abort branch where tracked application has + // been upgraded. + + now, err := g.st.ControllerTimestamp() + if err != nil { + return nil, errors.Trace(err) + } + // As a proxy for checking that the generation has not changed, + // Assert that the txn rev-no has not changed since we materialised + // this generation object. + ops := []txn.Op{{ + C: generationsC, + Id: g.doc.DocId, + Assert: bson.D{{"txn-revno", g.doc.TxnRevno}}, + Update: bson.D{ + {"$set", bson.D{ + {"completed", now.Unix()}, + {"completed-by", userName}, + }}, + }, + }} + return ops, nil + } + + return errors.Trace(g.st.db().Run(buildTxn)) +} // CheckNotComplete returns an error if this // generation was committed or aborted. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelgeneration_test.go juju-core-2.6.5/src/github.com/juju/juju/state/modelgeneration_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelgeneration_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelgeneration_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,6 +12,7 @@ gc "gopkg.in/check.v1" "gopkg.in/juju/charm.v6" + "github.com/juju/juju/core/model" "github.com/juju/juju/core/settings" "github.com/juju/juju/state" "github.com/juju/juju/testing" @@ -25,16 +26,18 @@ type generationSuite struct { ConnSuite + + ch *state.Charm } var _ = gc.Suite(&generationSuite{}) -func (s *generationSuite) TestNextGenerationNotFound(c *gc.C) { +func (s *generationSuite) TestBranchNameNotFound(c *gc.C) { _, err := s.Model.Branch("non-extant-branch") c.Assert(errors.IsNotFound(err), jc.IsTrue) } -func (s *generationSuite) TestNewGenerationSuccess(c *gc.C) { +func (s *generationSuite) TestAddBranchSuccess(c *gc.C) { s.setupTestingClock(c) gen := s.addBranch(c) @@ -73,7 +76,7 @@ c.Check(gen.AssignedUnits(), gc.DeepEquals, map[string][]string{"redis": {}}) } -func (s *generationSuite) TestAssignUnitGenAbortedError(c *gc.C) { +func (s *generationSuite) TestAssignUnitBranchAbortedError(c *gc.C) { s.setupTestingClock(c) gen := s.addBranch(c) @@ -92,7 +95,7 @@ c.Assert(gen.AssignUnit("redis/0"), gc.ErrorMatches, `unit "redis/0" not found`) } -func (s *generationSuite) TestAssignUnitGenCommittedError(c *gc.C) { +func (s *generationSuite) TestAssignUnitBranchCommittedError(c *gc.C) { s.setupTestingClock(c) gen := s.setupAssignAllUnits(c) @@ -208,7 +211,84 @@ c.Check(gen.CompletedBy(), gc.Equals, branchCommitter) } -// TODO (manadart 2019-03-21): Tests for abort. +func (s *generationSuite) TestCommitAppliesConfigDeltas(c *gc.C) { + s.setupTestingClock(c) + gen := s.setupAssignAllUnits(c) + + app, err := s.State.Application("riak") + c.Assert(err, jc.ErrorIsNil) + + newCfg := map[string]interface{}{"http_port": int64(9999)} + c.Assert(app.UpdateCharmConfig(newBranchName, newCfg), jc.ErrorIsNil) + c.Assert(gen.Refresh(), jc.ErrorIsNil) + + _, err = gen.Commit(branchCommitter) + c.Assert(gen.Refresh(), jc.ErrorIsNil) + + cfg, err := app.CharmConfig(model.GenerationMaster) + c.Assert(err, jc.ErrorIsNil) + + c.Check(cfg, gc.DeepEquals, charm.Settings(newCfg)) +} + +func (s *generationSuite) TestAbortSuccess(c *gc.C) { + s.setupTestingClock(c) + + gen := s.addBranch(c) + + err := gen.Abort(branchCommitter) + c.Assert(err, jc.ErrorIsNil) + + // Idempotent. + err = gen.Refresh() + c.Assert(err, jc.ErrorIsNil) + err = gen.Abort(branchCommitter) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *generationSuite) TestAbortSuccessApplicationNoAssignedUnits(c *gc.C) { + s.setupTestingClock(c) + + gen := s.addBranch(c) + err := gen.AssignApplication("riak") + c.Assert(err, jc.ErrorIsNil) + err = gen.Refresh() + c.Assert(err, jc.ErrorIsNil) + + err = gen.Abort(branchCommitter) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *generationSuite) TestAbortFailsAssignedUnits(c *gc.C) { + s.setupTestingClock(c) + + gen := s.setupAssignAllUnits(c) + err := gen.AssignUnit("riak/0") + c.Assert(err, jc.ErrorIsNil) + err = gen.Refresh() + c.Assert(err, jc.ErrorIsNil) + + err = gen.Abort(branchCommitter) + c.Assert(err, gc.ErrorMatches, "branch has assigned units") +} + +func (s *generationSuite) TestAbortCommittedBranch(c *gc.C) { + s.setupTestingClock(c) + + gen := s.setupAssignAllUnits(c) + err := gen.AssignUnit("riak/0") + c.Assert(err, jc.ErrorIsNil) + err = gen.Refresh() + c.Assert(err, jc.ErrorIsNil) + + _, err = gen.Commit(branchCommitter) + c.Assert(err, jc.ErrorIsNil) + err = gen.Refresh() + c.Assert(err, jc.ErrorIsNil) + + err = gen.Abort(branchCommitter) + c.Assert(err, gc.ErrorMatches, "branch was already committed") +} func (s *generationSuite) TestBranchCharmConfigDeltas(c *gc.C) { gen := s.setupAssignAllUnits(c) @@ -293,8 +373,13 @@ } func (s *generationSuite) setupAssignAllUnits(c *gc.C) *state.Generation { - ch := s.AddTestingCharm(c, "riak") - riak := s.AddTestingApplication(c, "riak", ch) + var cfgYAML = ` +options: + http_port: {default: 8089, description: HTTP Port, type: int} +` + s.ch = s.AddConfigCharm(c, "riak", cfgYAML, 666) + + riak := s.AddTestingApplication(c, "riak", s.ch) for i := 0; i < 4; i++ { _, err := riak.AddUnit(state.AddUnitParams{}) c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/model.go juju-core-2.6.5/src/github.com/juju/juju/state/model.go --- juju-core-2.6.2/src/github.com/juju/juju/state/model.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/model.go 2019-06-28 17:10:43.000000000 +0000 @@ -113,6 +113,11 @@ // MeterStatus is the current meter status of the model. MeterStatus modelMeterStatusdoc `bson:"meter-status"` + + // ForceDestroyed is whether --force was specified when destroying + // this model. It only has any meaning when the model is dying or + // dead. + ForceDestroyed bool `bson:"force-destroyed,omitempty"` } // slaLevel enumerates the support levels available to a model. @@ -330,17 +335,15 @@ var prereqOps []txn.Op - if args.Type == ModelTypeIAAS { - // If no region specified and the cloud only has one, default to that. - if args.CloudRegion == "" && len(modelCloud.Regions) == 1 { - args.CloudRegion = modelCloud.Regions[0].Name - } - assertCloudRegionOp, err := validateCloudRegion(modelCloud, args.CloudRegion) - if err != nil { - return nil, nil, errors.Trace(err) - } - prereqOps = append(prereqOps, assertCloudRegionOp) + // If no region specified and the cloud only has one, default to that. + if args.CloudRegion == "" && len(modelCloud.Regions) == 1 { + args.CloudRegion = modelCloud.Regions[0].Name + } + assertCloudRegionOp, err := validateCloudRegion(modelCloud, args.CloudRegion) + if err != nil { + return nil, nil, errors.Trace(err) } + prereqOps = append(prereqOps, assertCloudRegionOp) // Ensure that the cloud credential is valid, or if one is not // specified, that the cloud supports the "empty" authentication @@ -414,24 +417,16 @@ // the same "owner" and "name" in the collection. If the txn is // aborted, check if it is due to the unique key restriction. name := args.Config.Name() - qualifierTerm := bson.DocElem{"owner", owner.Id()} - if args.Type == ModelTypeCAAS { - qualifierTerm = bson.DocElem{"cloud", args.CloudName} - } models, closer := st.db().GetCollection(modelsC) defer closer() modelCount, countErr := models.Find(bson.D{ - qualifierTerm, + {"owner", owner.Id()}, {"name", name}}, ).Count() if countErr != nil { err = errors.Trace(countErr) } else if modelCount > 0 { - qualifierMessage := qualifierTerm.Value - if args.Type == ModelTypeCAAS { - qualifierMessage = fmt.Sprintf("cloud %v", qualifierMessage) - } - err = errors.AlreadyExistsf("model %q for %s", name, qualifierMessage) + err = errors.AlreadyExistsf("model %q for %s", name, owner.Id()) } else { err = errors.Annotate(err, "failed to create new model") } @@ -458,7 +453,12 @@ return nil, nil, errors.Annotate(err, "granting admin permission to the owner") } - if err := InitDbLogs(session, uuid); err != nil { + config, err := st.ControllerConfig() + if err != nil { + return nil, nil, errors.Annotate(err, "unable to get controller config") + } + + if err := InitDbLogsForModel(session, uuid, config.ModelLogsSizeMB()); err != nil { return nil, nil, errors.Annotate(err, "initialising model logs collection") } return newModel, newSt, nil @@ -627,14 +627,35 @@ return m.doc.Life } +// ForceDestroyed returns whether the destruction of a dying/dead +// model was forced. It's always false for a model that's alive. +func (m *Model) ForceDestroyed() bool { + return m.doc.ForceDestroyed +} + // Owner returns tag representing the owner of the model. // The owner is the user that created the model. func (m *Model) Owner() names.UserTag { return names.NewUserTag(m.doc.Owner) } +func modelStatusInvalidCredential() status.StatusInfo { + return status.StatusInfo{Status: status.Suspended, Message: "suspended since cloud credential is not valid"} +} + // Status returns the status of the model. func (m *Model) Status() (status.StatusInfo, error) { + // If model credential is invalid, model is suspended. + if credentialTag, hasCredential := m.CloudCredential(); hasCredential { + credential, err := m.st.CloudCredential(credentialTag) + if err != nil { + return status.StatusInfo{}, errors.Annotatef(err, "could not get model credential %v", credentialTag.Id()) + } + if !credential.IsValid() { + return modelStatusInvalidCredential(), nil + } + } + modelStatus, err := getStatus(m.st.db(), m.globalKey(), "model") if err != nil { return modelStatus, err @@ -982,11 +1003,7 @@ } func (m *Model) uniqueIndexID() string { - qualifier := m.doc.Owner - if m.Type() == ModelTypeCAAS { - qualifier = m.Cloud() - } - return userModelNameIndex(qualifier, m.doc.Name) + return userModelNameIndex(m.doc.Owner, m.doc.Name) } // Destroy sets the models's lifecycle to Dying, preventing @@ -1279,6 +1296,7 @@ bson.D{ {"life", nextLife}, {"time-of-dying", m.st.nowToTheSecond()}, + {"force-destroyed", force}, }, }, } @@ -1626,11 +1644,11 @@ } // createUniqueOwnerModelNameOp returns the operation needed to create -// an usermodelnameC document with the given qualifier and model name. -func createUniqueOwnerModelNameOp(qualifier string, modelName string) txn.Op { +// an usermodelnameC document with the given owner and model name. +func createUniqueOwnerModelNameOp(owner names.UserTag, modelName string) txn.Op { return txn.Op{ C: usermodelnameC, - Id: userModelNameIndex(qualifier, modelName), + Id: userModelNameIndex(owner.Id(), modelName), Assert: txn.DocMissing, Insert: bson.M{}, } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelsummaries.go juju-core-2.6.5/src/github.com/juju/juju/state/modelsummaries.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelsummaries.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelsummaries.go 2019-06-28 17:10:43.000000000 +0000 @@ -450,3 +450,67 @@ // actually connected to a model they were given access to. return nil } + +// fillInStatusBasedOnCloudCredentialValidity fills in the Status on every model (if credential is invalid). +func (p *modelSummaryProcessor) fillInStatusBasedOnCloudCredentialValidity() error { + credentialModels := map[names.CloudCredentialTag][]string{} + for _, model := range p.summaries { + if model.CloudCredentialTag == "" { + continue + } + tag, err := names.ParseCloudCredentialTag(model.CloudCredentialTag) + if err != nil { + logger.Warningf("could not parse cloud credential tag %v for model%v: %v", model.CloudCredentialTag, model.UUID, err) + // Don't stop the rest of the models + continue + } + summaries, ok := credentialModels[tag] + if !ok { + summaries = []string{} + } + credentialModels[tag] = append(summaries, model.UUID) + } + if len(credentialModels) != 0 { + if err := p.substituteModelStatusForInvalidCredentials(credentialModels); err != nil { + return errors.Trace(err) + } + } + return nil +} + +func (p *modelSummaryProcessor) substituteModelStatusForInvalidCredentials(credentials map[names.CloudCredentialTag][]string) error { + var ids []string + for tag := range credentials { + ids = append(ids, cloudCredentialDocID(tag)) + } + // cloudCredentialsC is a global collection, so can be accessed from any state + perms, closer := p.st.db().GetCollection(cloudCredentialsC) + defer closer() + query := perms.Find(bson.M{"_id": bson.M{"$in": ids}}) + iter := query.Iter() + defer iter.Close() + + var doc cloudCredentialDoc + for iter.Next(&doc) { + if doc.Invalid { + tag, err := doc.cloudCredentialTag() + if err != nil { + logger.Warningf("could not get cloud credential tag %v: %v", doc.DocID, err) + // Don't stop the rest of the models + continue + } + for _, uuid := range credentials[tag] { + idx, ok := p.indexByUUID[uuid] + if !ok { + continue + } + details := &p.summaries[idx] + details.Status = modelStatusInvalidCredential() + } + } + } + if err := iter.Close(); err != nil { + return errors.Trace(err) + } + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modelsummaries_test.go juju-core-2.6.5/src/github.com/juju/juju/state/modelsummaries_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modelsummaries_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modelsummaries_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,7 @@ package state_test import ( + "fmt" "sort" "time" @@ -13,6 +14,7 @@ "gopkg.in/juju/names.v2" "gopkg.in/mgo.v2/bson" + "github.com/juju/juju/cloud" "github.com/juju/juju/core/instance" "github.com/juju/juju/core/status" "github.com/juju/juju/permission" @@ -64,10 +66,27 @@ modelUUIDs["user3model"] = st3.ModelUUID() st3.Close() owner := s.Model.Owner() + err := s.State.AddCloud(cloud.Cloud{ + Name: "stratus", + Type: "low", + AuthTypes: cloud.AuthTypes{cloud.AccessKeyAuthType, cloud.UserPassAuthType}, + }, s.Owner.Name()) + c.Assert(err, jc.ErrorIsNil) + + cred := cloud.NewCredential(cloud.AccessKeyAuthType, map[string]string{ + "foo": "foo val", + "bar": "bar val", + }) + tag := names.NewCloudCredentialTag(fmt.Sprintf("stratus/%v/foobar", owner.Name())) + err = s.State.UpdateCloudCredential(tag, cred) + c.Assert(err, jc.ErrorIsNil) + sharedSt := s.Factory.MakeModel(c, &factory.ModelParams{ Name: "shared", // Owned by test-admin - Owner: owner, + Owner: owner, + CloudName: "stratus", + CloudCredential: tag, }) modelUUIDs["shared"] = sharedSt.ModelUUID() defer sharedSt.Close() @@ -273,6 +292,44 @@ user1, ph, err := s.StatePool.GetModel(modelNameToUUID["user1model"]) defer ph.Release() c.Assert(err, jc.ErrorIsNil) + err = user1.SetStatus(expectedStatus["user1model"]) + c.Assert(err, jc.ErrorIsNil) + summaries, err := s.State.ModelSummariesForUser(names.NewUserTag("user1write"), false) + c.Assert(err, jc.ErrorIsNil) + c.Check(summaries, gc.HasLen, 2) + statuses := make(map[string]status.StatusInfo) + for _, summary := range summaries { + // We nil the time, because we don't want to compare it, we nil the Data map to avoid comparing an + // empty map to a nil map + st := summary.Status + st.Since = nil + st.Data = nil + statuses[summary.Name] = st + } + c.Check(statuses, jc.DeepEquals, expectedStatus) +} + +func (s *ModelSummariesSuite) TestContainsModelStatusSuspended(c *gc.C) { + modelNameToUUID := s.Setup4Models(c) + expectedStatus := map[string]status.StatusInfo{ + "shared": { + Status: status.Suspended, + Message: "suspended since cloud credential is not valid", + }, + "user1model": { + Status: status.Busy, + Message: "human message", + }, + } + shared, err := s.StatePool.Get(modelNameToUUID["shared"]) + defer shared.Release() + c.Assert(err, jc.ErrorIsNil) + c.Assert(shared.InvalidateModelCredential("test"), jc.ErrorIsNil) + + s.State.StartSync() + user1, ph, err := s.StatePool.GetModel(modelNameToUUID["user1model"]) + defer ph.Release() + c.Assert(err, jc.ErrorIsNil) err = user1.SetStatus(expectedStatus["user1model"]) c.Assert(err, jc.ErrorIsNil) summaries, err := s.State.ModelSummariesForUser(names.NewUserTag("user1write"), false) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/model_test.go juju-core-2.6.5/src/github.com/juju/juju/state/model_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/model_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/model_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -154,7 +154,7 @@ c.Assert(st2, gc.NotNil) } -func (s *ModelSuite) TestNewCAASModelSameUserFails(c *gc.C) { +func (s *ModelSuite) TestNewCAASModelDifferentUser(c *gc.C) { cfg, _ := s.createTestModelConfig(c) owner := s.Factory.MakeUser(c, nil).UserTag() owner2 := s.Factory.MakeUser(c, nil).UserTag() @@ -163,6 +163,47 @@ model, st1, err := s.Controller.NewModel(state.ModelArgs{ Type: state.ModelTypeCAAS, CloudName: "dummy", + CloudRegion: "dummy-region", + Config: cfg, + Owner: owner, + StorageProviderRegistry: storage.StaticProviderRegistry{}, + }) + c.Assert(err, jc.ErrorIsNil) + defer st1.Close() + c.Assert(model.UniqueIndexExists(), jc.IsTrue) + + // Attempt to create another model with a different UUID and owner + // but the name as the first. + newUUID, err := utils.NewUUID() + c.Assert(err, jc.ErrorIsNil) + cfg2 := testing.CustomModelConfig(c, testing.Attrs{ + "name": cfg.Name(), + "uuid": newUUID.String(), + }) + + // We should now be able to create the other model. + model2, st2, err := s.Controller.NewModel(state.ModelArgs{ + Type: state.ModelTypeCAAS, + CloudName: "dummy", + CloudRegion: "dummy-region", + Config: cfg2, + Owner: owner2, + StorageProviderRegistry: storage.StaticProviderRegistry{}, + }) + c.Assert(err, jc.ErrorIsNil) + defer st2.Close() + c.Assert(model2.UniqueIndexExists(), jc.IsTrue) +} + +func (s *ModelSuite) TestNewCAASModelSameUserFails(c *gc.C) { + cfg, _ := s.createTestModelConfig(c) + owner := s.Factory.MakeUser(c, nil).UserTag() + + // Create the first model. + model, st1, err := s.Controller.NewModel(state.ModelArgs{ + Type: state.ModelTypeCAAS, + CloudName: "dummy", + CloudRegion: "dummy-region", Config: cfg, Owner: owner, StorageProviderRegistry: storage.StaticProviderRegistry{}, @@ -182,11 +223,12 @@ _, _, err = s.Controller.NewModel(state.ModelArgs{ Type: state.ModelTypeCAAS, CloudName: "dummy", + CloudRegion: "dummy-region", Config: cfg2, - Owner: owner2, + Owner: owner, StorageProviderRegistry: storage.StaticProviderRegistry{}, }) - errMsg := fmt.Sprintf("model %q for cloud dummy already exists", cfg2.Name()) + errMsg := fmt.Sprintf("model %q for %s already exists", cfg2.Name(), owner.Name()) c.Assert(err, gc.ErrorMatches, errMsg) c.Assert(errors.IsAlreadyExists(err), jc.IsTrue) @@ -207,6 +249,7 @@ model2, st2, err := s.Controller.NewModel(state.ModelArgs{ Type: state.ModelTypeCAAS, CloudName: "dummy", + CloudRegion: "dummy-region", Config: cfg2, Owner: owner, StorageProviderRegistry: storage.StaticProviderRegistry{}, @@ -724,7 +767,7 @@ c.Assert(err, jc.Satisfies, state.IsHasHostedModelsError) c.Assert(err, gc.ErrorMatches, `hosting 1 other model`) - assertCleanupCount(c, otherSt, 3) + assertCleanupCount(c, otherSt, 4) assertAllMachinesDeadAndRemove(c, otherSt) assertModel(otherModel, otherSt, state.Dying, 0, 0) c.Assert(otherSt.ProcessDyingModel(), jc.ErrorIsNil) @@ -1054,6 +1097,47 @@ c.Assert(err, jc.Satisfies, errors.IsNotFound) } +func (s *ModelSuite) TestForceDestroySetsForceDestroyed(c *gc.C) { + st := s.Factory.MakeModel(c, nil) + defer st.Close() + + model, err := st.Model() + c.Assert(err, jc.ErrorIsNil) + + c.Assert(model.ForceDestroyed(), gc.Equals, false) + + force := true + err = model.Destroy(state.DestroyModelParams{ + Force: &force, + }) + c.Assert(err, jc.ErrorIsNil) + + err = model.Refresh() + c.Assert(err, jc.ErrorIsNil) + + c.Assert(model.Life(), gc.Equals, state.Dying) + c.Assert(model.ForceDestroyed(), gc.Equals, true) +} + +func (s *ModelSuite) TestNonForceDestroy(c *gc.C) { + st := s.Factory.MakeModel(c, nil) + defer st.Close() + model, err := st.Model() + c.Assert(err, jc.ErrorIsNil) + + noForce := false + err = model.Destroy(state.DestroyModelParams{ + Force: &noForce, + }) + c.Assert(err, jc.ErrorIsNil) + + err = model.Refresh() + c.Assert(err, jc.ErrorIsNil) + + c.Assert(model.Life(), gc.Equals, state.Dying) + c.Assert(model.ForceDestroyed(), gc.Equals, false) +} + func (s *ModelSuite) TestProcessDyingServerModelTransitionDyingToDead(c *gc.C) { s.assertDyingModelTransitionDyingToDead(c, s.State) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modeluser.go juju-core-2.6.5/src/github.com/juju/juju/state/modeluser.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modeluser.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modeluser.go 2019-06-28 17:10:43.000000000 +0000 @@ -211,6 +211,9 @@ if err := p.fillInFromStatus(); err != nil { return nil, errors.Trace(err) } + if err := p.fillInStatusBasedOnCloudCredentialValidity(); err != nil { + return nil, errors.Trace(err) + } if err := p.fillInJustUser(); err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/modeluser_test.go juju-core-2.6.5/src/github.com/juju/juju/state/modeluser_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/modeluser_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/modeluser_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -524,9 +524,6 @@ func (s *ModelUserSuite) newModelWithUser(c *gc.C, user names.UserTag, modelType state.ModelType) *state.Model { params := &factory.ModelParams{Type: modelType} - if modelType == state.ModelTypeCAAS { - params.CloudRegion = "" - } st := s.Factory.MakeModel(c, params) defer st.Close() newModel, err := st.Model() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go --- juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -112,6 +112,8 @@ d.Entity = new(ActionInfo) case "charm": d.Entity = new(CharmInfo) + case "generation": + d.Entity = new(GenerationInfo) default: return errors.Errorf("Unexpected entity name %q", entityKind) } @@ -138,6 +140,7 @@ Life Life `json:"life"` Config map[string]interface{} `json:"config,omitempty"` Series string `json:"series"` + ContainerType string `json:"container-type"` SupportedContainers []instance.ContainerType `json:"supported-containers"` SupportedContainersKnown bool `json:"supported-containers-known"` HardwareCharacteristics *instance.HardwareCharacteristics `json:"hardware-characteristics,omitempty"` @@ -223,6 +226,8 @@ CharmVersion string `json:"charm-version"` Life Life `json:"life"` LXDProfile *Profile `json:"profile"` + // DefaultConfig is derived from state-stored *charm.Config. + DefaultConfig map[string]interface{} `json:"config,omitempty"` } // EntityId returns a unique identifier for an charm across @@ -480,7 +485,7 @@ Owner string `json:"owner"` } -// ModelInfo holds the information about an model that is +// ModelInfo holds the information about a model that is // tracked by multiwatcherStore. type ModelInfo struct { ModelUUID string `json:"model-uuid"` @@ -495,7 +500,7 @@ SLA ModelSLAInfo `json:"sla"` } -// EntityId returns a unique identifier for an model. +// EntityId returns a unique identifier for a model. func (i *ModelInfo) EntityId() EntityId { return EntityId{ Kind: "model", @@ -503,3 +508,35 @@ Id: i.ModelUUID, } } + +// ItemChange is the multiwatcher representation of a core settings ItemChange. +type ItemChange struct { + Type int `json:"type"` + Key string `json:"key"` + OldValue interface{} `json:"old,omitempty"` + NewValue interface{} `json:"new,omitempty"` +} + +// GenerationInfo holds data about a model generation (branch) +// that is tracked by multiwatcherStore. +type GenerationInfo struct { + ModelUUID string `json:"model-uuid"` + Id string `json:"id"` + Name string `json:"name"` + AssignedUnits map[string][]string `json:"assigned-units"` + Config map[string][]ItemChange `json:"charm-config"` + Created int64 `json:"created"` + CreatedBy string `json:"created-by"` + Completed int64 `json:"completed"` + CompletedBy string `json:"completed-by"` + GenerationId int `json:"generation-id"` +} + +// EntityId returns a unique identifier for a generation. +func (i *GenerationInfo) EntityId() EntityId { + return EntityId{ + Kind: "generation", + ModelUUID: i.ModelUUID, + Id: i.Id, + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher/multiwatcher_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher/multiwatcher_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -22,6 +22,7 @@ _ EntityInfo = (*BlockInfo)(nil) _ EntityInfo = (*ActionInfo)(nil) _ EntityInfo = (*ModelInfo)(nil) + _ EntityInfo = (*GenerationInfo)(nil) ) type ConstantsSuite struct{} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher.go juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher.go --- juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,7 +5,6 @@ import ( "container/list" - stderrors "errors" "reflect" "github.com/juju/errors" @@ -57,7 +56,31 @@ return errors.Trace(w.all.tomb.Err()) } -var ErrStopped = stderrors.New("watcher was stopped") +// stopped represents an error when state is supported. +type stopped struct { + errors.Err +} + +// ErrStoppedf returns an error which satisfies IsErrStopped(). +func ErrStoppedf(format string, args ...interface{}) error { + newErr := errors.NewErr(format+" was stopped", args...) + newErr.SetLocation(2) + return &stopped{newErr} +} + +// NewErrStopped returns an error which wraps err and satisfies IsErrStopped(). +func NewErrStopped() error { + newErr := errors.NewErr("watcher was stopped") + newErr.SetLocation(2) + return &stopped{newErr} +} + +// IsErrStopped reports whether the error was created with ErrStoppedf() or NewErrStopped(). +func IsErrStopped(err error) bool { + err = errors.Cause(err) + _, ok := err.(*stopped) + return ok +} // Next retrieves all changes that have happened since the last // time it was called, blocking until there are some changes available. @@ -80,7 +103,11 @@ select { case <-w.all.tomb.Dying(): - return nil, errors.Errorf("shared state watcher was stopped") + err := w.all.tomb.Err() + if err == nil { + err = ErrStoppedf("shared state watcher") + } + return nil, err case w.all.request <- req: } @@ -90,10 +117,14 @@ // the Multiwatcher, request, and storeManager types. select { case <-w.all.tomb.Dying(): - return nil, errors.Errorf("shared state watcher was stopped") + err := w.all.tomb.Err() + if err == nil { + err = ErrStoppedf("shared state watcher") + } + return nil, err case ok := <-req.reply: if !ok { - return nil, errors.Trace(ErrStopped) + return nil, errors.Trace(NewErrStopped()) } case <-req.noChanges: return []multiwatcher.Delta{}, nil @@ -124,7 +155,6 @@ // Backing is the interface required by the storeManager to access the // underlying state. type Backing interface { - // GetAll retrieves information about all information // known to the Backing and stashes it in the Store. GetAll(all *multiwatcherStore) error @@ -296,7 +326,12 @@ changes := sm.all.ChangesSince(revno) if len(changes) == 0 { if req.noChanges != nil { - req.noChanges <- struct{}{} + select { + case req.noChanges <- struct{}{}: + case <-sm.tomb.Dying(): + return + } + sm.removeWaitingReq(w, req) } continue @@ -304,10 +339,13 @@ req.changes = changes w.revno = sm.all.latestRevno + select { case req.reply <- true: case <-sm.tomb.Dying(): + return } + sm.removeWaitingReq(w, req) sm.seen(revno) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher_internal_test.go juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher_internal_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/multiwatcher_internal_test.go 2019-05-14 17:30:42.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/multiwatcher_internal_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -657,6 +657,7 @@ c.Assert(err, jc.ErrorIsNil) d, err := w.Next() c.Assert(err, gc.ErrorMatches, "shared state watcher was stopped") + c.Assert(err, jc.Satisfies, IsErrStopped) c.Assert(d, gc.HasLen, 0) } @@ -742,7 +743,7 @@ w := &Multiwatcher{all: sm} err := w.Stop() c.Assert(err, jc.ErrorIsNil) - checkNext(c, w, nil, ErrStopped.Error()) + checkNext(c, w, nil, NewErrStopped().Error()) } func (*storeManagerSuite) TestMultiwatcherStopBecauseStoreManagerError(c *gc.C) { @@ -752,14 +753,32 @@ c.Check(sm.Stop(), gc.ErrorMatches, "some error") }() w := &Multiwatcher{all: sm} + // Receive one delta to make sure that the storeManager // has seen the initial state. checkNext(c, w, []multiwatcher.Delta{{Entity: &multiwatcher.MachineInfo{Id: "0"}}}, "") c.Logf("setting fetch error") b.setFetchError(errors.New("some error")) + c.Logf("updating entity") b.updateEntity(&multiwatcher.MachineInfo{Id: "1"}) - checkNext(c, w, nil, `shared state watcher was stopped`) + checkNext(c, w, nil, "some error") +} + +func (*storeManagerSuite) TestMultiwatcherStopBecauseStoreManagerStop(c *gc.C) { + b := newTestBacking([]multiwatcher.EntityInfo{&multiwatcher.MachineInfo{Id: "0"}}) + sm := newStoreManager(b) + w := &Multiwatcher{all: sm} + + // Receive one delta to make sure that the storeManager + // has seen the initial state. + checkNext(c, w, []multiwatcher.Delta{{Entity: &multiwatcher.MachineInfo{Id: "0"}}}, "") + + // Stop the the store manager cleanly and check that + // the next update returns ErrStopped. + c.Check(sm.Stop(), jc.ErrorIsNil) + b.updateEntity(&multiwatcher.MachineInfo{Id: "1"}) + checkNext(c, w, nil, ErrStoppedf("shared state watcher").Error()) } func StoreIncRef(a *multiwatcherStore, id interface{}) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/relation.go juju-core-2.6.5/src/github.com/juju/juju/state/relation.go --- juju-core-2.6.2/src/github.com/juju/juju/state/relation.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/relation.go 2019-06-28 17:10:43.000000000 +0000 @@ -319,7 +319,10 @@ // Destroy ensures that the relation will be removed at some point; if no units // are currently in scope, it will be removed immediately. func (r *Relation) Destroy() error { - _, err := r.DestroyWithForce(false, time.Duration(0)) + errs, err := r.DestroyWithForce(false, time.Duration(0)) + if len(errs) != 0 { + logger.Warningf("operational errors removing relation %v: %v", r.Id(), errs) + } return err } @@ -427,10 +430,16 @@ } return removeOps, true, nil } + lifeAssert := isAliveDoc + if op.Force { + // Since we are force destroying, life assert should be current relation's life. + lifeAssert = bson.D{{"life", r.doc.Life}} + } + return []txn.Op{{ C: relationsC, Id: r.doc.DocID, - Assert: bson.D{{"life", Alive}, {"unitcount", bson.D{{"$gt", 0}}}}, + Assert: append(bson.D{{"unitcount", bson.D{{"$gt", 0}}}}, lifeAssert...), Update: bson.D{{"$set", bson.D{{"life", Dying}}}}, }}, false, nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/relationunit.go juju-core-2.6.5/src/github.com/juju/juju/state/relationunit.go --- juju-core-2.6.2/src/github.com/juju/juju/state/relationunit.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/relationunit.go 2019-06-28 17:10:43.000000000 +0000 @@ -355,7 +355,10 @@ // leaves, it is removed immediately. It is not an error to leave a scope // that the unit is not, or never was, a member of. func (ru *RelationUnit) LeaveScope() error { - _, err := ru.LeaveScopeWithForce(false, time.Duration(0)) + errs, err := ru.LeaveScopeWithForce(false, time.Duration(0)) + if len(errs) != 0 { + logger.Warningf("operational errors leaving scope for unit %q in relation %q: %v", ru.unitName, ru.relation, errs) + } return err } @@ -588,7 +591,7 @@ // The ingress addresses depend on if the relation is cross model and whether the // relation endpoint is bound to a space. func NetworksForRelation( - binding string, unit *Unit, rel *Relation, defaultEgress []string, + binding string, unit *Unit, rel *Relation, defaultEgress []string, pollPublic bool, ) (boundSpace string, ingress []string, egress []string, _ error) { st := unit.st @@ -606,6 +609,35 @@ if err != nil && !errors.IsNotValid(err) { return "", nil, nil, errors.Trace(err) } + + fetchAddr := func(fetcher func() (network.Address, error)) (network.Address, error) { + var address network.Address + retryArg := PreferredAddressRetryArgs() + retryArg.Func = func() error { + var err error + address, err = fetcher() + return err + } + retryArg.IsFatalError = func(err error) bool { + return !network.IsNoAddressError(err) + } + return address, retry.Call(retryArg) + } + + fallbackIngressToPrivateAddr := func() error { + // TODO(ycliuhw): lp-1830252 retry here once this is fixed. + address, err := unit.PrivateAddress() + if err != nil { + logger.Warningf( + "no private address for unit %q in relation %q", + unit.Name(), rel) + } + if address.Value != "" { + ingress = append(ingress, address.Value) + } + return nil + } + // If the endpoint for this relation is not bound to a space, or // is bound to the default space, we need to look up the ingress // address info which is aware of cross model relations. @@ -614,31 +646,21 @@ if err != nil { return "", nil, nil, errors.Trace(err) } - // TODO(caas) - we might need to use the service address - if crossmodel && unit.ShouldBeAssigned() { - var address network.Address - retryArg := PreferredAddressRetryArgs() - retryArg.Func = func() error { - var err error - address, err = unit.PublicAddress() - return err - } - retryArg.IsFatalError = func(err error) bool { - return !network.IsNoAddressError(err) - } - err := retry.Call(retryArg) + if crossmodel && (unit.ShouldBeAssigned() || pollPublic) { + address, err := fetchAddr(unit.PublicAddress) if err != nil { - // TODO(wallyworld) - it's ok to return a private address sometimes - // TODO return an error when it's not possible to use the private address logger.Warningf( - "no public address for unit %q in cross model relation %q, using private address", - unit.Name(), rel) - address, err = unit.PrivateAddress() - if err != nil { + "no public address for unit %q in cross model relation %q, will use private address", + unit.Name(), rel, + ) + } else if address.Value != "" { + ingress = append(ingress, address.Value) + } + if len(ingress) == 0 { + if err := fallbackIngressToPrivateAddr(); err != nil { return "", nil, nil, errors.Trace(err) } } - ingress = []string{address.Value} } } if len(ingress) == 0 { @@ -649,23 +671,19 @@ if err != nil { return "", nil, nil, errors.Trace(err) } - machine, err := st.Machine(machineID) if err != nil { return "", nil, nil, errors.Trace(err) } - networkInfos := machine.GetNetworkInfoForSpaces(set.NewStrings(boundSpace)) // The binding address information based on link layer devices. for _, nwInfo := range networkInfos[boundSpace].NetworkInfos { for _, addr := range nwInfo.Addresses { ingress = append(ingress, addr.Address) } - } } else { - // Be be consistent with IAAS behaviour above, we'll return all - // addresses, including any container address. + // Be be consistent with IAAS behaviour above, we'll return all addresses. addr, err := unit.AllAddresses() if err != nil { logger.Warningf( diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/relationunit_test.go juju-core-2.6.5/src/github.com/juju/juju/state/relationunit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/relationunit_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/relationunit_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -875,7 +875,7 @@ network.NewScopedAddress("4.3.2.1", network.ScopePublic), ) - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "") @@ -945,7 +945,7 @@ s.addDevicesWithAddresses(c, machine, "1.2.3.4/16", "2.2.3.4/16", "3.2.3.4/16", "4.3.2.1/16") - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "space-3") @@ -968,7 +968,7 @@ ) c.Assert(err, jc.ErrorIsNil) - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "") @@ -990,7 +990,7 @@ ) c.Assert(err, jc.ErrorIsNil) - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "") @@ -1055,7 +1055,7 @@ } }() - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.ru0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) // Ensure there we no errors in the go routine. @@ -1079,7 +1079,7 @@ prr := newProReqRelationForApps(c, st, mysql, gitlab) // First no address. - boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil) + boundSpace, ingress, egress, err := state.NetworksForRelation("", prr.pu0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "") c.Assert(ingress, gc.HasLen, 0) @@ -1092,7 +1092,7 @@ c.Assert(err, jc.ErrorIsNil) err = prr.pu0.Refresh() c.Assert(err, jc.ErrorIsNil) - boundSpace, ingress, egress, err = state.NetworksForRelation("", prr.pu0, prr.rel, nil) + boundSpace, ingress, egress, err = state.NetworksForRelation("", prr.pu0, prr.rel, nil, true) c.Assert(err, jc.ErrorIsNil) c.Assert(boundSpace, gc.Equals, "") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/remoteapplication.go juju-core-2.6.5/src/github.com/juju/juju/state/remoteapplication.go --- juju-core-2.6.2/src/github.com/juju/juju/state/remoteapplication.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/remoteapplication.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,7 +19,6 @@ "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/txn" - "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/status" "github.com/juju/juju/environs" ) @@ -249,8 +248,8 @@ return result } -// DestroyRemoteApplicationOperation returns a model operation to destroy remote application. -func (s *RemoteApplication) DestroyRemoteApplicationOperation(force bool) *DestroyRemoteApplicationOperation { +// DestroyOperation returns a model operation to destroy remote application. +func (s *RemoteApplication) DestroyOperation(force bool) *DestroyRemoteApplicationOperation { return &DestroyRemoteApplicationOperation{ app: &RemoteApplication{st: s.st, doc: s.doc}, ForcedOperation: ForcedOperation{Force: force}, @@ -296,6 +295,8 @@ // Done is part of the ModelOperation interface. func (op *DestroyRemoteApplicationOperation) Done(err error) error { + // NOTE(tsm): if you change the business logic here, check + // that RemoveOfferOperation is modified to suit if err != nil { if !op.Force { return errors.Annotatef(err, "cannot destroy remote application %q", op.app) @@ -314,7 +315,7 @@ s.doc.Life = Dying } }() - op := s.DestroyRemoteApplicationOperation(force) + op := s.DestroyOperation(force) op.MaxWait = maxWait err = s.st.ApplyOperation(op) return op.Errors, err @@ -324,7 +325,10 @@ // will be removed at some point; if no relation involving the // application has any units in scope, they are all removed immediately. func (s *RemoteApplication) Destroy() error { - _, err := s.DestroyWithForce(false, time.Duration(0)) + errs, err := s.DestroyWithForce(false, time.Duration(0)) + if len(errs) != 0 { + logger.Warningf("operational errors destroying remote application %v: %v", s.Name(), errs) + } return err } @@ -485,6 +489,7 @@ if !info.Status.KnownWorkloadStatus() { return errors.Errorf("cannot set invalid status %q", info.Status) } + return setStatus(s.st.db(), setStatusParams{ badge: "remote application", globalKey: s.globalKey(), @@ -495,6 +500,65 @@ }) } +// TerminateOperation returns a ModelOperation that will terminate this +// remote application when applied, ensuring that all units have left +// scope as well. +func (s *RemoteApplication) TerminateOperation(message string) ModelOperation { + return &terminateRemoteApplicationOperation{ + app: s, + doc: statusDoc{ + Status: status.Terminated, + StatusInfo: message, + Updated: s.st.clock().Now().UnixNano(), + }, + } +} + +type terminateRemoteApplicationOperation struct { + app *RemoteApplication + doc statusDoc +} + +// Build is part of ModelOperation. +func (op *terminateRemoteApplicationOperation) Build(attempt int) ([]txn.Op, error) { + ops, err := statusSetOps(op.app.st.db(), op.doc, op.app.globalKey()) + if err != nil { + return nil, errors.Annotate(err, "setting status") + } + name := op.app.Name() + logger.Debugf("leaving scope on all %q relation units", name) + rels, err := op.app.Relations() + if err != nil { + return nil, errors.Annotatef(err, "getting relations for %q", name) + } + for _, rel := range rels { + remoteUnits, err := rel.AllRemoteUnits(name) + if err != nil { + return nil, errors.Annotatef(err, "getting remote units for %q", name) + } + for _, ru := range remoteUnits { + leaveOperation := ru.LeaveScopeOperation(false) + leaveOps, err := leaveOperation.Build(attempt) + if errors.Cause(err) == jujutxn.ErrNoOperations { + continue + } else if err != nil { + return nil, errors.Annotatef(err, "leaving scope for %q", ru.key()) + } + ops = append(ops, leaveOps...) + } + } + return ops, nil +} + +// Done is part of ModelOperation. +func (op *terminateRemoteApplicationOperation) Done(err error) error { + if err != nil { + return errors.Annotatef(err, "updating unit %q", op.app.Name()) + } + probablyUpdateStatusHistory(op.app.st.db(), op.app.globalKey(), op.doc) + return nil +} + // Endpoints returns the application's currently available relation endpoints. func (s *RemoteApplication) Endpoints() ([]Endpoint, error) { return remoteEndpointDocsToEndpoints(s.Name(), s.doc.Endpoints), nil @@ -707,7 +771,7 @@ if p.URL != "" { // URL may be empty, to represent remote applications corresponding // to consumers of an offered application. - if _, err := crossmodel.ParseOfferURL(p.URL); err != nil { + if _, err := charm.ParseOfferURL(p.URL); err != nil { return errors.Annotate(err, "validating offer URL") } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/remoteapplication_test.go juju-core-2.6.5/src/github.com/juju/juju/state/remoteapplication_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/remoteapplication_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/remoteapplication_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -1083,3 +1083,45 @@ wc.AssertChangeInSingleEvent("mysql") wc.AssertNoChange() } + +func (s *remoteApplicationSuite) TestTerminateOperationLeavesScopes(c *gc.C) { + ch := s.AddTestingCharm(c, "wordpress") + + _ = s.AddTestingApplication(c, "wp1", ch) + eps1, err := s.State.InferEndpoints("wp1", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel1, err := s.State.AddRelation(eps1...) + c.Assert(err, jc.ErrorIsNil) + + _ = s.AddTestingApplication(c, "wp2", ch) + eps2, err := s.State.InferEndpoints("wp2", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel2, err := s.State.AddRelation(eps2...) + + ru1, err := rel1.RemoteUnit("mysql/0") + c.Assert(err, jc.ErrorIsNil) + err = ru1.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + + ru2, err := rel2.RemoteUnit("mysql/0") + c.Assert(err, jc.ErrorIsNil) + err = ru2.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + + op := s.application.TerminateOperation("do-do-do do-do-do do-do") + err = s.State.ApplyOperation(op) + c.Assert(err, jc.ErrorIsNil) + + appStatus, err := s.application.Status() + c.Assert(err, jc.ErrorIsNil) + c.Assert(appStatus.Status, gc.Equals, status.Terminated) + c.Assert(appStatus.Message, gc.Equals, "do-do-do do-do-do do-do") + + remoteRelUnits1, err := rel1.AllRemoteUnits("mysql") + c.Assert(err, jc.ErrorIsNil) + c.Assert(remoteRelUnits1, gc.HasLen, 0) + + remoteRelUnits2, err := rel2.AllRemoteUnits("mysql") + c.Assert(err, jc.ErrorIsNil) + c.Assert(remoteRelUnits2, gc.HasLen, 0) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/settings.go juju-core-2.6.5/src/github.com/juju/juju/state/settings.go --- juju-core-2.6.2/src/github.com/juju/juju/state/settings.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/settings.go 2019-06-28 17:10:43.000000000 +0000 @@ -194,7 +194,7 @@ return errors.NotFoundf("settings") } if err != nil { - return fmt.Errorf("cannot write settings: %v", err) + return errors.Annotate(err, "writing settings") } s.disk = copyMap(s.core, nil) return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/settings_test.go juju-core-2.6.5/src/github.com/juju/juju/state/settings_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/settings_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/settings_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -369,7 +369,7 @@ c.Assert(node.Map(), gc.DeepEquals, map[string]interface{}{}) } -func (s *SettingsSuite) TestReadResync(c *gc.C) { +func (s *SettingsSuite) TestReadReSync(c *gc.C) { // Check that read pulls the data into the node. nodeOne, err := s.createSettings(s.key, nil) c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/state.go juju-core-2.6.5/src/github.com/juju/juju/state/state.go --- juju-core-2.6.2/src/github.com/juju/juju/state/state.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/state.go 2019-06-28 17:10:43.000000000 +0000 @@ -1126,6 +1126,9 @@ Id string ProviderId string Addresses []network.Address + + Generation int64 + DesiredScaleProtected bool } // SaveCloudService creates a cloud service. @@ -1133,19 +1136,21 @@ defer errors.DeferredAnnotatef(&err, "cannot add cloud service %q", args.ProviderId) doc := cloudServiceDoc{ - DocID: applicationGlobalKey(args.Id), - ProviderId: args.ProviderId, - Addresses: fromNetworkAddresses(args.Addresses, OriginProvider), + DocID: applicationGlobalKey(args.Id), + ProviderId: args.ProviderId, + Addresses: fromNetworkAddresses(args.Addresses, OriginProvider), + Generation: args.Generation, + DesiredScaleProtected: args.DesiredScaleProtected, } - svc := newCloudService(st, &doc) buildTxn := func(int) ([]txn.Op, error) { - return svc.saveServiceOps(doc) + return buildCloudServiceOps(st, doc) } if err := st.db().Run(buildTxn); err != nil { return nil, errors.Annotate(err, "failed to save cloud service") } - return svc, nil + // refresh then return updated CloudService. + return newCloudService(st, &doc).CloudService() } // CloudService returns a cloud service state by Id. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/state_test.go juju-core-2.6.5/src/github.com/juju/juju/state/state_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/state_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/state_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -2695,7 +2695,7 @@ c.Assert(cfg, jc.DeepEquals, expectedCfg) settings := state.GetControllerSettings(s.State) - settings.Set("max-logs-age", "96h") + settings.Set("model-logs-size", "5M") _, err = settings.Write() c.Assert(err, jc.ErrorIsNil) @@ -2703,7 +2703,7 @@ cfg, err = s.State.ControllerConfig() c.Assert(err, jc.ErrorIsNil) - expectedCfg["max-logs-age"] = "96h" + expectedCfg["model-logs-size"] = "5M" c.Assert(cfg, jc.DeepEquals, expectedCfg) } @@ -3082,7 +3082,7 @@ for i := 0; i < n; i++ { err := dbLogger.Log([]state.LogRecord{{ Time: time.Now(), - Entity: names.NewApplicationTag("van-occupanther"), + Entity: "application-van-occupanther", Module: "chasing after deer", Location: "in a log house", Level: loggo.INFO, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/status.go juju-core-2.6.5/src/github.com/juju/juju/state/status.go --- juju-core-2.6.2/src/github.com/juju/juju/state/status.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/status.go 2019-06-28 17:10:43.000000000 +0000 @@ -442,7 +442,7 @@ // If this status is not new (i.e. it is exactly the same as // our last status), there is no need to update the record. // Update here will only reset the 'Since' field. - return err + return nil } // Set the authoritative status document, or fail trying. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/storage.go juju-core-2.6.5/src/github.com/juju/juju/state/storage.go --- juju-core-2.6.2/src/github.com/juju/juju/state/storage.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/storage.go 2019-06-28 17:10:43.000000000 +0000 @@ -428,11 +428,16 @@ return nil, errAlreadyDying } } + lifeAssert := isAliveDoc + if force { + // Since we are force destroying, life assert should be current storage instance's life. + lifeAssert = bson.D{{"life", s.doc.Life}} + } if s.doc.AttachmentCount == 0 { // There are no attachments remaining, so we can // remove the storage instance immediately. hasNoAttachments := bson.D{{"attachmentcount", 0}} - assert := append(hasNoAttachments, isAliveDoc...) + assert := append(hasNoAttachments, lifeAssert...) s.doc.Releasing = releaseStorage return removeStorageInstanceOps(s, assert, force) } @@ -466,10 +471,7 @@ // There are still attachments: the storage instance will be removed // when the last attachment is removed. We schedule a cleanup to destroy // attachments. - notLastRefs := bson.D{ - {"life", Alive}, - {"attachmentcount", bson.D{{"$gt", 0}}}, - } + notLastRefs := append(bson.D{{"attachmentcount", bson.D{{"$gt", 0}}}}, lifeAssert...) setFields := bson.D{{"life", Dying}} if releaseStorage { setFields = append(setFields, bson.DocElem{"releasing", true}) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/unit.go juju-core-2.6.5/src/github.com/juju/juju/state/unit.go --- juju-core-2.6.2/src/github.com/juju/juju/state/unit.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/unit.go 2019-06-28 17:10:43.000000000 +0000 @@ -466,7 +466,10 @@ // to a provisioned machine is Destroyed, it will be removed from state // directly. func (u *Unit) Destroy() error { - _, err := u.DestroyWithForce(false, time.Duration(0)) + errs, err := u.DestroyWithForce(false, time.Duration(0)) + if len(errs) != 0 { + logger.Warningf("operational errors destroying unit %v: %v", u.Name(), errs) + } return err } @@ -944,6 +947,9 @@ // LastError returns last added error for this operation. func (op *ForcedOperation) LastError() error { + if len(op.Errors) == 0 { + return nil + } return op.Errors[len(op.Errors)-1] } @@ -1212,30 +1218,30 @@ if u.ShouldBeAssigned() { return nil, nil } + // First the addresses of the service. app, err := u.Application() if err != nil { return nil, errors.Trace(err) } serviceInfo, err := app.ServiceInfo() - if errors.IsNotFound(err) { - return nil, nil - } - if err != nil { + if err != nil && !errors.IsNotFound(err) { return nil, errors.Trace(err) } - addresses := serviceInfo.Addresses() + if err == nil { + return serviceInfo.Addresses(), nil + } - // Second the address of the container. + // If there's no service deployed then it's ok + // to fallback to the container address. addr, err := u.containerAddress() if network.IsNoAddressError(err) { - return addresses, nil + return nil, nil } if err != nil { return nil, errors.Trace(err) } - addresses = append(addresses, addr) - return addresses, nil + return []network.Address{addr}, nil } // containerAddress returns the address of the pod's container. @@ -1264,11 +1270,9 @@ if len(addresses) == 0 { return network.Address{}, network.NoAddressError(scope) } - getStrictPublicAddr := func(addresses []network.Address) (network.Address, bool) { addr, ok := network.SelectPublicAddress(addresses) - ok = ok && addr.Scope == network.ScopePublic - return addr, ok + return addr, ok && addr.Scope == network.ScopePublic } getInternalAddr := func(addresses []network.Address) (network.Address, bool) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/unit_test.go juju-core-2.6.5/src/github.com/juju/juju/state/unit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/unit_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/unit_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -2441,10 +2441,6 @@ Value: "54.32.1.2", Scope: network.ScopePublic, Type: network.IPv4Address, - }, { - Value: "10.0.0.1", - Scope: network.ScopeMachineLocal, - Type: network.IPv4Address, }}) } @@ -2519,44 +2515,34 @@ c.Assert(w.Err(), jc.Satisfies, errors.IsNotFound) } -func (s *CAASUnitSuite) TestWatchContainerAddressesHash(c *gc.C) { +func (s *CAASUnitSuite) TestWatchServiceAddressesHash(c *gc.C) { unit, err := s.application.AddUnit(state.AddUnitParams{}) c.Assert(err, jc.ErrorIsNil) - s.WaitForModelWatchersIdle(c, s.Model.UUID()) - w := unit.WatchContainerAddressesHash() + w := s.application.WatchServiceAddressesHash() defer w.Stop() wc := statetesting.NewStringsWatcherC(c, s.State, w) wc.AssertChange("") - // Change the container port: not reported. + // Set container addresses: not reported. var updateUnits state.UpdateUnitsOperation - updateUnits.Updates = []*state.UpdateUnitOperation{unit.UpdateOperation(state.UnitUpdateProperties{ - Ports: &[]string{"443"}, - })} - err = s.application.UpdateUnits(&updateUnits) - c.Assert(err, jc.ErrorIsNil) - wc.AssertNoChange() - - // Set container addresses: reported. addr := "10.0.0.1" updateUnits.Updates = []*state.UpdateUnitOperation{unit.UpdateOperation(state.UnitUpdateProperties{ Address: &addr, })} err = s.application.UpdateUnits(&updateUnits) c.Assert(err, jc.ErrorIsNil) + wc.AssertNoChange() + + // Set service addresses: reported. + err = s.application.UpdateCloudService("1", []network.Address{{Value: "10.0.0.2"}}) c.Assert(err, jc.ErrorIsNil) - wc.AssertChange("0b94e9ad737e2ff4d50dc9d8cd443d336e6a6d638b038e31b973959be89d5dec") + wc.AssertChange("cb5f37b4762871e6bbeccee663cb332438340c469160c634566ecc7c7e01009f") // Set different container addresses: reported. - addr = "10.0.0.2" - updateUnits.Updates = []*state.UpdateUnitOperation{unit.UpdateOperation(state.UnitUpdateProperties{ - Address: &addr, - })} - err = s.application.UpdateUnits(&updateUnits) + err = s.application.UpdateCloudService("1", []network.Address{{Value: "10.0.0.3"}}) c.Assert(err, jc.ErrorIsNil) - c.Assert(err, jc.ErrorIsNil) - wc.AssertChange("30762101196c8bbafa8e495a941c74fe17a1fe9fdb17c2ed091343dc0f2f2633") + wc.AssertChange("a9a5126d7cca4ab5eecee72061f1e2060f6022266c74209f9fec62e986adc091") // Ensure the following operation to set the unit as Dying // is not short circuited to remove the unit. @@ -2580,6 +2566,8 @@ // returns an IsNotFound error. err = unit.Remove() c.Assert(err, jc.ErrorIsNil) + err = s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) s.State.StartSync() select { case _, ok := <-w.Changes(): diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/upgrades.go juju-core-2.6.5/src/github.com/juju/juju/state/upgrades.go --- juju-core-2.6.2/src/github.com/juju/juju/state/upgrades.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/upgrades.go 2019-06-28 17:10:43.000000000 +0000 @@ -712,11 +712,9 @@ } var ops []txn.Op - settingsChanged := maybeUpdateSettings(doc.Settings, controller.MaxLogsAge, fmt.Sprintf("%vh", controller.DefaultMaxLogsAgeDays*24)) - settingsChanged = - maybeUpdateSettings(doc.Settings, controller.MaxLogsSize, fmt.Sprintf("%vM", controller.DefaultMaxLogCollectionMB)) || settingsChanged - settingsChanged = - maybeUpdateSettings(doc.Settings, controller.MaxTxnLogSize, fmt.Sprintf("%vM", controller.DefaultMaxTxnLogCollectionMB)) || settingsChanged + // Logs settings removed here because they are now no longer necessary. + settingsChanged := + maybeUpdateSettings(doc.Settings, controller.MaxTxnLogSize, fmt.Sprintf("%vM", controller.DefaultMaxTxnLogCollectionMB)) if settingsChanged { ops = append(ops, txn.Op{ C: controllersC, @@ -964,7 +962,8 @@ newLogs := db.C(newCollName) if !seen.Contains(newCollName) { - if err := InitDbLogs(session, modelUUID); err != nil { + // There is no setting for the size, so use the default. + if err := InitDbLogsForModel(session, modelUUID, controller.DefaultModelLogsSizeMB); err != nil { return errors.Annotatef(err, "failed to init new logs collection %q", newCollName) } seen.Add(newCollName) @@ -1930,6 +1929,11 @@ if err != nil || model.Type() == ModelTypeIAAS { return errors.Trace(err) } + if model.Life() != Alive { + // No need to update models that are going away; they may no + // longer have settings to update. + return nil + } cred, ok := model.CloudCredential() if !ok { return nil @@ -1940,6 +1944,9 @@ } defaults, err := st.controllerInheritedConfig(model.Cloud())() + if err != nil { + return errors.Annotate(err, "getting cloud config") + } operatorStorage, haveDefaultOperatorStorage := defaults[k8s.OperatorStorageKey] if !haveDefaultOperatorStorage { cloudSpec, err := cloudSpec(st, model.Cloud(), model.CloudRegion(), cred) @@ -2101,3 +2108,80 @@ } return nil } + +// UpdateK8sModelNameIndex migrates k8s model indices to be based +// on the model owner rather than the cloud name. +func UpdateK8sModelNameIndex(pool *StatePool) error { + st := pool.SystemState() + + models, closer := st.db().GetCollection(modelsC) + defer closer() + usermodelNames, closer2 := st.db().GetCollection(usermodelnameC) + defer closer2() + + var ops []txn.Op + var docs []bson.M + err := models.Find(bson.D{{"type", ModelTypeCAAS}}).Select(bson.M{"cloud": 1, "name": 1, "owner": 1}).All(&docs) + if err != nil { + return errors.Trace(err) + } + + for _, m := range docs { + owner := m["owner"].(string) + name := m["name"].(string) + cloudName := m["cloud"].(string) + oldId := userModelNameIndex(cloudName, name) + expectedId := userModelNameIndex(owner, name) + + n, err := usermodelNames.FindId(expectedId).Count() + if err != nil { + return errors.Trace(err) + } + if n > 0 { + continue + } + + ops = append(ops, []txn.Op{{ + C: usermodelnameC, + Id: oldId, + Assert: txn.DocExists, + Remove: true, + }, { + C: usermodelnameC, + Id: expectedId, + Assert: txn.DocMissing, + Insert: bson.M{}, + }}...) + } + if len(ops) > 0 { + return errors.Trace(st.runRawTransaction(ops)) + } + return nil +} + +// AddModelLogsSize to controller config. +func AddModelLogsSize(pool *StatePool) error { + st := pool.SystemState() + coll, closer := st.db().GetRawCollection(controllersC) + defer closer() + var doc settingsDoc + if err := coll.FindId(controllerSettingsGlobalKey).One(&doc); err != nil { + if err == mgo.ErrNotFound { + return nil + } + return errors.Trace(err) + } + + settingsChanged := + maybeUpdateSettings(doc.Settings, controller.ModelLogsSize, fmt.Sprintf("%vM", controller.DefaultModelLogsSizeMB)) + if settingsChanged { + return errors.Trace(st.runRawTransaction( + []txn.Op{{ + C: controllersC, + Id: doc.DocID, + Assert: txn.DocExists, + Update: bson.M{"$set": bson.M{"settings": doc.Settings}}, + }})) + } + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/upgrades_test.go juju-core-2.6.5/src/github.com/juju/juju/state/upgrades_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/upgrades_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/upgrades_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -953,9 +953,8 @@ "_id": "controllerSettings", "settings": bson.M{ "key": "value", - "max-logs-age": "96h", - "max-logs-size": "5G", "max-txn-log-size": "8G", + "model-logs-size": "5M", }, }, bson.M{ "_id": "someothersettingshouldnotbetouched", @@ -969,9 +968,8 @@ "_id": "controllerSettings", "settings": bson.M{ "key": "value", - "max-logs-age": "96h", - "max-logs-size": "5G", "max-txn-log-size": "8G", + "model-logs-size": "5M", }, }, { "_id": "someothersettingshouldnotbetouched", @@ -1004,8 +1002,6 @@ "_id": "controllerSettings", "settings": bson.M{ "key": "value", - "max-logs-age": "72h", - "max-logs-size": "4096M", "max-txn-log-size": "10M", }, }, { @@ -3001,6 +2997,42 @@ } } +func (s *upgradesSuite) TestUpdateKubernetesStorageConfigWithDyingModel(c *gc.C) { + tag := names.NewCloudCredentialTag(fmt.Sprintf("dummy/%s/default", s.owner.Id())) + err := s.state.UpdateCloudCredential(tag, cloud.NewEmptyCredential()) + c.Assert(err, jc.ErrorIsNil) + + s.PatchValue(&NewBroker, func(args environs.OpenParams) (caas.Broker, error) { + return &fakeBroker{}, nil + }) + + m1 := s.makeCaasModel(c, "m1", tag, coretesting.Attrs{ + "type": "kubernetes", + }) + defer m1.Close() + model, err := m1.Model() + c.Assert(err, jc.ErrorIsNil) + err = model.Destroy(DestroyModelParams{}) + c.Assert(err, jc.ErrorIsNil) + + settingsColl, settingsCloser := m1.database.GetRawCollection(settingsC) + defer settingsCloser() + + // Doesn't fail... + err = UpdateKubernetesStorageConfig(s.pool) + c.Assert(err, jc.ErrorIsNil) + + // ...makes no changes to settings. + var docs []bson.M + err = settingsColl.FindId(m1.ModelUUID() + ":e").All(&docs) + c.Assert(err, jc.ErrorIsNil) + c.Assert(docs, gc.HasLen, 1) + settings, ok := docs[0]["settings"].(bson.M) + c.Assert(ok, jc.IsTrue) + c.Assert(settings["operator-storage"], gc.Equals, nil) + c.Assert(settings["workload-storage"], gc.Equals, nil) +} + func (s *upgradesSuite) TestEnsureDefaultModificationStatus(c *gc.C) { coll, closer := s.state.db().GetRawCollection(statusesC) defer closer() @@ -3122,6 +3154,93 @@ c.Assert(err, jc.ErrorIsNil) } +func (s *upgradesSuite) TestUpdateK8sModelNameIndex(c *gc.C) { + modelsColl, closer := s.state.db().GetRawCollection(modelsC) + defer closer() + err := modelsColl.Insert(bson.M{ + "_id": utils.MustNewUUID().String(), + "type": "iaas", + "name": "model1", + "owner": "fred", + "cloud": "lxd", + }, bson.M{ + "_id": utils.MustNewUUID().String(), + "type": "caas", + "name": "model2", + "owner": "mary", + "cloud": "microk8s", + }, bson.M{ + "_id": utils.MustNewUUID().String(), + "type": "caas", + "name": "model3", + "owner": "jane", + "cloud": "microk8s", + }) + c.Assert(err, jc.ErrorIsNil) + + modelNameColl, closer := s.state.db().GetRawCollection(usermodelnameC) + defer closer() + + err = modelNameColl.Insert(bson.M{ + "_id": "fred:model1", + }, bson.M{ + "_id": "mary:model2", + }, bson.M{ + "_id": "microk8s:model3", + }) + c.Assert(err, jc.ErrorIsNil) + + expected := bsonMById{ + { + "_id": "fred:model1", + }, { + "_id": "mary:model2", + }, { + "_id": "jane:model3", + }, { + "_id": "test-admin:testmodel", + }, + } + + sort.Sort(expected) + s.assertUpgradedData(c, UpdateK8sModelNameIndex, + expectUpgradedData{modelNameColl, expected}, + ) +} + +func (s *upgradesSuite) TestAddModelLogsSize(c *gc.C) { + settingsColl, settingsCloser := s.state.db().GetRawCollection(controllersC) + defer settingsCloser() + _, err := settingsColl.RemoveAll(nil) + c.Assert(err, jc.ErrorIsNil) + err = settingsColl.Insert(bson.M{ + "_id": "controllerSettings", + "settings": bson.M{ + "key": "value", + }, + }, bson.M{ + "_id": "someothersettingshouldnotbetouched", + // non-controller data: should not be touched + "settings": bson.M{"key": "value"}, + }) + c.Assert(err, jc.ErrorIsNil) + + expectedSettings := []bson.M{ + { + "_id": "controllerSettings", + "settings": bson.M{ + "key": "value", + "model-logs-size": "20M", + }, + }, { + "_id": "someothersettingshouldnotbetouched", + "settings": bson.M{"key": "value"}, + }, + } + + s.assertUpgradedData(c, AddModelLogsSize, expectUpgradedData{settingsColl, expectedSettings}) +} + type docById []bson.M func (d docById) Len() int { return len(d) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/user.go juju-core-2.6.5/src/github.com/juju/juju/state/user.go --- juju-core-2.6.2/src/github.com/juju/juju/state/user.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/user.go 2019-06-28 17:10:43.000000000 +0000 @@ -37,12 +37,14 @@ } func (st *State) checkUserExists(name string) (bool, error) { + lowercaseName := strings.ToLower(name) + users, closer := st.db().GetCollection(usersC) defer closer() var count int var err error - if count, err = users.FindId(name).Count(); err != nil { + if count, err = users.FindId(lowercaseName).Count(); err != nil { return false, err } return count > 0, nil @@ -72,13 +74,13 @@ if !names.IsValidUserName(name) { return nil, errors.Errorf("invalid user name %q", name) } - nameToLower := strings.ToLower(name) + lowercaseName := strings.ToLower(name) dateCreated := st.nowToTheSecond() user := &User{ st: st, doc: userDoc{ - DocID: nameToLower, + DocID: lowercaseName, Name: name, DisplayName: displayName, SecretKey: secretKey, @@ -98,7 +100,7 @@ ops := []txn.Op{{ C: usersC, - Id: nameToLower, + Id: lowercaseName, Assert: txn.DocMissing, Insert: &user.doc, }} @@ -126,7 +128,7 @@ // RemoveUser marks the user as deleted. This obviates the ability of a user // to function, but keeps the userDoc retaining provenance, i.e. auditing. func (st *State) RemoveUser(tag names.UserTag) error { - name := strings.ToLower(tag.Name()) + lowercaseName := strings.ToLower(tag.Name()) u, err := st.User(tag) if err != nil { @@ -144,7 +146,7 @@ } } ops := []txn.Op{{ - Id: name, + Id: lowercaseName, C: usersC, Assert: txn.DocExists, Update: bson.M{"$set": bson.M{"deleted": true}}, @@ -155,9 +157,9 @@ } func createInitialUserOps(controllerUUID string, user names.UserTag, password, salt string, dateCreated time.Time) []txn.Op { - nameToLower := strings.ToLower(user.Name()) + lowercaseName := strings.ToLower(user.Name()) doc := userDoc{ - DocID: nameToLower, + DocID: lowercaseName, Name: user.Name(), DisplayName: user.Name(), PasswordHash: utils.UserPasswordHash(password, salt), @@ -167,7 +169,7 @@ } ops := []txn.Op{{ C: usersC, - Id: nameToLower, + Id: lowercaseName, Assert: txn.DocMissing, Insert: &doc, }} @@ -428,9 +430,10 @@ bson.DocElem{"$unset", bson.D{{"secretkey", ""}}}, ) } + lowercaseName := strings.ToLower(u.Name()) ops := []txn.Op{{ C: usersC, - Id: u.Name(), + Id: lowercaseName, Assert: txn.DocExists, Update: update, }} @@ -494,9 +497,10 @@ } func (u *User) setDeactivated(value bool) error { + lowercaseName := strings.ToLower(u.Name()) ops := []txn.Op{{ C: usersC, - Id: u.Name(), + Id: lowercaseName, Assert: txn.DocExists, Update: bson.D{{"$set", bson.D{{"deactivated", value}}}}, }} @@ -575,9 +579,10 @@ }, }, } + lowercaseName := strings.ToLower(u.Name()) return []txn.Op{{ C: usersC, - Id: u.Name(), + Id: lowercaseName, Assert: txn.DocExists, Update: update, }}, nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/user_test.go juju-core-2.6.5/src/github.com/juju/juju/state/user_test.go --- juju-core-2.6.2/src/github.com/juju/juju/state/user_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/user_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "fmt" "regexp" + "strings" "time" "github.com/juju/errors" @@ -83,6 +84,9 @@ exists, err := state.CheckUserExists(s.State, user.Name()) c.Assert(err, jc.ErrorIsNil) c.Assert(exists, jc.IsTrue) + exists, err = state.CheckUserExists(s.State, strings.ToUpper(user.Name())) + c.Assert(err, jc.ErrorIsNil) + c.Assert(exists, jc.IsTrue) exists, err = state.CheckUserExists(s.State, "notAUser") c.Assert(err, jc.ErrorIsNil) c.Assert(exists, jc.IsFalse) @@ -228,6 +232,30 @@ c.Check(err, gc.ErrorMatches, `user "username-\d+" is permanently deleted`) } +func (s *UserSuite) TestRemoveUserUppercaseName(c *gc.C) { + name := "NameWithUppercase" + user := s.Factory.MakeUser(c, &factory.UserParams{ + Name: name, + Password: "wow very sea cret", + }) + + // Assert user exists and can authenticate. + c.Assert(user.PasswordValid("wow very sea cret"), jc.IsTrue) + + // Look for the user. + u, err := s.State.User(user.UserTag()) + c.Check(err, jc.ErrorIsNil) + c.Assert(u, jc.DeepEquals, user) + + // Remove the user. + err = s.State.RemoveUser(user.UserTag()) + c.Check(err, jc.ErrorIsNil) + + // Check to verify the user cannot be retrieved. + u, err = s.State.User(user.UserTag()) + c.Check(err, gc.ErrorMatches, fmt.Sprintf(`user "%s" is permanently deleted`, name)) +} + func (s *UserSuite) TestRemoveUserRemovesUserAccess(c *gc.C) { user := s.Factory.MakeUser(c, &factory.UserParams{Password: "so sekrit"}) @@ -279,6 +307,25 @@ c.Assert(s.activeUsers(c), jc.DeepEquals, []string{"test-admin", user.Name()}) } +func (s *UserSuite) TestDisableUserUppercaseName(c *gc.C) { + name := "NameWithUppercase" + user := s.Factory.MakeUser(c, &factory.UserParams{Password: "a-password", Name: name}) + c.Assert(user.IsDisabled(), jc.IsFalse) + c.Assert(s.activeUsers(c), jc.DeepEquals, []string{name, "test-admin"}) + + err := user.Disable() + c.Assert(err, jc.ErrorIsNil) + c.Assert(user.IsDisabled(), jc.IsTrue) + c.Assert(user.PasswordValid("a-password"), jc.IsFalse) + c.Assert(s.activeUsers(c), jc.DeepEquals, []string{"test-admin"}) + + err = user.Enable() + c.Assert(err, jc.ErrorIsNil) + c.Assert(user.IsDisabled(), jc.IsFalse) + c.Assert(user.PasswordValid("a-password"), jc.IsTrue) + c.Assert(s.activeUsers(c), jc.DeepEquals, []string{name, "test-admin"}) +} + func (s *UserSuite) TestDisableUserDisablesUserAccess(c *gc.C) { user := s.Factory.MakeUser(c, &factory.UserParams{Password: "so sekrit"}) @@ -356,6 +403,27 @@ c.Assert(user.PasswordValid("foo-12345678901234567890"), jc.IsFalse) } +func (s *UserSuite) TestSetPasswordHashUppercaseName(c *gc.C) { + name := "NameWithUppercase" + user := s.Factory.MakeUser(c, &factory.UserParams{Name: name}) + + salt, err := utils.RandomSalt() + c.Assert(err, jc.ErrorIsNil) + err = user.SetPasswordHash(utils.UserPasswordHash("foo", salt), salt) + c.Assert(err, jc.ErrorIsNil) + + c.Assert(user.PasswordValid("foo"), jc.IsTrue) + c.Assert(user.PasswordValid("bar"), jc.IsFalse) + + // User passwords should *not* use the fast PasswordHash function + hash := utils.AgentPasswordHash("foo-12345678901234567890") + c.Assert(err, jc.ErrorIsNil) + err = user.SetPasswordHash(hash, "") + c.Assert(err, jc.ErrorIsNil) + + c.Assert(user.PasswordValid("foo-12345678901234567890"), jc.IsFalse) +} + func (s *UserSuite) TestSetPasswordHashWithSalt(c *gc.C) { user := s.Factory.MakeUser(c, nil) @@ -461,6 +529,19 @@ c.Assert(err, jc.ErrorIsNil) c.Assert(u.SecretKey(), gc.HasLen, 32) oldKey := u.SecretKey() + + key, err := u.ResetPassword() + c.Assert(err, jc.ErrorIsNil) + c.Assert(key, gc.Not(gc.DeepEquals), oldKey) + c.Assert(key, gc.NotNil) + c.Assert(u.SecretKey(), gc.DeepEquals, key) +} + +func (s *UserSuite) TestResetPasswordUppercaseName(c *gc.C) { + u, err := s.State.AddUserWithSecretKey("BobHasAnUppercaseName", "display", "admin") + c.Assert(err, jc.ErrorIsNil) + c.Assert(u.SecretKey(), gc.HasLen, 32) + oldKey := u.SecretKey() key, err := u.ResetPassword() c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/watcher.go juju-core-2.6.5/src/github.com/juju/juju/state/watcher.go --- juju-core-2.6.2/src/github.com/juju/juju/state/watcher.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/watcher.go 2019-06-28 17:10:43.000000000 +0000 @@ -3787,17 +3787,17 @@ return fmt.Sprintf("%x", hash.Sum(nil)), nil } -// WatchContainerAddressesHash returns a StringsWatcher that emits a +// WatchServiceAddressesHash returns a StringsWatcher that emits a // hash of the unit's container address whenever it changes. -func (u *Unit) WatchContainerAddressesHash() StringsWatcher { +func (a *Application) WatchServiceAddressesHash() StringsWatcher { firstCall := true w := &hashWatcher{ - commonWatcher: newCommonWatcher(u.st), + commonWatcher: newCommonWatcher(a.st), out: make(chan []string), - collection: cloudContainersC, - id: u.st.docID(u.globalKey()), + collection: cloudServicesC, + id: a.st.docID(a.globalKey()), hash: func() (string, error) { - result, err := hashContainerAddresses(u, firstCall) + result, err := hashServiceAddresses(a, firstCall) firstCall = false return result, err }, @@ -3806,11 +3806,11 @@ return w } -func hashContainerAddresses(u *Unit, firstCall bool) (string, error) { - container, err := u.cloudContainer() +func hashServiceAddresses(a *Application, firstCall bool) (string, error) { + service, err := a.ServiceInfo() if errors.IsNotFound(err) && firstCall { // To keep behaviour the same as - // WatchContainerAddresses, we need to ignore NotFound + // WatchServiceAddresses, we need to ignore NotFound // errors on the first call but propagate them after // that. return "", nil @@ -3818,15 +3818,15 @@ if err != nil { return "", errors.Trace(err) } - address := container.Address - if address == nil { + addresses := service.Addresses() + if len(addresses) == 0 { return "", nil } + address := addresses[0] hash := sha256.New() hash.Write([]byte(address.Value)) - hash.Write([]byte(address.AddressType)) + hash.Write([]byte(address.Type)) hash.Write([]byte(address.Scope)) - hash.Write([]byte(address.Origin)) hash.Write([]byte(address.SpaceName)) return fmt.Sprintf("%x", hash.Sum(nil)), nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/state/workers.go juju-core-2.6.5/src/github.com/juju/juju/state/workers.go --- juju-core-2.6.2/src/github.com/juju/juju/state/workers.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/state/workers.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,14 +4,17 @@ package state import ( + "path" "time" "github.com/juju/errors" "github.com/juju/loggo" + "github.com/juju/os/series" "github.com/juju/pubsub" "gopkg.in/juju/worker.v1" corelease "github.com/juju/juju/core/lease" + "github.com/juju/juju/juju/paths" "github.com/juju/juju/state/presence" "github.com/juju/juju/state/watcher" jworker "github.com/juju/juju/worker" @@ -101,6 +104,14 @@ if err != nil { return nil, errors.Trace(err) } + series, err := series.HostSeries() + if err != nil { + return nil, errors.Trace(err) + } + logDir, err := paths.LogDir(series) + if err != nil { + return nil, errors.Trace(err) + } manager, err := lease.NewManager(lease.ManagerConfig{ Secretary: func(_ string) (lease.Secretary, error) { return secretary, nil @@ -110,6 +121,7 @@ Logger: loggo.GetLogger("juju.worker.lease.mongo"), MaxSleep: time.Minute, EntityUUID: entityUUID, + LogDir: path.Join(logDir, "juju"), }) if err != nil { return nil, errors.Trace(err) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm.go juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm.go --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm.go 2019-06-28 17:10:43.000000000 +0000 @@ -30,6 +30,8 @@ var Repo = testing.NewRepo("charm-repo", defaultSeries) // RepoForSeries returns a new charm repository for the specified series. +// Note: this is a bit weird, as it ignores the series if it's NOT kubernetes +// and falls back to the default series, which makes this pretty pointless. func RepoForSeries(series string) *testing.Repo { // TODO(ycliuhw): workaround - currently `quantal` is not exact series // (for example, here makes deploy charm at charm-repo/quantal/mysql --series precise possible )! @@ -39,6 +41,11 @@ return testing.NewRepo("charm-repo", series) } +// RepoWithSeries returns a new charm repository for the specified series. +func RepoWithSeries(series string) *testing.Repo { + return testing.NewRepo("charm-repo", series) +} + // CharmstoreClient bridges a charmstore and Juju // // Only methods that are relied upon by the testcharms package are exposed here. @@ -76,7 +83,7 @@ return chURL, ch } -// UploadCharm sets default series to quantal +// UploadCharm sets default series to defaultSeries func UploadCharm(c *gc.C, client CharmstoreClient, url, name string) (*charm.URL, charm.Charm) { return UploadCharmWithSeries(c, client, url, name, defaultSeries) } @@ -131,16 +138,21 @@ return id, ch } -// UploadCharmMultiSeries uploads a charm with revision using the given charm store client, +// UploadCharmMultiSeries sets default series to defaultSeries +func UploadCharmMultiSeries(c *gc.C, client CharmstoreClient, url, name string) (*charm.URL, charm.Charm) { + return UploadCharmMultiSeriesWithSeries(c, client, url, name, defaultSeries) +} + +// UploadCharmMultiSeriesWithSeries uploads a charm with revision using the given charm store client, // and returns the resulting charm URL and charm. This API caters for new multi-series charms // which do not specify a series in the URL. -func UploadCharmMultiSeries(c *gc.C, client CharmstoreClient, url, name string) (*charm.URL, charm.Charm) { +func UploadCharmMultiSeriesWithSeries(c *gc.C, client CharmstoreClient, url, name, series string) (*charm.URL, charm.Charm) { id := charm.MustParseURL(url) if id.User == "" { // We still need a user even if we are uploading a promulgated charm. id.User = "who" } - ch := Repo.CharmArchive(c.MkDir(), name) + ch := RepoForSeries(series).CharmArchive(c.MkDir(), name) // Upload the charm. curl, err := client.UploadCharm(id, ch) @@ -152,9 +164,14 @@ return curl, ch } -// UploadBundle uploads a bundle using the given charm store client, and -// returns the resulting bundle URL and bundle. +// UploadBundle sets default series to defaultSeries func UploadBundle(c *gc.C, client CharmstoreClient, url, name string) (*charm.URL, charm.Bundle) { + return UploadBundleWithSeries(c, client, url, name, defaultSeries) +} + +// UploadBundleWithSeries uploads a bundle using the given charm store client, and +// returns the resulting bundle URL and bundle. +func UploadBundleWithSeries(c *gc.C, client CharmstoreClient, url, name, series string) (*charm.URL, charm.Bundle) { id := charm.MustParseURL(url) promulgatedRevision := -1 if id.User == "" { @@ -162,7 +179,7 @@ id.User = "who" promulgatedRevision = id.Revision } - b := Repo.BundleArchive(c.MkDir(), name) + b := RepoForSeries(series).BundleArchive(c.MkDir(), name) // Upload the bundle. err := client.UploadBundleWithRevision(id, b, promulgatedRevision) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/actions.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/actions.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/actions.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/actions.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,7 @@ +snapshot: + description: Take a snapshot of the database. + params: + outfile: + description: The file to write out to. + type: string + default: foo.bz2 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +options: + title: {default: My Title, description: A descriptive title used for the application., type: string} + outlook: {description: No default outlook., type: string} + username: {default: admin001, description: The name of the initial account (given admin permissions)., type: string} + skill-level: {description: A number indicating skill., type: int} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Done!" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/.ignored juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/.ignored --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/.ignored 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/.ignored 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +# \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,6 @@ +name: dummy +summary: "That's a dummy charm." +description: | + This is a longer description which + potentially contains multiple lines. +minjujuversion: "1.0.0" \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/src/hello.c juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/src/hello.c --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/src/hello.c 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/src/hello.c 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +main() +{ + printf ("Hello World!\n"); + return 0; +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/version juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/version --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/version 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy/version 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +revision-id: dummy-146-g725cfd3-dirty \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/dummy-resource.zip juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/dummy-resource.zip --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/dummy-resource.zip 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/dummy-resource.zip 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +hello \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/dummy-resource/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,13 @@ +name: dummy-resource +summary: "That's a dummy charm." +description: | + This is a longer description which + potentially contains multiple lines. +minjujuversion: "1.0.0" +resources: + dummy: + type: file + filename: dummy.zip + description: "One line description that is useful when operators need to push it." + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,16 @@ +name: logging +summary: "Subordinate logging test charm" +description: | + This is a longer description which + potentially contains multiple lines. +subordinate: true +provides: + logging-client: + interface: logging +requires: + logging-directory: + interface: logging + scope: container + info: + interface: juju-info + scope: container diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/logging/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +options: {} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/start juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/start --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/start 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/start 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash +status-set active ready +application-version-set $(grep DISTRIB_RELEASE /etc/lsb-release | cut -d= -sf2) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/sh +status-set active "$(uptime | grep -oe 'average: .*' | sed -e 's/average:/load:/')" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/icon.svg juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/icon.svg --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/icon.svg 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/lxd-profile.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/lxd-profile.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/lxd-profile.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/lxd-profile.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,19 @@ +description: lxd profile for testing, will pass validation +config: + security.nesting: "true" + security.privileged: "true" + linux.kernel_modules: openvswitch,nbd,ip_tables,ip6_tables + environment.http_proxy: "" +devices: + tun: + path: /dev/net/tun + type: unix-char + sony: + type: usb + vendorid: 0fce + productid: 51da + bdisk: + type: unix-block + source: /dev/loop0 + gpu: + type: gpu diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,18 @@ +name: lxd-profile +summary: start a juju machine with a lxd profile +maintainer: Juju QA +description: | + Run an Ubuntu system, with the given lxd-profile +provides: + ubuntu: + interface: ubuntu +extra-bindings: + another: +tags: + - misc + - application_development +subordinate: false +series: + - bionic + - xenial + - quantal diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/README juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/README --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/README 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile/README 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,15 @@ +# Overview + +Start ubuntu image on a container with the included lxd profile. Most useful when deploying to a container or an lxd cloud. + +# Usaage + +juju deploy lxd-profile + +## Known Limitations and Issues + +It doesn't do much, but it does get you a machine you can play with. If not deployed to an LXD container or cloud, that functionality is a no-op + +# Configuration + +None diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +options: {} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/start juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/start --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/start 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/start 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash +status-set active ready +application-version-set $(grep DISTRIB_RELEASE /etc/lsb-release | cut -d= -sf2) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/sh +status-set active "$(uptime | grep -oe 'average: .*' | sed -e 's/average:/load:/')" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/icon.svg juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/icon.svg --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/icon.svg 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/lxd-profile.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/lxd-profile.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/lxd-profile.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/lxd-profile.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,8 @@ +#name: juju-default +description: lxd profile for testing nested container profiles +config: + security.nesting: "true" + security.privileged: "true" + linux.kernel_modules: openvswitch,nbd,ip_tables,ip6_tables + environment.http_proxy: "" +devices: {} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,18 @@ +name: lxd-profile-alt +summary: start a juju machine with a lxd profile +maintainer: Juju QA +description: | + Run an Ubuntu system, with the given lxd-profile +provides: + ubuntu: + interface: ubuntu +extra-bindings: + another: +tags: + - misc + - application_development +subordinate: false +series: + - bionic + - xenial + - quantal diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/README juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/README --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/README 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-alt/README 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,17 @@ +# Overview + +Start ubuntu image on a container with the included lxd profile. +Most useful when deploying to a nested container in a lxd setup. + +# Usaage + +juju deploy lxd-profile-alt --to=lxd + +## Known Limitations and Issues + +It doesn't do much, but it does get you a machine you can play with. +If not deployed to an LXD container or cloud, that functionality is a no-op + +# Configuration + +None diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +options: {} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/start juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/start --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/start 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/start 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash +status-set active ready +application-version-set $(grep DISTRIB_RELEASE /etc/lsb-release | cut -d= -sf2) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/sh +status-set active "$(uptime | grep -oe 'average: .*' | sed -e 's/average:/load:/')" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/icon.svg juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/icon.svg --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/icon.svg 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/lxd-profile.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/lxd-profile.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/lxd-profile.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/lxd-profile.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,19 @@ +description: lxd profile for testing +config: + security.nesting: "true" + security.privileged: "true" + linux.kernel_modules: openvswitch,nbd,ip_tables,ip6_tables + # boot.* keys are blacklisted by juju. + boot.autostart: "true" + limits.memory: 256mb +devices: + tun: + path: /dev/net/tun + type: unix-char + sony: + type: usb + vendorid: 0fce + productid: 51da + bdisk: + type: unix-disk + source: /dev/loop0 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,19 @@ +name: lxd-profile-fail +summary: Start a juju machine with a lxd profile, force flag required +maintainer: Juju QA +description: | + Run an Ubuntu system, with the given lxd-profile which contains a + blacklisted item. The force flag will be necessary to deploy. +provides: + ubuntu: + interface: ubuntu +extra-bindings: + another: +tags: + - misc + - application_development +subordinate: false +series: + - bionic + - xenial + - quantal diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/README juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/README --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/README 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/lxd-profile-fail/README 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,16 @@ +# Overview + +Just an Ubuntu image with not much else running, includes a failing lxd-profile.yaml for juju + +# Usage + +juju deploy lxd-profile-fail --force + +## Known Limitations and Issues + +It doesn't do much, but it does get you a machine you can play with, as quickly +as I could make it. The force flag is required to deploy this charm. + +# Configuration + +None diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +name: metered +summary: "A metered charm with custom metrics" +description: "" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metrics.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metrics.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metrics.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/metrics.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,10 @@ +plan: + required: true +metrics: + pings: + type: gauge + description: Description of the metric. + pongs: + type: gauge + description: Description of the metric. + juju-units: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,6 @@ +name: metered-multi-series +summary: "A metered charm with custom metrics" +description: "" +series: + - xenial + - trusty diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metrics.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metrics.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metrics.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/metrics.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,7 @@ +plan: + required: true +metrics: + pings: + type: gauge + description: Description of the metric. + juju-units: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/metered-multi-series/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +options: + title: {default: My Title, description: A descriptive title used for the application., type: string} + outlook: {description: No default outlook., type: string} + username: {default: admin001, description: The name of the initial account (given admin permissions)., type: string} + skill-level: {description: A number indicating skill., type: int} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,15 @@ +name: multi-series +summary: "That's a dummy charm with multi-series." +description: | + This is a longer description which + potentially contains multiple lines. +series: + - precise + - trusty + - xenial + - yakkety + - bionic +provides: + multi-directory: + interface: logging + scope: container diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +options: + title: {default: My Title, description: A descriptive title used for the application., type: string} + outlook: {description: No default outlook., type: string} + username: {default: admin001, description: The name of the initial account (given admin permissions)., type: string} + skill-level: {description: A number indicating skill., type: int} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/multi-series-subordinate/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,17 @@ +name: multi-series-subordinate +summary: "That's a dummy subordinate charm with multi-series." +description: | + This is a longer description which + potentially contains multiple lines. +subordinate: true +series: + - precise + - trusty + - yakkety +provides: + multi-client: + interface: logging +requires: + multi-directory: + interface: logging + scope: container diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/actions.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/actions.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/actions.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/actions.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +fakeaction: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/icon.svg juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/icon.svg --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/icon.svg 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,11 @@ +name: mysql +summary: "Database engine" +description: "A pretty popular database" +provides: + server: + interface: mysql + server-admin: + interface: mysql-root +requires: + metrics-client: + interface: metrics diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/actions.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/actions.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/actions.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/actions.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +fakeaction: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,10 @@ +name: mysql +summary: "Database engine" +description: "A pretty popular database" +provides: + server: mysql +storage: + data: + type: filesystem + logs: + type: filesystem diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/mysql-storage/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,11 @@ +name: riak +summary: "K/V storage engine" +description: "Scalable K/V Store in Erlang with Clocks :-)" +provides: + endpoint: + interface: http + admin: + interface: http +peers: + ring: + interface: riak diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/riak/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +7 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/config-changed juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/config-changed --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/config-changed 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/config-changed 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/hooks juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/hooks --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/hooks 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/hooks 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/bash + +# Do nothing! diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="install-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/update-status juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/update-status --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/update-status 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/hooks/update-status 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash + +RES_NAME="upload-resource" +RES_PATH=$(2>&1 resource-get $RES_NAME) +if [ $? -ne 0 ]; then + RES_GET_STDERR=$RES_PATH + status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR" + exit 0 +fi + +set -e + +status-set maintenance "path: $RES_PATH" +status-set maintenance $(cat $RES_PATH) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,19 @@ +name: starsay +summary: A dumb little test charm for resources. +maintainer: Nate Finch +description: Doesn't do anything at all. +tags: + - application +resources: + store-resource: + type: file + filename: filename.tgz + description: One line that is useful when operators need to push it. + install-resource: + type: file + filename: gotta-have-it.txt + description: get things started + upload-resource: + type: file + filename: somename.xml + description: Who uses xml anymore? diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/somename.xml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/somename.xml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/somename.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/starsay/somename.xml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +data diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Done!" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,13 @@ +name: storage-block +summary: A charm needing block storage +description: See above +storage: + data: + type: block + allecto: + type: block + multiple: + range: 0+ +series: + - trusty + - utopic diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-block/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Done!" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,11 @@ +name: storage-filesystem +summary: A charm needing filesystem storage +description: See above +storage: + data: + type: filesystem + read-only: true + multiple: + range: 1+ +series: + - xenial diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/storage-filesystem-multi-series/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +options: + title: {default: My Title, description: A descriptive title used for the application., type: string} + outlook: {description: No default outlook., type: string} + username: {default: admin001, description: The name of the initial account (given admin permissions)., type: string} + skill-level: {description: A number indicating skill., type: int} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Done!" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/.ignored juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/.ignored --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/.ignored 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/.ignored 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +# \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,6 @@ +name: terms1 +summary: "That's a dummy charm with terms." +description: | + This is a longer description which + potentially contains multiple lines. +terms: ["term1/1", "term3/1"] \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms1/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +options: + title: {default: My Title, description: A descriptive title used for the application., type: string} + outlook: {description: No default outlook., type: string} + username: {default: admin001, description: The name of the initial account (given admin permissions)., type: string} + skill-level: {description: A number indicating skill., type: int} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/hooks/install juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/hooks/install --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/hooks/install 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/hooks/install 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Done!" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/.ignored juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/.ignored --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/.ignored 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/.ignored 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +# \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,6 @@ +name: terms2 +summary: "This is a dummy charm with terms." +description: | + This is a longer description which + potentially contains multiple lines. +terms: ["term1/1", "term2/1"] diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/terms2/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +name: upgrade +summary: "Sample charm to test version changes" +description: | + Sample charm to test version changes. + This is the old charm. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade1/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +name: upgrade +summary: "Sample charm to test version changes" +description: | + Sample charm to test version changes. + This is the new charm. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/upgrade2/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +2 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,5 @@ +name: varnish +summary: "Database engine" +description: "Another popular database" +provides: + webcache: varnish diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/varnish/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +1 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/actions.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/actions.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/actions.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/actions.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +fakeaction: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +options: + blog-title: {default: My Title, description: A descriptive title used for the blog., type: string} + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,27 @@ +name: wordpress +summary: "Blog engine" +description: "A pretty popular blog engine" +provides: + url: + interface: http + limit: + optional: false + logging-dir: + interface: logging + scope: container + monitoring-port: + interface: monitoring + scope: container +requires: + db: + interface: mysql + limit: 1 + optional: false + cache: + interface: varnish + limit: 2 + optional: true +extra-bindings: + db-client: + admin-api: + foo-bar: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +3 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/config.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/config.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/config.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,3 @@ +options: + blog-title: {default: My Title, description: A descriptive title used for the blog., type: string} + diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/metadata.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/metadata.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/metadata.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/metadata.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,29 @@ +name: wordpress-extra-bindings +summary: "Blog engine" +description: "A pretty popular blog engine - NOW with extra-bindings!" +provides: + url: + interface: http + limit: + optional: false + logging-dir: + interface: logging + scope: container + monitoring-port: + interface: monitoring + scope: container +requires: + db: + interface: mysql + limit: 1 + optional: false + cache: + interface: varnish + limit: 2 + optional: true +peers: + cluster: wp-cluster +extra-bindings: + db-client: + admin-api: + foo-bar: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/revision juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/revision --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/revision 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bionic/wordpress-extra-bindings/revision 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +4 \ No newline at end of file diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,15 @@ +series: bionic +applications: + apache2: + charm: cs:apache2-26 + offers: + my-offer: + endpoints: + - apache-website + - website-cache + acl: + admin: admin + bar: consume + my-other-offer: + endpoints: + - apache-website diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/README.md juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/README.md --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/apache2-with-offers/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +A bundle installing apache2 and exposing two offers for its endpoints diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,6 @@ +services: + aws-integrator: + charm: cs:~containers/aws-integrator + num_units: 1 + options: + trust: true diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/README.md juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/README.md --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-conf-param/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +A bundle with a single application requiring trust via a config option diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,9 @@ +services: + aws-integrator: + charm: cs:~containers/aws-integrator + num_units: 1 + trust: true + gcp-integrator: + charm: cs:~containers/gcp-integrator + num_units: 1 + trust: true diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/README.md juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/README.md --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-multi/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +A bundle with a multiple applications requiring trust diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,8 @@ +services: + aws-integrator: + charm: cs:~containers/aws-integrator + num_units: 1 + trust: true + ubuntu-lite: + charm: cs:~jameinel/ubuntu-lite-7 + num_units: 1 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/README.md juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/README.md --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/aws-integrator-trust-single/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +A bundle with a single application requiring trust diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/gitlab/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/gitlab/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/gitlab/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/gitlab/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,4 @@ +services: + gitlab: + charm: cs:precise/gitlab-5 + num_units: 1 diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/bundle.yaml juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/bundle.yaml --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/bundle.yaml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/bundle.yaml 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,11 @@ +series: bionic +saas: + mysql: + url: test:admin/default.mysql +applications: + wordpress: + charm: wordpress + num_units: 1 +relations: +- - wordpress:db + - mysql:db diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/README.md juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/README.md --- juju-core-2.6.2/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testcharms/charm-repo/bundle/wordpress-with-saas/README.md 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1 @@ +A bundle installing wordpress and using the mysql SAAS as the data store diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testing/environ.go juju-core-2.6.5/src/github.com/juju/juju/testing/environ.go --- juju-core-2.6.2/src/github.com/juju/juju/testing/environ.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testing/environ.go 2019-06-28 17:10:43.000000000 +0000 @@ -47,8 +47,7 @@ "state-port": 1234, "api-port": 17777, "set-numa-control-policy": false, - "max-logs-age": "72h", - "max-logs-size": "4G", + "model-logs-size": "1M", "max-txn-log-size": "10M", "auditing-enabled": false, "audit-log-capture-args": true, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/testing/factory/factory.go juju-core-2.6.5/src/github.com/juju/juju/testing/factory/factory.go --- juju-core-2.6.2/src/github.com/juju/juju/testing/factory/factory.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/testing/factory/factory.go 2019-06-28 17:10:43.000000000 +0000 @@ -492,8 +492,14 @@ c.Assert(err, jc.ErrorIsNil) err = application.SetPassword(params.Password) c.Assert(err, jc.ErrorIsNil) - err = application.SetScale(params.DesiredScale) + + model, err := factory.st.Model() c.Assert(err, jc.ErrorIsNil) + isCAAS := model.Type() == state.ModelTypeCAAS + if isCAAS { + err = application.SetScale(params.DesiredScale, 0, true) + c.Assert(err, jc.ErrorIsNil) + } if params.Status != nil { now := time.Now() @@ -507,10 +513,7 @@ c.Assert(err, jc.ErrorIsNil) } - model, err := factory.st.Model() - c.Assert(err, jc.ErrorIsNil) - - if model.Type() == state.ModelTypeCAAS { + if isCAAS { agentTools := version.Binary{ Number: jujuversion.Current, Arch: arch.HostArch(), @@ -720,7 +723,7 @@ if params.CloudName == "" { params.CloudName = "dummy" } - if params.CloudRegion == "" { + if params.CloudRegion == "" && params.CloudName == "dummy" { params.CloudRegion = "dummy-region" } if params.CloudRegion == "" { @@ -774,7 +777,6 @@ params = &ModelParams{} } params.Type = state.ModelTypeCAAS - params.CloudRegion = "" if params.Owner == nil { origEnv, err := factory.st.Model() c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/backend.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/backend.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/backend.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/backend.go 2019-06-28 17:10:43.000000000 +0000 @@ -63,6 +63,8 @@ EnsureDefaultModificationStatus() error EnsureApplicationDeviceConstraints() error RemoveInstanceCharmProfileDataCollection() error + UpdateK8sModelNameIndex() error + AddModelLogsSize() error } // Model is an interface providing access to the details of a model within the @@ -244,3 +246,11 @@ func (s stateBackend) RemoveInstanceCharmProfileDataCollection() error { return state.RemoveInstanceCharmProfileDataCollection(s.pool) } + +func (s stateBackend) UpdateK8sModelNameIndex() error { + return state.UpdateK8sModelNameIndex(s.pool) +} + +func (s stateBackend) AddModelLogsSize() error { + return state.AddModelLogsSize(s.pool) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/contexts.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/contexts.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/contexts.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/contexts.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,17 +6,14 @@ import ( "github.com/juju/juju/agent" "github.com/juju/juju/api" + "github.com/juju/juju/api/base" ) // Context provides the dependencies used when executing upgrade steps. type Context interface { - // APIState returns an API connection to state. - // - // TODO(mjs) - for 2.0, this should return a base.APICaller - // instead of api.Connection once the 1.x upgrade steps have been - // removed. Upgrade steps should not be able close the API - // connection. - APIState() api.Connection + // APIState returns an base APICaller to help make + // an API connection to state. + APIState() base.APICaller // State returns a connection to state. This will be non-nil // only in the context of a controller. @@ -58,7 +55,7 @@ // APIState is defined on the Context interface. // // This will panic if called on a Context returned by StateContext. -func (c *upgradeContext) APIState() api.Connection { +func (c *upgradeContext) APIState() base.APICaller { if c.api == nil { panic("API not available from this context") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/operations.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/operations.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/operations.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/operations.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,6 +36,8 @@ upgradeToVersion{version.MustParse("2.5.3"), stateStepsFor253()}, upgradeToVersion{version.MustParse("2.5.4"), stateStepsFor254()}, upgradeToVersion{version.MustParse("2.6.0"), stateStepsFor26()}, + upgradeToVersion{version.MustParse("2.6.3"), stateStepsFor263()}, + upgradeToVersion{version.MustParse("2.6.5"), stateStepsFor265()}, } return steps } @@ -49,6 +51,7 @@ upgradeToVersion{version.MustParse("2.2.0"), stepsFor22()}, upgradeToVersion{version.MustParse("2.4.0"), stepsFor24()}, upgradeToVersion{version.MustParse("2.4.5"), stepsFor245()}, + upgradeToVersion{version.MustParse("2.6.3"), stepsFor263()}, } return steps } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_263.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_263.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_263.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_263.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades + +import ( + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/upgradesteps" +) + +// stepsFor263 returns upgrade steps for Juju 2.6.3. +func stepsFor263() []Step { + return []Step{ + &upgradeStep{ + description: "reset kvm machine modification status to idle", + targets: []Target{AllMachines}, + run: resetKVMMachineModificationStatusIdle, + }, + } +} + +func resetKVMMachineModificationStatusIdle(context Context) error { + tag := context.AgentConfig().Tag() + if !names.IsContainerMachine(tag.Id()) { + // Skip if not a container, work to be done only on KVM + // machines. + return nil + } + client := upgradesteps.NewClient(context.APIState()) + return client.ResetKVMMachineModificationStatusIdle(tag) +} + +// stateStepsFor263 returns upgrade steps for Juju 2.6.3. +func stateStepsFor263() []Step { + return []Step{ + &upgradeStep{ + description: "update model name index of k8s models", + targets: []Target{DatabaseMaster}, + run: func(context Context) error { + return context.State().UpdateK8sModelNameIndex() + }, + }, + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_263_test.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_263_test.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_263_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_263_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades_test + +import ( + jc "github.com/juju/testing/checkers" + "github.com/juju/version" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/testing" + "github.com/juju/juju/upgrades" +) + +var v263 = version.MustParse("2.6.3") + +type steps263Suite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&steps263Suite{}) + +func (s *steps263Suite) TestResetKVMMachineModificationStatusIdle(c *gc.C) { + step := findStep(c, v263, "reset kvm machine modification status to idle") + c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.AllMachines}) +} + +func (s *steps263Suite) TestUpdateK8sModelNameIndex(c *gc.C) { + step := findStateStep(c, v263, `update model name index of k8s models`) + // Logic for step itself is tested in state package. + c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster}) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_265.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_265.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_265.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_265.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,17 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades + +// stateStepsFor265 returns upgrade steps for Juju 2.6.5. +func stateStepsFor265() []Step { + return []Step{ + &upgradeStep{ + description: "add models-logs-size to controller config", + targets: []Target{DatabaseMaster}, + run: func(context Context) error { + return context.State().AddModelLogsSize() + }, + }, + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_265_test.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_265_test.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/steps_265_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/steps_265_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades_test + +import ( + jc "github.com/juju/testing/checkers" + "github.com/juju/version" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/testing" + "github.com/juju/juju/upgrades" +) + +var v265 = version.MustParse("2.6.5") + +type steps265Suite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&steps265Suite{}) + +func (s *steps265Suite) TestAddModelLogsSize(c *gc.C) { + step := findStateStep(c, v265, "add models-logs-size to controller config") + // Logic for step itself is tested in state package. + c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster}) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/upgrades/upgrade_test.go juju-core-2.6.5/src/github.com/juju/juju/upgrades/upgrade_test.go --- juju-core-2.6.2/src/github.com/juju/juju/upgrades/upgrade_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/upgrades/upgrade_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,6 +18,7 @@ "github.com/juju/juju/agent" "github.com/juju/juju/api" + "github.com/juju/juju/api/base" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/environs" "github.com/juju/juju/environs/config" @@ -132,7 +133,7 @@ state upgrades.StateBackend } -func (c *mockContext) APIState() api.Connection { +func (c *mockContext) APIState() base.APICaller { return c.apiState } @@ -652,13 +653,15 @@ "2.5.3", "2.5.4", "2.6.0", + "2.6.3", + "2.6.5", }) } func (s *upgradeSuite) TestUpgradeOperationsVersions(c *gc.C) { versions := extractUpgradeVersions(c, (*upgrades.UpgradeOperations)()) c.Assert(versions, gc.DeepEquals, []string{ - "2.0.0", "2.2.0", "2.4.0", "2.4.5", + "2.0.0", "2.2.0", "2.4.0", "2.4.5", "2.6.3", }) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/README.md juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/README.md --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/README.md 2019-06-28 17:11:28.000000000 +0000 @@ -0,0 +1,64 @@ +# Go JSON Schema Reflection + +This package can be used to generate [JSON Schemas](http://json-schema.org/latest/json-schema-validation.html) from Go types through reflection. + +It supports arbitrarily complex types, including `interface{}`, maps, slices, etc. + +## Example + +The following Go type: + +```go +type TestUser struct { + ID int `json:"id"` + Name string `json:"name"` + Friends []int `json:"friends,omitempty"` + Tags map[string]interface{} `json:"tags,omitempty"` + BirthDate time.Time `json:"birth_date,omitempty"` +} +``` + +Results in this JSON Schema: + +```json +{ + "$ref": "#/definitions/TestUser", + "definitions": { + "TestUser": { + "type": "object", + "properties": { + "birth_date": { + "type": "string", + "format": "date-time" + }, + "friends": { + "type": "array", + "items": { + "type": "integer" + } + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "name" + ] + } + } +} +``` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect.go 2019-06-28 17:11:28.000000000 +0000 @@ -0,0 +1,222 @@ +// Package jsonschema uses reflection to generate JSON Schemas from Go types [1]. +// +// If json tags are present on struct fields, they will be used to infer +// property names and if a property is required (omitempty is present). +// +// [1] http://json-schema.org/latest/json-schema-validation.html +package jsonschema + +import ( + "encoding/json" + "fmt" + "net" + "net/url" + "os" + "reflect" + "strings" + "time" + + "github.com/juju/juju/rpc/rpcreflect" +) + +var ( + timeType = reflect.TypeOf(time.Time{}) + ipType = reflect.TypeOf(net.IP{}) + urlType = reflect.TypeOf(url.URL{}) + objType = reflect.TypeOf(rpcreflect.ObjType{}) +) + +type Type struct { + Type string `json:"type,omitempty"` + Format string `json:"format,omitempty"` + Items *Type `json:"items,omitempty"` + Properties map[string]*Type `json:"properties,omitempty"` + PatternProperties map[string]*Type `json:"patternProperties,omitempty"` + AdditionalProperties json.RawMessage `json:"additionalProperties,omitempty"` + Ref string `json:"$ref,omitempty"` + Required []string `json:"required,omitempty"` + MaxLength int `json:"maxLength,omitempty"` + MinLength int `json:"minLength,omitempty"` + Pattern string `json:"pattern,omitempty"` + Enum []interface{} `json:"enum,omitempty"` + Default interface{} `json:"default,omitempty"` + Title string `json:"title,omitempty"` + Description string `json:"description,omitempty"` +} + +type Schema struct { + *Type + Definitions Definitions `json:"definitions,omitempty"` +} + +// Reflect a Schema from a value. +func Reflect(v interface{}) *Schema { + return ReflectFromType(reflect.TypeOf(v)) +} + +func ReflectFromType(t reflect.Type) *Schema { + definitions := Definitions{} + s := &Schema{ + Type: reflectTypeToSchema(definitions, t), + Definitions: definitions, + } + return s +} + +// rpcreflect is itself a description so we provide additional handling here +func ReflectFromObjType(objtype *rpcreflect.ObjType) *Schema { + definitions := Definitions{} + s := &Schema{ + Definitions: definitions, + } + + methodNames := objtype.MethodNames() + props := make(map[string]*Type, len(methodNames)) + for _, n := range methodNames { + method, err := objtype.Method(n) + if err == nil { + callmap := make(map[string]*Type) + if method.Params != nil { + callmap["Params"] = reflectTypeToSchema(definitions, method.Params) + } + if method.Result != nil { + callmap["Result"] = reflectTypeToSchema(definitions, method.Result) + } + + props[n] = &Type{ + Type: "object", + Properties: callmap, + } + } + } + + s.Type = &Type{ + Type: "object", + Properties: props, + } + return s +} + +type Definitions map[string]*Type + +func reflectTypeToSchema(definitions Definitions, t reflect.Type) *Type { + if _, ok := definitions[t.Name()]; ok { + return &Type{Ref: "#/definitions/" + t.Name()} + } + + switch t.Kind() { + case reflect.Struct: + switch t { + case timeType: + return &Type{Type: "string", Format: "date-time"} + + case ipType: + return &Type{Type: "string", Format: "ipv4"} + + case urlType: + return &Type{Type: "string", Format: "uri"} + + default: + return reflectStruct(definitions, t) + } + + case reflect.Map: + rt := &Type{ + Type: "object", + PatternProperties: map[string]*Type{ + ".*": reflectTypeToSchema(definitions, t.Elem()), + }, + } + delete(rt.PatternProperties, "additionalProperties") + return rt + + case reflect.Array, reflect.Slice: + return &Type{ + Type: "array", + Items: reflectTypeToSchema(definitions, t.Elem()), + } + + case reflect.Interface: + return &Type{ + Type: "object", + AdditionalProperties: []byte("true"), + } + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return &Type{Type: "integer"} + + case reflect.Float32, reflect.Float64: + return &Type{Type: "number"} + + case reflect.Bool: + return &Type{Type: "boolean"} + + case reflect.String: + return &Type{Type: "string"} + + case reflect.Ptr: + return reflectTypeToSchema(definitions, t.Elem()) + } + + fmt.Fprintf(os.Stderr, "Unsupported Type %s", t.String()) + return nil +} + +func reflectStruct(definitions Definitions, t reflect.Type) *Type { + st := &Type{ + Type: "object", + Properties: map[string]*Type{}, + AdditionalProperties: []byte("false"), + } + definitions[t.Name()] = st + reflectStructFields(st, definitions, t) + + return &Type{Ref: "#/definitions/" + t.Name()} +} + +func reflectStructFields(st *Type, definitions Definitions, t reflect.Type) { + if t.Kind() == reflect.Ptr { + t = t.Elem() + } + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + // anonymous and exported type should be processed recursively + // current type should inherit properties of anonymous one + //if f.Anonymous && f.PkgPath == "" { + // reflectStructFields(st, definitions, f.Type) + // continue + //} + + name, required := reflectFieldName(f) + if name == "" { + continue + } + st.Properties[name] = reflectTypeToSchema(definitions, f.Type) + if required { + st.Required = append(st.Required, name) + } + } +} + +func reflectFieldName(f reflect.StructField) (string, bool) { + if f.PkgPath != "" { // unexported field, ignore it + return "", false + } + parts := strings.Split(f.Tag.Get("json"), ",") + if parts[0] == "-" { + return "", false + } + + name := f.Name + required := true + + if parts[0] != "" { + name = parts[0] + } + + if len(parts) > 1 && parts[1] == "omitempty" { + required = false + } + return name, required +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/bcsaller/jsonschema/reflect_test.go 2019-06-28 17:11:28.000000000 +0000 @@ -0,0 +1,78 @@ +package jsonschema + +import ( + "testing" + "time" +) + +type GrandfatherType struct { + FamilyName string `json:"family_name"` +} + +type SomeBaseType struct { + SomeBaseProperty int `json:"some_base_property"` + somePrivateBaseProperty string `json:"i_am_private"` + SomeIgnoredBaseProperty string `json:"-"` + Grandfather GrandfatherType `json:"grand"` + + SomeUntaggedBaseProperty bool + someUnexportedUntaggedBaseProperty bool +} + +type nonExported struct { + PublicNonExported int + privateNonExported int +} + +type TestUser struct { + SomeBaseType + nonExported + + ID int `json:"id"` + Name string `json:"name"` + Friends []int `json:"friends,omitempty"` + Tags map[string]interface{} `json:"tags,omitempty"` + BirthDate time.Time `json:"birth_date,omitempty"` + + TestFlag bool + IgnoredCounter int `json:"-"` +} + +// TestSchemaGeneration checks if schema generated correctly: +// - fields marked with "-" are ignored +// - non-exported fields are ignored +// - anonymous fields are expanded +func TestSchemaGeneration(t *testing.T) { + s := Reflect(&TestUser{}) + + expectedProperties := map[string]string{ + "id": "integer", + "name": "string", + "friends": "array", + "tags": "object", + "birth_date": "string", + "TestFlag": "boolean", + "some_base_property": "integer", + "grand": "#/definitions/GrandfatherType", + "SomeUntaggedBaseProperty": "boolean", + } + + props := s.Definitions["TestUser"].Properties + for defKey, prop := range props { + typeOrRef, ok := expectedProperties[defKey] + if !ok { + t.Fatalf("unexpected property '%s'", defKey) + } + if prop.Type != "" && prop.Type != typeOrRef { + t.Fatalf("expected property type '%s', got '%s' for property '%s'", typeOrRef, prop.Type, defKey) + } else if prop.Ref != "" && prop.Ref != typeOrRef { + t.Fatalf("expected reference to '%s', got '%s' for property '%s'", typeOrRef, prop.Ref, defKey) + } + } + + for defKey := range expectedProperties { + if _, ok := props[defKey]; !ok { + t.Fatalf("expected property missing '%s'", defKey) + } + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes.go 2019-05-14 17:32:12.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes.go 2019-06-28 17:11:12.000000000 +0000 @@ -5,6 +5,7 @@ import ( "fmt" + "strings" "github.com/juju/collections/set" "github.com/juju/errors" @@ -64,6 +65,7 @@ if resolver.bundle.Type != kubernetes { addedMachines = resolver.handleMachines() } + addedApplications = resolver.handleOffers(addedApplications) resolver.handleRelations(addedApplications) if resolver.bundle.Type != kubernetes { err := resolver.handleUnits(addedApplications, addedMachines) @@ -716,6 +718,116 @@ Constraints string } +// CreateOfferChange holds a change for creating a new application endpoint offer. +type CreateOfferChange struct { + changeInfo + // Params holds parameters for creating an offer. + Params CreateOfferParams +} + +// newCreateOfferChange creates a new change for creating an offer. +func newCreateOfferChange(params CreateOfferParams, requires ...string) *CreateOfferChange { + return &CreateOfferChange{ + changeInfo: changeInfo{ + requires: requires, + method: "createOffer", + }, + Params: params, + } +} + +// GUIArgs implements Change.GUIArgs. +func (ch *CreateOfferChange) GUIArgs() []interface{} { + return []interface{}{ch.Params.Application, ch.Params.Endpoints, ch.Params.OfferName} +} + +// Description implements Change. +func (ch *CreateOfferChange) Description() string { + return fmt.Sprintf("create offer %s using %s:%s", ch.Params.OfferName, ch.Params.Application, strings.Join(ch.Params.Endpoints, ",")) +} + +// CreateOfferParams holds parameters for creating an application offer. +type CreateOfferParams struct { + // Application is the name of the application to create an offer for. + Application string + // Endpoint is a list of application endpoint to expose as part of an offer. + Endpoints []string + // OfferName describes the offer name. + OfferName string +} + +// ConsumeOfferChange holds a change for consuming a offer. +type ConsumeOfferChange struct { + changeInfo + // Params holds the parameters for consuming an offer. + Params ConsumeOfferParams +} + +func newConsumeOfferChange(params ConsumeOfferParams, requires ...string) *ConsumeOfferChange { + return &ConsumeOfferChange{ + changeInfo: changeInfo{ + requires: requires, + method: "consumeOffer", + }, + Params: params, + } +} + +// GUIArgs implements Change.GUIArgs. +func (ch *ConsumeOfferChange) GUIArgs() []interface{} { + return []interface{}{ch.Params.URL, ch.Params.ApplicationName} +} + +// Description implements Change. +func (ch *ConsumeOfferChange) Description() string { + return fmt.Sprintf("consume offer %s at %s", ch.Params.ApplicationName, ch.Params.URL) +} + +// ConsumeOfferParams holds the parameters for consuming an offer. +type ConsumeOfferParams struct { + // URL contains the location of the offer + URL string + // ApplicationName describes the application name on offer. + ApplicationName string +} + +// GrantOfferAccessChange holds a change for granting a user access to an offer. +type GrantOfferAccessChange struct { + changeInfo + // Params holds the parameters for the grant. + Params GrantOfferAccessParams +} + +func newGrantOfferAccessChange(params GrantOfferAccessParams, requires ...string) *GrantOfferAccessChange { + return &GrantOfferAccessChange{ + changeInfo: changeInfo{ + requires: requires, + method: "grantOfferAccess", + }, + Params: params, + } +} + +// GUIArgs implements Change.GUIArgs. +func (ch *GrantOfferAccessChange) GUIArgs() []interface{} { + return []interface{}{ch.Params.User, ch.Params.Access, ch.Params.Offer} +} + +// Description implements Change. +func (ch *GrantOfferAccessChange) Description() string { + return fmt.Sprintf("grant user %s %s access to offer %s", ch.Params.User, ch.Params.Access, ch.Params.Offer) +} + +// GrantOfferAccessParams holds the parameters for granting access to a user. +type GrantOfferAccessParams struct { + // User holds the user name to grant access to. + User string + // The type of access to grant. + Access string + // The offer name to be granted access to. + Offer string +} + // changeset holds the list of changes returned by FromData. type changeset struct { changes []Change diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes_test.go 2019-05-14 17:32:12.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes_test.go 2019-06-28 17:11:12.000000000 +0000 @@ -198,6 +198,216 @@ s.assertParseDataWithDevices(c, content, expected) } +func (s *changesSuite) TestMinimalBundleWithOffer(c *gc.C) { + content := ` +saas: + keystone: + url: production:admin/info.keystone +applications: + apache2: + charm: "cs:apache2-26" + offers: + offer1: + endpoints: + - "apache-website" + - "apache-proxy" + ` + expected := []record{ + { + Id: "addCharm-0", + Method: "addCharm", + Params: bundlechanges.AddCharmParams{ + Charm: "cs:apache2-26", + }, + GUIArgs: []interface{}{"cs:apache2-26", ""}, + }, + { + Id: "deploy-1", + Method: "deploy", + Params: bundlechanges.AddApplicationParams{ + Charm: "$addCharm-0", + Application: "apache2", + }, + GUIArgs: []interface{}{ + "$addCharm-0", + "", + "apache2", + map[string]interface{}{}, + "", + map[string]string{}, + map[string]string{}, + map[string]int{}, + 0, + }, + Requires: []string{"addCharm-0"}, + }, + { + Id: "consumeOffer-2", + Method: "consumeOffer", + Params: bundlechanges.ConsumeOfferParams{ + URL: "production:admin/info.keystone", + ApplicationName: "keystone", + }, + GUIArgs: []interface{}{"production:admin/info.keystone", "keystone"}, + Requires: []string{}, + }, + { + Id: "createOffer-3", + Method: "createOffer", + Params: bundlechanges.CreateOfferParams{ + Application: "apache2", + Endpoints: []string{ + "apache-website", + "apache-proxy", + }, + OfferName: "offer1", + }, + GUIArgs: []interface{}{"apache2", []string{"apache-website", "apache-proxy"}, "offer1"}, + Requires: []string{"deploy-1"}, + }, + } + + s.assertParseData(c, content, expected) +} + +func (s *changesSuite) TestMinimalBundleWithOfferACL(c *gc.C) { + content := ` +applications: + apache2: + charm: "cs:apache2-26" + offers: + offer1: + endpoints: + - "apache-website" + - "apache-proxy" + acl: + foo: consume + ` + expected := []record{ + { + Id: "addCharm-0", + Method: "addCharm", + Params: bundlechanges.AddCharmParams{ + Charm: "cs:apache2-26", + }, + GUIArgs: []interface{}{"cs:apache2-26", ""}, + }, + { + Id: "deploy-1", + Method: "deploy", + Params: bundlechanges.AddApplicationParams{ + Charm: "$addCharm-0", + Application: "apache2", + }, + GUIArgs: []interface{}{ + "$addCharm-0", + "", + "apache2", + map[string]interface{}{}, + "", + map[string]string{}, + map[string]string{}, + map[string]int{}, + 0, + }, + Requires: []string{"addCharm-0"}, + }, + { + Id: "createOffer-2", + Method: "createOffer", + Params: bundlechanges.CreateOfferParams{ + Application: "apache2", + Endpoints: []string{ + "apache-website", + "apache-proxy", + }, + OfferName: "offer1", + }, + GUIArgs: []interface{}{"apache2", []string{"apache-website", "apache-proxy"}, "offer1"}, + Requires: []string{"deploy-1"}, + }, + { + Id: "grantOfferAccess-3", + Method: "grantOfferAccess", + Params: bundlechanges.GrantOfferAccessParams{ + User: "foo", + Access: "consume", + Offer: "offer1", + }, + GUIArgs: []interface{}{"foo", "consume", "offer1"}, + Requires: []string{"createOffer-2"}, + }, + } + + s.assertParseData(c, content, expected) +} + +func (s *changesSuite) TestMinimalBundleWithOfferAndRelations(c *gc.C) { + content := ` +saas: + mysql: + url: production:admin/info.mysql +applications: + apache2: + charm: "cs:apache2-26" +relations: +- - apache2:db + - mysql:db + ` + expected := []record{ + { + Id: "addCharm-0", + Method: "addCharm", + Params: bundlechanges.AddCharmParams{ + Charm: "cs:apache2-26", + }, + GUIArgs: []interface{}{"cs:apache2-26", ""}, + }, + { + Id: "deploy-1", + Method: "deploy", + Params: bundlechanges.AddApplicationParams{ + Charm: "$addCharm-0", + Application: "apache2", + }, + GUIArgs: []interface{}{ + "$addCharm-0", + "", + "apache2", + map[string]interface{}{}, + "", + map[string]string{}, + map[string]string{}, + map[string]int{}, + 0, + }, + Requires: []string{"addCharm-0"}, + }, + { + Id: "consumeOffer-2", + Method: "consumeOffer", + Params: bundlechanges.ConsumeOfferParams{ + URL: "production:admin/info.mysql", + ApplicationName: "mysql", + }, + GUIArgs: []interface{}{"production:admin/info.mysql", "mysql"}, + Requires: []string{}, + }, + { + Id: "addRelation-3", + Method: "addRelation", + Params: bundlechanges.AddRelationParams{ + Endpoint1: "$deploy-1:db", + Endpoint2: "$consumeOffer-2:db", + }, + GUIArgs: []interface{}{"$deploy-1:db", "$consumeOffer-2:db"}, + Requires: []string{"deploy-1", "consumeOffer-2"}, + }, + } + + s.assertParseData(c, content, expected) +} + func (s *changesSuite) TestSimpleBundle(c *gc.C) { content := ` applications: diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/dependencies.tsv juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/dependencies.tsv --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/dependencies.tsv 2019-05-14 17:32:12.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/dependencies.tsv 2019-06-28 17:11:12.000000000 +0000 @@ -1,3 +1,4 @@ +github.com/gobwas/glob git e7a84e9525fe90abcda167b604e483cc959ad4aa 2018-10-02T19:08:08Z github.com/juju/collections git 520e0549d51ae2b50f44f4df2b145a780a5bc6e0 2018-05-15T20:37:31Z github.com/juju/errors git 1b5e39b83d1835fa480e0c2ddefb040ee82d58b3 2015-09-16T12:56:42Z github.com/juju/gojsonpointer git afe8b77aa08f272b49e01b82de78510c11f61500 2015-02-04T19:46:29Z @@ -7,6 +8,7 @@ github.com/juju/httprequest git 266fd1e9debf09c037a63f074d099a2da4559ece 2016-10-06T15:09:09Z github.com/juju/loggo git 8232ab8918d91c72af1a9fb94d3edbe31d88b790 2017-06-05T01:46:07Z github.com/juju/naturalsort git 5b81707e882b8293e6cf77854b4cd49f29776e11 2018-04-23T03:48:42Z +github.com/juju/os git 0ffd1641ec10b98d99eabb23729a2156244da119 2018-11-02T05:00:08Z github.com/juju/retry git 62c62032529169c7ec02fa48f93349604c345e1f 2015-10-29T02:48:21Z github.com/juju/schema git 075de04f9b7d7580d60a1e12a0b3f50bb18e6998 2016-04-20T04:42:03Z github.com/juju/testing git 44801989f0f7f280bd16b58e898ba9337807f147 2018-04-02T13:06:37Z @@ -19,10 +21,12 @@ github.com/rogpeppe/fastuuid git 6724a57986aff9bff1a1770e9347036def7c89f6 2015-01-06T09:32:20Z golang.org/x/crypto git 650f4a345ab4e5b245a3034b110ebc7299e68186 2018-02-14T00:00:28Z golang.org/x/net git 61147c48b25b599e5b561d2e9c4f3e1ef489ca41 2018-04-06T21:48:16Z +golang.org/x/sys git afcc84fd7533758f95a6e93ae710aa945a0b7e73 2019-02-01T15:26:29Z gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z gopkg.in/errgo.v1 git 442357a80af5c6bf9b6d51ae791a39c3421004f3 2016-12-22T12:58:16Z +gopkg.in/gobwas/glob.v0 git 5ccd90ef52e1e632236f7326478d4faa74f99438 2018-02-08T21:06:56Z gopkg.in/httprequest.v1 git 1a21782420ea13c3c6fb1d03578f446b3248edb1 2018-03-08T16:26:44Z -gopkg.in/juju/charm.v6 git 3469d139dfb3c189a92bebb42f7075fac4bba707 2018-11-07T03:25:05Z +gopkg.in/juju/charm.v6 git 52b617a34c5a360391bb84d0e7fe40912141ff17 2019-06-27T11:32:48Z gopkg.in/juju/charmrepo.v2 git 653bbd81990d2d7d48e0fb931a3b0f52c694572f 2017-11-14T18:40:45Z gopkg.in/juju/names.v2 git c43e8bdf2f4915a7019a2f8ad561af1498731a21 2018-05-16T01:04:14Z gopkg.in/macaroon-bakery.v1 git 469b44e6f1f9479e115c8ae879ef80695be624d5 2016-06-22T12:14:21Z diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go 2019-05-14 17:32:12.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go 2019-06-28 17:11:12.000000000 +0000 @@ -309,6 +309,43 @@ } } +// handleOffers populates the change set with "CreateOffer" records. +// ensure we pass back handle offers so that if the map resizes we don't lose +// applications +func (r *resolver) handleOffers(addedApplications map[string]string) map[string]string { + // the bundle should have been verified before calling handling of types + // as saas applications will stamp on existing applications with the same + // name. + for name, saasSpec := range r.bundle.Saas { + change := newConsumeOfferChange(ConsumeOfferParams{ + URL: saasSpec.URL, + ApplicationName: name, + }) + r.changes.add(change) + addedApplications[name] = change.Id() + } + + for appName, appSpec := range r.bundle.Applications { + for offerName, offerSpec := range appSpec.Offers { + change := newCreateOfferChange(CreateOfferParams{ + Application: appName, + Endpoints: offerSpec.Endpoints, + OfferName: offerName, + }, addedApplications[appName]) + r.changes.add(change) + + for user, access := range offerSpec.ACL { + r.changes.add(newGrantOfferAccessChange(GrantOfferAccessParams{ + User: user, + Access: access, + Offer: offerName, + }, change.Id())) + } + } + } + return addedApplications +} + type unitProcessor struct { add func(Change) existing *Model diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/application.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/application.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/application.go 2019-05-14 17:31:07.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/application.go 2019-06-28 17:11:06.000000000 +0000 @@ -59,6 +59,9 @@ Tools() AgentTools SetTools(AgentToolsArgs) + Offers() []ApplicationOffer + AddOffer(ApplicationOfferArgs) ApplicationOffer + Validate() error } @@ -113,6 +116,9 @@ CloudService_ *cloudService `yaml:"cloud-service,omitempty"` Tools_ *agentTools `yaml:"tools,omitempty"` OperatorStatus_ *status `yaml:"operator-status,omitempty"` + + // Offer-related fields + Offers_ *applicationOffers `yaml:"offers,omitempty"` } // ApplicationArgs is an argument struct used to add an application to the Model. @@ -420,6 +426,39 @@ a.Tools_ = newAgentTools(args) } +// Offers implements Application. +func (a *application) Offers() []ApplicationOffer { + if a.Offers_ == nil || len(a.Offers_.Offers) == 0 { + return nil + } + + res := make([]ApplicationOffer, len(a.Offers_.Offers)) + for i, offer := range a.Offers_.Offers { + res[i] = offer + } + return res +} + +// AddOffer implements Application. +func (a *application) AddOffer(args ApplicationOfferArgs) ApplicationOffer { + if a.Offers_ == nil { + a.Offers_ = &applicationOffers{ + Version: 1, + } + } + + offer := newApplicationOffer(args) + a.Offers_.Offers = append(a.Offers_.Offers, offer) + return offer +} + +func (a *application) setOffers(offers []*applicationOffer) { + a.Offers_ = &applicationOffers{ + Version: 1, + Offers: offers, + } +} + // Validate implements Application. func (a *application) Validate() error { if a.Name_ == "" { @@ -497,6 +536,7 @@ 2: importApplicationV2, 3: importApplicationV3, 4: importApplicationV4, + 5: importApplicationV5, } func applicationV1Fields() (schema.Fields, schema.Defaults) { @@ -569,6 +609,13 @@ return fields, defaults } +func applicationV5Fields() (schema.Fields, schema.Defaults) { + fields, defaults := applicationV4Fields() + fields["offers"] = schema.StringMap(schema.Any()) + defaults["offers"] = schema.Omit + return fields, defaults +} + func importApplicationV1(source map[string]interface{}) (*application, error) { fields, defaults := applicationV1Fields() return importApplication(fields, defaults, 1, source) @@ -589,6 +636,11 @@ return importApplication(fields, defaults, 4, source) } +func importApplicationV5(source map[string]interface{}) (*application, error) { + fields, defaults := applicationV5Fields() + return importApplication(fields, defaults, 5, source) +} + func importApplication(fields schema.Fields, defaults schema.Defaults, importVersion int, source map[string]interface{}) (*application, error) { checker := schema.FieldMap(fields, defaults) @@ -636,6 +688,15 @@ result.OperatorStatus_ = status } } + if importVersion >= 5 { + if offerMap, ok := valid["offers"]; ok { + offers, err := importApplicationOffers(offerMap.(map[string]interface{})) + if err != nil { + return nil, errors.Trace(err) + } + result.setOffers(offers) + } + } result.importAnnotations(valid) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer.go 2019-06-28 17:11:06.000000000 +0000 @@ -0,0 +1,136 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package description + +import ( + "github.com/juju/errors" + "github.com/juju/schema" +) + +// ApplicationOffer represents an offer for a an application's endpoints. +type ApplicationOffer interface { + OfferName() string + Endpoints() []string + ACL() map[string]string +} + +var _ ApplicationOffer = (*applicationOffer)(nil) + +type applicationOffers struct { + Version int `yaml:"version"` + Offers []*applicationOffer `yaml:"offers,omitempty"` +} + +type applicationOffer struct { + OfferName_ string `yaml:"offer-name"` + Endpoints_ []string `yaml:"endpoints,omitempty"` + ACL_ map[string]string `yaml:"acl,omitempty"` +} + +// OfferName implements ApplicationOffer. +func (o *applicationOffer) OfferName() string { + return o.OfferName_ +} + +// Endpoints implements ApplicationOffer. +func (o *applicationOffer) Endpoints() []string { + return o.Endpoints_ +} + +// ACL implements ApplicationOffer. It returns a map were keys are users and +// values are access permissions. +func (o *applicationOffer) ACL() map[string]string { + return o.ACL_ +} + +// ApplicationOfferArgs is an argument struct used to instanciate a new +// applicationOffer instance that implements ApplicationOffer. +type ApplicationOfferArgs struct { + OfferName string + Endpoints []string + ACL map[string]string +} + +func newApplicationOffer(args ApplicationOfferArgs) *applicationOffer { + return &applicationOffer{ + OfferName_: args.OfferName, + Endpoints_: args.Endpoints, + ACL_: args.ACL, + } +} + +func importApplicationOffers(source map[string]interface{}) ([]*applicationOffer, error) { + checker := versionedChecker("offers") + coerced, err := checker.Coerce(source, nil) + if err != nil { + return nil, errors.Annotatef(err, "offers version schema check failed") + } + valid := coerced.(map[string]interface{}) + + version := int(valid["version"].(int64)) + importFunc, ok := applicationOfferDeserializationFuncs[version] + if !ok { + return nil, errors.NotValidf("version %d", version) + } + + sourceList := valid["offers"].([]interface{}) + return importApplicationOfferList(sourceList, importFunc) +} + +func importApplicationOfferList(sourceList []interface{}, importFunc applicationOfferDeserializationFunc) ([]*applicationOffer, error) { + result := make([]*applicationOffer, 0, len(sourceList)) + + for i, value := range sourceList { + source, ok := value.(map[string]interface{}) + if !ok { + return nil, errors.Errorf("unexpected value for application offer %d, %T", i, value) + } + + offer, err := importFunc(source) + if err != nil { + return nil, errors.Annotatef(err, "application offer %d", i) + } + result = append(result, offer) + } + return result, nil +} + +type applicationOfferDeserializationFunc func(interface{}) (*applicationOffer, error) + +var applicationOfferDeserializationFuncs = map[int]applicationOfferDeserializationFunc{ + 1: importApplicationOfferV1, +} + +func importApplicationOfferV1(source interface{}) (*applicationOffer, error) { + fields := schema.Fields{ + "offer-name": schema.String(), + "endpoints": schema.List(schema.String()), + "acl": schema.Map(schema.String(), schema.String()), + } + checker := schema.FieldMap(fields, nil) + + coerced, err := checker.Coerce(source, nil) + if err != nil { + return nil, errors.Annotatef(err, "application offer v1 schema check failed") + } + valid := coerced.(map[string]interface{}) + + validEndpoints := valid["endpoints"].([]interface{}) + endpoints := make([]string, len(validEndpoints)) + for i, ep := range validEndpoints { + endpoints[i] = ep.(string) + } + + validACL := valid["acl"].(map[interface{}]interface{}) + aclMap := make(map[string]string, len(validACL)) + for user, access := range validACL { + aclMap[user.(string)] = access.(string) + } + + return &applicationOffer{ + OfferName_: valid["offer-name"].(string), + Endpoints_: endpoints, + ACL_: aclMap, + }, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/applicationoffer_test.go 2019-06-28 17:11:06.000000000 +0000 @@ -0,0 +1,97 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package description + +import ( + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + yaml "gopkg.in/yaml.v2" +) + +type ApplicationOfferSerializationSuite struct { + SliceSerializationSuite +} + +var _ = gc.Suite(&ApplicationOfferSerializationSuite{}) + +func (s *ApplicationOfferSerializationSuite) SetUpTest(c *gc.C) { + s.SliceSerializationSuite.SetUpTest(c) + s.importName = "offers" + s.sliceName = "offers" + s.importFunc = func(m map[string]interface{}) (interface{}, error) { + return importApplicationOffers(m) + } + s.testFields = func(m map[string]interface{}) { + m["offers"] = []interface{}{} + } +} + +func (s *ApplicationOfferSerializationSuite) TestNewApplicationOffer(c *gc.C) { + offer := newApplicationOffer(ApplicationOfferArgs{ + OfferName: "my-offer", + Endpoints: []string{"endpoint-1", "endpoint-2"}, + ACL: map[string]string{ + "admin": "admin", + "foo": "read", + "bar": "consume", + }, + }) + + c.Check(offer.OfferName(), gc.Equals, "my-offer") + c.Check(offer.Endpoints(), gc.DeepEquals, []string{"endpoint-1", "endpoint-2"}) + c.Check(offer.ACL(), gc.DeepEquals, map[string]string{ + "admin": "admin", + "foo": "read", + "bar": "consume", + }) +} + +func (s *ApplicationOfferSerializationSuite) TestParsingSerializedData(c *gc.C) { + initial := newApplicationOffer(ApplicationOfferArgs{ + OfferName: "my-offer", + Endpoints: []string{"endpoint-1", "endpoint-2"}, + ACL: map[string]string{ + "admin": "admin", + "foo": "read", + "bar": "consume", + }, + }) + offer := s.exportImportLatest(c, initial) + c.Assert(offer, jc.DeepEquals, initial) +} + +func (s *ApplicationOfferSerializationSuite) exportImportLatest(c *gc.C, offer *applicationOffer) *applicationOffer { + return s.exportImportVersion(c, offer, 1) +} + +func (s *ApplicationOfferSerializationSuite) exportImportVersion(c *gc.C, offer_ *applicationOffer, version int) *applicationOffer { + initial := &applicationOffers{ + Version: version, + Offers: []*applicationOffer{offer_}, + } + + bytes, err := yaml.Marshal(initial) + c.Assert(err, jc.ErrorIsNil) + + var source map[string]interface{} + err = yaml.Unmarshal(bytes, &source) + c.Assert(err, jc.ErrorIsNil) + + offers, err := importApplicationOffers(source) + c.Assert(err, jc.ErrorIsNil) + c.Assert(offers, gc.HasLen, 1) + return offers[0] +} + +func minimalApplicationOfferMap() map[interface{}]interface{} { + return map[interface{}]interface{}{ + "offer-name": "my-offer", + "endpoints": []interface{}{"endpoint-1", "endpoint-2"}, + "acl": map[interface{}]interface{}{ + "admin": "admin", + "foo": "read", + "bar": "consume", + }, + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/application_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/application_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/application_test.go 2019-05-14 17:31:07.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/application_test.go 2019-06-28 17:11:06.000000000 +0000 @@ -68,6 +68,17 @@ } } +func minimalApplicationWithOfferMap() map[interface{}]interface{} { + result := minimalApplicationMap() + result["offers"] = map[interface{}]interface{}{ + "version": 1, + "offers": []interface{}{ + minimalApplicationOfferMap(), + }, + } + return result +} + func minimalApplicationMapCAAS() map[interface{}]interface{} { result := minimalApplicationMap() result["type"] = CAAS @@ -113,6 +124,24 @@ return a } +func minimalApplicationWithOffer(args ...ApplicationArgs) *application { + a := minimalApplication(args...) + if a.Type_ != CAAS { + a.setOffers([]*applicationOffer{ + { + OfferName_: "my-offer", + Endpoints_: []string{"endpoint-1", "endpoint-2"}, + ACL_: map[string]string{ + "admin": "admin", + "foo": "read", + "bar": "consume", + }, + }, + }) + } + return a +} + func addMinimalApplication(model Model) { a := model.AddApplication(minimalApplicationArgs(IAAS)) a.SetStatus(minimalStatusArgs()) @@ -242,6 +271,22 @@ c.Assert(source, jc.DeepEquals, minimalApplicationMap()) } +func (s *ApplicationSerializationSuite) TestMinimalWithOfferMatchesIAAS(c *gc.C) { + bytes, err := yaml.Marshal(minimalApplicationWithOffer()) + c.Assert(err, jc.ErrorIsNil) + + var source map[interface{}]interface{} + err = yaml.Unmarshal(bytes, &source) + c.Assert(err, jc.ErrorIsNil) + c.Assert(source, jc.DeepEquals, minimalApplicationWithOfferMap()) +} + +func (s *ApplicationSerializationSuite) TestParsingSerializedDataWithOfferBlock(c *gc.C) { + app := minimalApplicationWithOffer() + application := s.exportImportLatest(c, app) + c.Assert(application, jc.DeepEquals, app) +} + func (s *ApplicationSerializationSuite) exportImportVersion(c *gc.C, application_ *application, version int) *application { initial := applications{ Version: version, @@ -262,7 +307,7 @@ } func (s *ApplicationSerializationSuite) exportImportLatest(c *gc.C, application_ *application) *application { - return s.exportImportVersion(c, application_, 4) + return s.exportImportVersion(c, application_, 5) } func (s *ApplicationSerializationSuite) TestV1ParsingReturnsLatest(c *gc.C) { @@ -279,6 +324,7 @@ appLatest.CloudService_ = nil appLatest.Tools_ = nil appLatest.OperatorStatus_ = nil + appLatest.Offers_ = nil appResult := s.exportImportVersion(c, appV1, 1) c.Assert(appResult, jc.DeepEquals, appLatest) @@ -297,6 +343,7 @@ appLatest.CloudService_ = nil appLatest.Tools_ = nil appLatest.OperatorStatus_ = nil + appLatest.Offers_ = nil appResult := s.exportImportVersion(c, appV1, 2) c.Assert(appResult, jc.DeepEquals, appLatest) @@ -311,6 +358,7 @@ appLatest.Placement_ = "" appLatest.DesiredScale_ = 0 appLatest.OperatorStatus_ = nil + appLatest.Offers_ = nil appResult := s.exportImportVersion(c, appV2, 3) c.Assert(appResult, jc.DeepEquals, appLatest) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/model.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/model.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/description/model.go 2019-05-14 17:31:07.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/description/model.go 2019-06-28 17:11:06.000000000 +0000 @@ -398,7 +398,7 @@ func (m *model) setApplications(applicationList []*application) { m.Applications_ = applications{ - Version: 4, + Version: 5, Applications_: applicationList, } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/context.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/context.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/context.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/context.go 2019-06-28 17:11:30.000000000 +0000 @@ -39,6 +39,7 @@ level: rootLevel, context: context, } + context.root.parent = context.root context.modules[""] = context.root return context } @@ -156,6 +157,14 @@ return nil } +// Writer returns the named writer if one exists. +// If there is not a writer with the specified name, nil is returned. +func (c *Context) Writer(name string) Writer { + c.writersMutex.Lock() + defer c.writersMutex.Unlock() + return c.writers[name] +} + // RemoveWriter remotes the specified writer. If a writer is not found with // the specified name an error is returned. The writer that was removed is also // returned. @@ -196,3 +205,21 @@ defer c.writersMutex.Unlock() c.writers = make(map[string]Writer) } + +// ConfigureLoggers configures loggers according to the given string +// specification, which specifies a set of modules and their associated +// logging levels. Loggers are colon- or semicolon-separated; each +// module is specified as =. White space outside of +// module names and levels is ignored. The root module is specified +// with the name "". +// +// An example specification: +// `=ERROR; foo.bar=WARNING` +func (c *Context) ConfigureLoggers(specification string) error { + config, err := ParseConfigString(specification) + if err != nil { + return err + } + c.ApplyConfig(config) + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/context_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/context_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/context_test.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/context_test.go 2019-06-28 17:11:30.000000000 +0000 @@ -38,7 +38,7 @@ level: loggo.Level(42), expected: loggo.WARNING, }} { - c.Log("%d: %s", i, test.level) + c.Logf("%d: %s", i, test.level) context := loggo.NewContext(test.level) cfg := context.Config() c.Check(cfg, gc.HasLen, 1) @@ -152,6 +152,14 @@ }) } +func (*ContextSuite) TestConfigureLoggers(c *gc.C) { + context := loggo.NewContext(loggo.INFO) + err := context.ConfigureLoggers("testing.module=debug") + c.Assert(err, gc.IsNil) + expected := "=INFO;testing.module=DEBUG" + c.Assert(context.Config().String(), gc.Equals, expected) +} + func (*ContextSuite) TestApplyNilConfig(c *gc.C) { context := loggo.NewContext(loggo.DEBUG) context.ApplyConfig(nil) @@ -321,6 +329,23 @@ checkLogEntries(c, third.Log(), expected) } +func (*ContextSuite) TestWriter(c *gc.C) { + first := &writer{name: "first"} + second := &writer{name: "second"} + context := loggo.NewContext(loggo.TRACE) + err := context.AddWriter("first", first) + c.Assert(err, gc.IsNil) + err = context.AddWriter("second", second) + c.Assert(err, gc.IsNil) + + c.Check(context.Writer("unknown"), gc.IsNil) + c.Check(context.Writer("first"), gc.Equals, first) + c.Check(context.Writer("second"), gc.Equals, second) + + c.Check(first, gc.Not(gc.Equals), second) + +} + type writer struct { loggo.TestWriter // The name exists to discriminate writer equality. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/dependencies.tsv juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/dependencies.tsv --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/dependencies.tsv 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/dependencies.tsv 2019-06-28 17:11:30.000000000 +0000 @@ -1,6 +1,5 @@ -github.com/juju/ansiterm git b99631de12cf04a906c1d4e4ec54fb86eae5863d 2016-09-07T23:45:32Z +github.com/juju/ansiterm git 720a0952cc2ac777afc295d9861263e2a4cf96a1 2018-01-09T21:29:12Z github.com/lunixbochs/vtclean git 4fbf7632a2c6d3fbdb9931439bdbbeded02cbe36 2016-01-25T03:51:06Z github.com/mattn/go-colorable git ed8eb9e318d7a84ce5915b495b7d35e0cfe7b5a8 2016-07-31T23:54:17Z github.com/mattn/go-isatty git 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8 2016-08-06T12:27:52Z -golang.org/x/sys git 9bb9f0998d48b31547d975974935ae9b48c7a03c 2016-10-12T00:19:20Z gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/doc.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/doc.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/doc.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/doc.go 2019-06-28 17:11:30.000000000 +0000 @@ -26,22 +26,26 @@ a lower severity than the module's effective severity level are not written out. +Loggers are created through their Context. There is a default global context +that is used if you just want simple use. Contexts are used where you may want +different sets of writers for different loggers. Most use cases are fine with +just using the default global context. + Loggers are created using the GetLogger function. logger := loggo.GetLogger("foo.bar") -By default there is one writer registered, which will write to Stderr, +The default global context has one writer registered, which will write to Stderr, and the root module, which will only emit warnings and above. If you want to continue using the default logger, but have it emit all logging levels you need to do the following. - writer, _, err := loggo.RemoveWriter("default") + writer, err := loggo.RemoveWriter("default") // err is non-nil if and only if the name isn't found. loggo.RegisterWriter("default", writer) To make loggo produce colored output, you can do the following, having imported github.com/juju/loggo/loggocolor: - loggo.RemoveWriter("default") - loggo.RegisterWriter("default", loggocolor.NewWriter(os.Stderr)) + loggo.ReplaceDefaultWriter(loggocolor.NewWriter(os.Stderr)) */ package loggo diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/global.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/global.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/global.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/global.go 2019-06-28 17:11:30.000000000 +0000 @@ -66,20 +66,15 @@ return defaultContext.RemoveWriter(name) } -// ConfigureLoggers configures loggers according to the given string -// specification, which specifies a set of modules and their associated -// logging levels. Loggers are colon- or semicolon-separated; each -// module is specified as =. White space outside of -// module names and levels is ignored. The root module is specified -// with the name "". +// ConfigureLoggers configures loggers on the default context according to the +// given string specification, which specifies a set of modules and their +// associated logging levels. Loggers are colon- or semicolon-separated; each +// module is specified as =. White space outside of module +// names and levels is ignored. The root module is specified with the name +// "". // // An example specification: -// `=ERROR; foo.bar=WARNING` +// `=ERROR; foo.bar=WARNING` func ConfigureLoggers(specification string) error { - config, err := ParseConfigString(specification) - if err != nil { - return err - } - defaultContext.ApplyConfig(config) - return nil + return defaultContext.ConfigureLoggers(specification) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger.go 2019-06-28 17:11:30.000000000 +0000 @@ -27,6 +27,28 @@ return logger.impl } +// Parent returns the Logger whose module name is the same +// as this logger without the last period and suffix. +// For example the parent of the logger that has the module +// "a.b.c" is "a.b". +// The Parent of the root logger is still the root logger. +func (logger Logger) Parent() Logger { + return Logger{logger.getModule().parent} +} + +// Child returns the Logger whose module name is the composed of this +// Logger's name and the specified name. +func (logger Logger) Child(name string) Logger { + module := logger.getModule() + path := module.name + if path == "" { + path = name + } else { + path += "." + name + } + return module.context.GetLogger(path) +} + // Name returns the logger's module name. func (logger Logger) Name() string { return logger.getModule().Name() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger_test.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/logger_test.go 2019-06-28 17:11:30.000000000 +0000 @@ -137,3 +137,46 @@ c.Assert(second.LogLevel(), gc.Equals, loggo.INFO) c.Assert(second.EffectiveLogLevel(), gc.Equals, loggo.INFO) } + +func (s *LoggerSuite) TestParent(c *gc.C) { + logger := loggo.GetLogger("a.b.c") + b := logger.Parent() + a := b.Parent() + root := a.Parent() + + c.Check(b.Name(), gc.Equals, "a.b") + c.Check(a.Name(), gc.Equals, "a") + c.Check(root.Name(), gc.Equals, "") + c.Check(root.Parent(), gc.Equals, root) +} + +func (s *LoggerSuite) TestParentSameContext(c *gc.C) { + ctx := loggo.NewContext(loggo.DEBUG) + + logger := ctx.GetLogger("a.b.c") + b := logger.Parent() + + c.Check(b, gc.Equals, ctx.GetLogger("a.b")) + c.Check(b, gc.Not(gc.Equals), loggo.GetLogger("a.b")) +} + +func (s *LoggerSuite) TestChild(c *gc.C) { + root := loggo.GetLogger("") + + a := root.Child("a") + logger := a.Child("b.c") + + c.Check(a.Name(), gc.Equals, "a") + c.Check(logger.Name(), gc.Equals, "a.b.c") + c.Check(logger.Parent(), gc.Equals, a.Child("b")) +} + +func (s *LoggerSuite) TestChildSameContext(c *gc.C) { + ctx := loggo.NewContext(loggo.DEBUG) + + logger := ctx.GetLogger("a") + b := logger.Child("b") + + c.Check(b, gc.Equals, ctx.GetLogger("a.b")) + c.Check(b, gc.Not(gc.Equals), loggo.GetLogger("a.b")) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/loggocolor/writer.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/loggocolor/writer.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/loggocolor/writer.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/loggocolor/writer.go 2019-06-28 17:11:30.000000000 +0000 @@ -5,8 +5,8 @@ "io" "path/filepath" - "github.com/juju/loggo" "github.com/juju/ansiterm" + "github.com/juju/loggo" ) var ( @@ -36,6 +36,14 @@ return &colorWriter{ansiterm.NewWriter(writer)} } +// NewcolorWriter will write out colored severity levels whether or not the +// writer is outputting to a terminal. +func NewColorWriter(writer io.Writer) loggo.Writer { + w := ansiterm.NewWriter(writer) + w.SetColorCapable(true) + return &colorWriter{w} +} + // Write implements Writer. func (w *colorWriter) Write(entry loggo.Entry) { ts := entry.Timestamp.Format(loggo.TimeFormat) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/README.md juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/README.md --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/README.md 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/README.md 2019-06-28 17:11:30.000000000 +0000 @@ -27,20 +27,31 @@ a lower severity than the module's effective severity level are not written out. +Loggers are created through their Context. There is a default global context +that is used if you just want simple use. Contexts are used where you may want +different sets of writers for different loggers. Most use cases are fine with +just using the default global context. + Loggers are created using the GetLogger function. logger := loggo.GetLogger("foo.bar") -By default there is one writer registered, which will write to Stderr, +The default global context has one writer registered, which will write to Stderr, and the root module, which will only emit warnings and above. If you want to continue using the default logger, but have it emit all logging levels you need to do the following. - writer, _, err := loggo.RemoveWriter("default") + writer, err := loggo.RemoveWriter("default") // err is non-nil if and only if the name isn't found. - loggo.RegisterWriter("default", writer, loggo.TRACE) + loggo.RegisterWriter("default", writer) + +To make loggo produce colored output, you can do the following, +having imported github.com/juju/loggo/loggocolor: + + + loggo.ReplaceDefaultWriter(loggocolor.NewWriter(os.Stderr)) @@ -55,24 +66,6 @@ ## Variables ``` go -var ( - // SeverityColor defines the colors for the levels output by the ColorWriter. - SeverityColor = map[Level]*ansiterm.Context{ - TRACE: ansiterm.Foreground(ansiterm.Default), - DEBUG: ansiterm.Foreground(ansiterm.Green), - INFO: ansiterm.Foreground(ansiterm.BrightBlue), - WARNING: ansiterm.Foreground(ansiterm.Yellow), - ERROR: ansiterm.Foreground(ansiterm.BrightRed), - CRITICAL: &ansiterm.Context{ - Foreground: ansiterm.White, - Background: ansiterm.Red, - }, - } - // LocationColor defines the colors for the location output by the ColorWriter. - LocationColor = ansiterm.Foreground(ansiterm.BrightBlue) -) -``` -``` go var TimeFormat = initTimeFormat() ``` TimeFormat is the time format used for the default writer. @@ -308,6 +301,15 @@ +### func (\*Context) Writer +``` go +func (c *Context) Writer(name string) Writer +``` +Writer returns the named writer if one exists. +If there is not a writer with the specified name, nil is returned. + + + ## type Entry ``` go type Entry struct { @@ -424,6 +426,15 @@ +### func (Logger) Child +``` go +func (logger Logger) Child(name string) Logger +``` +Child returns the Logger whose module name is the composed of this +Logger's name and the specified name. + + + ### func (Logger) Criticalf ``` go func (logger Logger) Criticalf(message string, args ...interface{}) @@ -566,6 +577,18 @@ +### func (Logger) Parent +``` go +func (logger Logger) Parent() Logger +``` +Parent returns the Logger whose module name is the same +as this logger without the last period and suffix. +For example the parent of the logger that has the module +"a.b.c" is "a.b". +The Parent of the root logger is still the root logger. + + + ### func (Logger) SetLogLevel ``` go func (logger Logger) SetLogLevel(level Level) @@ -657,14 +680,6 @@ -### func NewColorWriter -``` go -func NewColorWriter(writer io.Writer) Writer -``` -NewColorWriter will write out colored severity levels if the writer is -outputting to a terminal. - - ### func NewMinimumLevelWriter ``` go func NewMinimumLevelWriter(writer Writer, minLevel Level) Writer diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/util_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/util_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/loggo/util_test.go 2019-05-14 17:31:48.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/loggo/util_test.go 2019-06-28 17:11:30.000000000 +0000 @@ -60,7 +60,7 @@ if j := strings.Index(line, "//tag "); j >= 0 { tag := line[j+len("//tag "):] if _, found := tagToLocation[tag]; found { - panic(fmt.Errorf("tag %q already processed previously")) + panic(fmt.Errorf("tag %q already processed previously", tag)) } tagToLocation[tag] = Location{file: filename, line: i + 1} } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/export_linux_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/export_linux_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/export_linux_test.go 2019-05-14 17:32:05.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/export_linux_test.go 2019-06-28 17:12:24.000000000 +0000 @@ -9,9 +9,12 @@ OSReleaseFile = &osReleaseFile ) -func SetUbuntuSeries(value map[string]string) func() { +// HideUbuntuSeries hides the global state of the ubuntu series for tests. The +// function returns a closure, that puts the global state back once called. +// This is not concurrent safe. +func HideUbuntuSeries() func() { origSeries := ubuntuSeries - ubuntuSeries = value + ubuntuSeries = make(map[string]seriesVersion) return func() { ubuntuSeries = origSeries } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/series_linux.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/series_linux.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/series_linux.go 2019-05-14 17:32:05.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/series_linux.go 2019-06-28 17:12:24.000000000 +0000 @@ -20,6 +20,13 @@ osReleaseFile = "/etc/os-release" ) +const ( + // this is just for an approximation in an error case, when the eol + // date has a parse error. + day = 24 * time.Hour + year = 365 * day +) + func readSeries() (string, error) { values, err := jujuos.ReadOSRelease(osReleaseFile) if err != nil { @@ -32,7 +39,7 @@ func seriesFromOSRelease(values map[string]string) (string, error) { switch values["ID"] { case strings.ToLower(jujuos.Ubuntu.String()): - return getValue(ubuntuSeries, values["VERSION_ID"]) + return getValueFromSeriesVersion(ubuntuSeries, values["VERSION_ID"]) case strings.ToLower(jujuos.CentOS.String()): codename := fmt.Sprintf("%s%s", values["ID"], values["VERSION_ID"]) return getValue(centosSeries, codename) @@ -55,6 +62,15 @@ return "unknown", errors.New("could not determine series") } +func getValueFromSeriesVersion(from map[string]seriesVersion, val string) (string, error) { + for s, version := range from { + if version.Version == val { + return s, nil + } + } + return "unknown", errors.New("could not determine series") +} + // ReleaseVersion looks for the value of VERSION_ID in the content of // the os-release. If the value is not found, the file is not found, or // an error occurs reading the file, an empty string is returned. @@ -66,14 +82,11 @@ return release["VERSION_ID"] } -func updateLocalSeriesVersions() error { - return updateDistroInfo() -} - var distroInfo = "/usr/share/distro-info/ubuntu.csv" -// updateDistroInfo updates seriesVersions from /usr/share/distro-info/ubuntu.csv if possible.. -func updateDistroInfo() error { +// updateLocalSeriesVersions updates seriesVersions from +// /usr/share/distro-info/ubuntu.csv if possible.. +func updateLocalSeriesVersions() error { // We need to find the series version eg 12.04 from the series eg precise. Use the information found in // /usr/share/distro-info/ubuntu.csv provided by distro-info-data package. f, err := os.Open(distroInfo) @@ -96,12 +109,13 @@ // // TODO(axw) only add in series that are supported? (i.e. before end of life) // Can we really do this? Users might have Extended Security Maintenance. - now := time.Now() var foundPrecise bool for _, fields := range records { var version, series string var release string + var eol, eolESM string + var warnings []string for i, field := range fields { if i >= len(fieldNames) { break @@ -113,8 +127,14 @@ series = field case "release": release = field + case "eol": + eol = field + case "eol-esm": + eolESM = field } } + // we ignore eol and eolESM as they're optional, as we can fall back to + // some dates if they are missing. if version == "" || series == "" || release == "" { // Ignore malformed line. continue @@ -132,15 +152,42 @@ continue } + eolDate, err := time.Parse("2006-01-02", eol) + if err != nil { + // we should add 5 years to the release date in case of an error + // parsing the eol date. + eolDate = releaseDate.Add(5 * year) + warnings = append(warnings, "EOL date not found, falling back to release date, plus 5 years") + } + + eolESMDate, err := time.Parse("2006-01-02", eolESM) + if err != nil { + // fall back to the eolDate if none is provided in the csv. + eolESMDate = eolDate + warnings = append(warnings, "EOL ESM date not found, falling back to EOL date") + } + // The numeric version may contain a LTS moniker so strip that out. trimmedVersion := strings.TrimSuffix(version, " LTS") seriesVersions[series] = trimmedVersion - ubuntuSeries[series] = trimmedVersion - if trimmedVersion != version && !now.Before(releaseDate) { + + var ltsRelease bool + if strings.HasSuffix(version, " LTS") && !now.Before(releaseDate) { // We only record that a series is LTS if its release // date has passed. This allows the series to be tested // pre-release, without affecting default series. - ubuntuLTS[series] = true + ltsRelease = true + } + + // work out if the series is supported or if the extended security + // maintenance is supported from the following release cycle + // documentation https://www.ubuntu.com/about/release-cycle + ubuntuSeries[series] = seriesVersion{ + Version: trimmedVersion, + LTS: ltsRelease, + Supported: now.After(releaseDate) && now.Before(eolDate), + ESMSupported: ltsRelease && now.After(releaseDate) && now.Before(eolESMDate), + WarningInfo: warnings, } } return nil diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries.go 2019-05-14 17:32:05.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries.go 2019-06-28 17:12:24.000000000 +0000 @@ -75,6 +75,7 @@ "bionic": "18.04", "cosmic": "18.10", "disco": "19.04", + "eoan": "19.10", "win2008r2": "win2008r2", "win2012hvr2": "win2012hvr2", "win2012hv": "win2012hv", @@ -107,34 +108,154 @@ "kubernetes": "kubernetes", } -var ubuntuSeries = map[string]string{ - "precise": "12.04", - "quantal": "12.10", - "raring": "13.04", - "saucy": "13.10", - "trusty": "14.04", - "utopic": "14.10", - "vivid": "15.04", - "wily": "15.10", - "xenial": "16.04", - "yakkety": "16.10", - "zesty": "17.04", - "artful": "17.10", - "bionic": "18.04", - "cosmic": "18.10", - "disco": "19.04", -} - -// ubuntuLTS provides a lookup for current LTS series. Like seriesVersions, -// the values here are current at the time of writing. On Ubuntu systems this -// map is updated by updateDistroInfo, using data from -// /usr/share/distro-info/ubuntu.csv to ensure we have the latest values. On -// non-Ubuntu systems, these values provide a nice fallback option. -var ubuntuLTS = map[string]bool{ - "precise": true, - "trusty": true, - "xenial": true, - "bionic": true, +// seriesVersion represents a ubuntu series that includes the version, if the +// series is an LTS and the supported defines if Juju supports the series +// version. +type seriesVersion struct { + Version string + // LTS provides a lookup for current LTS series. Like seriesVersions, + // the values here are current at the time of writing. On Ubuntu systems this + // map is updated by updateDistroInfo, using data from + // /usr/share/distro-info/ubuntu.csv to ensure we have the latest values. On + // non-Ubuntu systems, these values provide a nice fallback option. + LTS bool + // Supported defines if Juju classifies the series as officially supported. + Supported bool + // Extended security maintenance for customers, extends the supported bool + // for how Juju classifies the series. + ESMSupported bool + // WarningInfo shows any potential issues when parsing the series version + // information. + WarningInfo []string +} + +var ubuntuSeries = map[string]seriesVersion{ + "precise": seriesVersion{ + Version: "12.04", + }, + "quantal": seriesVersion{ + Version: "12.10", + }, + "raring": seriesVersion{ + Version: "13.04", + }, + "saucy": seriesVersion{ + Version: "13.10", + }, + "trusty": seriesVersion{ + Version: "14.04", + LTS: true, + ESMSupported: true, + }, + "utopic": seriesVersion{ + Version: "14.10", + }, + "vivid": seriesVersion{ + Version: "15.04", + }, + "wily": seriesVersion{ + Version: "15.10", + }, + "xenial": seriesVersion{ + Version: "16.04", + LTS: true, + Supported: true, + ESMSupported: true, + }, + "yakkety": seriesVersion{ + Version: "16.10", + }, + "zesty": seriesVersion{ + Version: "17.04", + }, + "artful": seriesVersion{ + Version: "17.10", + }, + "bionic": seriesVersion{ + Version: "18.04", + LTS: true, + Supported: true, + ESMSupported: true, + }, + "cosmic": seriesVersion{ + Version: "18.10", + Supported: true, + }, + "disco": seriesVersion{ + Version: "19.04", + Supported: true, + }, + "eoan": seriesVersion{ + Version: "19.10", + Supported: true, + }, +} + +var nonUbuntuSeries = map[string]seriesVersion{ + "win2008r2": { + Version: "win2008r2", + Supported: true, + }, + "win2012hvr2": { + Version: "win2012hvr2", + Supported: true, + }, + "win2012hv": { + Version: "win2012hv", + Supported: true, + }, + "win2012r2": { + Version: "win2012r2", + Supported: true, + }, + "win2012": { + Version: "win2012", + Supported: true, + }, + "win2016": { + Version: "win2016", + Supported: true, + }, + "win2016hv": { + Version: "win2016hv", + Supported: true, + }, + "win2016nano": { + Version: "win2016nano", + Supported: true, + }, + "win7": { + Version: "win7", + Supported: true, + }, + "win8": { + Version: "win8", + Supported: true, + }, + "win81": { + Version: "win81", + Supported: true, + }, + "win10": { + Version: "win10", + Supported: true, + }, + "centos7": { + Version: "centos7", + Supported: true, + }, + "opensuseleap": { + Version: "opensuse42", + Supported: true, + }, + genericLinuxSeries: { + Version: genericLinuxVersion, + Supported: true, + }, + "kubernetes": { + Version: "kubernetes", + Supported: true, + }, } // Windows versions come in various flavors: @@ -339,8 +460,11 @@ updateSeriesVersionsOnce() versions := []string{} - for k := range ubuntuLTS { - versions = append(versions, ubuntuSeries[k]) + for _, version := range ubuntuSeries { + if !version.LTS { + continue + } + versions = append(versions, version.Version) } sort.Strings(versions) sorted := []string{} @@ -365,8 +489,11 @@ updateSeriesVersionsOnce() var latest string - for k := range ubuntuLTS { - if ubuntuSeries[k] > ubuntuSeries[latest] { + for k, version := range ubuntuSeries { + if !version.LTS { + continue + } + if version.Version > ubuntuSeries[latest].Version { latest = k } } @@ -411,6 +538,61 @@ return series } +func allSeriesVersions() map[string]seriesVersion { + all := map[string]seriesVersion{} + for k, v := range ubuntuSeries { + all[k] = v + } + for k, v := range nonUbuntuSeries { + all[k] = v + } + return all +} + +// SupportedJujuSeries returns a slice of juju supported series. +func SupportedJujuSeries() []string { + seriesVersionsMutex.Lock() + defer seriesVersionsMutex.Unlock() + updateSeriesVersionsOnce() + var series []string + for s, version := range allSeriesVersions() { + if !version.Supported { + continue + } + series = append(series, s) + } + return series +} + +// ESMSupportedJujuSeries returns a slice of just juju extended security +// maintenance supported ubuntu series. +func ESMSupportedJujuSeries() []string { + seriesVersionsMutex.Lock() + defer seriesVersionsMutex.Unlock() + updateSeriesVersionsOnce() + var series []string + for s, version := range ubuntuSeries { + if !version.ESMSupported { + continue + } + series = append(series, s) + } + return series +} + +// SeriesWarningInfo returns any potential warnings about a particular series +// when parsing data from the system. +func SeriesWarningInfo(version string) []string { + seriesVersionsMutex.Lock() + defer seriesVersionsMutex.Unlock() + updateSeriesVersionsOnce() + + if s, ok := ubuntuSeries[version]; ok { + return s.WarningInfo + } + return nil +} + // OSSupportedSeries returns the series of the specified OS on which we // can run Juju workloads. func OSSupportedSeries(os os.OSType) []string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_linux_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_linux_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_linux_test.go 2019-05-14 17:32:05.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_linux_test.go 2019-06-28 17:12:24.000000000 +0000 @@ -35,7 +35,7 @@ c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.DistroInfo, filename) - expectedSeries := []string{"precise", "quantal", "raring", "saucy"} + expectedSeries := []string{"artful", "bionic", "cosmic", "disco", "eoan", "precise", "quantal", "raring", "saucy", "trusty", "utopic", "vivid", "wily", "xenial", "yakkety", "zesty"} series := series.SupportedSeries() sort.Strings(series) c.Assert(series, gc.DeepEquals, expectedSeries) @@ -48,7 +48,7 @@ c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.DistroInfo, filename) - expectedSeries := []string{"precise", "quantal", "raring", "saucy"} + expectedSeries := []string{"artful", "bionic", "cosmic", "disco", "eoan", "precise", "quantal", "raring", "saucy", "trusty", "utopic", "vivid", "wily", "xenial", "yakkety", "zesty"} checkSeries := func() { series := series.SupportedSeries() sort.Strings(series) @@ -64,14 +64,43 @@ checkSeries() expectedSeries = append([]string{"ornery"}, expectedSeries...) - expectedSeries = append(expectedSeries, "trusty") + expectedSeries = append(expectedSeries, "firewolf") + sort.Strings(expectedSeries) series.UpdateSeriesVersions() checkSeries() } +func (s *supportedSeriesSuite) TestESMSupportedJujuSeries(c *gc.C) { + d := c.MkDir() + filename := filepath.Join(d, "ubuntu.csv") + err := ioutil.WriteFile(filename, []byte(distInfoData), 0644) + c.Assert(err, jc.ErrorIsNil) + s.PatchValue(series.DistroInfo, filename) + + expectedSeries := []string{"bionic", "trusty", "xenial"} + series := series.ESMSupportedJujuSeries() + sort.Strings(series) + c.Assert(series, jc.SameContents, expectedSeries) +} + +func (s *supportedSeriesSuite) TestWarningInfoForInvalidParsing(c *gc.C) { + d := c.MkDir() + filename := filepath.Join(d, "ubuntu.csv") + err := ioutil.WriteFile(filename, []byte(distInfoData2), 0644) + c.Assert(err, jc.ErrorIsNil) + s.PatchValue(series.DistroInfo, filename) + + info := series.SeriesWarningInfo("firewolf") + c.Assert(info, jc.SameContents, []string{ + "EOL date not found, falling back to release date, plus 5 years", + "EOL ESM date not found, falling back to EOL date", + }) +} + func (s *supportedSeriesSuite) TestOSSeries(c *gc.C) { - cleanup := series.SetUbuntuSeries(make(map[string]string)) - defer cleanup() + restore := series.HideUbuntuSeries() + defer restore() + d := c.MkDir() filename := filepath.Join(d, "ubuntu.csv") err := ioutil.WriteFile(filename, []byte(distInfoData), 0644) @@ -83,7 +112,7 @@ c.Assert(osType, gc.Equals, os.Ubuntu) } -const distInfoData = `version,codename,series,created,release,eol,eol-server +const distInfoData = `version,codename,series,created,release,eol,eol-server,eol-esm 4.10,Warty Warthog,warty,2004-03-05,2004-10-20,2006-04-30 5.04,Hoary Hedgehog,hoary,2004-10-20,2005-04-08,2006-10-31 5.10,Breezy Badger,breezy,2005-04-08,2005-10-12,2007-04-13 @@ -99,13 +128,25 @@ 10.10,Maverick Meerkat,maverick,2010-04-29,2010-10-10,2012-04-10 11.04,Natty Narwhal,natty,2010-10-10,2011-04-28,2012-10-28 11.10,Oneiric Ocelot,oneiric,2011-04-28,2011-10-13,2013-05-09 -12.04 LTS,Precise Pangolin,precise,2011-10-13,2012-04-26,2017-04-26 -12.10,Quantal Quetzal,quantal,2012-04-26,2012-10-18,2014-04-18 +12.04 LTS,Precise Pangolin,precise,2011-10-13,2012-04-26,2017-04-26,2017-04-26,2019-04-26 +12.10,Quantal Quetzal,quantal,2012-04-26,2012-10-18,2014-05-16 13.04,Raring Ringtail,raring,2012-10-18,2013-04-25,2014-01-27 13.10,Saucy Salamander,saucy,2013-04-25,2013-10-17,2014-07-17 +14.04 LTS,Trusty Tahr,trusty,2013-10-17,2014-04-17,2019-04-17,2019-04-17,2022-04-17 +14.10,Utopic Unicorn,utopic,2014-04-17,2014-10-23,2015-07-23 +15.04,Vivid Vervet,vivid,2014-10-23,2015-04-23,2016-01-23 +15.10,Wily Werewolf,wily,2015-04-23,2015-10-22,2016-07-22 +16.04 LTS,Xenial Xerus,xenial,2015-10-22,2016-04-21,2021-04-21,2021-04-21,2024-04-21 +16.10,Yakkety Yak,yakkety,2016-04-21,2016-10-13,2017-07-20 +17.04,Zesty Zapus,zesty,2016-10-13,2017-04-13,2018-01-13 +17.10,Artful Aardvark,artful,2017-04-13,2017-10-19,2018-07-19 +18.04 LTS,Bionic Beaver,bionic,2017-10-19,2018-04-26,2023-04-26,2023-04-26,2028-04-26 +18.10,Cosmic Cuttlefish,cosmic,2018-04-26,2018-10-18,2019-07-18 +19.04,Disco Dingo,disco,2018-10-18,2019-04-18,2020-01-18 +19.10,Eoan EANIMAL,eoan,2019-04-18,2019-10-17,2020-07-17 ` const distInfoData2 = distInfoData + ` -14.04 LTS,Trusty Tahr,trusty,2013-10-17,2014-04-17,2019-04-17 +14.04 LTS,Firewolf,firewolf,2013-10-17,2014-04-17 94.04 LTS,Ornery Omega,ornery,2094-10-17,2094-04-17,2099-04-17 ` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_test.go 2019-05-14 17:32:05.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/juju/os/series/supportedseries_test.go 2019-06-28 17:12:24.000000000 +0000 @@ -4,6 +4,10 @@ package series_test import ( + "io/ioutil" + "path/filepath" + "sort" + "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -175,3 +179,16 @@ want := []string{"precise", "trusty", "xenial", "bionic"} c.Assert(got, gc.DeepEquals, want) } + +func (s *supportedSeriesSuite) TestSupportedJujuSeries(c *gc.C) { + d := c.MkDir() + filename := filepath.Join(d, "ubuntu.csv") + err := ioutil.WriteFile(filename, []byte(distInfoData), 0644) + c.Assert(err, jc.ErrorIsNil) + s.PatchValue(series.DistroInfo, filename) + + expectedSeries := []string{"bionic", "centos7", "cosmic", "disco", "genericlinux", "kubernetes", "opensuseleap", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win7", "win8", "win81", "xenial"} + series := series.SupportedJujuSeries() + sort.Strings(series) + c.Assert(series, jc.SameContents, expectedSeries) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/affected_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/affected_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/affected_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/affected_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AffectedResource The resource affected by the event described in the announcement. +type AffectedResource struct { + + // The OCID of the affected resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // The friendly name of the resource. + ResourceName *string `mandatory:"true" json:"resourceName"` + + // The region where the affected resource exists. + Region *string `mandatory:"true" json:"region"` +} + +func (m AffectedResource) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,167 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// Announcement A message about an impactful operational event. +type Announcement struct { + + // The OCID of the announcement. + Id *string `mandatory:"true" json:"id"` + + // The reference Jira ticket number. + ReferenceTicketNumber *string `mandatory:"true" json:"referenceTicketNumber"` + + // A summary of the issue. A summary might appear in the console banner view of the announcement or in + // an email subject line. Avoid entering confidential information. + Summary *string `mandatory:"true" json:"summary"` + + // Impacted Oracle Cloud Infrastructure services. + Services []string `mandatory:"true" json:"services"` + + // Impacted regions. + AffectedRegions []string `mandatory:"true" json:"affectedRegions"` + + // Whether the announcement is displayed as a banner in the console. + IsBanner *bool `mandatory:"true" json:"isBanner"` + + // The label associated with an initial time value. + // Example: `Time Started` + TimeOneTitle *string `mandatory:"false" json:"timeOneTitle"` + + // The actual value of the first time value for the event. Typically, this is the time an event started, but the meaning + // can vary, depending on the announcement type. + TimeOneValue *common.SDKTime `mandatory:"false" json:"timeOneValue"` + + // The label associated with a second time value. + // Example: `Time Ended` + TimeTwoTitle *string `mandatory:"false" json:"timeTwoTitle"` + + // The actual value of the second time value. Typically, this is the time an event ended, but the meaning + // can vary, depending on the announcement type. + TimeTwoValue *common.SDKTime `mandatory:"false" json:"timeTwoValue"` + + // The date and time the announcement was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the announcement was last updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A detailed explanation of the event, expressed by using Markdown language. Avoid entering + // confidential information. + Description *string `mandatory:"false" json:"description"` + + // Additional information about the event, expressed by using Markdown language and included in the + // details view of an announcement. Additional information might include remediation steps or + // answers to frequently asked questions. Avoid entering confidential information. + AdditionalInformation *string `mandatory:"false" json:"additionalInformation"` + + // The list of resources, if any, affected by the event described in the announcement. + AffectedResources []AffectedResource `mandatory:"false" json:"affectedResources"` + + // The type of announcement. An announcement's type signals its severity. + AnnouncementType BaseAnnouncementAnnouncementTypeEnum `mandatory:"true" json:"announcementType"` + + // The current lifecycle state of the announcement. + LifecycleState BaseAnnouncementLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +//GetId returns Id +func (m Announcement) GetId() *string { + return m.Id +} + +//GetReferenceTicketNumber returns ReferenceTicketNumber +func (m Announcement) GetReferenceTicketNumber() *string { + return m.ReferenceTicketNumber +} + +//GetSummary returns Summary +func (m Announcement) GetSummary() *string { + return m.Summary +} + +//GetTimeOneTitle returns TimeOneTitle +func (m Announcement) GetTimeOneTitle() *string { + return m.TimeOneTitle +} + +//GetTimeOneValue returns TimeOneValue +func (m Announcement) GetTimeOneValue() *common.SDKTime { + return m.TimeOneValue +} + +//GetTimeTwoTitle returns TimeTwoTitle +func (m Announcement) GetTimeTwoTitle() *string { + return m.TimeTwoTitle +} + +//GetTimeTwoValue returns TimeTwoValue +func (m Announcement) GetTimeTwoValue() *common.SDKTime { + return m.TimeTwoValue +} + +//GetServices returns Services +func (m Announcement) GetServices() []string { + return m.Services +} + +//GetAffectedRegions returns AffectedRegions +func (m Announcement) GetAffectedRegions() []string { + return m.AffectedRegions +} + +//GetAnnouncementType returns AnnouncementType +func (m Announcement) GetAnnouncementType() BaseAnnouncementAnnouncementTypeEnum { + return m.AnnouncementType +} + +//GetLifecycleState returns LifecycleState +func (m Announcement) GetLifecycleState() BaseAnnouncementLifecycleStateEnum { + return m.LifecycleState +} + +//GetIsBanner returns IsBanner +func (m Announcement) GetIsBanner() *bool { + return m.IsBanner +} + +//GetTimeCreated returns TimeCreated +func (m Announcement) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m Announcement) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m Announcement) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m Announcement) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAnnouncement Announcement + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeAnnouncement + }{ + "Announcement", + (MarshalTypeAnnouncement)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcements_collection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcements_collection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcements_collection.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcements_collection.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AnnouncementsCollection A list of announcements that match filter criteria, if any. Results contain both the announcements and the user-specific status of the announcements. +type AnnouncementsCollection struct { + + // A collection of announcements. + Items []AnnouncementSummary `mandatory:"false" json:"items"` + + // The user-specific status for found announcements. + UserStatuses []AnnouncementUserStatusDetails `mandatory:"false" json:"userStatuses"` +} + +func (m AnnouncementsCollection) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcementsservice_announcement_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcementsservice_announcement_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcementsservice_announcement_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcementsservice_announcement_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,227 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//AnnouncementClient a client for Announcement +type AnnouncementClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewAnnouncementClientWithConfigurationProvider Creates a new default Announcement client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewAnnouncementClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client AnnouncementClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = AnnouncementClient{BaseClient: baseClient} + client.BasePath = "20180904" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *AnnouncementClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("announcements") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *AnnouncementClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *AnnouncementClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetAnnouncement Gets the details of a specific announcement. +func (client AnnouncementClient) GetAnnouncement(ctx context.Context, request GetAnnouncementRequest) (response GetAnnouncementResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAnnouncement, policy) + if err != nil { + if ociResponse != nil { + response = GetAnnouncementResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAnnouncementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAnnouncementResponse") + } + return +} + +// getAnnouncement implements the OCIOperation interface (enables retrying operations) +func (client AnnouncementClient) getAnnouncement(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/announcements/{announcementId}") + if err != nil { + return nil, err + } + + var response GetAnnouncementResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAnnouncementUserStatus Gets information about whether a specific announcement was acknowledged by a user. +func (client AnnouncementClient) GetAnnouncementUserStatus(ctx context.Context, request GetAnnouncementUserStatusRequest) (response GetAnnouncementUserStatusResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAnnouncementUserStatus, policy) + if err != nil { + if ociResponse != nil { + response = GetAnnouncementUserStatusResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAnnouncementUserStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAnnouncementUserStatusResponse") + } + return +} + +// getAnnouncementUserStatus implements the OCIOperation interface (enables retrying operations) +func (client AnnouncementClient) getAnnouncementUserStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/announcements/{announcementId}/userStatus") + if err != nil { + return nil, err + } + + var response GetAnnouncementUserStatusResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAnnouncements Gets a list of announcements for the current tenancy. +func (client AnnouncementClient) ListAnnouncements(ctx context.Context, request ListAnnouncementsRequest) (response ListAnnouncementsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAnnouncements, policy) + if err != nil { + if ociResponse != nil { + response = ListAnnouncementsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAnnouncementsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAnnouncementsResponse") + } + return +} + +// listAnnouncements implements the OCIOperation interface (enables retrying operations) +func (client AnnouncementClient) listAnnouncements(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/announcements") + if err != nil { + return nil, err + } + + var response ListAnnouncementsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAnnouncementUserStatus Updates the status of the specified announcement with regard to whether it has been marked as read. +func (client AnnouncementClient) UpdateAnnouncementUserStatus(ctx context.Context, request UpdateAnnouncementUserStatusRequest) (response UpdateAnnouncementUserStatusResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateAnnouncementUserStatus, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAnnouncementUserStatusResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAnnouncementUserStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAnnouncementUserStatusResponse") + } + return +} + +// updateAnnouncementUserStatus implements the OCIOperation interface (enables retrying operations) +func (client AnnouncementClient) updateAnnouncementUserStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/announcements/{announcementId}/userStatus") + if err != nil { + return nil, err + } + + var response UpdateAnnouncementUserStatusResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,155 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AnnouncementSummary Summary representation of an announcement. +type AnnouncementSummary struct { + + // The OCID of the announcement. + Id *string `mandatory:"true" json:"id"` + + // The reference Jira ticket number. + ReferenceTicketNumber *string `mandatory:"true" json:"referenceTicketNumber"` + + // A summary of the issue. A summary might appear in the console banner view of the announcement or in + // an email subject line. Avoid entering confidential information. + Summary *string `mandatory:"true" json:"summary"` + + // Impacted Oracle Cloud Infrastructure services. + Services []string `mandatory:"true" json:"services"` + + // Impacted regions. + AffectedRegions []string `mandatory:"true" json:"affectedRegions"` + + // Whether the announcement is displayed as a banner in the console. + IsBanner *bool `mandatory:"true" json:"isBanner"` + + // The label associated with an initial time value. + // Example: `Time Started` + TimeOneTitle *string `mandatory:"false" json:"timeOneTitle"` + + // The actual value of the first time value for the event. Typically, this is the time an event started, but the meaning + // can vary, depending on the announcement type. + TimeOneValue *common.SDKTime `mandatory:"false" json:"timeOneValue"` + + // The label associated with a second time value. + // Example: `Time Ended` + TimeTwoTitle *string `mandatory:"false" json:"timeTwoTitle"` + + // The actual value of the second time value. Typically, this is the time an event ended, but the meaning + // can vary, depending on the announcement type. + TimeTwoValue *common.SDKTime `mandatory:"false" json:"timeTwoValue"` + + // The date and time the announcement was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the announcement was last updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The type of announcement. An announcement's type signals its severity. + AnnouncementType BaseAnnouncementAnnouncementTypeEnum `mandatory:"true" json:"announcementType"` + + // The current lifecycle state of the announcement. + LifecycleState BaseAnnouncementLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +//GetId returns Id +func (m AnnouncementSummary) GetId() *string { + return m.Id +} + +//GetReferenceTicketNumber returns ReferenceTicketNumber +func (m AnnouncementSummary) GetReferenceTicketNumber() *string { + return m.ReferenceTicketNumber +} + +//GetSummary returns Summary +func (m AnnouncementSummary) GetSummary() *string { + return m.Summary +} + +//GetTimeOneTitle returns TimeOneTitle +func (m AnnouncementSummary) GetTimeOneTitle() *string { + return m.TimeOneTitle +} + +//GetTimeOneValue returns TimeOneValue +func (m AnnouncementSummary) GetTimeOneValue() *common.SDKTime { + return m.TimeOneValue +} + +//GetTimeTwoTitle returns TimeTwoTitle +func (m AnnouncementSummary) GetTimeTwoTitle() *string { + return m.TimeTwoTitle +} + +//GetTimeTwoValue returns TimeTwoValue +func (m AnnouncementSummary) GetTimeTwoValue() *common.SDKTime { + return m.TimeTwoValue +} + +//GetServices returns Services +func (m AnnouncementSummary) GetServices() []string { + return m.Services +} + +//GetAffectedRegions returns AffectedRegions +func (m AnnouncementSummary) GetAffectedRegions() []string { + return m.AffectedRegions +} + +//GetAnnouncementType returns AnnouncementType +func (m AnnouncementSummary) GetAnnouncementType() BaseAnnouncementAnnouncementTypeEnum { + return m.AnnouncementType +} + +//GetLifecycleState returns LifecycleState +func (m AnnouncementSummary) GetLifecycleState() BaseAnnouncementLifecycleStateEnum { + return m.LifecycleState +} + +//GetIsBanner returns IsBanner +func (m AnnouncementSummary) GetIsBanner() *bool { + return m.IsBanner +} + +//GetTimeCreated returns TimeCreated +func (m AnnouncementSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m AnnouncementSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m AnnouncementSummary) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m AnnouncementSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAnnouncementSummary AnnouncementSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeAnnouncementSummary + }{ + "AnnouncementSummary", + (MarshalTypeAnnouncementSummary)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_user_status_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_user_status_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_user_status_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/announcement_user_status_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AnnouncementUserStatusDetails An announcement's status regarding whether it has been acknowledged by a user. +type AnnouncementUserStatusDetails struct { + + // The OCID of the announcement that this status is associated with. + UserStatusAnnouncementId *string `mandatory:"true" json:"userStatusAnnouncementId"` + + // The OCID of the user that this status is associated with. + UserId *string `mandatory:"true" json:"userId"` + + // The date and time the announcement was acknowledged, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + TimeAcknowledged *common.SDKTime `mandatory:"false" json:"timeAcknowledged"` +} + +func (m AnnouncementUserStatusDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/base_announcement.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/base_announcement.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/base_announcement.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/base_announcement.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,282 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// BaseAnnouncement Incident information that forms the basis of an announcement. Avoid entering confidential information. +type BaseAnnouncement interface { + + // The OCID of the announcement. + GetId() *string + + // The reference Jira ticket number. + GetReferenceTicketNumber() *string + + // A summary of the issue. A summary might appear in the console banner view of the announcement or in + // an email subject line. Avoid entering confidential information. + GetSummary() *string + + // Impacted Oracle Cloud Infrastructure services. + GetServices() []string + + // Impacted regions. + GetAffectedRegions() []string + + // The type of announcement. An announcement's type signals its severity. + GetAnnouncementType() BaseAnnouncementAnnouncementTypeEnum + + // The current lifecycle state of the announcement. + GetLifecycleState() BaseAnnouncementLifecycleStateEnum + + // Whether the announcement is displayed as a banner in the console. + GetIsBanner() *bool + + // The label associated with an initial time value. + // Example: `Time Started` + GetTimeOneTitle() *string + + // The actual value of the first time value for the event. Typically, this is the time an event started, but the meaning + // can vary, depending on the announcement type. + GetTimeOneValue() *common.SDKTime + + // The label associated with a second time value. + // Example: `Time Ended` + GetTimeTwoTitle() *string + + // The actual value of the second time value. Typically, this is the time an event ended, but the meaning + // can vary, depending on the announcement type. + GetTimeTwoValue() *common.SDKTime + + // The date and time the announcement was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + GetTimeCreated() *common.SDKTime + + // The date and time the announcement was last updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-01-01T17:43:01.389+0000` + GetTimeUpdated() *common.SDKTime +} + +type baseannouncement struct { + JsonData []byte + Id *string `mandatory:"true" json:"id"` + ReferenceTicketNumber *string `mandatory:"true" json:"referenceTicketNumber"` + Summary *string `mandatory:"true" json:"summary"` + Services []string `mandatory:"true" json:"services"` + AffectedRegions []string `mandatory:"true" json:"affectedRegions"` + AnnouncementType BaseAnnouncementAnnouncementTypeEnum `mandatory:"true" json:"announcementType"` + LifecycleState BaseAnnouncementLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + IsBanner *bool `mandatory:"true" json:"isBanner"` + TimeOneTitle *string `mandatory:"false" json:"timeOneTitle"` + TimeOneValue *common.SDKTime `mandatory:"false" json:"timeOneValue"` + TimeTwoTitle *string `mandatory:"false" json:"timeTwoTitle"` + TimeTwoValue *common.SDKTime `mandatory:"false" json:"timeTwoValue"` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *baseannouncement) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerbaseannouncement baseannouncement + s := struct { + Model Unmarshalerbaseannouncement + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.ReferenceTicketNumber = s.Model.ReferenceTicketNumber + m.Summary = s.Model.Summary + m.Services = s.Model.Services + m.AffectedRegions = s.Model.AffectedRegions + m.AnnouncementType = s.Model.AnnouncementType + m.LifecycleState = s.Model.LifecycleState + m.IsBanner = s.Model.IsBanner + m.TimeOneTitle = s.Model.TimeOneTitle + m.TimeOneValue = s.Model.TimeOneValue + m.TimeTwoTitle = s.Model.TimeTwoTitle + m.TimeTwoValue = s.Model.TimeTwoValue + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *baseannouncement) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "AnnouncementSummary": + mm := AnnouncementSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "Announcement": + mm := Announcement{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetId returns Id +func (m baseannouncement) GetId() *string { + return m.Id +} + +//GetReferenceTicketNumber returns ReferenceTicketNumber +func (m baseannouncement) GetReferenceTicketNumber() *string { + return m.ReferenceTicketNumber +} + +//GetSummary returns Summary +func (m baseannouncement) GetSummary() *string { + return m.Summary +} + +//GetServices returns Services +func (m baseannouncement) GetServices() []string { + return m.Services +} + +//GetAffectedRegions returns AffectedRegions +func (m baseannouncement) GetAffectedRegions() []string { + return m.AffectedRegions +} + +//GetAnnouncementType returns AnnouncementType +func (m baseannouncement) GetAnnouncementType() BaseAnnouncementAnnouncementTypeEnum { + return m.AnnouncementType +} + +//GetLifecycleState returns LifecycleState +func (m baseannouncement) GetLifecycleState() BaseAnnouncementLifecycleStateEnum { + return m.LifecycleState +} + +//GetIsBanner returns IsBanner +func (m baseannouncement) GetIsBanner() *bool { + return m.IsBanner +} + +//GetTimeOneTitle returns TimeOneTitle +func (m baseannouncement) GetTimeOneTitle() *string { + return m.TimeOneTitle +} + +//GetTimeOneValue returns TimeOneValue +func (m baseannouncement) GetTimeOneValue() *common.SDKTime { + return m.TimeOneValue +} + +//GetTimeTwoTitle returns TimeTwoTitle +func (m baseannouncement) GetTimeTwoTitle() *string { + return m.TimeTwoTitle +} + +//GetTimeTwoValue returns TimeTwoValue +func (m baseannouncement) GetTimeTwoValue() *common.SDKTime { + return m.TimeTwoValue +} + +//GetTimeCreated returns TimeCreated +func (m baseannouncement) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m baseannouncement) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m baseannouncement) String() string { + return common.PointerString(m) +} + +// BaseAnnouncementAnnouncementTypeEnum Enum with underlying type: string +type BaseAnnouncementAnnouncementTypeEnum string + +// Set of constants representing the allowable values for BaseAnnouncementAnnouncementTypeEnum +const ( + BaseAnnouncementAnnouncementTypeActionRecommended BaseAnnouncementAnnouncementTypeEnum = "ACTION_RECOMMENDED" + BaseAnnouncementAnnouncementTypeActionRequired BaseAnnouncementAnnouncementTypeEnum = "ACTION_REQUIRED" + BaseAnnouncementAnnouncementTypeEmergencyChange BaseAnnouncementAnnouncementTypeEnum = "EMERGENCY_CHANGE" + BaseAnnouncementAnnouncementTypeEmergencyMaintenance BaseAnnouncementAnnouncementTypeEnum = "EMERGENCY_MAINTENANCE" + BaseAnnouncementAnnouncementTypeEmergencyMaintenanceComplete BaseAnnouncementAnnouncementTypeEnum = "EMERGENCY_MAINTENANCE_COMPLETE" + BaseAnnouncementAnnouncementTypeEmergencyMaintenanceExtended BaseAnnouncementAnnouncementTypeEnum = "EMERGENCY_MAINTENANCE_EXTENDED" + BaseAnnouncementAnnouncementTypeEmergencyMaintenanceRescheduled BaseAnnouncementAnnouncementTypeEnum = "EMERGENCY_MAINTENANCE_RESCHEDULED" + BaseAnnouncementAnnouncementTypeInformation BaseAnnouncementAnnouncementTypeEnum = "INFORMATION" + BaseAnnouncementAnnouncementTypePlannedChange BaseAnnouncementAnnouncementTypeEnum = "PLANNED_CHANGE" + BaseAnnouncementAnnouncementTypePlannedChangeComplete BaseAnnouncementAnnouncementTypeEnum = "PLANNED_CHANGE_COMPLETE" + BaseAnnouncementAnnouncementTypePlannedChangeExtended BaseAnnouncementAnnouncementTypeEnum = "PLANNED_CHANGE_EXTENDED" + BaseAnnouncementAnnouncementTypePlannedChangeRescheduled BaseAnnouncementAnnouncementTypeEnum = "PLANNED_CHANGE_RESCHEDULED" + BaseAnnouncementAnnouncementTypeProductionEventNotification BaseAnnouncementAnnouncementTypeEnum = "PRODUCTION_EVENT_NOTIFICATION" + BaseAnnouncementAnnouncementTypeScheduledMaintenance BaseAnnouncementAnnouncementTypeEnum = "SCHEDULED_MAINTENANCE" +) + +var mappingBaseAnnouncementAnnouncementType = map[string]BaseAnnouncementAnnouncementTypeEnum{ + "ACTION_RECOMMENDED": BaseAnnouncementAnnouncementTypeActionRecommended, + "ACTION_REQUIRED": BaseAnnouncementAnnouncementTypeActionRequired, + "EMERGENCY_CHANGE": BaseAnnouncementAnnouncementTypeEmergencyChange, + "EMERGENCY_MAINTENANCE": BaseAnnouncementAnnouncementTypeEmergencyMaintenance, + "EMERGENCY_MAINTENANCE_COMPLETE": BaseAnnouncementAnnouncementTypeEmergencyMaintenanceComplete, + "EMERGENCY_MAINTENANCE_EXTENDED": BaseAnnouncementAnnouncementTypeEmergencyMaintenanceExtended, + "EMERGENCY_MAINTENANCE_RESCHEDULED": BaseAnnouncementAnnouncementTypeEmergencyMaintenanceRescheduled, + "INFORMATION": BaseAnnouncementAnnouncementTypeInformation, + "PLANNED_CHANGE": BaseAnnouncementAnnouncementTypePlannedChange, + "PLANNED_CHANGE_COMPLETE": BaseAnnouncementAnnouncementTypePlannedChangeComplete, + "PLANNED_CHANGE_EXTENDED": BaseAnnouncementAnnouncementTypePlannedChangeExtended, + "PLANNED_CHANGE_RESCHEDULED": BaseAnnouncementAnnouncementTypePlannedChangeRescheduled, + "PRODUCTION_EVENT_NOTIFICATION": BaseAnnouncementAnnouncementTypeProductionEventNotification, + "SCHEDULED_MAINTENANCE": BaseAnnouncementAnnouncementTypeScheduledMaintenance, +} + +// GetBaseAnnouncementAnnouncementTypeEnumValues Enumerates the set of values for BaseAnnouncementAnnouncementTypeEnum +func GetBaseAnnouncementAnnouncementTypeEnumValues() []BaseAnnouncementAnnouncementTypeEnum { + values := make([]BaseAnnouncementAnnouncementTypeEnum, 0) + for _, v := range mappingBaseAnnouncementAnnouncementType { + values = append(values, v) + } + return values +} + +// BaseAnnouncementLifecycleStateEnum Enum with underlying type: string +type BaseAnnouncementLifecycleStateEnum string + +// Set of constants representing the allowable values for BaseAnnouncementLifecycleStateEnum +const ( + BaseAnnouncementLifecycleStateActive BaseAnnouncementLifecycleStateEnum = "ACTIVE" + BaseAnnouncementLifecycleStateInactive BaseAnnouncementLifecycleStateEnum = "INACTIVE" +) + +var mappingBaseAnnouncementLifecycleState = map[string]BaseAnnouncementLifecycleStateEnum{ + "ACTIVE": BaseAnnouncementLifecycleStateActive, + "INACTIVE": BaseAnnouncementLifecycleStateInactive, +} + +// GetBaseAnnouncementLifecycleStateEnumValues Enumerates the set of values for BaseAnnouncementLifecycleStateEnum +func GetBaseAnnouncementLifecycleStateEnumValues() []BaseAnnouncementLifecycleStateEnum { + values := make([]BaseAnnouncementLifecycleStateEnum, 0) + for _, v := range mappingBaseAnnouncementLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAnnouncementRequest wrapper for the GetAnnouncement operation +type GetAnnouncementRequest struct { + + // The OCID of the announcement. + AnnouncementId *string `mandatory:"true" contributesTo:"path" name:"announcementId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAnnouncementRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAnnouncementRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAnnouncementRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAnnouncementResponse wrapper for the GetAnnouncement operation +type GetAnnouncementResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Announcement instance + Announcement `presentIn:"body"` + + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAnnouncementResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAnnouncementResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_user_status_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_user_status_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_user_status_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/get_announcement_user_status_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAnnouncementUserStatusRequest wrapper for the GetAnnouncementUserStatus operation +type GetAnnouncementUserStatusRequest struct { + + // The OCID of the announcement. + AnnouncementId *string `mandatory:"true" contributesTo:"path" name:"announcementId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAnnouncementUserStatusRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAnnouncementUserStatusRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAnnouncementUserStatusRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAnnouncementUserStatusResponse wrapper for the GetAnnouncementUserStatus operation +type GetAnnouncementUserStatusResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AnnouncementUserStatusDetails instance + AnnouncementUserStatusDetails `presentIn:"body"` + + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAnnouncementUserStatusResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAnnouncementUserStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/list_announcements_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/list_announcements_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/list_announcements_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/list_announcements_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,166 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAnnouncementsRequest wrapper for the ListAnnouncements operation +type ListAnnouncementsRequest struct { + + // The OCID of the compartment. Because announcements are specific to a tenancy, this is the + // OCID of the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The type of announcement. + AnnouncementType *string `mandatory:"false" contributesTo:"query" name:"announcementType"` + + // The announcement's current lifecycle state. + LifecycleState ListAnnouncementsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Whether the announcement is displayed as a console banner. + IsBanner *bool `mandatory:"false" contributesTo:"query" name:"isBanner"` + + // The criteria to sort by. You can specify only one sort order. + SortBy ListAnnouncementsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use. (Sorting by `announcementType` orders the announcements list according to importance.) + SortOrder ListAnnouncementsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The boundary for the earliest `timeOneValue` date on announcements that you want to see. + TimeOneEarliestTime *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeOneEarliestTime"` + + // The boundary for the latest `timeOneValue` date on announcements that you want to see. + TimeOneLatestTime *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeOneLatestTime"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAnnouncementsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAnnouncementsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAnnouncementsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAnnouncementsResponse wrapper for the ListAnnouncements operation +type ListAnnouncementsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AnnouncementsCollection instances + AnnouncementsCollection `presentIn:"body"` + + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAnnouncementsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAnnouncementsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAnnouncementsLifecycleStateEnum Enum with underlying type: string +type ListAnnouncementsLifecycleStateEnum string + +// Set of constants representing the allowable values for ListAnnouncementsLifecycleStateEnum +const ( + ListAnnouncementsLifecycleStateActive ListAnnouncementsLifecycleStateEnum = "ACTIVE" + ListAnnouncementsLifecycleStateInactive ListAnnouncementsLifecycleStateEnum = "INACTIVE" +) + +var mappingListAnnouncementsLifecycleState = map[string]ListAnnouncementsLifecycleStateEnum{ + "ACTIVE": ListAnnouncementsLifecycleStateActive, + "INACTIVE": ListAnnouncementsLifecycleStateInactive, +} + +// GetListAnnouncementsLifecycleStateEnumValues Enumerates the set of values for ListAnnouncementsLifecycleStateEnum +func GetListAnnouncementsLifecycleStateEnumValues() []ListAnnouncementsLifecycleStateEnum { + values := make([]ListAnnouncementsLifecycleStateEnum, 0) + for _, v := range mappingListAnnouncementsLifecycleState { + values = append(values, v) + } + return values +} + +// ListAnnouncementsSortByEnum Enum with underlying type: string +type ListAnnouncementsSortByEnum string + +// Set of constants representing the allowable values for ListAnnouncementsSortByEnum +const ( + ListAnnouncementsSortByTimeonevalue ListAnnouncementsSortByEnum = "timeOneValue" + ListAnnouncementsSortByTimetwovalue ListAnnouncementsSortByEnum = "timeTwoValue" + ListAnnouncementsSortByTimecreated ListAnnouncementsSortByEnum = "timeCreated" + ListAnnouncementsSortByReferenceticketnumber ListAnnouncementsSortByEnum = "referenceTicketNumber" + ListAnnouncementsSortBySummary ListAnnouncementsSortByEnum = "summary" + ListAnnouncementsSortByAnnouncementtype ListAnnouncementsSortByEnum = "announcementType" +) + +var mappingListAnnouncementsSortBy = map[string]ListAnnouncementsSortByEnum{ + "timeOneValue": ListAnnouncementsSortByTimeonevalue, + "timeTwoValue": ListAnnouncementsSortByTimetwovalue, + "timeCreated": ListAnnouncementsSortByTimecreated, + "referenceTicketNumber": ListAnnouncementsSortByReferenceticketnumber, + "summary": ListAnnouncementsSortBySummary, + "announcementType": ListAnnouncementsSortByAnnouncementtype, +} + +// GetListAnnouncementsSortByEnumValues Enumerates the set of values for ListAnnouncementsSortByEnum +func GetListAnnouncementsSortByEnumValues() []ListAnnouncementsSortByEnum { + values := make([]ListAnnouncementsSortByEnum, 0) + for _, v := range mappingListAnnouncementsSortBy { + values = append(values, v) + } + return values +} + +// ListAnnouncementsSortOrderEnum Enum with underlying type: string +type ListAnnouncementsSortOrderEnum string + +// Set of constants representing the allowable values for ListAnnouncementsSortOrderEnum +const ( + ListAnnouncementsSortOrderAsc ListAnnouncementsSortOrderEnum = "ASC" + ListAnnouncementsSortOrderDesc ListAnnouncementsSortOrderEnum = "DESC" +) + +var mappingListAnnouncementsSortOrder = map[string]ListAnnouncementsSortOrderEnum{ + "ASC": ListAnnouncementsSortOrderAsc, + "DESC": ListAnnouncementsSortOrderDesc, +} + +// GetListAnnouncementsSortOrderEnumValues Enumerates the set of values for ListAnnouncementsSortOrderEnum +func GetListAnnouncementsSortOrderEnumValues() []ListAnnouncementsSortOrderEnum { + values := make([]ListAnnouncementsSortOrderEnum, 0) + for _, v := range mappingListAnnouncementsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/update_announcement_user_status_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/update_announcement_user_status_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/update_announcement_user_status_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/announcementsservice/update_announcement_user_status_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package announcementsservice + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAnnouncementUserStatusRequest wrapper for the UpdateAnnouncementUserStatus operation +type UpdateAnnouncementUserStatusRequest struct { + + // The OCID of the announcement. + AnnouncementId *string `mandatory:"true" contributesTo:"path" name:"announcementId"` + + // The information to use to update the announcement's read status. + StatusDetails AnnouncementUserStatusDetails `contributesTo:"body"` + + // The locking version, used for optimistic concurrency control. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAnnouncementUserStatusRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAnnouncementUserStatusRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAnnouncementUserStatusRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAnnouncementUserStatusResponse wrapper for the UpdateAnnouncementUserStatus operation +type UpdateAnnouncementUserStatusResponse struct { + + // The underlying http response + RawResponse *http.Response + + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateAnnouncementUserStatusResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAnnouncementUserStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Audit API @@ -37,7 +37,7 @@ // SetRegion overrides the region of this client. func (client *AuditClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "audit", region) + client.Host = common.StringToRegion(region).Endpoint("audit") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +48,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -60,54 +60,126 @@ // GetConfiguration Get the configuration func (client AuditClient) GetConfiguration(ctx context.Context, request GetConfigurationRequest) (response GetConfigurationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/configuration", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = GetConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConfigurationResponse") + } + return +} + +// getConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AuditClient) getConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/configuration") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListEvents Returns all audit events for the specified compartment that were processed within the specified time range. func (client AuditClient) ListEvents(ctx context.Context, request ListEventsRequest) (response ListEventsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/auditEvents", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listEvents, policy) + if err != nil { + if ociResponse != nil { + response = ListEventsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListEventsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListEventsResponse") + } + return +} + +// listEvents implements the OCIOperation interface (enables retrying operations) +func (client AuditClient) listEvents(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/auditEvents") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListEventsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateConfiguration Update the configuration func (client AuditClient) UpdateConfiguration(ctx context.Context, request UpdateConfigurationRequest) (response UpdateConfigurationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/configuration", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = UpdateConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateConfigurationResponse") + } + return +} + +// updateConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AuditClient) updateConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/configuration") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_event.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_event.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_event.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/audit_event.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Audit API @@ -21,9 +21,17 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The name of the compartment. This value is the friendly name associated with compartmentId. + // This value can change, but the service logs the value that appeared at the time of the audit event. + CompartmentName *string `mandatory:"false" json:"compartmentName"` + // The GUID of the event. EventId *string `mandatory:"false" json:"eventId"` + // The name of the event. + // Example: `LaunchInstance` + EventName *string `mandatory:"false" json:"eventName"` + // The source of the event. EventSource *string `mandatory:"false" json:"eventSource"` @@ -71,6 +79,9 @@ // Metadata of interest from the response payload. For example, the OCID of a resource. ResponsePayload map[string]interface{} `mandatory:"false" json:"responsePayload"` + + // The name of the user or service. This value is the friendly name associated with principalId. + UserName *string `mandatory:"false" json:"userName"` } func (m AuditEvent) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/configuration.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Audit API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/get_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/get_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/get_configuration_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/get_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package audit @@ -13,12 +13,30 @@ // ID of the root compartment (tenancy) CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetConfigurationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetConfigurationResponse wrapper for the GetConfiguration operation type GetConfigurationResponse struct { @@ -32,3 +50,8 @@ func (response GetConfigurationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/list_events_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/list_events_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/list_events_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/list_events_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package audit @@ -30,19 +30,33 @@ // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListEventsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListEventsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListEventsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListEventsResponse wrapper for the ListEvents operation type ListEventsResponse struct { // The underlying http response RawResponse *http.Response - // The []AuditEvent instance + // A list of []AuditEvent instances Items []AuditEvent `presentIn:"body"` // For pagination of a list of audit events. When this header appears in the response, @@ -58,3 +72,8 @@ func (response ListEventsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListEventsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Audit API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/audit/update_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package audit @@ -16,12 +16,30 @@ // The configuration properties UpdateConfigurationDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateConfigurationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateConfigurationResponse wrapper for the UpdateConfiguration operation type UpdateConfigurationResponse struct { @@ -32,10 +50,15 @@ // particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateConfigurationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/action.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/action.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/action.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/action.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Action The action to take when autoscaling is triggered. +type Action struct { + + // The type of action to take. + Type ActionTypeEnum `mandatory:"true" json:"type"` + + // To scale out (increase the number of instances), provide a positive value. To scale in (decrease the number of + // instances), provide a negative value. + Value *int `mandatory:"true" json:"value"` +} + +func (m Action) String() string { + return common.PointerString(m) +} + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeBy ActionTypeEnum = "CHANGE_COUNT_BY" +) + +var mappingActionType = map[string]ActionTypeEnum{ + "CHANGE_COUNT_BY": ActionTypeBy, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/autoscaling_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/autoscaling_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/autoscaling_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/autoscaling_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,501 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//AutoScalingClient a client for AutoScaling +type AutoScalingClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewAutoScalingClientWithConfigurationProvider Creates a new default AutoScaling client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewAutoScalingClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client AutoScalingClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = AutoScalingClient{BaseClient: baseClient} + client.BasePath = "20181001" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *AutoScalingClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("None", "https://autoscaling.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *AutoScalingClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *AutoScalingClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateAutoScalingConfiguration Creates an autoscaling configuration. +func (client AutoScalingClient) CreateAutoScalingConfiguration(ctx context.Context, request CreateAutoScalingConfigurationRequest) (response CreateAutoScalingConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutoScalingConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutoScalingConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAutoScalingConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutoScalingConfigurationResponse") + } + return +} + +// createAutoScalingConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) createAutoScalingConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autoScalingConfigurations") + if err != nil { + return nil, err + } + + var response CreateAutoScalingConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAutoScalingPolicy Creates an autoscaling policy for the specified autoscaling configuration. +func (client AutoScalingClient) CreateAutoScalingPolicy(ctx context.Context, request CreateAutoScalingPolicyRequest) (response CreateAutoScalingPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutoScalingPolicy, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutoScalingPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAutoScalingPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutoScalingPolicyResponse") + } + return +} + +// createAutoScalingPolicy implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) createAutoScalingPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autoScalingConfigurations/{autoScalingConfigurationId}/policies") + if err != nil { + return nil, err + } + + var response CreateAutoScalingPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &autoscalingpolicy{}) + return response, err +} + +// DeleteAutoScalingConfiguration Deletes an autoscaling configuration. +func (client AutoScalingClient) DeleteAutoScalingConfiguration(ctx context.Context, request DeleteAutoScalingConfigurationRequest) (response DeleteAutoScalingConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAutoScalingConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAutoScalingConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutoScalingConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutoScalingConfigurationResponse") + } + return +} + +// deleteAutoScalingConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) deleteAutoScalingConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autoScalingConfigurations/{autoScalingConfigurationId}") + if err != nil { + return nil, err + } + + var response DeleteAutoScalingConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAutoScalingPolicy Deletes an autoscaling policy for the specified autoscaling configuration. +func (client AutoScalingClient) DeleteAutoScalingPolicy(ctx context.Context, request DeleteAutoScalingPolicyRequest) (response DeleteAutoScalingPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAutoScalingPolicy, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAutoScalingPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutoScalingPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutoScalingPolicyResponse") + } + return +} + +// deleteAutoScalingPolicy implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) deleteAutoScalingPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}") + if err != nil { + return nil, err + } + + var response DeleteAutoScalingPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutoScalingConfiguration Gets information about the specified autoscaling configuration. +func (client AutoScalingClient) GetAutoScalingConfiguration(ctx context.Context, request GetAutoScalingConfigurationRequest) (response GetAutoScalingConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutoScalingConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = GetAutoScalingConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutoScalingConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutoScalingConfigurationResponse") + } + return +} + +// getAutoScalingConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) getAutoScalingConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autoScalingConfigurations/{autoScalingConfigurationId}") + if err != nil { + return nil, err + } + + var response GetAutoScalingConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutoScalingPolicy Gets information about the specified autoscaling policy in the specified autoscaling configuration. +func (client AutoScalingClient) GetAutoScalingPolicy(ctx context.Context, request GetAutoScalingPolicyRequest) (response GetAutoScalingPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutoScalingPolicy, policy) + if err != nil { + if ociResponse != nil { + response = GetAutoScalingPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutoScalingPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutoScalingPolicyResponse") + } + return +} + +// getAutoScalingPolicy implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) getAutoScalingPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}") + if err != nil { + return nil, err + } + + var response GetAutoScalingPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &autoscalingpolicy{}) + return response, err +} + +// ListAutoScalingConfigurations Lists autoscaling configurations in the specifed compartment. +func (client AutoScalingClient) ListAutoScalingConfigurations(ctx context.Context, request ListAutoScalingConfigurationsRequest) (response ListAutoScalingConfigurationsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutoScalingConfigurations, policy) + if err != nil { + if ociResponse != nil { + response = ListAutoScalingConfigurationsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutoScalingConfigurationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutoScalingConfigurationsResponse") + } + return +} + +// listAutoScalingConfigurations implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) listAutoScalingConfigurations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autoScalingConfigurations") + if err != nil { + return nil, err + } + + var response ListAutoScalingConfigurationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAutoScalingPolicies Lists the autoscaling policies in the specified autoscaling configuration. +func (client AutoScalingClient) ListAutoScalingPolicies(ctx context.Context, request ListAutoScalingPoliciesRequest) (response ListAutoScalingPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutoScalingPolicies, policy) + if err != nil { + if ociResponse != nil { + response = ListAutoScalingPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutoScalingPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutoScalingPoliciesResponse") + } + return +} + +// listAutoScalingPolicies implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) listAutoScalingPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autoScalingConfigurations/{autoScalingConfigurationId}/policies") + if err != nil { + return nil, err + } + + var response ListAutoScalingPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAutoScalingConfiguration Updates certain fields on the specified autoscaling configuration, such as the name, the cooldown period, +// and whether the autoscaling configuration is enabled. +func (client AutoScalingClient) UpdateAutoScalingConfiguration(ctx context.Context, request UpdateAutoScalingConfigurationRequest) (response UpdateAutoScalingConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateAutoScalingConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAutoScalingConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAutoScalingConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAutoScalingConfigurationResponse") + } + return +} + +// updateAutoScalingConfiguration implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) updateAutoScalingConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/autoScalingConfigurations/{autoScalingConfigurationId}") + if err != nil { + return nil, err + } + + var response UpdateAutoScalingConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAutoScalingPolicy Updates an autoscaling policy in the specified autoscaling configuration. +func (client AutoScalingClient) UpdateAutoScalingPolicy(ctx context.Context, request UpdateAutoScalingPolicyRequest) (response UpdateAutoScalingPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateAutoScalingPolicy, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAutoScalingPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAutoScalingPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAutoScalingPolicyResponse") + } + return +} + +// updateAutoScalingPolicy implements the OCIOperation interface (enables retrying operations) +func (client AutoScalingClient) updateAutoScalingPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}") + if err != nil { + return nil, err + } + + var response UpdateAutoScalingPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &autoscalingpolicy{}) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AutoScalingConfiguration An autoscaling configuration allows you to dynamically scale the resources in a Compute instance pool. +// For more information, see Autoscaling (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/autoscalinginstancepools.htm). +type AutoScalingConfiguration struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the autoscaling configuration. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + Id *string `mandatory:"true" json:"id"` + + Resource Resource `mandatory:"true" json:"resource"` + + // Autoscaling policy definitions for the autoscaling configuration. An autoscaling policy defines the criteria that + // trigger autoscaling actions and the actions to take. + // Each autoscaling configuration can have one autoscaling policy. + Policies []AutoScalingPolicy `mandatory:"true" json:"policies"` + + // The date and time the AutoScalingConfiguration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The minimum period of time to wait between scaling actions. The cooldown period gives the system time to stabilize + // before rescaling. The minimum value is 300 seconds, which is also the default. + CoolDownInSeconds *int `mandatory:"false" json:"coolDownInSeconds"` + + // Whether the autoscaling configuration is enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m AutoScalingConfiguration) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *AutoScalingConfiguration) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + CoolDownInSeconds *int `json:"coolDownInSeconds"` + IsEnabled *bool `json:"isEnabled"` + CompartmentId *string `json:"compartmentId"` + Id *string `json:"id"` + Resource resource `json:"resource"` + Policies []autoscalingpolicy `json:"policies"` + TimeCreated *common.SDKTime `json:"timeCreated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.CoolDownInSeconds = model.CoolDownInSeconds + m.IsEnabled = model.IsEnabled + m.CompartmentId = model.CompartmentId + m.Id = model.Id + nn, e := model.Resource.UnmarshalPolymorphicJSON(model.Resource.JsonData) + if e != nil { + return + } + if nn != nil { + m.Resource = nn.(Resource) + } else { + m.Resource = nil + } + m.Policies = make([]AutoScalingPolicy, len(model.Policies)) + for i, n := range model.Policies { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Policies[i] = nn.(AutoScalingPolicy) + } else { + m.Policies[i] = nil + } + } + m.TimeCreated = model.TimeCreated + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_configuration_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AutoScalingConfigurationSummary Summary information for an autoscaling configuration. +type AutoScalingConfigurationSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the autoscaling configuration. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + Id *string `mandatory:"true" json:"id"` + + // The date and time the AutoScalingConfiguration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The minimum period of time to wait between scaling actions. The cooldown period gives the system time to stabilize + // before rescaling. The minimum value is 300 seconds, which is also the default. + CoolDownInSeconds *int `mandatory:"false" json:"coolDownInSeconds"` + + // Whether the autoscaling configuration is enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + Resource Resource `mandatory:"false" json:"resource"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m AutoScalingConfigurationSummary) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *AutoScalingConfigurationSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + CoolDownInSeconds *int `json:"coolDownInSeconds"` + IsEnabled *bool `json:"isEnabled"` + Resource resource `json:"resource"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + FreeformTags map[string]string `json:"freeformTags"` + CompartmentId *string `json:"compartmentId"` + Id *string `json:"id"` + TimeCreated *common.SDKTime `json:"timeCreated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DisplayName = model.DisplayName + m.CoolDownInSeconds = model.CoolDownInSeconds + m.IsEnabled = model.IsEnabled + nn, e := model.Resource.UnmarshalPolymorphicJSON(model.Resource.JsonData) + if e != nil { + return + } + if nn != nil { + m.Resource = nn.(Resource) + } else { + m.Resource = nil + } + m.DefinedTags = model.DefinedTags + m.FreeformTags = model.FreeformTags + m.CompartmentId = model.CompartmentId + m.Id = model.Id + m.TimeCreated = model.TimeCreated + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AutoScalingPolicy Autoscaling policies define the criteria that trigger autoscaling actions and the actions to take. +// An autoscaling policy is part of an autoscaling configuration. For more information, see +// Autoscaling (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/autoscalinginstancepools.htm). +type AutoScalingPolicy interface { + + // The capacity requirements of the autoscaling policy. + GetCapacity() *Capacity + + // The date and time the autoscaling configuration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + GetTimeCreated() *common.SDKTime + + // The ID of the autoscaling policy that is assigned after creation. + GetId() *string + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + GetDisplayName() *string +} + +type autoscalingpolicy struct { + JsonData []byte + Capacity *Capacity `mandatory:"true" json:"capacity"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + Id *string `mandatory:"false" json:"id"` + DisplayName *string `mandatory:"false" json:"displayName"` + PolicyType string `json:"policyType"` +} + +// UnmarshalJSON unmarshals json +func (m *autoscalingpolicy) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerautoscalingpolicy autoscalingpolicy + s := struct { + Model Unmarshalerautoscalingpolicy + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Capacity = s.Model.Capacity + m.TimeCreated = s.Model.TimeCreated + m.Id = s.Model.Id + m.DisplayName = s.Model.DisplayName + m.PolicyType = s.Model.PolicyType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *autoscalingpolicy) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PolicyType { + case "threshold": + mm := ThresholdPolicy{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetCapacity returns Capacity +func (m autoscalingpolicy) GetCapacity() *Capacity { + return m.Capacity +} + +//GetTimeCreated returns TimeCreated +func (m autoscalingpolicy) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetId returns Id +func (m autoscalingpolicy) GetId() *string { + return m.Id +} + +//GetDisplayName returns DisplayName +func (m autoscalingpolicy) GetDisplayName() *string { + return m.DisplayName +} + +func (m autoscalingpolicy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/auto_scaling_policy_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutoScalingPolicySummary Summary information for an autoscaling policy. +type AutoScalingPolicySummary struct { + + // The ID of the autoscaling policy that is assigned after creation. + Id *string `mandatory:"true" json:"id"` + + // The type of autoscaling policy. + PolicyType *string `mandatory:"true" json:"policyType"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m AutoScalingPolicySummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/capacity.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/capacity.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/capacity.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/capacity.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Capacity Capacity limits for the instance pool. +type Capacity struct { + + // The maximum number of instances the instance pool is allowed to increase to (scale out). + Max *int `mandatory:"true" json:"max"` + + // The minimum number of instances the instance pool is allowed to decrease to (scale in). + Min *int `mandatory:"true" json:"min"` + + // The initial number of instances to launch in the instance pool immediately after autoscaling is + // enabled. After autoscaling retrieves performance metrics, the number of instances is automatically adjusted from this + // initial number to a number that is based on the limits that you set. + Initial *int `mandatory:"true" json:"initial"` +} + +func (m Capacity) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/condition.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/condition.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/condition.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/condition.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Condition A rule that defines a specific autoscaling action to take (scale in or scale out) and the metric that triggers that action. +type Condition struct { + Action *Action `mandatory:"true" json:"action"` + + Metric *Metric `mandatory:"true" json:"metric"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // ID of the condition that is assigned after creation. + Id *string `mandatory:"false" json:"id"` +} + +func (m Condition) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutoScalingConfigurationDetails Creation details for an autoscaling configuration. +type CreateAutoScalingConfigurationDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the autoscaling configuration. + // The autoscaling configuration and the instance pool that it manages must be in the same compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + Policies []CreateAutoScalingPolicyDetails `mandatory:"true" json:"policies"` + + Resource Resource `mandatory:"true" json:"resource"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The minimum period of time to wait between scaling actions. The cooldown period gives the system time to stabilize + // before rescaling. The minimum value is 300 seconds, which is also the default. + CoolDownInSeconds *int `mandatory:"false" json:"coolDownInSeconds"` + + // Whether the autoscaling configuration is enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m CreateAutoScalingConfigurationDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateAutoScalingConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + CoolDownInSeconds *int `json:"coolDownInSeconds"` + IsEnabled *bool `json:"isEnabled"` + CompartmentId *string `json:"compartmentId"` + Policies []createautoscalingpolicydetails `json:"policies"` + Resource resource `json:"resource"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.CoolDownInSeconds = model.CoolDownInSeconds + m.IsEnabled = model.IsEnabled + m.CompartmentId = model.CompartmentId + m.Policies = make([]CreateAutoScalingPolicyDetails, len(model.Policies)) + for i, n := range model.Policies { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Policies[i] = nn.(CreateAutoScalingPolicyDetails) + } else { + m.Policies[i] = nil + } + } + nn, e := model.Resource.UnmarshalPolymorphicJSON(model.Resource.JsonData) + if e != nil { + return + } + if nn != nil { + m.Resource = nn.(Resource) + } else { + m.Resource = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutoScalingConfigurationRequest wrapper for the CreateAutoScalingConfiguration operation +type CreateAutoScalingConfigurationRequest struct { + + // Creation details for an autoscaling configuration. + CreateAutoScalingConfigurationDetails `contributesTo:"body"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutoScalingConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutoScalingConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutoScalingConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutoScalingConfigurationResponse wrapper for the CreateAutoScalingConfiguration operation +type CreateAutoScalingConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingConfiguration instance + AutoScalingConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutoScalingConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutoScalingConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutoScalingPolicyDetails Creation details for an autoscaling policy. +// Each autoscaling configuration can have one autoscaling policy. +// In a threshold-based autoscaling policy, an autoscaling action is triggered when a performance metric meets +// or exceeds a threshold. +type CreateAutoScalingPolicyDetails interface { + + // The capacity requirements of the autoscaling policy. + GetCapacity() *Capacity + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + GetDisplayName() *string +} + +type createautoscalingpolicydetails struct { + JsonData []byte + Capacity *Capacity `mandatory:"true" json:"capacity"` + DisplayName *string `mandatory:"false" json:"displayName"` + PolicyType string `json:"policyType"` +} + +// UnmarshalJSON unmarshals json +func (m *createautoscalingpolicydetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateautoscalingpolicydetails createautoscalingpolicydetails + s := struct { + Model Unmarshalercreateautoscalingpolicydetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Capacity = s.Model.Capacity + m.DisplayName = s.Model.DisplayName + m.PolicyType = s.Model.PolicyType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createautoscalingpolicydetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PolicyType { + case "threshold": + mm := CreateThresholdPolicyDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetCapacity returns Capacity +func (m createautoscalingpolicydetails) GetCapacity() *Capacity { + return m.Capacity +} + +//GetDisplayName returns DisplayName +func (m createautoscalingpolicydetails) GetDisplayName() *string { + return m.DisplayName +} + +func (m createautoscalingpolicydetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_auto_scaling_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutoScalingPolicyRequest wrapper for the CreateAutoScalingPolicy operation +type CreateAutoScalingPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // Creation details for an autoscaling policy. + CreateAutoScalingPolicyDetails `contributesTo:"body"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutoScalingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutoScalingPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutoScalingPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutoScalingPolicyResponse wrapper for the CreateAutoScalingPolicy operation +type CreateAutoScalingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingPolicy instance + AutoScalingPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutoScalingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutoScalingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_condition_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_condition_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_condition_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_condition_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateConditionDetails Creation details for a condition in a threshold-based autoscaling policy. +type CreateConditionDetails struct { + Action *Action `mandatory:"true" json:"action"` + + Metric *Metric `mandatory:"true" json:"metric"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CreateConditionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_threshold_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_threshold_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_threshold_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/create_threshold_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateThresholdPolicyDetails Creation details for a threshold-based autoscaling policy. +// In a threshold-based autoscaling policy, an autoscaling action is triggered when a performance metric meets +// or exceeds a threshold. +type CreateThresholdPolicyDetails struct { + + // The capacity requirements of the autoscaling policy. + Capacity *Capacity `mandatory:"true" json:"capacity"` + + Rules []CreateConditionDetails `mandatory:"true" json:"rules"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +//GetCapacity returns Capacity +func (m CreateThresholdPolicyDetails) GetCapacity() *Capacity { + return m.Capacity +} + +//GetDisplayName returns DisplayName +func (m CreateThresholdPolicyDetails) GetDisplayName() *string { + return m.DisplayName +} + +func (m CreateThresholdPolicyDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m CreateThresholdPolicyDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateThresholdPolicyDetails CreateThresholdPolicyDetails + s := struct { + DiscriminatorParam string `json:"policyType"` + MarshalTypeCreateThresholdPolicyDetails + }{ + "threshold", + (MarshalTypeCreateThresholdPolicyDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAutoScalingConfigurationRequest wrapper for the DeleteAutoScalingConfiguration operation +type DeleteAutoScalingConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAutoScalingConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAutoScalingConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAutoScalingConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAutoScalingConfigurationResponse wrapper for the DeleteAutoScalingConfiguration operation +type DeleteAutoScalingConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAutoScalingConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAutoScalingConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/delete_auto_scaling_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAutoScalingPolicyRequest wrapper for the DeleteAutoScalingPolicy operation +type DeleteAutoScalingPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // The ID of the autoscaling policy. + AutoScalingPolicyId *string `mandatory:"true" contributesTo:"path" name:"autoScalingPolicyId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAutoScalingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAutoScalingPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAutoScalingPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAutoScalingPolicyResponse wrapper for the DeleteAutoScalingPolicy operation +type DeleteAutoScalingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAutoScalingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAutoScalingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutoScalingConfigurationRequest wrapper for the GetAutoScalingConfiguration operation +type GetAutoScalingConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutoScalingConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutoScalingConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutoScalingConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutoScalingConfigurationResponse wrapper for the GetAutoScalingConfiguration operation +type GetAutoScalingConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingConfiguration instance + AutoScalingConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutoScalingConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutoScalingConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/get_auto_scaling_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutoScalingPolicyRequest wrapper for the GetAutoScalingPolicy operation +type GetAutoScalingPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // The ID of the autoscaling policy. + AutoScalingPolicyId *string `mandatory:"true" contributesTo:"path" name:"autoScalingPolicyId"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutoScalingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutoScalingPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutoScalingPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutoScalingPolicyResponse wrapper for the GetAutoScalingPolicy operation +type GetAutoScalingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingPolicy instance + AutoScalingPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutoScalingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutoScalingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/instance_pool_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/instance_pool_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/instance_pool_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/instance_pool_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolResource A Compute instance pool. +type InstancePoolResource struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource that is managed by the autoscaling configuration. + Id *string `mandatory:"true" json:"id"` +} + +//GetId returns Id +func (m InstancePoolResource) GetId() *string { + return m.Id +} + +func (m InstancePoolResource) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstancePoolResource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstancePoolResource InstancePoolResource + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeInstancePoolResource + }{ + "instancePool", + (MarshalTypeInstancePoolResource)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_configurations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_configurations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_configurations_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_configurations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutoScalingConfigurationsRequest wrapper for the ListAutoScalingConfigurations operation +type ListAutoScalingConfigurationsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources monitored by the metric that you are searching for. Use tenancyId to search in + // the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of items to return in a paginated "List" call. For important details + // about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. For important + // details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + SortBy ListAutoScalingConfigurationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListAutoScalingConfigurationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutoScalingConfigurationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutoScalingConfigurationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutoScalingConfigurationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutoScalingConfigurationsResponse wrapper for the ListAutoScalingConfigurations operation +type ListAutoScalingConfigurationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutoScalingConfigurationSummary instances + Items []AutoScalingConfigurationSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAutoScalingConfigurationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutoScalingConfigurationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutoScalingConfigurationsSortByEnum Enum with underlying type: string +type ListAutoScalingConfigurationsSortByEnum string + +// Set of constants representing the allowable values for ListAutoScalingConfigurationsSortByEnum +const ( + ListAutoScalingConfigurationsSortByTimecreated ListAutoScalingConfigurationsSortByEnum = "TIMECREATED" + ListAutoScalingConfigurationsSortByDisplayname ListAutoScalingConfigurationsSortByEnum = "DISPLAYNAME" +) + +var mappingListAutoScalingConfigurationsSortBy = map[string]ListAutoScalingConfigurationsSortByEnum{ + "TIMECREATED": ListAutoScalingConfigurationsSortByTimecreated, + "DISPLAYNAME": ListAutoScalingConfigurationsSortByDisplayname, +} + +// GetListAutoScalingConfigurationsSortByEnumValues Enumerates the set of values for ListAutoScalingConfigurationsSortByEnum +func GetListAutoScalingConfigurationsSortByEnumValues() []ListAutoScalingConfigurationsSortByEnum { + values := make([]ListAutoScalingConfigurationsSortByEnum, 0) + for _, v := range mappingListAutoScalingConfigurationsSortBy { + values = append(values, v) + } + return values +} + +// ListAutoScalingConfigurationsSortOrderEnum Enum with underlying type: string +type ListAutoScalingConfigurationsSortOrderEnum string + +// Set of constants representing the allowable values for ListAutoScalingConfigurationsSortOrderEnum +const ( + ListAutoScalingConfigurationsSortOrderAsc ListAutoScalingConfigurationsSortOrderEnum = "ASC" + ListAutoScalingConfigurationsSortOrderDesc ListAutoScalingConfigurationsSortOrderEnum = "DESC" +) + +var mappingListAutoScalingConfigurationsSortOrder = map[string]ListAutoScalingConfigurationsSortOrderEnum{ + "ASC": ListAutoScalingConfigurationsSortOrderAsc, + "DESC": ListAutoScalingConfigurationsSortOrderDesc, +} + +// GetListAutoScalingConfigurationsSortOrderEnumValues Enumerates the set of values for ListAutoScalingConfigurationsSortOrderEnum +func GetListAutoScalingConfigurationsSortOrderEnumValues() []ListAutoScalingConfigurationsSortOrderEnum { + values := make([]ListAutoScalingConfigurationsSortOrderEnum, 0) + for _, v := range mappingListAutoScalingConfigurationsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_policies_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/list_auto_scaling_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutoScalingPoliciesRequest wrapper for the ListAutoScalingPolicies operation +type ListAutoScalingPoliciesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of items to return in a paginated "List" call. For important details + // about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. For important + // details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + SortBy ListAutoScalingPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListAutoScalingPoliciesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutoScalingPoliciesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutoScalingPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutoScalingPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutoScalingPoliciesResponse wrapper for the ListAutoScalingPolicies operation +type ListAutoScalingPoliciesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutoScalingPolicySummary instances + Items []AutoScalingPolicySummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAutoScalingPoliciesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutoScalingPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutoScalingPoliciesSortByEnum Enum with underlying type: string +type ListAutoScalingPoliciesSortByEnum string + +// Set of constants representing the allowable values for ListAutoScalingPoliciesSortByEnum +const ( + ListAutoScalingPoliciesSortByTimecreated ListAutoScalingPoliciesSortByEnum = "TIMECREATED" + ListAutoScalingPoliciesSortByDisplayname ListAutoScalingPoliciesSortByEnum = "DISPLAYNAME" +) + +var mappingListAutoScalingPoliciesSortBy = map[string]ListAutoScalingPoliciesSortByEnum{ + "TIMECREATED": ListAutoScalingPoliciesSortByTimecreated, + "DISPLAYNAME": ListAutoScalingPoliciesSortByDisplayname, +} + +// GetListAutoScalingPoliciesSortByEnumValues Enumerates the set of values for ListAutoScalingPoliciesSortByEnum +func GetListAutoScalingPoliciesSortByEnumValues() []ListAutoScalingPoliciesSortByEnum { + values := make([]ListAutoScalingPoliciesSortByEnum, 0) + for _, v := range mappingListAutoScalingPoliciesSortBy { + values = append(values, v) + } + return values +} + +// ListAutoScalingPoliciesSortOrderEnum Enum with underlying type: string +type ListAutoScalingPoliciesSortOrderEnum string + +// Set of constants representing the allowable values for ListAutoScalingPoliciesSortOrderEnum +const ( + ListAutoScalingPoliciesSortOrderAsc ListAutoScalingPoliciesSortOrderEnum = "ASC" + ListAutoScalingPoliciesSortOrderDesc ListAutoScalingPoliciesSortOrderEnum = "DESC" +) + +var mappingListAutoScalingPoliciesSortOrder = map[string]ListAutoScalingPoliciesSortOrderEnum{ + "ASC": ListAutoScalingPoliciesSortOrderAsc, + "DESC": ListAutoScalingPoliciesSortOrderDesc, +} + +// GetListAutoScalingPoliciesSortOrderEnumValues Enumerates the set of values for ListAutoScalingPoliciesSortOrderEnum +func GetListAutoScalingPoliciesSortOrderEnumValues() []ListAutoScalingPoliciesSortOrderEnum { + values := make([]ListAutoScalingPoliciesSortOrderEnum, 0) + for _, v := range mappingListAutoScalingPoliciesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/metric.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/metric.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/metric.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/metric.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Metric Metric and threshold details for triggering an autoscaling action. +type Metric struct { + MetricType MetricMetricTypeEnum `mandatory:"true" json:"metricType"` + + Threshold *Threshold `mandatory:"true" json:"threshold"` +} + +func (m Metric) String() string { + return common.PointerString(m) +} + +// MetricMetricTypeEnum Enum with underlying type: string +type MetricMetricTypeEnum string + +// Set of constants representing the allowable values for MetricMetricTypeEnum +const ( + MetricMetricTypeCpuUtilization MetricMetricTypeEnum = "CPU_UTILIZATION" + MetricMetricTypeMemoryUtilization MetricMetricTypeEnum = "MEMORY_UTILIZATION" +) + +var mappingMetricMetricType = map[string]MetricMetricTypeEnum{ + "CPU_UTILIZATION": MetricMetricTypeCpuUtilization, + "MEMORY_UTILIZATION": MetricMetricTypeMemoryUtilization, +} + +// GetMetricMetricTypeEnumValues Enumerates the set of values for MetricMetricTypeEnum +func GetMetricMetricTypeEnumValues() []MetricMetricTypeEnum { + values := make([]MetricMetricTypeEnum, 0) + for _, v := range mappingMetricMetricType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// Resource A resource that is managed by an autoscaling configuration. The only supported type is "instancePool." +// Each instance pool can have one autoscaling configuration. +type Resource interface { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource that is managed by the autoscaling configuration. + GetId() *string +} + +type resource struct { + JsonData []byte + Id *string `mandatory:"true" json:"id"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *resource) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerresource resource + s := struct { + Model Unmarshalerresource + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *resource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "instancePool": + mm := InstancePoolResource{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetId returns Id +func (m resource) GetId() *string { + return m.Id +} + +func (m resource) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Threshold The representation of Threshold +type Threshold struct { + + // The comparison operator to use. Options are greater than (`GT`), greater than or equal to + // (`GTE`), less than (`LT`), and less than or equal to (`LTE`). + Operator ThresholdOperatorEnum `mandatory:"true" json:"operator"` + + Value *int `mandatory:"true" json:"value"` +} + +func (m Threshold) String() string { + return common.PointerString(m) +} + +// ThresholdOperatorEnum Enum with underlying type: string +type ThresholdOperatorEnum string + +// Set of constants representing the allowable values for ThresholdOperatorEnum +const ( + ThresholdOperatorGt ThresholdOperatorEnum = "GT" + ThresholdOperatorGte ThresholdOperatorEnum = "GTE" + ThresholdOperatorLt ThresholdOperatorEnum = "LT" + ThresholdOperatorLte ThresholdOperatorEnum = "LTE" +) + +var mappingThresholdOperator = map[string]ThresholdOperatorEnum{ + "GT": ThresholdOperatorGt, + "GTE": ThresholdOperatorGte, + "LT": ThresholdOperatorLt, + "LTE": ThresholdOperatorLte, +} + +// GetThresholdOperatorEnumValues Enumerates the set of values for ThresholdOperatorEnum +func GetThresholdOperatorEnumValues() []ThresholdOperatorEnum { + values := make([]ThresholdOperatorEnum, 0) + for _, v := range mappingThresholdOperator { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/threshold_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ThresholdPolicy An autoscaling policy that defines threshold-based rules for an autoscaling configuration. +type ThresholdPolicy struct { + + // The capacity requirements of the autoscaling policy. + Capacity *Capacity `mandatory:"true" json:"capacity"` + + // The date and time the autoscaling configuration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + Rules []Condition `mandatory:"true" json:"rules"` + + // The ID of the autoscaling policy that is assigned after creation. + Id *string `mandatory:"false" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +//GetCapacity returns Capacity +func (m ThresholdPolicy) GetCapacity() *Capacity { + return m.Capacity +} + +//GetId returns Id +func (m ThresholdPolicy) GetId() *string { + return m.Id +} + +//GetDisplayName returns DisplayName +func (m ThresholdPolicy) GetDisplayName() *string { + return m.DisplayName +} + +//GetTimeCreated returns TimeCreated +func (m ThresholdPolicy) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +func (m ThresholdPolicy) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m ThresholdPolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeThresholdPolicy ThresholdPolicy + s := struct { + DiscriminatorParam string `json:"policyType"` + MarshalTypeThresholdPolicy + }{ + "threshold", + (MarshalTypeThresholdPolicy)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAutoScalingConfigurationDetails The representation of UpdateAutoScalingConfigurationDetails +type UpdateAutoScalingConfigurationDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Whether the autoscaling configuration is enabled. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // The minimum period of time to wait between scaling actions. The cooldown period gives the system time + // to stabilize before rescaling. The minimum value is 300 seconds, which is also the default. + CoolDownInSeconds *int `mandatory:"false" json:"coolDownInSeconds"` +} + +func (m UpdateAutoScalingConfigurationDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAutoScalingConfigurationRequest wrapper for the UpdateAutoScalingConfiguration operation +type UpdateAutoScalingConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // Update details for an autoscaling configuration. + UpdateAutoScalingConfigurationDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAutoScalingConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAutoScalingConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAutoScalingConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAutoScalingConfigurationResponse wrapper for the UpdateAutoScalingConfiguration operation +type UpdateAutoScalingConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingConfiguration instance + AutoScalingConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateAutoScalingConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAutoScalingConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAutoScalingPolicyDetails The representation of UpdateAutoScalingPolicyDetails +type UpdateAutoScalingPolicyDetails interface { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + GetDisplayName() *string + + // The capacity requirements of the autoscaling policy. + GetCapacity() *Capacity +} + +type updateautoscalingpolicydetails struct { + JsonData []byte + DisplayName *string `mandatory:"false" json:"displayName"` + Capacity *Capacity `mandatory:"false" json:"capacity"` + PolicyType string `json:"policyType"` +} + +// UnmarshalJSON unmarshals json +func (m *updateautoscalingpolicydetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateautoscalingpolicydetails updateautoscalingpolicydetails + s := struct { + Model Unmarshalerupdateautoscalingpolicydetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.Capacity = s.Model.Capacity + m.PolicyType = s.Model.PolicyType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateautoscalingpolicydetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PolicyType { + case "threshold": + mm := UpdateThresholdPolicyDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetDisplayName returns DisplayName +func (m updateautoscalingpolicydetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCapacity returns Capacity +func (m updateautoscalingpolicydetails) GetCapacity() *Capacity { + return m.Capacity +} + +func (m updateautoscalingpolicydetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_auto_scaling_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAutoScalingPolicyRequest wrapper for the UpdateAutoScalingPolicy operation +type UpdateAutoScalingPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the autoscaling configuration. + AutoScalingConfigurationId *string `mandatory:"true" contributesTo:"path" name:"autoScalingConfigurationId"` + + // The ID of the autoscaling policy. + AutoScalingPolicyId *string `mandatory:"true" contributesTo:"path" name:"autoScalingPolicyId"` + + // Update details for an autoscaling policy. + UpdateAutoScalingPolicyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAutoScalingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAutoScalingPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAutoScalingPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAutoScalingPolicyResponse wrapper for the UpdateAutoScalingPolicy operation +type UpdateAutoScalingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutoScalingPolicy instance + AutoScalingPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateAutoScalingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAutoScalingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_condition_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_condition_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_condition_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_condition_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateConditionDetails Update details for a condition in a threshold-based autoscaling policy. +type UpdateConditionDetails struct { + Action *Action `mandatory:"true" json:"action"` + + Metric *Metric `mandatory:"true" json:"metric"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m UpdateConditionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_threshold_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_threshold_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_threshold_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/autoscaling/update_threshold_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Autoscaling API +// +// APIs for dynamically scaling Compute resources to meet application requirements. +// For information about the Compute service, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). +// + +package autoscaling + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateThresholdPolicyDetails The representation of UpdateThresholdPolicyDetails +type UpdateThresholdPolicyDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The capacity requirements of the autoscaling policy. + Capacity *Capacity `mandatory:"false" json:"capacity"` + + Rules []UpdateConditionDetails `mandatory:"false" json:"rules"` +} + +//GetDisplayName returns DisplayName +func (m UpdateThresholdPolicyDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetCapacity returns Capacity +func (m UpdateThresholdPolicyDetails) GetCapacity() *Capacity { + return m.Capacity +} + +func (m UpdateThresholdPolicyDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m UpdateThresholdPolicyDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateThresholdPolicyDetails UpdateThresholdPolicyDetails + s := struct { + DiscriminatorParam string `json:"policyType"` + MarshalTypeUpdateThresholdPolicyDetails + }{ + "threshold", + (MarshalTypeUpdateThresholdPolicyDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlertRule The alert rule. +type AlertRule struct { + + // The OCID of the alert rule + Id *string `mandatory:"true" json:"id"` + + // The OCID of the budget + BudgetId *string `mandatory:"true" json:"budgetId"` + + // The name of the alert rule. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or + // FORECAST (the alert will trigger based on predicted usage). + Type AlertRuleTypeEnum `mandatory:"true" json:"type"` + + // The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000. + Threshold *float32 `mandatory:"true" json:"threshold"` + + // The type of threshold. + ThresholdType AlertRuleThresholdTypeEnum `mandatory:"true" json:"thresholdType"` + + // The current state of the alert rule. + LifecycleState AlertRuleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Delimited list of email addresses to receive the alert when it triggers. + // Delimiter character can be comma, space, TAB, or semicolon. + Recipients *string `mandatory:"true" json:"recipients"` + + // Time budget was created + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Time budget was updated + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Custom message sent when alert is triggered + Message *string `mandatory:"false" json:"message"` + + // The description of the alert rule. + Description *string `mandatory:"false" json:"description"` + + // Version of the alert rule. Starts from 1 and increments by 1. + Version *int `mandatory:"false" json:"version"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m AlertRule) String() string { + return common.PointerString(m) +} + +// AlertRuleTypeEnum Enum with underlying type: string +type AlertRuleTypeEnum string + +// Set of constants representing the allowable values for AlertRuleTypeEnum +const ( + AlertRuleTypeActual AlertRuleTypeEnum = "ACTUAL" + AlertRuleTypeForecast AlertRuleTypeEnum = "FORECAST" +) + +var mappingAlertRuleType = map[string]AlertRuleTypeEnum{ + "ACTUAL": AlertRuleTypeActual, + "FORECAST": AlertRuleTypeForecast, +} + +// GetAlertRuleTypeEnumValues Enumerates the set of values for AlertRuleTypeEnum +func GetAlertRuleTypeEnumValues() []AlertRuleTypeEnum { + values := make([]AlertRuleTypeEnum, 0) + for _, v := range mappingAlertRuleType { + values = append(values, v) + } + return values +} + +// AlertRuleThresholdTypeEnum Enum with underlying type: string +type AlertRuleThresholdTypeEnum string + +// Set of constants representing the allowable values for AlertRuleThresholdTypeEnum +const ( + AlertRuleThresholdTypePercentage AlertRuleThresholdTypeEnum = "PERCENTAGE" + AlertRuleThresholdTypeAbsolute AlertRuleThresholdTypeEnum = "ABSOLUTE" +) + +var mappingAlertRuleThresholdType = map[string]AlertRuleThresholdTypeEnum{ + "PERCENTAGE": AlertRuleThresholdTypePercentage, + "ABSOLUTE": AlertRuleThresholdTypeAbsolute, +} + +// GetAlertRuleThresholdTypeEnumValues Enumerates the set of values for AlertRuleThresholdTypeEnum +func GetAlertRuleThresholdTypeEnumValues() []AlertRuleThresholdTypeEnum { + values := make([]AlertRuleThresholdTypeEnum, 0) + for _, v := range mappingAlertRuleThresholdType { + values = append(values, v) + } + return values +} + +// AlertRuleLifecycleStateEnum Enum with underlying type: string +type AlertRuleLifecycleStateEnum string + +// Set of constants representing the allowable values for AlertRuleLifecycleStateEnum +const ( + AlertRuleLifecycleStateActive AlertRuleLifecycleStateEnum = "ACTIVE" + AlertRuleLifecycleStateInactive AlertRuleLifecycleStateEnum = "INACTIVE" +) + +var mappingAlertRuleLifecycleState = map[string]AlertRuleLifecycleStateEnum{ + "ACTIVE": AlertRuleLifecycleStateActive, + "INACTIVE": AlertRuleLifecycleStateInactive, +} + +// GetAlertRuleLifecycleStateEnumValues Enumerates the set of values for AlertRuleLifecycleStateEnum +func GetAlertRuleLifecycleStateEnumValues() []AlertRuleLifecycleStateEnum { + values := make([]AlertRuleLifecycleStateEnum, 0) + for _, v := range mappingAlertRuleLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_rule_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlertRuleSummary The alert rule. +type AlertRuleSummary struct { + + // The OCID of the alert rule + Id *string `mandatory:"true" json:"id"` + + // The OCID of the budget + BudgetId *string `mandatory:"true" json:"budgetId"` + + // The name of the alert rule. + DisplayName *string `mandatory:"true" json:"displayName"` + + // ACTUAL means the alert will trigger based on actual usage. + // FORECAST means the alert will trigger based on predicted usage. + Type AlertRuleSummaryTypeEnum `mandatory:"true" json:"type"` + + // The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000. + Threshold *float32 `mandatory:"true" json:"threshold"` + + // The type of threshold. + ThresholdType AlertRuleSummaryThresholdTypeEnum `mandatory:"true" json:"thresholdType"` + + // The current state of the alert rule. + LifecycleState AlertRuleSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The audience that will received the alert when it triggers. + Recipients *string `mandatory:"true" json:"recipients"` + + // Time when budget was created + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Time when budget was updated + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Custom message that will be sent when alert is triggered + Message *string `mandatory:"false" json:"message"` + + // The description of the alert rule. + Description *string `mandatory:"false" json:"description"` + + // Version of the alert rule. Starts from 1 and increments by 1. + Version *int `mandatory:"false" json:"version"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m AlertRuleSummary) String() string { + return common.PointerString(m) +} + +// AlertRuleSummaryTypeEnum Enum with underlying type: string +type AlertRuleSummaryTypeEnum string + +// Set of constants representing the allowable values for AlertRuleSummaryTypeEnum +const ( + AlertRuleSummaryTypeActual AlertRuleSummaryTypeEnum = "ACTUAL" + AlertRuleSummaryTypeForecast AlertRuleSummaryTypeEnum = "FORECAST" +) + +var mappingAlertRuleSummaryType = map[string]AlertRuleSummaryTypeEnum{ + "ACTUAL": AlertRuleSummaryTypeActual, + "FORECAST": AlertRuleSummaryTypeForecast, +} + +// GetAlertRuleSummaryTypeEnumValues Enumerates the set of values for AlertRuleSummaryTypeEnum +func GetAlertRuleSummaryTypeEnumValues() []AlertRuleSummaryTypeEnum { + values := make([]AlertRuleSummaryTypeEnum, 0) + for _, v := range mappingAlertRuleSummaryType { + values = append(values, v) + } + return values +} + +// AlertRuleSummaryThresholdTypeEnum Enum with underlying type: string +type AlertRuleSummaryThresholdTypeEnum string + +// Set of constants representing the allowable values for AlertRuleSummaryThresholdTypeEnum +const ( + AlertRuleSummaryThresholdTypePercentage AlertRuleSummaryThresholdTypeEnum = "PERCENTAGE" + AlertRuleSummaryThresholdTypeAbsolute AlertRuleSummaryThresholdTypeEnum = "ABSOLUTE" +) + +var mappingAlertRuleSummaryThresholdType = map[string]AlertRuleSummaryThresholdTypeEnum{ + "PERCENTAGE": AlertRuleSummaryThresholdTypePercentage, + "ABSOLUTE": AlertRuleSummaryThresholdTypeAbsolute, +} + +// GetAlertRuleSummaryThresholdTypeEnumValues Enumerates the set of values for AlertRuleSummaryThresholdTypeEnum +func GetAlertRuleSummaryThresholdTypeEnumValues() []AlertRuleSummaryThresholdTypeEnum { + values := make([]AlertRuleSummaryThresholdTypeEnum, 0) + for _, v := range mappingAlertRuleSummaryThresholdType { + values = append(values, v) + } + return values +} + +// AlertRuleSummaryLifecycleStateEnum Enum with underlying type: string +type AlertRuleSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for AlertRuleSummaryLifecycleStateEnum +const ( + AlertRuleSummaryLifecycleStateActive AlertRuleSummaryLifecycleStateEnum = "ACTIVE" + AlertRuleSummaryLifecycleStateInactive AlertRuleSummaryLifecycleStateEnum = "INACTIVE" +) + +var mappingAlertRuleSummaryLifecycleState = map[string]AlertRuleSummaryLifecycleStateEnum{ + "ACTIVE": AlertRuleSummaryLifecycleStateActive, + "INACTIVE": AlertRuleSummaryLifecycleStateInactive, +} + +// GetAlertRuleSummaryLifecycleStateEnumValues Enumerates the set of values for AlertRuleSummaryLifecycleStateEnum +func GetAlertRuleSummaryLifecycleStateEnumValues() []AlertRuleSummaryLifecycleStateEnum { + values := make([]AlertRuleSummaryLifecycleStateEnum, 0) + for _, v := range mappingAlertRuleSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_type.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_type.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_type.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/alert_type.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,22 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlertType Valid values are ACTUAL (the alert will trigger based on actual usage) or +// FORECAST (the alert will trigger based on predicted usage). +type AlertType struct { +} + +func (m AlertType) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,489 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//BudgetClient a client for Budget +type BudgetClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewBudgetClientWithConfigurationProvider Creates a new default Budget client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewBudgetClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client BudgetClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = BudgetClient{BaseClient: baseClient} + client.BasePath = "20190111" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *BudgetClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("budget", "https://usage.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *BudgetClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *BudgetClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateAlertRule Creates a new Alert Rule. +func (client BudgetClient) CreateAlertRule(ctx context.Context, request CreateAlertRuleRequest) (response CreateAlertRuleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAlertRule, policy) + if err != nil { + if ociResponse != nil { + response = CreateAlertRuleResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAlertRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAlertRuleResponse") + } + return +} + +// createAlertRule implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) createAlertRule(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/budgets/{budgetId}/alertRules") + if err != nil { + return nil, err + } + + var response CreateAlertRuleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateBudget Creates a new Budget. +func (client BudgetClient) CreateBudget(ctx context.Context, request CreateBudgetRequest) (response CreateBudgetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBudget, policy) + if err != nil { + if ociResponse != nil { + response = CreateBudgetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateBudgetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBudgetResponse") + } + return +} + +// createBudget implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) createBudget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/budgets") + if err != nil { + return nil, err + } + + var response CreateBudgetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAlertRule Deletes a specified Alert Rule resource. +func (client BudgetClient) DeleteAlertRule(ctx context.Context, request DeleteAlertRuleRequest) (response DeleteAlertRuleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAlertRule, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAlertRuleResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAlertRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAlertRuleResponse") + } + return +} + +// deleteAlertRule implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) deleteAlertRule(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/budgets/{budgetId}/alertRules/{alertRuleId}") + if err != nil { + return nil, err + } + + var response DeleteAlertRuleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteBudget Deletes a specified Budget resource +func (client BudgetClient) DeleteBudget(ctx context.Context, request DeleteBudgetRequest) (response DeleteBudgetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBudget, policy) + if err != nil { + if ociResponse != nil { + response = DeleteBudgetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteBudgetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBudgetResponse") + } + return +} + +// deleteBudget implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) deleteBudget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/budgets/{budgetId}") + if err != nil { + return nil, err + } + + var response DeleteBudgetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAlertRule Gets an Alert Rule for a specified Budget. +func (client BudgetClient) GetAlertRule(ctx context.Context, request GetAlertRuleRequest) (response GetAlertRuleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAlertRule, policy) + if err != nil { + if ociResponse != nil { + response = GetAlertRuleResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAlertRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAlertRuleResponse") + } + return +} + +// getAlertRule implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) getAlertRule(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/budgets/{budgetId}/alertRules/{alertRuleId}") + if err != nil { + return nil, err + } + + var response GetAlertRuleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBudget Gets a Budget by identifier +func (client BudgetClient) GetBudget(ctx context.Context, request GetBudgetRequest) (response GetBudgetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBudget, policy) + if err != nil { + if ociResponse != nil { + response = GetBudgetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBudgetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBudgetResponse") + } + return +} + +// getBudget implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) getBudget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/budgets/{budgetId}") + if err != nil { + return nil, err + } + + var response GetBudgetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAlertRules Returns a list of Alert Rules for a specified Budget. +func (client BudgetClient) ListAlertRules(ctx context.Context, request ListAlertRulesRequest) (response ListAlertRulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAlertRules, policy) + if err != nil { + if ociResponse != nil { + response = ListAlertRulesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAlertRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAlertRulesResponse") + } + return +} + +// listAlertRules implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) listAlertRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/budgets/{budgetId}/alertRules") + if err != nil { + return nil, err + } + + var response ListAlertRulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBudgets Gets a list of all Budgets in a compartment. +func (client BudgetClient) ListBudgets(ctx context.Context, request ListBudgetsRequest) (response ListBudgetsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBudgets, policy) + if err != nil { + if ociResponse != nil { + response = ListBudgetsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListBudgetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBudgetsResponse") + } + return +} + +// listBudgets implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) listBudgets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/budgets") + if err != nil { + return nil, err + } + + var response ListBudgetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAlertRule Update an Alert Rule for the budget identified by the OCID. +func (client BudgetClient) UpdateAlertRule(ctx context.Context, request UpdateAlertRuleRequest) (response UpdateAlertRuleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateAlertRule, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAlertRuleResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAlertRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAlertRuleResponse") + } + return +} + +// updateAlertRule implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) updateAlertRule(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/budgets/{budgetId}/alertRules/{alertRuleId}") + if err != nil { + return nil, err + } + + var response UpdateAlertRuleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateBudget Update a Budget identified by the OCID +func (client BudgetClient) UpdateBudget(ctx context.Context, request UpdateBudgetRequest) (response UpdateBudgetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateBudget, policy) + if err != nil { + if ociResponse != nil { + response = UpdateBudgetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateBudgetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBudgetResponse") + } + return +} + +// updateBudget implements the OCIOperation interface (enables retrying operations) +func (client BudgetClient) updateBudget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/budgets/{budgetId}") + if err != nil { + return nil, err + } + + var response UpdateBudgetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Budget A budget. +type Budget struct { + + // The OCID of the budget + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the compartment on which budget is applied + TargetCompartmentId *string `mandatory:"true" json:"targetCompartmentId"` + + // The display name of the budget. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The amount of the budget expressed in the currency of the customer's rate card. + Amount *float32 `mandatory:"true" json:"amount"` + + // The reset period for the budget. + ResetPeriod BudgetResetPeriodEnum `mandatory:"true" json:"resetPeriod"` + + // The current state of the budget. + LifecycleState BudgetLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Total number of alert rules in the budget + AlertRuleCount *int `mandatory:"true" json:"alertRuleCount"` + + // Time that budget was created + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Time that budget was updated + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The description of the budget. + Description *string `mandatory:"false" json:"description"` + + // Version of the budget. Starts from 1 and increments by 1. + Version *int `mandatory:"false" json:"version"` + + // The actual spend in currency for the current budget cycle + ActualSpend *float32 `mandatory:"false" json:"actualSpend"` + + // The forecasted spend in currency by the end of the current budget cycle + ForecastedSpend *float32 `mandatory:"false" json:"forecastedSpend"` + + // The time that the budget spend was last computed + TimeSpendComputed *common.SDKTime `mandatory:"false" json:"timeSpendComputed"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Budget) String() string { + return common.PointerString(m) +} + +// BudgetResetPeriodEnum Enum with underlying type: string +type BudgetResetPeriodEnum string + +// Set of constants representing the allowable values for BudgetResetPeriodEnum +const ( + BudgetResetPeriodMonthly BudgetResetPeriodEnum = "MONTHLY" +) + +var mappingBudgetResetPeriod = map[string]BudgetResetPeriodEnum{ + "MONTHLY": BudgetResetPeriodMonthly, +} + +// GetBudgetResetPeriodEnumValues Enumerates the set of values for BudgetResetPeriodEnum +func GetBudgetResetPeriodEnumValues() []BudgetResetPeriodEnum { + values := make([]BudgetResetPeriodEnum, 0) + for _, v := range mappingBudgetResetPeriod { + values = append(values, v) + } + return values +} + +// BudgetLifecycleStateEnum Enum with underlying type: string +type BudgetLifecycleStateEnum string + +// Set of constants representing the allowable values for BudgetLifecycleStateEnum +const ( + BudgetLifecycleStateActive BudgetLifecycleStateEnum = "ACTIVE" + BudgetLifecycleStateInactive BudgetLifecycleStateEnum = "INACTIVE" +) + +var mappingBudgetLifecycleState = map[string]BudgetLifecycleStateEnum{ + "ACTIVE": BudgetLifecycleStateActive, + "INACTIVE": BudgetLifecycleStateInactive, +} + +// GetBudgetLifecycleStateEnumValues Enumerates the set of values for BudgetLifecycleStateEnum +func GetBudgetLifecycleStateEnumValues() []BudgetLifecycleStateEnum { + values := make([]BudgetLifecycleStateEnum, 0) + for _, v := range mappingBudgetLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/budget_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BudgetSummary A budget. +type BudgetSummary struct { + + // The OCID of the budget + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the compartment on which budget is applied + TargetCompartmentId *string `mandatory:"true" json:"targetCompartmentId"` + + // The display name of the budget. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The amount of the budget expressed in the currency of the customer's rate card. + Amount *float32 `mandatory:"true" json:"amount"` + + // The reset period for the budget. + ResetPeriod BudgetSummaryResetPeriodEnum `mandatory:"true" json:"resetPeriod"` + + // The current state of the budget. + LifecycleState BudgetSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Total number of alert rules in the budget + AlertRuleCount *int `mandatory:"true" json:"alertRuleCount"` + + // Time budget was created + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Time budget was updated + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The description of the budget. + Description *string `mandatory:"false" json:"description"` + + // Version of the budget. Starts from 1 and increments by 1. + Version *int `mandatory:"false" json:"version"` + + // The actual spend in currency for the current budget cycle + ActualSpend *float32 `mandatory:"false" json:"actualSpend"` + + // The forecasted spend in currency by the end of the current budget cycle + ForecastedSpend *float32 `mandatory:"false" json:"forecastedSpend"` + + // Time budget spend was last computed + TimeSpendComputed *common.SDKTime `mandatory:"false" json:"timeSpendComputed"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m BudgetSummary) String() string { + return common.PointerString(m) +} + +// BudgetSummaryResetPeriodEnum Enum with underlying type: string +type BudgetSummaryResetPeriodEnum string + +// Set of constants representing the allowable values for BudgetSummaryResetPeriodEnum +const ( + BudgetSummaryResetPeriodMonthly BudgetSummaryResetPeriodEnum = "MONTHLY" +) + +var mappingBudgetSummaryResetPeriod = map[string]BudgetSummaryResetPeriodEnum{ + "MONTHLY": BudgetSummaryResetPeriodMonthly, +} + +// GetBudgetSummaryResetPeriodEnumValues Enumerates the set of values for BudgetSummaryResetPeriodEnum +func GetBudgetSummaryResetPeriodEnumValues() []BudgetSummaryResetPeriodEnum { + values := make([]BudgetSummaryResetPeriodEnum, 0) + for _, v := range mappingBudgetSummaryResetPeriod { + values = append(values, v) + } + return values +} + +// BudgetSummaryLifecycleStateEnum Enum with underlying type: string +type BudgetSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for BudgetSummaryLifecycleStateEnum +const ( + BudgetSummaryLifecycleStateActive BudgetSummaryLifecycleStateEnum = "ACTIVE" + BudgetSummaryLifecycleStateInactive BudgetSummaryLifecycleStateEnum = "INACTIVE" +) + +var mappingBudgetSummaryLifecycleState = map[string]BudgetSummaryLifecycleStateEnum{ + "ACTIVE": BudgetSummaryLifecycleStateActive, + "INACTIVE": BudgetSummaryLifecycleStateInactive, +} + +// GetBudgetSummaryLifecycleStateEnumValues Enumerates the set of values for BudgetSummaryLifecycleStateEnum +func GetBudgetSummaryLifecycleStateEnumValues() []BudgetSummaryLifecycleStateEnum { + values := make([]BudgetSummaryLifecycleStateEnum, 0) + for _, v := range mappingBudgetSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAlertRuleDetails The create alert rule details. This is a batch-create. +type CreateAlertRuleDetails struct { + + // Type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or + // FORECAST (the alert will trigger based on predicted usage). + Type CreateAlertRuleDetailsTypeEnum `mandatory:"true" json:"type"` + + // The threshold for triggering the alert expressed as a whole number or decimal value. + // If thresholdType is ABSOLUTE, threshold can have at most 12 digits before the decimal point and up to 2 digits after the decimal point. + // If thresholdType is PERCENTAGE, the maximum value is 10000 and can have up to 2 digits after the decimal point. + Threshold *float32 `mandatory:"true" json:"threshold"` + + // The type of threshold. + ThresholdType CreateAlertRuleDetailsThresholdTypeEnum `mandatory:"true" json:"thresholdType"` + + // The audience that will received the alert when it triggers. + Recipients *string `mandatory:"true" json:"recipients"` + + // The name of the alert rule. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description of the alert rule. + Description *string `mandatory:"false" json:"description"` + + // The message to be sent to the recipients when alert rule is triggered. + Message *string `mandatory:"false" json:"message"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateAlertRuleDetails) String() string { + return common.PointerString(m) +} + +// CreateAlertRuleDetailsTypeEnum Enum with underlying type: string +type CreateAlertRuleDetailsTypeEnum string + +// Set of constants representing the allowable values for CreateAlertRuleDetailsTypeEnum +const ( + CreateAlertRuleDetailsTypeActual CreateAlertRuleDetailsTypeEnum = "ACTUAL" + CreateAlertRuleDetailsTypeForecast CreateAlertRuleDetailsTypeEnum = "FORECAST" +) + +var mappingCreateAlertRuleDetailsType = map[string]CreateAlertRuleDetailsTypeEnum{ + "ACTUAL": CreateAlertRuleDetailsTypeActual, + "FORECAST": CreateAlertRuleDetailsTypeForecast, +} + +// GetCreateAlertRuleDetailsTypeEnumValues Enumerates the set of values for CreateAlertRuleDetailsTypeEnum +func GetCreateAlertRuleDetailsTypeEnumValues() []CreateAlertRuleDetailsTypeEnum { + values := make([]CreateAlertRuleDetailsTypeEnum, 0) + for _, v := range mappingCreateAlertRuleDetailsType { + values = append(values, v) + } + return values +} + +// CreateAlertRuleDetailsThresholdTypeEnum Enum with underlying type: string +type CreateAlertRuleDetailsThresholdTypeEnum string + +// Set of constants representing the allowable values for CreateAlertRuleDetailsThresholdTypeEnum +const ( + CreateAlertRuleDetailsThresholdTypePercentage CreateAlertRuleDetailsThresholdTypeEnum = "PERCENTAGE" + CreateAlertRuleDetailsThresholdTypeAbsolute CreateAlertRuleDetailsThresholdTypeEnum = "ABSOLUTE" +) + +var mappingCreateAlertRuleDetailsThresholdType = map[string]CreateAlertRuleDetailsThresholdTypeEnum{ + "PERCENTAGE": CreateAlertRuleDetailsThresholdTypePercentage, + "ABSOLUTE": CreateAlertRuleDetailsThresholdTypeAbsolute, +} + +// GetCreateAlertRuleDetailsThresholdTypeEnumValues Enumerates the set of values for CreateAlertRuleDetailsThresholdTypeEnum +func GetCreateAlertRuleDetailsThresholdTypeEnumValues() []CreateAlertRuleDetailsThresholdTypeEnum { + values := make([]CreateAlertRuleDetailsThresholdTypeEnum, 0) + for _, v := range mappingCreateAlertRuleDetailsThresholdType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_alert_rule_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAlertRuleRequest wrapper for the CreateAlertRule operation +type CreateAlertRuleRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // Details for the new Alert Rule. + CreateAlertRuleDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAlertRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAlertRuleRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAlertRuleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAlertRuleResponse wrapper for the CreateAlertRule operation +type CreateAlertRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AlertRule instance + AlertRule `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateAlertRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAlertRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateBudgetDetails The create budget details. +type CreateBudgetDetails struct { + + // The OCID of the compartment + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the compartment on which budget is applied + TargetCompartmentId *string `mandatory:"true" json:"targetCompartmentId"` + + // The amount of the budget expressed as a whole number in the currency of the customer's rate card. + Amount *float32 `mandatory:"true" json:"amount"` + + // The reset period for the budget. + ResetPeriod CreateBudgetDetailsResetPeriodEnum `mandatory:"true" json:"resetPeriod"` + + // The displayName of the budget. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description of the budget. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateBudgetDetails) String() string { + return common.PointerString(m) +} + +// CreateBudgetDetailsResetPeriodEnum Enum with underlying type: string +type CreateBudgetDetailsResetPeriodEnum string + +// Set of constants representing the allowable values for CreateBudgetDetailsResetPeriodEnum +const ( + CreateBudgetDetailsResetPeriodMonthly CreateBudgetDetailsResetPeriodEnum = "MONTHLY" +) + +var mappingCreateBudgetDetailsResetPeriod = map[string]CreateBudgetDetailsResetPeriodEnum{ + "MONTHLY": CreateBudgetDetailsResetPeriodMonthly, +} + +// GetCreateBudgetDetailsResetPeriodEnumValues Enumerates the set of values for CreateBudgetDetailsResetPeriodEnum +func GetCreateBudgetDetailsResetPeriodEnumValues() []CreateBudgetDetailsResetPeriodEnum { + values := make([]CreateBudgetDetailsResetPeriodEnum, 0) + for _, v := range mappingCreateBudgetDetailsResetPeriod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/create_budget_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateBudgetRequest wrapper for the CreateBudget operation +type CreateBudgetRequest struct { + + // Details for the new Budget. + CreateBudgetDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateBudgetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateBudgetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBudgetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateBudgetResponse wrapper for the CreateBudget operation +type CreateBudgetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Budget instance + Budget `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateBudgetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateBudgetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_alert_rule_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_alert_rule_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_alert_rule_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_alert_rule_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAlertRuleRequest wrapper for the DeleteAlertRule operation +type DeleteAlertRuleRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The unique Alert Rule OCID + AlertRuleId *string `mandatory:"true" contributesTo:"path" name:"alertRuleId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAlertRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAlertRuleRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAlertRuleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAlertRuleResponse wrapper for the DeleteAlertRule operation +type DeleteAlertRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAlertRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAlertRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_budget_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_budget_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_budget_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/delete_budget_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteBudgetRequest wrapper for the DeleteBudget operation +type DeleteBudgetRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteBudgetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteBudgetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBudgetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteBudgetResponse wrapper for the DeleteBudget operation +type DeleteBudgetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteBudgetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBudgetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_alert_rule_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_alert_rule_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_alert_rule_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_alert_rule_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAlertRuleRequest wrapper for the GetAlertRule operation +type GetAlertRuleRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The unique Alert Rule OCID + AlertRuleId *string `mandatory:"true" contributesTo:"path" name:"alertRuleId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAlertRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAlertRuleRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAlertRuleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAlertRuleResponse wrapper for the GetAlertRule operation +type GetAlertRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AlertRule instance + AlertRule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAlertRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAlertRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_budget_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_budget_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_budget_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/get_budget_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetBudgetRequest wrapper for the GetBudget operation +type GetBudgetRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetBudgetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetBudgetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBudgetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetBudgetResponse wrapper for the GetBudget operation +type GetBudgetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Budget instance + Budget `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetBudgetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetBudgetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/lifecycle_state.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/lifecycle_state.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/lifecycle_state.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/lifecycle_state.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// LifecycleState The current state of the resource. +type LifecycleState struct { +} + +func (m LifecycleState) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_alert_rules_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_alert_rules_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_alert_rules_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_alert_rules_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAlertRulesRequest wrapper for the ListAlertRules operation +type ListAlertRulesRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListAlertRulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. If not specified, the default is timeCreated. + // The default sort order for timeCreated is DESC. + // The default sort order for displayName is ASC in alphanumeric order. + SortBy *string `mandatory:"false" contributesTo:"query" name:"sortBy"` + + // The current state of the resource to filter by. + LifecycleState *string `mandatory:"false" contributesTo:"query" name:"lifecycleState"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAlertRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAlertRulesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAlertRulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAlertRulesResponse wrapper for the ListAlertRules operation +type ListAlertRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AlertRuleSummary instances + Items []AlertRuleSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of `AlertRuleSummary`s. If this header appears in the response, then this + // is a partial list of AlertRuleSummaries. Include this value as the `page` parameter in a subsequent + // GET request to get the next batch of AlertRuleSummaries. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAlertRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAlertRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAlertRulesSortOrderEnum Enum with underlying type: string +type ListAlertRulesSortOrderEnum string + +// Set of constants representing the allowable values for ListAlertRulesSortOrderEnum +const ( + ListAlertRulesSortOrderAsc ListAlertRulesSortOrderEnum = "ASC" + ListAlertRulesSortOrderDesc ListAlertRulesSortOrderEnum = "DESC" +) + +var mappingListAlertRulesSortOrder = map[string]ListAlertRulesSortOrderEnum{ + "ASC": ListAlertRulesSortOrderAsc, + "DESC": ListAlertRulesSortOrderDesc, +} + +// GetListAlertRulesSortOrderEnumValues Enumerates the set of values for ListAlertRulesSortOrderEnum +func GetListAlertRulesSortOrderEnumValues() []ListAlertRulesSortOrderEnum { + values := make([]ListAlertRulesSortOrderEnum, 0) + for _, v := range mappingListAlertRulesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_budgets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_budgets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_budgets_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/list_budgets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListBudgetsRequest wrapper for the ListBudgets operation +type ListBudgetsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListBudgetsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. If not specified, the default is timeCreated. + // The default sort order for timeCreated is DESC. + // The default sort order for displayName is ASC in alphanumeric order. + SortBy *string `mandatory:"false" contributesTo:"query" name:"sortBy"` + + // The current state of the resource to filter by. + LifecycleState *string `mandatory:"false" contributesTo:"query" name:"lifecycleState"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Example: `My new resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListBudgetsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListBudgetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBudgetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListBudgetsResponse wrapper for the ListBudgets operation +type ListBudgetsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []BudgetSummary instances + Items []BudgetSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of `Budget`s. If this header appears in the response, then this + // is a partial list of Budgets. Include this value as the `page` parameter in a subsequent + // GET request to get the next batch of Budgets. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListBudgetsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListBudgetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListBudgetsSortOrderEnum Enum with underlying type: string +type ListBudgetsSortOrderEnum string + +// Set of constants representing the allowable values for ListBudgetsSortOrderEnum +const ( + ListBudgetsSortOrderAsc ListBudgetsSortOrderEnum = "ASC" + ListBudgetsSortOrderDesc ListBudgetsSortOrderEnum = "DESC" +) + +var mappingListBudgetsSortOrder = map[string]ListBudgetsSortOrderEnum{ + "ASC": ListBudgetsSortOrderAsc, + "DESC": ListBudgetsSortOrderDesc, +} + +// GetListBudgetsSortOrderEnumValues Enumerates the set of values for ListBudgetsSortOrderEnum +func GetListBudgetsSortOrderEnumValues() []ListBudgetsSortOrderEnum { + values := make([]ListBudgetsSortOrderEnum, 0) + for _, v := range mappingListBudgetsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/reset_period.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/reset_period.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/reset_period.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/reset_period.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ResetPeriod The reset period for the budget. Valid value is MONTHLY. +type ResetPeriod struct { +} + +func (m ResetPeriod) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_by.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_by.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_by.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_by.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SortBy The field to sort by. If not specified, the default is timeCreated. +// The default sort order for timeCreated is DESC. +// The default sort order for displayName is ASC in alphanumeric order. +type SortBy struct { +} + +func (m SortBy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_order.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_order.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_order.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/sort_order.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SortOrder The sort order to use. Valid values are 'asc' or 'desc'. +type SortOrder struct { +} + +func (m SortOrder) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/threshold_type.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/threshold_type.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/threshold_type.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/threshold_type.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ThresholdType The type of threshold. Valid values are PERCENTAGE or ABSOLUTE. +type ThresholdType struct { +} + +func (m ThresholdType) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAlertRuleDetails The update alert rule details. +type UpdateAlertRuleDetails struct { + + // The name of the alert rule. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or + // FORECAST (the alert will trigger based on predicted usage). + Type UpdateAlertRuleDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The threshold for triggering the alert expressed as a whole number or decimal value. + // If thresholdType is ABSOLUTE, threshold can have at most 12 digits before the decimal point and up to 2 digits after the decimal point. + // If thresholdType is PERCENTAGE, the maximum value is 10000 and can have up to 2 digits after the decimal point. + Threshold *float32 `mandatory:"false" json:"threshold"` + + // The type of threshold. + ThresholdType UpdateAlertRuleDetailsThresholdTypeEnum `mandatory:"false" json:"thresholdType,omitempty"` + + // The audience that will received the alert when it triggers. + Recipients *string `mandatory:"false" json:"recipients"` + + // The description of the alert rule + Description *string `mandatory:"false" json:"description"` + + // The message to be delivered to the recipients when alert is triggered + Message *string `mandatory:"false" json:"message"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateAlertRuleDetails) String() string { + return common.PointerString(m) +} + +// UpdateAlertRuleDetailsTypeEnum Enum with underlying type: string +type UpdateAlertRuleDetailsTypeEnum string + +// Set of constants representing the allowable values for UpdateAlertRuleDetailsTypeEnum +const ( + UpdateAlertRuleDetailsTypeActual UpdateAlertRuleDetailsTypeEnum = "ACTUAL" + UpdateAlertRuleDetailsTypeForecast UpdateAlertRuleDetailsTypeEnum = "FORECAST" +) + +var mappingUpdateAlertRuleDetailsType = map[string]UpdateAlertRuleDetailsTypeEnum{ + "ACTUAL": UpdateAlertRuleDetailsTypeActual, + "FORECAST": UpdateAlertRuleDetailsTypeForecast, +} + +// GetUpdateAlertRuleDetailsTypeEnumValues Enumerates the set of values for UpdateAlertRuleDetailsTypeEnum +func GetUpdateAlertRuleDetailsTypeEnumValues() []UpdateAlertRuleDetailsTypeEnum { + values := make([]UpdateAlertRuleDetailsTypeEnum, 0) + for _, v := range mappingUpdateAlertRuleDetailsType { + values = append(values, v) + } + return values +} + +// UpdateAlertRuleDetailsThresholdTypeEnum Enum with underlying type: string +type UpdateAlertRuleDetailsThresholdTypeEnum string + +// Set of constants representing the allowable values for UpdateAlertRuleDetailsThresholdTypeEnum +const ( + UpdateAlertRuleDetailsThresholdTypePercentage UpdateAlertRuleDetailsThresholdTypeEnum = "PERCENTAGE" + UpdateAlertRuleDetailsThresholdTypeAbsolute UpdateAlertRuleDetailsThresholdTypeEnum = "ABSOLUTE" +) + +var mappingUpdateAlertRuleDetailsThresholdType = map[string]UpdateAlertRuleDetailsThresholdTypeEnum{ + "PERCENTAGE": UpdateAlertRuleDetailsThresholdTypePercentage, + "ABSOLUTE": UpdateAlertRuleDetailsThresholdTypeAbsolute, +} + +// GetUpdateAlertRuleDetailsThresholdTypeEnumValues Enumerates the set of values for UpdateAlertRuleDetailsThresholdTypeEnum +func GetUpdateAlertRuleDetailsThresholdTypeEnumValues() []UpdateAlertRuleDetailsThresholdTypeEnum { + values := make([]UpdateAlertRuleDetailsThresholdTypeEnum, 0) + for _, v := range mappingUpdateAlertRuleDetailsThresholdType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_alert_rule_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAlertRuleRequest wrapper for the UpdateAlertRule operation +type UpdateAlertRuleRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The unique Alert Rule OCID + AlertRuleId *string `mandatory:"true" contributesTo:"path" name:"alertRuleId"` + + // The information to be updated. + UpdateAlertRuleDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAlertRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAlertRuleRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAlertRuleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAlertRuleResponse wrapper for the UpdateAlertRule operation +type UpdateAlertRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AlertRule instance + AlertRule `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateAlertRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAlertRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Budgets API +// +// Use the Budgets API to manage budgets and budget alerts. +// + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateBudgetDetails The update budget details. +type UpdateBudgetDetails struct { + + // The displayName of the budget. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The description of the budget. + Description *string `mandatory:"false" json:"description"` + + // The amount of the budget expressed as a whole number in the currency of the customer's rate card. + Amount *float32 `mandatory:"false" json:"amount"` + + // The reset period for the budget. + ResetPeriod UpdateBudgetDetailsResetPeriodEnum `mandatory:"false" json:"resetPeriod,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateBudgetDetails) String() string { + return common.PointerString(m) +} + +// UpdateBudgetDetailsResetPeriodEnum Enum with underlying type: string +type UpdateBudgetDetailsResetPeriodEnum string + +// Set of constants representing the allowable values for UpdateBudgetDetailsResetPeriodEnum +const ( + UpdateBudgetDetailsResetPeriodMonthly UpdateBudgetDetailsResetPeriodEnum = "MONTHLY" +) + +var mappingUpdateBudgetDetailsResetPeriod = map[string]UpdateBudgetDetailsResetPeriodEnum{ + "MONTHLY": UpdateBudgetDetailsResetPeriodMonthly, +} + +// GetUpdateBudgetDetailsResetPeriodEnumValues Enumerates the set of values for UpdateBudgetDetailsResetPeriodEnum +func GetUpdateBudgetDetailsResetPeriodEnumValues() []UpdateBudgetDetailsResetPeriodEnum { + values := make([]UpdateBudgetDetailsResetPeriodEnum, 0) + for _, v := range mappingUpdateBudgetDetailsResetPeriod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/budget/update_budget_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package budget + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateBudgetRequest wrapper for the UpdateBudget operation +type UpdateBudgetRequest struct { + + // The unique Budget OCID + BudgetId *string `mandatory:"true" contributesTo:"path" name:"budgetId"` + + // The information to be updated. + UpdateBudgetDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateBudgetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateBudgetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBudgetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateBudgetResponse wrapper for the UpdateBudget operation +type UpdateBudgetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Budget instance + Budget `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateBudgetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBudgetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/CHANGELOG.md juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/CHANGELOG.md --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/CHANGELOG.md 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/CHANGELOG.md 2019-06-28 17:13:01.000000000 +0000 @@ -4,6 +4,438 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 5.7.0 - 2019-05-21 +### Added +- Support for returning tags when listing instance configurations, instance pools, or autoscaling configurations in the Compute Autoscaling service +- Support for getting the namespace of another tenancy than the caller's tenancy in the Object Storage service +- Support for BGP dynamic routing and providing pre-shared secrets (PSKs) when establishing tunnels in the Networking service + +## 5.6.0 - 2019-05-14 +### Added +- Support for the Seoul (ICN) region +- Support for logging context fields on data-plane APIs of the Key Management Service +- Support for reverse pagination on list operations of the Email service +- Support for configuring backup retention windows on database backups in the Database service + +## 5.5.0 - 2019-05-07 +### Added +- Support for the Tokyo (NRT) region + +- Support UploadManager for uploading large objects. Sample is available on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_objectstorage_test.go) + +## 5.4.0 - 2019-04-16 +### Added +- Support for tagging dynamic groups in the Identity service +- Support for updating network ACLs and license types for autonomous databases and autonomous data warehouses in the Database service +- Support for editing static routes and IPSec remote IDs in the Virtual Networking service + +## 5.3.0 - 2019-04-09 +### Added +- Support for etag and if-match headers (for optimistic concurrency control) in the Email service + +## 5.2.0 - 2019-04-02 +### Added +- Support for provider service key names on virtual circuits in the FastConnect service +- Support for customer reference names on cross connects and cross connect groups in the FastConnect service + +## 5.1.0 - 2019-03-26 +### Added +- Support for glob patterns and exclusions for object lifecycle management in the Object Storage service +- Documentation enhancements and corrections for traffic management in the DNS service + +### Fixed +- The 'tag' info is always ignored in the returned string of Version() function [Github issue 157](https://github.com/oracle/oci-go-sdk/issues/157) + +## 5.0.0 - 2019-03-19 +### Added + +- Support for specifying metadata on node pools in the Container Engine for Kubernetes service +- Support for provisioning a new autonomous database or autonomous data warehouse as a clone of another in the Database service +### Breaking changes +- The field``CreateAutonomousDatabaseDetails`` is no longer an anonymous field and the type changed from struct to interface in struct ``CreateAutonomousDatabaseRequest``. Here is sample code that shows how to update your code to incorporate this change. + + - Before + + ```golang + // create a CreateAutonomousDatabaseRequest + // There were two ways to initialize the CreateAutonomousDatabaseRequest struct. + // This breaking change only impact option #2 + request := database.CreateAutonomousDatabaseRequest{} + + // #1. Instantiate CreateAutonomousDatabaseDetails directly: no impact + details := database.CreateAutonomousDatabaseDetails{} + details.CompartmentId = common.String(getCompartmentID()) + // ... other properties + + // Set it to the request class + request.CreateAutonomousDatabaseDetails = details + + // #2. Instantiate CreateAutnomousDatabaseDetails through anonymous fields: will break + request.CompartmentId = common.String(getCompartmentID()) + // ... other properties + ``` + + - After + + ```golang + // #2 no longer supported. Create CreateAutonomousDatabaseDetails directly + details := database.CreateAutonomousDatabaseDetails{} + details.CompartmentId = common.String(getCompartmentID()) + // ... other properties + + // and set the details to CreateAutonomousDatabaseBase + request := database.CreateAutonomousDatabaseRequest{} + request.CreateAutonomousDatabaseDetails = details + // ... + ``` + + +## 4.2.0 - 2019-03-12 +### Added +- Support for the Budgets service +- Support for managing multifactor authentication in the Identity service +- Support for managing default tags in the Identity service +- Support for account recovery in the Identity service +- Support for authentication policies in the Identity service +- Support for specifying the workload type when creating autonomous databases in the Database service +- Support for I/O resource management for Exadata database systems in the Database service +- Support for customer-specified timezones on database systems in the Database service + +## 4.1.0 - 2019-02-28 +### Added +- Support for the Monitoring service +- Support for the Notification service +- Support for the Resource Manager service +- Support for the Compute Autoscaling service +- Support for changing the compartment of a tag namespace in the Identity service +- Support for specifying fault domains in the Database service +- Support for managing instance monitoring in the Compute service +- Support for attaching/detaching load balancers to instance pools in the Compute service + +## 4.0.0 - 2019-02-21 +### Added +- Support for government-realm regions +- Support for the Streaming service +- Support for tags in the Key Management service +- Support for regional subnets in the Virtual Networking service + +### Fixed +- Removed unused Announcements service 'NotificationFollowupDetails' struct and 'GetFollowups' operation +- InstancePrincipals now invalidates a token shortly before its expiration time to avoid making a service call with an expired token +- Requests with binary bodies that require its body to be included in the signature are now being signed correctly + +## 3.7.0 - 2019-02-07 +### Added +- Support for the Web Application Acceleration and Security (WAAS) service +- Support for the Health Checks service +- Support for connection strings on Database resources in the Database service +- Support for traffic management in the DNS service +- Support for tagging in the Email service +### Fixed +- Retry context in now cancelable during wait for new retry + +## 3.6.0 - 2019-01-31 +### Added +- Support for the Announcements service + +## 3.5.0 - 2019-01-24 +### Added + +- Support for renaming databases during restore-from-backup operations in the Database service +- Built-in logging now supports log levels. More information about the changes can be found in the [go-docs page](https://godoc.org/github.com/oracle/oci-go-sdk#hdr-Logging_and_Debugging) +- Support for calling Oracle Cloud Infrastructure services in the ca-toronto-1 region + +## 3.4.0 - 2019-01-10 +### Added +- Support for device attributes on volume attachments in the Compute service +- Support for custom header rulesets in the Load Balancing service + + +## 3.3.0 - 2018-12-13 +### Added +- Support for Data Guard for VM shapes in the Database service +- Support for sparse disk groups for Exadata shapes in the Database service +- Support for a new field, isLatestForMajorVersion, when listing DB versions in the Database service +- Support for in-transit encryption for paravirtualized boot volume and data volume attachments in the Block Storage service +- Support for tagging DNS Zones in the DNS service +- Support for resetting credentials for SCIM clients associated with an Identity provider and updating user capabilities in the Identity service + +## 3.2.0 - 2018-11-29 +### Added +- Support for getting bucket statistics in the Object Storage service + +### Fixed +- Block Storage service for copying volume backups across regions is now enabled +- Object storage `PutObject` and `UploadPart` operations now do not override the client's signer + +## 3.1.0 - 2018-11-15 +### Added +- Support for VCN transit routing in the Networking service + +## 3.0.0 - 2018-11-01 +### Added +- Support for modifying the route table, DHCP options and security lists associated with a subnet in the Networking service. +- Support for tagging of File Systems, Mount Targets and Snapshots in the File Storage service. +- Support for nested compartments in the Identity service + +### Notes +- The version is bumped due to breaking changes in previous release. + +## 2.7.0 - 2018-10-18 +### Added +- Support for cost tracking tags in the Identity service +- Support for generating and downloading wallets in the Database service +- Support for creating a standalone backup from an on-premises database in the Database service +- Support for db version and additional connection strings in the Autonomous Transaction Processing and Autonomous Data Warehouse resources of the Database service +- Support for copying volume backups across regions in the Block Storage service +- Support for deleting compartments in the Identity service +- Support for reboot migration for virtual machines in the Compute service +- Support for Instance Pools and Instance Configurations in the Compute service + +### Fixed +- The signing algorithm does not lower case the header fields [Github issue 132](https://github.com/oracle/oci-go-sdk/issues/132) +- Raw configuration provider does not check for empty strings [Github issue 134](https://github.com/oracle/oci-go-sdk/issues/134) + +### Breaking change +- DbDataSizeInMBs field in Backup and BackupSummary struct was renamed to DatabaseSizeInGBs and type changed from *int to *float64 + - Before + ```golang + // Size of the database in megabytes (MB) at the time the backup was taken. + DbDataSizeInMBs *int `mandatory:"false" json:"dbDataSizeInMBs"` + ``` + + - After + + ```golang + // The size of the database in gigabytes at the time the backup was taken. + DatabaseSizeInGBs *float64 `mandatory:"false" json:"databaseSizeInGBs"` + ``` +- Data type for DatabaseEdition in Backup and BackupSummary struct was changed from *string to BackupDatabaseEditionEnum + - Before + + ```golang + // The Oracle Database edition of the DB system from which the database backup was taken. + DatabaseEdition *string `mandatory:"false" json:"databaseEdition"` + ``` + + - After + + ```golang + // The Oracle Database edition of the DB system from which the database backup was taken. + DatabaseEdition BackupDatabaseEditionEnum `mandatory:"false" json:"databaseEdition,omitempty"` + ``` + +## 2.6.0 - 2018-10-04 +### Added +- Support for trusted partner images through application listings and subscriptions in the Compute service +- Support for object lifecycle policies in the Object Storage service +- Support for copying objects across regions in the Object Storage service +- Support for network address translation (NAT) gateways in the Networking service + +## 2.5.0 - 2018-09-27 +### Added +- Support for paravirtualized launch mode when importing images in the Compute service +- Support for Key Management service +- Support for encrypting the contents of an Object Storage bucket using a Key Management service key +- Support for specifying a Key Management service key when launching a compute instance in the Compute service +- Support for specifying a Key Management service key when backing up or restoring a block storage volume in the Block Volume service + +## 2.4.0 - 2018-09-06 +### Added +- Added support for updating metadata fields on an instance in the Compute service + +## 2.3.0 - 2018-08-23 +### Added +- Support for fault domain in the Identity Service +- Support for Autonomous Data Warehouse and Autonomous Transaction Processing in the Database service +- Support for resizing an offline volume in the Block Storage service +- Nil interface when polymorphic json response object is null + +## 2.2.0 - 2018-08-09 +### Added +- Support for fault domains in the Compute service +- A sample showing how to use Search service from the SDK is available on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_resourcesearch_test.go) + +## 2.1.0 - 2018-07-26 +### Added +- Support for the Search service +- Support for specifying a backup policy when creating a boot volume in the Block Storage service + +### Fixed +- OCI error is missing opc-request-id value [Github Issue 120](https://github.com/oracle/oci-go-sdk/issues/120) +- Include raw http response when service error occurred + +## 2.0.0 - 2018-07-12 +### Added +- Support for tagging Load Balancers in the Load Balancing service +- Support for export options in the File Storage service +- Support for retrieving compartment name and user name as part of events in the Audit service + +### Fixed +- CreateKubeconfig function should not close http reponse body [Github Issue 116](https://github.com/oracle/oci-go-sdk/issues/116) + +### Breaking changes +- Datatype changed from *int to *int64 for several request/response structs. Here is sample code that shows how to update your code to incorporate this change. + + - Before + + ```golang + // Update the impacted properties from common.Int to common.Int64. + // Here is the updates for CreateBootVolumeDetails + details := core.CreateBootVolumeDetails{ + SizeInGBs: common.Int(10), + } + ``` + + - After + + ```golang + details := core.CreateBootVolumeDetails{ + SizeInGBs: common.Int64(10), + } + ``` + +- Impacted packages and structs + - core + - BootVolume.(SizeInGBs, SizeInMBs) + - BootVolumeBackup.(SizeInGBs, UniqueSizeInGBs) + - CreateBootVolumeDetails.SizeInGBs + - CreateVolumeDetails.(SizeInGBs, SizeInMBs) + - Image.SizeInMBs + - InstanceSourceViaImageDetails.BootVolumeSizeInGBs + - Volume.(SizeInGBs, SizeInMBs) + - VolumeBackup.(SizeInGBs, SizeInMBs, UniqueSizeInGBs, UniqueSizeInMbs) + - VolumeGroup.(SizeInMBs, SizeInGBs) + - VolumeGroupBackup.(SizeInMBs, SizeInGBs, UniqueSizeInMbs, UniqueSizeInGbs) + - dns + - GetDomainRecordsRequest.Limit + - GetRRSetRequest.Limit + - GetZoneRecordsRequest.Limit + - ListZonesRequest.Limit + - Zone.Serial + - ZoneSummary.Serial + - filestorage + - ExportSet.(MaxFsStatBytes, MaxFsStatFiles) + - FileSystem.MeteredBytes + - FileSystemSummary.MeteredBytes + - UpdateExportSetDetails.(MaxFsStatBytes, MaxFsStatFiles) + - identity + - ApiKey.InactiveStatus + - AuthToken.InactiveStatus + - Compartment.InactiveStatus + - CustomerSecretKey.InactiveStatus + - CustomerSecretKeySummary.InactiveStatus + - DynamicGroup.InactiveStatus + - Group.InactiveStatus + - IdentityProvider.InactiveStatus + - IdpGroupMapping.InactiveStatus + - Policy.InactiveStatus + - Saml2IdentityProvider.InactiveStatus + - SmtpCredential.InactiveStatus + - SmtpCredentialSummary.InactiveStatus + - SwiftPassword.InactiveStatus + - UiPassword.InactiveStatus + - User.InactiveStatus + - UserGroupMembership.InactiveStatus + - loadbalancer + - ConnectionConfiguration.IdleTimeout + - ListLoadBalancerHealthsRequest.Limit + - ListLoadBalancersRequest.Limit + - ListPoliciesRequest + - ListProtocolsRequest.Limit + - ListShapesRequest.Limit + - ListWorkRequestsRequest.Limit + - objectstorage + - GetObjectResponse.ContentLength + - HeadObjectResponse.ContentLength + - MultipartUploadPartSummary.Size + - ObjectSummary.Size + - PutObjectRequest.ContentLength + - UploadPartRequest.ContentLength + +## 1.8.0 - 2018-06-28 +### Added +- Support for service gateway management in the Networking service +- Support for backup and clone of boot volumes in the Block Storage service + +## 1.7.0 - 2018-06-14 +### Added +- Support for the Container Engine service. A sample showing how to use this service from the SDK is available [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_containerengine_test.go) + +### Fixed +- Empty string was send to backend service for optional enum if it's not set + +## 1.6.0 - 2018-05-31 +### Added +- Support for the "soft shutdown" instance action in the Compute service +- Support for Auth Token management in the Identity service +- Support for backup or clone of multiple volumes at once using volume groups in the Block Storage service +- Support for launching a database system from a backup in the Database service + +### Breaking changes +- ``LaunchDbSystemDetails`` is renamed to ``LaunchDbSystemBase`` and the type changed from struct to interface in ``LaunchDbSystemRequest``. Here is sample code that shows how to update your code to incorporate this change. + + - Before + + ```golang + // create a LaunchDbSystemRequest + // There were two ways to initialize the LaunchDbSystemRequest struct. + // This breaking change only impact option #2 + request := database.LaunchDbSystemRequest{} + + // #1. explicity create LaunchDbSystemDetails struct (No impact) + details := database.LaunchDbSystemDetails{} + details.AvailabilityDomain = common.String(validAD()) + details.CompartmentId = common.String(getCompartmentID()) + // ... other properties + request.LaunchDbSystemDetails = details + + // #2. use anonymous fields (Will break) + request.AvailabilityDomain = common.String(validAD()) + request.CompartmentId = common.String(getCompartmentID()) + // ... + ``` + + - After + + ```golang + // create a LaunchDbSystemRequest + request := database.LaunchDbSystemRequest{} + details := database.LaunchDbSystemDetails{} + details.AvailabilityDomain = common.String(validAD()) + details.CompartmentId = common.String(getCompartmentID()) + // ... other properties + + // set the details to LaunchDbSystemBase + request.LaunchDbSystemBase = details + // ... + ``` + +## 1.5.0 - 2018-05-17 +### Added +- ~~Support for backup or clone of multiple volumes at once using volume groups in the Block Storage service~~ +- Support for the ability to optionally specify a compartment filter when listing exports in the File Storage service +- Support for tagging virtual cloud network resources in the Networking service +- Support for specifying the PARAVIRTUALIZED remote volume type when creating a virtual image or launching a new instance in the Compute service +- Support for tilde in private key path in configuration files + +## 1.4.0 - 2018-05-03 +### Added +- Support for ``event_name`` in Audit Service +- Support for multiple ``hostnames`` for loadbalancer listener in LoadBalance service +- Support for auto-generating opc-request-id for all operations +- Add opc-request-id property for all requests except for Object Storage which use opc-client-request-id + +## 1.3.0 - 2018-04-19 +### Added +- Support for retry on Oracle Cloud Infrastructure service APIs. Example can be found on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_retry_test.go) +- Support for tagging DbSystem and Database resources in the Database Service +- Support for filtering by DbSystemId in ListDbVersions operation in Database Service + +### Fixed +- Fixed a request signing bug for PatchZoneRecords API +- Fixed a bug in DebugLn + ## 1.2.0 - 2018-04-05 ### Added - Support for Email Delivery Service. Example can be found on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_email_test.go) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/main.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/main.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/main.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/main.go 2019-06-28 17:13:01.000000000 +0000 @@ -42,7 +42,7 @@ Tag string }{ getEnvOrDefault(majorVer, "0"), - getEnvOrDefault(minorVer, "0" ), + getEnvOrDefault(minorVer, "0"), getEnvOrDefault(patchVer, "0"), getEnvOrDefault(tag, ""), } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/version_template.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/version_template.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/version_template.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/cmd/genver/version_template.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,6 +1,5 @@ package main - const versionTemplate = ` // Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. // Code generated by go generate; DO NOT EDIT @@ -30,7 +29,7 @@ verBuilder := bytes.NewBufferString(ver) if tag != "" && tag != "-" { _, err := verBuilder.WriteString(tag) - if err == nil { + if err != nil { verBuilder = bytes.NewBufferString(ver) } } @@ -39,4 +38,3 @@ return version } ` - diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever.go 2019-06-28 17:13:01.000000000 +0000 @@ -31,14 +31,16 @@ privateKeyPemRaw []byte privateKey *rsa.PrivateKey mux sync.Mutex + dispatcher common.HTTPRequestDispatcher } -func newURLBasedX509CertificateRetriever(certURL, privateKeyURL, passphrase string) x509CertificateRetriever { +func newURLBasedX509CertificateRetriever(dispatcher common.HTTPRequestDispatcher, certURL, privateKeyURL, passphrase string) x509CertificateRetriever { return &urlBasedX509CertificateRetriever{ certURL: certURL, privateKeyURL: privateKeyURL, passphrase: passphrase, mux: sync.Mutex{}, + dispatcher: dispatcher, } } @@ -75,7 +77,7 @@ func (r *urlBasedX509CertificateRetriever) renewCertificate(url string) (certificatePemRaw []byte, certificate *x509.Certificate, err error) { var body bytes.Buffer - if body, err = httpGet(url); err != nil { + if body, err = httpGet(r.dispatcher, url); err != nil { return nil, nil, fmt.Errorf("failed to get certificate from %s: %s", url, err.Error()) } @@ -95,7 +97,7 @@ func (r *urlBasedX509CertificateRetriever) renewPrivateKey(url, passphrase string) (privateKeyPemRaw []byte, privateKey *rsa.PrivateKey, err error) { var body bytes.Buffer - if body, err = httpGet(url); err != nil { + if body, err = httpGet(r.dispatcher, url); err != nil { return nil, nil, fmt.Errorf("failed to get private key from %s: %s", url, err.Error()) } @@ -149,6 +151,7 @@ r.mux.Lock() defer r.mux.Unlock() + //Nil Private keys are supported as part of a certificate if r.privateKey == nil { return nil } @@ -156,3 +159,102 @@ c := *r.privateKey return &c } + +//staticCertificateRetriever serves certificates from static data +type staticCertificateRetriever struct { + Passphrase []byte + CertificatePem []byte + PrivateKeyPem []byte + certificate *x509.Certificate + privateKey *rsa.PrivateKey + mux sync.Mutex +} + +//Refresh proccess the inputs into appropiate keys and certificates +func (r *staticCertificateRetriever) Refresh() error { + r.mux.Lock() + defer r.mux.Unlock() + + certifcate, err := r.readCertificate() + if err != nil { + r.certificate = nil + return err + } + r.certificate = certifcate + + key, err := r.readPrivateKey() + if err != nil { + r.privateKey = nil + return err + } + r.privateKey = key + + return nil +} + +func (r *staticCertificateRetriever) Certificate() *x509.Certificate { + r.mux.Lock() + defer r.mux.Unlock() + + return r.certificate +} + +func (r *staticCertificateRetriever) PrivateKey() *rsa.PrivateKey { + r.mux.Lock() + defer r.mux.Unlock() + + return r.privateKey +} + +func (r *staticCertificateRetriever) CertificatePemRaw() []byte { + r.mux.Lock() + defer r.mux.Unlock() + + if r.CertificatePem == nil { + return nil + } + + c := make([]byte, len(r.CertificatePem)) + copy(c, r.CertificatePem) + return c +} + +func (r *staticCertificateRetriever) PrivateKeyPemRaw() []byte { + r.mux.Lock() + defer r.mux.Unlock() + + if r.PrivateKeyPem == nil { + return nil + } + + c := make([]byte, len(r.PrivateKeyPem)) + copy(c, r.PrivateKeyPem) + return c +} + +func (r *staticCertificateRetriever) readCertificate() (certificate *x509.Certificate, err error) { + block, _ := pem.Decode(r.CertificatePem) + if block == nil { + return nil, fmt.Errorf("failed to parse the new certificate, not valid pem data") + } + + if certificate, err = x509.ParseCertificate(block.Bytes); err != nil { + return nil, fmt.Errorf("failed to parse the new certificate: %s", err.Error()) + } + return certificate, nil +} + +func (r *staticCertificateRetriever) readPrivateKey() (*rsa.PrivateKey, error) { + if r.PrivateKeyPem == nil { + return nil, nil + } + + var pass *string + if r.Passphrase == nil { + pass = nil + } else { + ss := string(r.Passphrase) + pass = &ss + } + return common.PrivateKeyFromBytes(r.PrivateKeyPem, pass) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -25,7 +25,7 @@ })) defer certServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, "", "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, "", "") err := retriever.Refresh() assert.Error(t, err) @@ -37,7 +37,7 @@ })) defer certServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, "", "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, "", "") err := retriever.Refresh() assert.NoError(t, err) @@ -62,7 +62,7 @@ })) defer privateKeyServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, privateKeyServer.URL, "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, privateKeyServer.URL, "") err := retriever.Refresh() assert.NoError(t, err) @@ -82,7 +82,7 @@ certServer := httptest.NewServer(http.NotFoundHandler()) defer certServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, "", "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, "", "") err := retriever.Refresh() assert.Error(t, err) @@ -101,7 +101,7 @@ privateKeyServer := httptest.NewServer(http.NotFoundHandler()) defer privateKeyServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, privateKeyServer.URL, "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, privateKeyServer.URL, "") err := retriever.Refresh() assert.Error(t, err) @@ -119,7 +119,7 @@ certServer := httptest.NewServer(http.HandlerFunc(internalServerError)) defer certServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, "", "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, "", "") err := retriever.Refresh() assert.Error(t, err) @@ -138,7 +138,7 @@ privateKeyServer := httptest.NewServer(http.HandlerFunc(internalServerError)) defer privateKeyServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, privateKeyServer.URL, "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, privateKeyServer.URL, "") err := retriever.Refresh() assert.Error(t, err) @@ -173,7 +173,7 @@ })) defer privateKeyServer.Close() - retriever := newURLBasedX509CertificateRetriever(certServer.URL, privateKeyServer.URL, "") + retriever := newURLBasedX509CertificateRetriever(&http.Client{}, certServer.URL, privateKeyServer.URL, "") err := retriever.Refresh() assert.NoError(t, err) @@ -221,3 +221,35 @@ certPem = pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: newCertBytes}) return } + +func TestStaticCertificateRetriever(t *testing.T) { + retriever := staticCertificateRetriever{ + Passphrase: []byte(""), + CertificatePem: []byte(leafCertPem), + PrivateKeyPem: []byte(leafCertPrivateKeyPem), + } + + err := retriever.Refresh() + assert.NoError(t, err) + key := retriever.PrivateKey() + assert.NotNil(t, key) + cert := retriever.Certificate() + assert.NotNil(t, cert) +} + +func TestBadStaticCertificateRetriever(t *testing.T) { + retriever := staticCertificateRetriever{ + Passphrase: []byte(""), + CertificatePem: []byte(""), + PrivateKeyPem: []byte(""), + } + + err := retriever.Refresh() + assert.Error(t, err) + + c := retriever.Certificate() + assert.Nil(t, c) + + k := retriever.PrivateKey() + assert.Nil(t, k) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/configuration.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -9,28 +9,70 @@ ) type instancePrincipalConfigurationProvider struct { - keyProvider *instancePrincipalKeyProvider + keyProvider instancePrincipalKeyProvider region *common.Region } //InstancePrincipalConfigurationProvider returns a configuration for instance principals func InstancePrincipalConfigurationProvider() (common.ConfigurationProvider, error) { - var err error - var keyProvider *instancePrincipalKeyProvider - if keyProvider, err = newInstancePrincipalKeyProvider(); err != nil { - return nil, fmt.Errorf("failed to create a new key provider for instance principal: %s", err.Error()) - } - return instancePrincipalConfigurationProvider{keyProvider: keyProvider, region: nil}, nil + return newInstancePrincipalConfigurationProvider("", nil) } //InstancePrincipalConfigurationProviderForRegion returns a configuration for instance principals with a given region func InstancePrincipalConfigurationProviderForRegion(region common.Region) (common.ConfigurationProvider, error) { + return newInstancePrincipalConfigurationProvider(region, nil) +} + +//InstancePrincipalConfigurationProviderWithCustomClient returns a configuration for instance principals using a modifier function to modify the HTTPRequestDispatcher +func InstancePrincipalConfigurationProviderWithCustomClient(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { + return newInstancePrincipalConfigurationProvider("", modifier) +} + +//InstancePrincipalConfigurationForRegionWithCustomClient returns a configuration for instance principals with a given region using a modifier function to modify the HTTPRequestDispatcher +func InstancePrincipalConfigurationForRegionWithCustomClient(region common.Region, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { + return newInstancePrincipalConfigurationProvider(region, modifier) +} + +func newInstancePrincipalConfigurationProvider(region common.Region, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { var err error var keyProvider *instancePrincipalKeyProvider - if keyProvider, err = newInstancePrincipalKeyProvider(); err != nil { + if keyProvider, err = newInstancePrincipalKeyProvider(modifier); err != nil { return nil, fmt.Errorf("failed to create a new key provider for instance principal: %s", err.Error()) } - return instancePrincipalConfigurationProvider{keyProvider: keyProvider, region: ®ion}, nil + if len(region) > 0 { + return instancePrincipalConfigurationProvider{keyProvider: *keyProvider, region: ®ion}, nil + } + return instancePrincipalConfigurationProvider{keyProvider: *keyProvider, region: nil}, nil +} + +//InstancePrincipalConfigurationWithCerts returns a configuration for instance principals with a given region and hardcoded certificates in lieu of metadata service certs +func InstancePrincipalConfigurationWithCerts(region common.Region, leafCertificate, leafPassphrase, leafPrivateKey []byte, intermediateCertificates [][]byte) (common.ConfigurationProvider, error) { + leafCertificateRetriever := staticCertificateRetriever{Passphrase: leafPassphrase, CertificatePem: leafCertificate, PrivateKeyPem: leafPrivateKey} + + //The .Refresh() call actually reads the certificates from the inputs + err := leafCertificateRetriever.Refresh() + if err != nil { + return nil, err + } + + certificate := leafCertificateRetriever.Certificate() + + tenancyID := extractTenancyIDFromCertificate(certificate) + fedClient, err := newX509FederationClientWithCerts(region, tenancyID, leafCertificate, leafPassphrase, leafPrivateKey, intermediateCertificates, *newDispatcherModifier(nil)) + if err != nil { + return nil, err + } + + provider := instancePrincipalConfigurationProvider{ + keyProvider: instancePrincipalKeyProvider{ + Region: region, + FederationClient: fedClient, + TenancyID: tenancyID, + }, + region: ®ion, + } + return provider, nil + } func (p instancePrincipalConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { @@ -55,7 +97,9 @@ func (p instancePrincipalConfigurationProvider) Region() (string, error) { if p.region == nil { - return string(p.keyProvider.RegionForFederationClient()), nil + region := p.keyProvider.RegionForFederationClient() + common.Debugf("Region in instance principal configuration provider is nil. Returning federation clients region: %s", region) + return string(region), nil } return string(*p.region), nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +package auth + +import "github.com/oracle/oci-go-sdk/common" + +//dispatcherModifier gives ability to modify a HTTPRequestDispatcher before use. +type dispatcherModifier struct { + modifiers []func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) +} + +//newDispatcherModifier creates a new dispatcherModifier with optional initial modifier (may be nil). +func newDispatcherModifier(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) *dispatcherModifier { + dispatcherModifier := &dispatcherModifier{ + modifiers: make([]func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error), 0), + } + if modifier != nil { + dispatcherModifier.QueueModifier(modifier) + } + return dispatcherModifier +} + +//QueueModifier queues up a new modifier +func (c *dispatcherModifier) QueueModifier(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) { + c.modifiers = append(c.modifiers, modifier) +} + +//Modify the provided HTTPRequestDispatcher with this modifier, and return the result, or error if something goes wrong +func (c *dispatcherModifier) Modify(dispatcher common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) { + if len(c.modifiers) > 0 { + for _, modifier := range c.modifiers { + var err error + if dispatcher, err = modifier(dispatcher); err != nil { + common.Debugf("An error occurred when attempting to modify the dispatcher. Error was: %s", err.Error()) + return nil, err + } + } + } + return dispatcher, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +package auth + +import ( + "crypto/tls" + "errors" + "github.com/oracle/oci-go-sdk/common" + "github.com/stretchr/testify/assert" + "net/http" + "testing" +) + +var customTransport = &http.Transport{ + TLSClientConfig: &tls.Config{ + ServerName: "test", + }, +} + +func TestNewDispatcherModifier_NoInitialModifier(t *testing.T) { + modifier := newDispatcherModifier(nil) + initialClient := &http.Client{} + returnClient, err := modifier.Modify(initialClient) + assert.Nil(t, err) + assert.ObjectsAreEqual(initialClient, returnClient) +} + +func TestNewDispatcherModifier_InitialModifier(t *testing.T) { + modifier := newDispatcherModifier(setCustomCAPool) + initialClient := &http.Client{} + returnDispatcher, err := modifier.Modify(initialClient) + assert.Nil(t, err) + returnClient := returnDispatcher.(*http.Client) + assert.ObjectsAreEqual(returnClient.Transport, customTransport) +} + +func TestNewDispatcherModifier_ModifierFails(t *testing.T) { + modifier := newDispatcherModifier(modifierGoneWrong) + initialClient := &http.Client{} + returnClient, err := modifier.Modify(initialClient) + assert.NotNil(t, err) + assert.Nil(t, returnClient) +} + +func setCustomCAPool(dispatcher common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) { + client := dispatcher.(*http.Client) + client.Transport = customTransport + return client, nil +} + +func modifierGoneWrong(dispatcher common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) { + return nil, errors.New("uh oh") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -12,8 +12,10 @@ "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" + "os" "strings" "sync" + "time" ) // federationClient is a client to retrieve the security token for an instance principal necessary to sign a request. @@ -34,15 +36,49 @@ mux sync.Mutex } -func newX509FederationClient(region common.Region, tenancyID string, leafCertificateRetriever x509CertificateRetriever, intermediateCertificateRetrievers []x509CertificateRetriever) federationClient { +func newX509FederationClient(region common.Region, tenancyID string, leafCertificateRetriever x509CertificateRetriever, intermediateCertificateRetrievers []x509CertificateRetriever, modifier dispatcherModifier) (federationClient, error) { client := &x509FederationClient{ tenancyID: tenancyID, leafCertificateRetriever: leafCertificateRetriever, intermediateCertificateRetrievers: intermediateCertificateRetrievers, } client.sessionKeySupplier = newSessionKeySupplier() - client.authClient = newAuthClient(region, client) - return client + authClient := newAuthClient(region, client) + + var err error + + if authClient.HTTPClient, err = modifier.Modify(authClient.HTTPClient); err != nil { + err = fmt.Errorf("failed to modify client: %s", err.Error()) + return nil, err + } + + client.authClient = authClient + return client, nil +} + +func newX509FederationClientWithCerts(region common.Region, tenancyID string, leafCertificate, leafPassphrase, leafPrivateKey []byte, intermediateCertificates [][]byte, modifier dispatcherModifier) (federationClient, error) { + intermediateRetrievers := make([]x509CertificateRetriever, len(intermediateCertificates)) + for i, c := range intermediateCertificates { + intermediateRetrievers[i] = &staticCertificateRetriever{Passphrase: []byte(""), CertificatePem: c, PrivateKeyPem: nil} + } + + client := &x509FederationClient{ + tenancyID: tenancyID, + leafCertificateRetriever: &staticCertificateRetriever{Passphrase: leafPassphrase, CertificatePem: leafCertificate, PrivateKeyPem: leafPrivateKey}, + intermediateCertificateRetrievers: intermediateRetrievers, + } + client.sessionKeySupplier = newSessionKeySupplier() + authClient := newAuthClient(region, client) + + var err error + + if authClient.HTTPClient, err = modifier.Modify(authClient.HTTPClient); err != nil { + err = fmt.Errorf("failed to modify client: %s", err.Error()) + return nil, err + } + + client.authClient = authClient + return client, nil } var ( @@ -53,7 +89,11 @@ func newAuthClient(region common.Region, provider common.KeyProvider) *common.BaseClient { signer := common.RequestSigner(provider, genericHeaders, bodyHeaders) client := common.DefaultBaseClientWithSigner(signer) - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "auth", string(region)) + if regionURL, ok := os.LookupEnv("OCI_SDK_AUTH_CLIENT_REGION_URL"); ok { + client.Host = regionURL + } else { + client.Host = region.Endpoint("auth") + } client.BasePath = "v1/x509" return &client } @@ -67,7 +107,12 @@ // For authClient to sign requests to X509 Federation Endpoint func (c *x509FederationClient) PrivateRSAKey() (*rsa.PrivateKey, error) { - return c.leafCertificateRetriever.PrivateKey(), nil + key := c.leafCertificateRetriever.PrivateKey() + if key == nil { + return nil, fmt.Errorf("can not read private key from leaf certificate. Likely an error in the metadata service") + } + + return key, nil } func (c *x509FederationClient) PrivateKey() (*rsa.PrivateKey, error) { @@ -120,9 +165,11 @@ } } + common.Logf("Renewing security token at: %v\n", time.Now().Format("15:04:05.000")) if c.securityToken, err = c.getSecurityToken(); err != nil { return fmt.Errorf("failed to get security token: %s", err.Error()) } + common.Logf("Security token renewed at: %v\n", time.Now().Format("15:04:05.000")) return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -8,13 +8,14 @@ "crypto/x509" "encoding/pem" "fmt" - "github.com/oracle/oci-go-sdk/common" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "net/http" "net/http/httptest" "strings" "testing" + + "github.com/oracle/oci-go-sdk/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) func TestX509FederationClient_VeryFirstSecurityToken(t *testing.T) { @@ -304,6 +305,31 @@ assert.Error(t, err) } +func TestX509FederationClient_ClientHost(t *testing.T) { + type testData struct { + region common.Region + expected string + } + testDataSet := []testData{ + { + // OC1 + region: common.StringToRegion("us-phoenix-1"), + expected: "auth.us-phoenix-1.oraclecloud.com", + }, + { + // unknown + region: common.StringToRegion("test"), + expected: "auth.test.oraclecloud.com", + }, + } + + for _, testData := range testDataSet { + federationClient := &x509FederationClient{} + federationClient.authClient = newAuthClient(testData.region, federationClient) + assert.Equal(t, testData.expected, federationClient.authClient.Host) + } +} + func parseCertificate(certPem string) *x509.Certificate { var block *pem.Block block, _ = pem.Decode([]byte(certPem)) @@ -387,7 +413,7 @@ // "opc-certtype:instance", // "opc-instance.ocid1.phx.bluhbluhbluh", // "opc-compartment:ocid1.compartment.oc1.bluhbluhbluh", - // fmt.Sprintf("opc-tenant:%s", tenancyID), + // fmt.Sprintf("opc-tenant:%s", TenancyID), // }, // }, // NotBefore: notBefore, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider.go 2019-06-28 17:13:01.000000000 +0000 @@ -7,6 +7,7 @@ "crypto/rsa" "fmt" "github.com/oracle/oci-go-sdk/common" + "net/http" ) const ( @@ -25,9 +26,9 @@ // The region name of the endpoint for x509FederationClient is obtained from the metadata service on the compute // instance. type instancePrincipalKeyProvider struct { - regionForFederationClient common.Region - federationClient federationClient - tenancyID string + Region common.Region + FederationClient federationClient + TenancyID string } // newInstancePrincipalKeyProvider creates and returns an instancePrincipalKeyProvider instance based on @@ -38,19 +39,29 @@ // The x509FederationClient caches the security token in memory until it is expired. Thus, even if a client obtains a // KeyID that is not expired at the moment, the PrivateRSAKey that the client acquires at a next moment could be // invalid because the KeyID could be already expired. -func newInstancePrincipalKeyProvider() (provider *instancePrincipalKeyProvider, err error) { +func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (provider *instancePrincipalKeyProvider, err error) { + clientModifier := newDispatcherModifier(modifier) + + client, err := clientModifier.Modify(&http.Client{}) + if err != nil { + err = fmt.Errorf("failed to modify client: %s", err.Error()) + return nil, err + } + var region common.Region - if region, err = getRegionForFederationClient(regionURL); err != nil { + + if region, err = getRegionForFederationClient(client, regionURL); err != nil { err = fmt.Errorf("failed to get the region name from %s: %s", regionURL, err.Error()) - common.Logln(err) + common.Logf("%v\n", err) return nil, err } - leafCertificateRetriever := newURLBasedX509CertificateRetriever( + leafCertificateRetriever := newURLBasedX509CertificateRetriever(client, leafCertificateURL, leafCertificateKeyURL, leafCertificateKeyPassphrase) intermediateCertificateRetrievers := []x509CertificateRetriever{ newURLBasedX509CertificateRetriever( - intermediateCertificateURL, intermediateCertificateKeyURL, intermediateCertificateKeyPassphrase), + client, intermediateCertificateURL, intermediateCertificateKeyURL, + intermediateCertificateKeyPassphrase), } if err = leafCertificateRetriever.Refresh(); err != nil { @@ -59,27 +70,31 @@ } tenancyID := extractTenancyIDFromCertificate(leafCertificateRetriever.Certificate()) - federationClient := newX509FederationClient( - region, tenancyID, leafCertificateRetriever, intermediateCertificateRetrievers) + federationClient, err := newX509FederationClient(region, tenancyID, leafCertificateRetriever, intermediateCertificateRetrievers, *clientModifier) - provider = &instancePrincipalKeyProvider{regionForFederationClient: region, federationClient: federationClient, tenancyID: tenancyID} + if err != nil { + err = fmt.Errorf("failed to create federation client: %s", err.Error()) + return nil, err + } + + provider = &instancePrincipalKeyProvider{FederationClient: federationClient, TenancyID: tenancyID, Region: region} return } -func getRegionForFederationClient(url string) (r common.Region, err error) { +func getRegionForFederationClient(dispatcher common.HTTPRequestDispatcher, url string) (r common.Region, err error) { var body bytes.Buffer - if body, err = httpGet(url); err != nil { + if body, err = httpGet(dispatcher, url); err != nil { return } return common.StringToRegion(body.String()), nil } func (p *instancePrincipalKeyProvider) RegionForFederationClient() common.Region { - return p.regionForFederationClient + return p.Region } func (p *instancePrincipalKeyProvider) PrivateRSAKey() (privateKey *rsa.PrivateKey, err error) { - if privateKey, err = p.federationClient.PrivateKey(); err != nil { + if privateKey, err = p.FederationClient.PrivateKey(); err != nil { err = fmt.Errorf("failed to get private key: %s", err.Error()) return nil, err } @@ -89,13 +104,12 @@ func (p *instancePrincipalKeyProvider) KeyID() (string, error) { var securityToken string var err error - if securityToken, err = p.federationClient.SecurityToken(); err != nil { + if securityToken, err = p.FederationClient.SecurityToken(); err != nil { return "", fmt.Errorf("failed to get security token: %s", err.Error()) } return fmt.Sprintf("ST$%s", securityToken), nil } - func (p *instancePrincipalKeyProvider) TenancyOCID() (string, error) { - return p.tenancyID, nil -} \ No newline at end of file + return p.TenancyID, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -19,7 +19,7 @@ })) defer regionServer.Close() - actualRegion, err := getRegionForFederationClient(regionServer.URL) + actualRegion, err := getRegionForFederationClient(&http.Client{}, regionServer.URL) assert.NoError(t, err) assert.Equal(t, common.RegionPHX, actualRegion) @@ -29,7 +29,7 @@ regionServer := httptest.NewServer(http.NotFoundHandler()) defer regionServer.Close() - _, err := getRegionForFederationClient(regionServer.URL) + _, err := getRegionForFederationClient(&http.Client{}, regionServer.URL) assert.Error(t, err) } @@ -38,17 +38,24 @@ regionServer := httptest.NewServer(http.HandlerFunc(internalServerError)) defer regionServer.Close() - _, err := getRegionForFederationClient(regionServer.URL) + _, err := getRegionForFederationClient(&http.Client{}, regionServer.URL) assert.Error(t, err) } +func TestInstancePrincipalKeyProvider_RegionForFederationClient(t *testing.T) { + expectedRegion := common.StringToRegion("sea") + keyProvider := &instancePrincipalKeyProvider{Region: expectedRegion} + returnedRegion := keyProvider.RegionForFederationClient() + assert.Equal(t, returnedRegion, expectedRegion) +} + func TestInstancePrincipalKeyProvider_PrivateRSAKey(t *testing.T) { mockFederationClient := new(mockFederationClient) expectedPrivateKey := new(rsa.PrivateKey) mockFederationClient.On("PrivateKey").Return(expectedPrivateKey, nil).Once() - keyProvider := &instancePrincipalKeyProvider{federationClient: mockFederationClient} + keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient} actualPrivateKey, err := keyProvider.PrivateRSAKey() @@ -63,7 +70,7 @@ expectedErrorMessage := "TestPrivateRSAKeyError" mockFederationClient.On("PrivateKey").Return(nilPtr, fmt.Errorf(expectedErrorMessage)).Once() - keyProvider := &instancePrincipalKeyProvider{federationClient: mockFederationClient} + keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient} actualPrivateKey, actualError := keyProvider.PrivateRSAKey() @@ -76,7 +83,7 @@ mockFederationClient := new(mockFederationClient) mockFederationClient.On("SecurityToken").Return("TestSecurityTokenString", nil).Once() - keyProvider := &instancePrincipalKeyProvider{federationClient: mockFederationClient} + keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient} actualKeyID, err := keyProvider.KeyID() @@ -89,7 +96,7 @@ expectedErrorMessage := "TestSecurityTokenError" mockFederationClient.On("SecurityToken").Return("", fmt.Errorf(expectedErrorMessage)).Once() - keyProvider := &instancePrincipalKeyProvider{federationClient: mockFederationClient} + keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient} actualKeyID, actualError := keyProvider.KeyID() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/jwt.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/jwt.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/jwt.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/jwt.go 2019-06-28 17:13:01.000000000 +0000 @@ -7,6 +7,7 @@ "encoding/base64" "encoding/json" "fmt" + "github.com/oracle/oci-go-sdk/common" "strings" "time" ) @@ -17,9 +18,16 @@ payload map[string]interface{} } +const bufferTimeBeforeTokenExpiration = 5 * time.Minute + func (t *jwtToken) expired() bool { exp := int64(t.payload["exp"].(float64)) - return exp <= time.Now().Unix() + expTime := time.Unix(exp, 0) + expired := exp <= time.Now().Unix()+int64(bufferTimeBeforeTokenExpiration.Seconds()) + if expired { + common.Debugf("Token expires at: %v, currently expired due to bufferTime: %v", expTime.Format("15:04:05.000"), expired) + } + return expired } func parseJwt(tokenString string) (*jwtToken, error) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/utils.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/utils.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/utils.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/auth/utils.go 2019-06-28 17:13:01.000000000 +0000 @@ -15,9 +15,11 @@ // httpGet makes a simple HTTP GET request to the given URL, expecting only "200 OK" status code. // This is basically for the Instance Metadata Service. -func httpGet(url string) (body bytes.Buffer, err error) { +func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Buffer, err error) { var response *http.Response - if response, err = http.Get(url); err != nil { + request, err := http.NewRequest(http.MethodGet, url, nil) + + if response, err = dispatcher.Do(request); err != nil { return } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client.go 2019-06-28 17:13:01.000000000 +0000 @@ -6,6 +6,7 @@ import ( "context" "fmt" + "math/rand" "net/http" "net/http/httputil" "net/url" @@ -14,16 +15,55 @@ "path" "runtime" "strings" + "sync/atomic" "time" ) const ( // DefaultHostURLTemplate The default url template for service hosts - DefaultHostURLTemplate = "%s.%s.oraclecloud.com" + DefaultHostURLTemplate = "%s.%s.oraclecloud.com" + + // requestHeaderAccept The key for passing a header to indicate Accept + requestHeaderAccept = "Accept" + + // requestHeaderAuthorization The key for passing a header to indicate Authorization + requestHeaderAuthorization = "Authorization" + + // requestHeaderContentLength The key for passing a header to indicate Content Length + requestHeaderContentLength = "Content-Length" + + // requestHeaderContentType The key for passing a header to indicate Content Type + requestHeaderContentType = "Content-Type" + + // requestHeaderDate The key for passing a header to indicate Date + requestHeaderDate = "Date" + + // requestHeaderIfMatch The key for passing a header to indicate If Match + requestHeaderIfMatch = "if-match" + + // requestHeaderOpcClientInfo The key for passing a header to indicate OPC Client Info + requestHeaderOpcClientInfo = "opc-client-info" + + // requestHeaderOpcRetryToken The key for passing a header to indicate OPC Retry Token + requestHeaderOpcRetryToken = "opc-retry-token" + + // requestHeaderOpcRequestID The key for unique Oracle-assigned identifier for the request. + requestHeaderOpcRequestID = "opc-request-id" + + // requestHeaderOpcClientRequestID The key for unique Oracle-assigned identifier for the request. + requestHeaderOpcClientRequestID = "opc-client-request-id" + + // requestHeaderUserAgent The key for passing a header to indicate User Agent + requestHeaderUserAgent = "User-Agent" + + // requestHeaderXContentSHA256 The key for passing a header to indicate SHA256 hash + requestHeaderXContentSHA256 = "X-Content-SHA256" + + // private constants defaultScheme = "https" defaultSDKMarker = "Oracle-GoSDK" defaultUserAgentTemplate = "%s/%s (%s/%s; go/%s)" //SDK/SDKVersion (OS/OSVersion; Lang/LangVersion) - defaultTimeout = time.Second * 30 + defaultTimeout = 60 * time.Second defaultConfigFileName = "config" defaultConfigDirName = ".oci" secondaryConfigDirName = ".oraclebmc" @@ -65,7 +105,15 @@ return userAgent } +var clientCounter int64 + +func getNextSeed() int64 { + newCounterValue := atomic.AddInt64(&clientCounter, 1) + return newCounterValue + time.Now().UnixNano() +} + func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) BaseClient { + rand.Seed(getNextSeed()) return BaseClient{ UserAgent: defaultUserAgent(), Interceptor: nil, @@ -146,7 +194,8 @@ if request.Header == nil { request.Header = http.Header{} } - request.Header.Set("User-Agent", client.UserAgent) + request.Header.Set(requestHeaderUserAgent, client.UserAgent) + request.Header.Set(requestHeaderDate, time.Now().UTC().Format(http.TimeFormat)) if !strings.Contains(client.Host, "http") && !strings.Contains(client.Host, "https") { @@ -160,7 +209,9 @@ request.URL.Host = clientURL.Host request.URL.Scheme = clientURL.Scheme currentPath := request.URL.Path - request.URL.Path = path.Clean(fmt.Sprintf("/%s/%s", client.BasePath, currentPath)) + if !strings.Contains(currentPath, fmt.Sprintf("/%s", client.BasePath)) { + request.URL.Path = path.Clean(fmt.Sprintf("/%s/%s", client.BasePath, currentPath)) + } return } @@ -177,11 +228,44 @@ return newServiceFailureFromResponse(res) } return nil +} + +// OCIRequest is any request made to an OCI service. +type OCIRequest interface { + // HTTPRequest assembles an HTTP request. + HTTPRequest(method, path string) (http.Request, error) +} + +// RequestMetadata is metadata about an OCIRequest. This structure represents the behavior exhibited by the SDK when +// issuing (or reissuing) a request. +type RequestMetadata struct { + // RetryPolicy is the policy for reissuing the request. If no retry policy is set on the request, + // then the request will be issued exactly once. + RetryPolicy *RetryPolicy +} +// OCIResponse is the response from issuing a request to an OCI service. +type OCIResponse interface { + // HTTPResponse returns the raw HTTP response. + HTTPResponse() *http.Response } -//Call executes the underlying http requrest with the given context +// OCIOperation is the generalization of a request-response cycle undergone by an OCI service. +type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) + +//ClientCallDetails a set of settings used by the a single Call operation of the http Client +type ClientCallDetails struct { + Signer HTTPRequestSigner +} + +// Call executes the http request with the given context func (client BaseClient) Call(ctx context.Context, request *http.Request) (response *http.Response, err error) { + return client.CallWithDetails(ctx, request, ClientCallDetails{Signer: client.Signer}) +} + +// CallWithDetails executes the http request, the given context using details specified in the paremeters, this function +// provides a way to override some settings present in the client +func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) { Debugln("Atempting to call downstream service") request = request.WithContext(ctx) @@ -197,7 +281,7 @@ } //Sign the request - err = client.Signer.Sign(request) + err = details.Signer.Sign(request) if err != nil { return } @@ -205,13 +289,14 @@ IfDebug(func() { dumpBody := true if request.ContentLength > maxBodyLenForDebug { - Logln("not dumping body too big") + Debugf("not dumping body too big\n") dumpBody = false } - if dump, e := httputil.DumpRequest(request, dumpBody); e == nil { - Logf("Dump Request %v", string(dump)) + dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging + if dump, e := httputil.DumpRequestOut(request, dumpBody); e == nil { + Debugf("Dump Request %s", string(dump)) } else { - Debugln(e) + Debugf("%v\n", e) } }) @@ -220,20 +305,21 @@ IfDebug(func() { if err != nil { - Logln(err) + Debugf("%v\n", err) return } dumpBody := true if response.ContentLength > maxBodyLenForDebug { - Logln("not dumping body too big") + Debugf("not dumping body too big\n") dumpBody = false } + dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging if dump, e := httputil.DumpResponse(response, dumpBody); e == nil { - Logf("Dump Response %v", string(dump)) + Debugf("Dump Response %s", string(dump)) } else { - Debugln(e) + Debugf("%v\n", e) } }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/client_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -14,6 +14,7 @@ "testing" "github.com/stretchr/testify/assert" + "time" ) type customConfig struct { @@ -63,6 +64,46 @@ assert.Equal(t, host, request.URL.Host) } +func TestClient_prepareRequestCanBeCalledMultipleTimes(t *testing.T) { + host := "somehost:9000" + basePath := "basePath" + restPath := "somepath" + + c := BaseClient{UserAgent: "asdf"} + c.Host = host + c.BasePath = basePath + + request := http.Request{} + request.URL = &url.URL{Path: restPath} + c.prepareRequest(&request) + assert.Equal(t, "https", request.URL.Scheme) + assert.Equal(t, "/basePath/somepath", request.URL.Path) + assert.Equal(t, host, request.URL.Host) + c.prepareRequest(&request) + assert.Equal(t, "https", request.URL.Scheme) + assert.Equal(t, "/basePath/somepath", request.URL.Path) +} + +func TestClient_prepareRequestUpdatesDateHeader(t *testing.T) { + host := "somehost:9000" + basePath := "basePath" + restPath := "somepath" + + c := BaseClient{UserAgent: "asdf"} + c.Host = host + c.BasePath = basePath + + request := http.Request{} + request.URL = &url.URL{Path: restPath} + c.prepareRequest(&request) + d1 := request.Header.Get(requestHeaderDate) + // make sure we wait some time to see that d1 and d2 have different times (set at second-level granularity) + time.Sleep(2 * time.Second) + c.prepareRequest(&request) + d2 := request.Header.Get(requestHeaderDate) + assert.NotEqual(t, d1, d2) +} + func TestDefaultHTTPDispatcher_transportNotSet(t *testing.T) { client := defaultHTTPDispatcher() @@ -181,7 +222,7 @@ Customcall: func(r *http.Request) (*http.Response, error) { assert.Equal(t, "somehost:9000", r.URL.Host) assert.Equal(t, defaultUserAgent(), r.UserAgent()) - assert.Contains(t, r.Header.Get("Authorization"), "signature") + assert.Contains(t, r.Header.Get(requestHeaderAuthorization), "signature") assert.Contains(t, r.URL.Path, "basePath/somepath") bodyBuffer := bytes.NewBufferString(body) response.Body = ioutil.NopCloser(bodyBuffer) @@ -219,7 +260,7 @@ Customcall: func(r *http.Request) (*http.Response, error) { assert.Equal(t, "somehost:9000", r.URL.Host) assert.Equal(t, defaultUserAgent(), r.UserAgent()) - assert.Contains(t, r.Header.Get("Authorization"), "signature") + assert.Contains(t, r.Header.Get(requestHeaderAuthorization), "signature") assert.Contains(t, r.URL.Path, "basePath/somepath") assert.Equal(t, "CustomValue", r.Header.Get("Custom-Header")) bodyBuffer := bytes.NewBufferString(body) @@ -240,38 +281,208 @@ } -func TestBaseClient_CallError(t *testing.T) { - response := http.Response{ - Header: http.Header{}, - StatusCode: 400, +type genericOCIResponse struct { + RawResponse *http.Response +} + +type retryableOCIRequest struct { + retryPolicy *RetryPolicy +} + +func (request retryableOCIRequest) HTTPRequest(method, path string) (http.Request, error) { + r := http.Request{} + r.Method = method + r.URL = &url.URL{Path: path} + return r, nil +} + +func (request retryableOCIRequest) RetryPolicy() *RetryPolicy { + return request.retryPolicy +} + +// HTTPResponse implements the OCIResponse interface +func (response genericOCIResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +func TestRetry_NeverGetSuccessfulResponse(t *testing.T) { + errorResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 400, + }, } - body := `{"code" : "some fake error","message" : "fake error not here"}` - c := testClientWithRegion(RegionIAD) - host := "http://somehost:9000" - basePath := "basePath/" - restPath := "/somepath" - caller := fakeCaller{ - Customcall: func(r *http.Request) (*http.Response, error) { - assert.Equal(t, "somehost:9000", r.URL.Host) - assert.Equal(t, defaultUserAgent(), r.UserAgent()) - assert.Contains(t, r.Header.Get("Authorization"), "signature") - assert.Contains(t, r.URL.Path, "basePath/somepath") - bodyBuffer := bytes.NewBufferString(body) - response.Body = ioutil.NopCloser(bodyBuffer) - return &response, nil + totalNumberAttempts := uint(5) + numberOfTimesWeEnterShouldRetry := uint(0) + numberOfTimesWeEnterGetNextDuration := uint(0) + shouldRetryOperation := func(operationResponse OCIOperationResponse) bool { + numberOfTimesWeEnterShouldRetry = numberOfTimesWeEnterShouldRetry + 1 + return true + } + getNextDuration := func(operationResponse OCIOperationResponse) time.Duration { + numberOfTimesWeEnterGetNextDuration = numberOfTimesWeEnterGetNextDuration + 1 + return 0 + } + retryPolicy := NewRetryPolicy(totalNumberAttempts, shouldRetryOperation, getNextDuration) + retryableRequest := retryableOCIRequest{ + retryPolicy: &retryPolicy, + } + // type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) + fakeOperation := func(context.Context, OCIRequest) (OCIResponse, error) { + return errorResponse, nil + } + + response, err := Retry(context.Background(), retryableRequest, fakeOperation, retryPolicy) + assert.Equal(t, totalNumberAttempts, numberOfTimesWeEnterShouldRetry) + assert.Nil(t, response) + assert.Equal(t, err.Error(), "maximum number of attempts exceeded (5)") +} + +func TestRetry_ImmediatelyGetsSuccessfulResponse(t *testing.T) { + successResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 200, }, } + totalNumberAttempts := uint(5) + numberOfTimesWeEnterShouldRetry := uint(0) + numberOfTimesWeEnterGetNextDuration := uint(0) + shouldRetryOperation := func(operationResponse OCIOperationResponse) bool { + numberOfTimesWeEnterShouldRetry = numberOfTimesWeEnterShouldRetry + 1 + return false + } + getNextDuration := func(operationResponse OCIOperationResponse) time.Duration { + numberOfTimesWeEnterGetNextDuration = numberOfTimesWeEnterGetNextDuration + 1 + return 0 + } + retryPolicy := NewRetryPolicy(totalNumberAttempts, shouldRetryOperation, getNextDuration) + retryableRequest := retryableOCIRequest{ + retryPolicy: &retryPolicy, + } + // type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) + fakeOperation := func(context.Context, OCIRequest) (OCIResponse, error) { + return successResponse, nil + } - c.Host = host - c.BasePath = basePath - c.HTTPClient = caller + response, err := Retry(context.Background(), retryableRequest, fakeOperation, retryPolicy) + assert.Equal(t, uint(1), numberOfTimesWeEnterShouldRetry) + assert.Equal(t, uint(0), numberOfTimesWeEnterGetNextDuration) + assert.Equal(t, response, successResponse) + assert.Nil(t, err) +} - request := http.Request{} - request.URL = &url.URL{Path: restPath} - retRes, err := c.Call(context.Background(), &request) - assert.Error(t, err) - assert.Equal(t, &response, retRes) +func TestRetry_RaisesDeadlineExceededException(t *testing.T) { + errorResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 400, + }, + } + totalNumberAttempts := uint(5) + numberOfTimesWeEnterShouldRetry := uint(0) + numberOfTimesWeEnterGetNextDuration := uint(0) + shouldRetryOperation := func(operationResponse OCIOperationResponse) bool { + numberOfTimesWeEnterShouldRetry = numberOfTimesWeEnterShouldRetry + 1 + return true + } + getNextDuration := func(operationResponse OCIOperationResponse) time.Duration { + numberOfTimesWeEnterGetNextDuration = numberOfTimesWeEnterGetNextDuration + 1 + return 10 * time.Second + } + retryPolicy := NewRetryPolicy(totalNumberAttempts, shouldRetryOperation, getNextDuration) + retryableRequest := retryableOCIRequest{ + retryPolicy: &retryPolicy, + } + // type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) + fakeOperation := func(context.Context, OCIRequest) (OCIResponse, error) { + return errorResponse, nil + } + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + response, err := Retry(ctx, retryableRequest, fakeOperation, retryPolicy) + assert.Equal(t, uint(1), numberOfTimesWeEnterShouldRetry) + assert.Equal(t, uint(1), numberOfTimesWeEnterGetNextDuration) + assert.Equal(t, response, errorResponse) + assert.Equal(t, DeadlineExceededByBackoff, err) +} +func TestRetry_GetsSuccessfulResponseAfterMultipleAttempts(t *testing.T) { + errorResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 400, + }, + } + successResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 200, + }, + } + totalNumberAttempts := uint(10) + numberOfTimesWeEnterShouldRetry := uint(0) + numberOfTimesWeEnterGetNextDuration := uint(0) + shouldRetryOperation := func(operationResponse OCIOperationResponse) bool { + numberOfTimesWeEnterShouldRetry = numberOfTimesWeEnterShouldRetry + 1 + return operationResponse.Response.HTTPResponse().StatusCode == 400 + } + getNextDuration := func(operationResponse OCIOperationResponse) time.Duration { + numberOfTimesWeEnterGetNextDuration = numberOfTimesWeEnterGetNextDuration + 1 + return 0 * time.Second + } + retryPolicy := NewRetryPolicy(totalNumberAttempts, shouldRetryOperation, getNextDuration) + retryableRequest := retryableOCIRequest{ + retryPolicy: &retryPolicy, + } + // type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) + fakeOperation := func(context.Context, OCIRequest) (OCIResponse, error) { + if numberOfTimesWeEnterShouldRetry < 7 { + return errorResponse, nil + } + return successResponse, nil + } + + response, err := Retry(context.Background(), retryableRequest, fakeOperation, retryPolicy) + assert.Equal(t, uint(8), numberOfTimesWeEnterShouldRetry) + assert.Equal(t, uint(7), numberOfTimesWeEnterGetNextDuration) + assert.Equal(t, response, successResponse) + assert.Nil(t, err) +} + +func TestRetry_CancelContextWhileSleeping(t *testing.T) { + + shouldRetryOperation := func(res OCIOperationResponse) bool { return true } + getNextDuration := func(res OCIOperationResponse) time.Duration { return 4 * time.Second } + + errorResponse := genericOCIResponse{ + RawResponse: &http.Response{ + Header: http.Header{}, + StatusCode: 400, + }, + } + pol := NewRetryPolicy(uint(10), shouldRetryOperation, getNextDuration) + req := retryableOCIRequest{retryPolicy: &pol} + fakeOperation := func(context.Context, OCIRequest) (OCIResponse, error) { return errorResponse, nil } + + ctx, cancelFn := context.WithDeadline(context.Background(), time.Now().Add(10*time.Second)) + + //cancel context while sleeping + go func() { + time.Sleep(1 * time.Second) + cancelFn() + }() + + res, err := Retry(ctx, req, fakeOperation, pol) + assert.Equal(t, errorResponse, res) + assert.Equal(t, context.Canceled, err) +} + +func TestRetryToken_GenerateMultipleTimes(t *testing.T) { + token1 := RetryToken() + token2 := RetryToken() + assert.NotEqual(t, token1, token2) } func TestBaseClient_CreateWithInvalidConfig(t *testing.T) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common.go 2019-06-28 17:13:01.000000000 +0000 @@ -3,6 +3,8 @@ package common import ( + "fmt" + "regexp" "strings" ) @@ -12,6 +14,8 @@ const ( //RegionSEA region SEA RegionSEA Region = "sea" + //RegionCAToronto1 region for toronto + RegionCAToronto1 Region = "ca-toronto-1" //RegionPHX region PHX RegionPHX Region = "us-phoenix-1" //RegionIAD region IAD @@ -20,13 +24,87 @@ RegionFRA Region = "eu-frankfurt-1" //RegionLHR region LHR RegionLHR Region = "uk-london-1" + //RegionAPTokyo1 region for tokyo + RegionAPTokyo1 Region = "ap-tokyo-1" + //RegionAPSeoul1 region for seoul + RegionAPSeoul1 Region = "ap-seoul-1" + + //RegionUSLangley1 region for langley + RegionUSLangley1 Region = "us-langley-1" + //RegionUSLuke1 region for luke + RegionUSLuke1 Region = "us-luke-1" + + //RegionUSGovAshburn1 region for langley + RegionUSGovAshburn1 Region = "us-gov-ashburn-1" + //RegionUSGovChicago1 region for luke + RegionUSGovChicago1 Region = "us-gov-chicago-1" + //RegionUSGovPhoenix1 region for luke + RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" ) +var realm = map[string]string{ + "oc1": "oraclecloud.com", + "oc2": "oraclegovcloud.com", + "oc3": "oraclegovcloud.com", +} + +var regionRealm = map[Region]string{ + RegionPHX: "oc1", + RegionIAD: "oc1", + RegionFRA: "oc1", + RegionLHR: "oc1", + RegionCAToronto1: "oc1", + RegionAPTokyo1: "oc1", + RegionAPSeoul1: "oc1", + + RegionUSLangley1: "oc2", + RegionUSLuke1: "oc2", + RegionUSGovAshburn1: "oc3", + RegionUSGovChicago1: "oc3", + RegionUSGovPhoenix1: "oc3", +} + +// Endpoint returns a endpoint for a service +func (region Region) Endpoint(service string) string { + return fmt.Sprintf("%s.%s.%s", service, region, region.secondLevelDomain()) +} + +// EndpointForTemplate returns a endpoint for a service based on template +func (region Region) EndpointForTemplate(service string, serviceEndpointTemplate string) string { + if serviceEndpointTemplate == "" { + return region.Endpoint(service) + } + + // replace service prefix + endpoint := strings.Replace(serviceEndpointTemplate, "{serviceEndpointPrefix}", service, 1) + + // replace region + endpoint = strings.Replace(endpoint, "{region}", string(region), 1) + + // replace second level domain + endpoint = strings.Replace(endpoint, "{secondLevelDomain}", region.secondLevelDomain(), 1) + + return endpoint +} + +func (region Region) secondLevelDomain() string { + if realmID, ok := regionRealm[region]; ok { + if secondLevelDomain, ok := realm[realmID]; ok { + return secondLevelDomain + } + } + + Debugf("cannot find realm for region : %s, return default realm value.", region) + return realm["oc1"] +} + //StringToRegion convert a string to Region type func StringToRegion(stringRegion string) (r Region) { switch strings.ToLower(stringRegion) { case "sea": r = RegionSEA + case "ca-toronto-1": + r = RegionCAToronto1 case "phx", "us-phoenix-1": r = RegionPHX case "iad", "us-ashburn-1": @@ -35,9 +113,34 @@ r = RegionFRA case "lhr", "uk-london-1": r = RegionLHR + case "ap-tokyo-1": + r = RegionAPTokyo1 + case "ap-seoul-1": + r = RegionAPSeoul1 + case "us-langley-1": + r = RegionUSLangley1 + case "us-luke-1": + r = RegionUSLuke1 + case "us-gov-ashburn-1": + r = RegionUSGovAshburn1 + case "us-gov-chicago-1": + r = RegionUSGovChicago1 + case "us-gov-phoenix-1": + r = RegionUSGovPhoenix1 default: r = Region(stringRegion) Debugf("region named: %s, is not recognized", stringRegion) } return } + +// canStringBeRegion test if the string can be a region, if it can, returns the string as is, otherwise it +// returns an error +var blankRegex = regexp.MustCompile("\\s") + +func canStringBeRegion(stringRegion string) (region string, err error) { + if blankRegex.MatchString(stringRegion) || stringRegion == "" { + return "", fmt.Errorf("region can not be empty or have spaces") + } + return stringRegion, nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/common_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package common + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestEndpoint(t *testing.T) { + // OC1 + region := StringToRegion("us-phoenix-1") + endpoint := region.Endpoint("foo") + assert.Equal(t, "foo.us-phoenix-1.oraclecloud.com", endpoint) + + region = StringToRegion("us-ashburn-1") + endpoint = region.Endpoint("bar") + assert.Equal(t, "bar.us-ashburn-1.oraclecloud.com", endpoint) + + region = StringToRegion("ca-toronto-1") + endpoint = region.Endpoint("bar") + assert.Equal(t, "bar.ca-toronto-1.oraclecloud.com", endpoint) + + // OC2 + region = StringToRegion("us-langley-1") + endpoint = region.Endpoint("bar") + assert.Equal(t, "bar.us-langley-1.oraclegovcloud.com", endpoint) + + // OC3 + region = StringToRegion("us-gov-ashburn-1") + endpoint = region.Endpoint("bar") + assert.Equal(t, "bar.us-gov-ashburn-1.oraclegovcloud.com", endpoint) +} + +func TestEndpointForTemplate(t *testing.T) { + type testData struct { + region Region + service string + endpointTemplate string + expected string + } + testDataSet := []testData{ + { + // template with region + region: StringToRegion("us-phoenix-1"), + service: "test", + endpointTemplate: "https://foo.{region}.bar.com", + expected: "https://foo.us-phoenix-1.bar.com", + }, + { + // template with second level domain + region: StringToRegion("us-phoenix-1"), + service: "test", + endpointTemplate: "https://foo.region.{secondLevelDomain}", + expected: "https://foo.region.oraclecloud.com", + }, + { + // template with everything for OC2 + region: StringToRegion("us-langley-1"), + service: "test", + endpointTemplate: "https://test.{region}.{secondLevelDomain}", + expected: "https://test.us-langley-1.oraclegovcloud.com", + }, + { + // template with everything for OC3 + region: StringToRegion("us-gov-ashburn-1"), + service: "test", + endpointTemplate: "https://test.{region}.{secondLevelDomain}", + expected: "https://test.us-gov-ashburn-1.oraclegovcloud.com", + }, + } + + for _, testData := range testDataSet { + endpoint := testData.region.EndpointForTemplate(testData.service, testData.endpointTemplate) + assert.Equal(t, testData.expected, endpoint) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -8,6 +8,7 @@ "fmt" "io/ioutil" "os" + "path" "regexp" "strings" ) @@ -79,19 +80,28 @@ } func (p rawConfigurationProvider) TenancyOCID() (string, error) { + if p.tenancy == "" { + return "", fmt.Errorf("tenancy OCID can not be empty") + } return p.tenancy, nil } func (p rawConfigurationProvider) UserOCID() (string, error) { + if p.user == "" { + return "", fmt.Errorf("user OCID can not be empty") + } return p.user, nil } func (p rawConfigurationProvider) KeyFingerprint() (string, error) { + if p.fingerprint == "" { + return "", fmt.Errorf("fingerprint can not be empty") + } return p.fingerprint, nil } func (p rawConfigurationProvider) Region() (string, error) { - return p.region, nil + return canStringBeRegion(p.region) } // environmentConfigurationProvider reads configuration from environment variables @@ -120,7 +130,8 @@ return nil, fmt.Errorf("can not read PrivateKey from env variable: %s", environmentVariable) } - pemFileContent, err := ioutil.ReadFile(value) + expandedPath := expandPath(value) + pemFileContent, err := ioutil.ReadFile(expandedPath) if err != nil { Debugln("Can not read PrivateKey location from environment variable: " + environmentVariable) return @@ -181,8 +192,10 @@ var ok bool if value, ok = os.LookupEnv(environmentVariable); !ok { err = fmt.Errorf("can not read region from environment variable %s", environmentVariable) + return value, err } - return + + return canStringBeRegion(value) } // fileConfigurationProvider. reads configuration information from a file @@ -278,7 +291,7 @@ splits := strings.Split(line, "=") switch key, value := strings.TrimSpace(splits[0]), strings.TrimSpace(splits[1]); strings.ToLower(key) { - case "passphrase": + case "passphrase", "pass_phrase": configurationPresent = configurationPresent | hasPassphrase info.Passphrase = value case "user": @@ -303,8 +316,21 @@ } +// cleans and expands the path if it contains a tilde , returns the expanded path or the input path as is if not expansion +// was performed +func expandPath(filepath string) (expandedPath string) { + cleanedPath := path.Clean(filepath) + expandedPath = cleanedPath + if strings.HasPrefix(cleanedPath, "~") { + rest := cleanedPath[2:] + expandedPath = path.Join(getHomeFolder(), rest) + } + return +} + func openConfigFile(configFilePath string) (data []byte, err error) { - data, err = ioutil.ReadFile(configFilePath) + expandedPath := expandPath(configFilePath) + data, err = ioutil.ReadFile(expandedPath) if err != nil { err = fmt.Errorf("can not read config file: %s due to: %s", configFilePath, err.Error()) } @@ -395,7 +421,9 @@ if err != nil { return } - pemFileContent, err := ioutil.ReadFile(filePath) + + expandedPath := expandPath(filePath) + pemFileContent, err := ioutil.ReadFile(expandedPath) if err != nil { err = fmt.Errorf("can not read PrivateKey from configuration file due to: %s", err.Error()) return @@ -419,7 +447,11 @@ } value, err = presentOrError(info.Region, hasRegion, info.PresentConfiguration, "region") - return + if err != nil { + return + } + + return canStringBeRegion(value) } // A configuration provider that look for information in multiple configuration providers diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/configuration_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -9,6 +9,8 @@ "testing" "github.com/stretchr/testify/assert" + "path" + "strings" ) var ( @@ -65,10 +67,8 @@ testKeyPassphrase = "goisfun" ) -func removeFileFn(filename string) func() { - return func() { - os.Remove(filename) - } +func removeFileFn(filename string) { + os.Remove(filename) } func writeTempFile(data string) (filename string) { @@ -112,6 +112,99 @@ } +func TestBadRawConfigurationProvider(t *testing.T) { + var ( + testTenancy = "" + testUser = "" + testRegion = "" + testFingerprint = "" + ) + + c := NewRawConfigurationProvider(testTenancy, testUser, testRegion, testFingerprint, "", nil) + + _, err := c.UserOCID() + assert.Error(t, err) + + _, err = c.KeyFingerprint() + assert.Error(t, err) + + _, err = c.Region() + assert.Error(t, err) + + _, err = c.PrivateRSAKey() + assert.Error(t, err) + + _, err = c.KeyID() + assert.Error(t, err) + +} + +func TestRawConfigurationProvider_BadRegion(t *testing.T) { + var ( + testTenancy = "ocid1.tenancy.oc1..aaaaaaaaxf3fuazos" + testUser = "ocid1.user.oc1..aaaaaaaa3p67n2kmpxnbcnff" + testRegion = "us-ashburn-1 " + testFingerprint = "af:81:71:8e:d2" + ) + + c := NewRawConfigurationProvider(testTenancy, testUser, testRegion, testFingerprint, testPrivateKeyConf, nil) + + user, err := c.UserOCID() + assert.NoError(t, err) + assert.Equal(t, user, testUser) + + fingerprint, err := c.KeyFingerprint() + assert.NoError(t, err) + assert.Equal(t, fingerprint, testFingerprint) + + _, err = c.Region() + assert.Error(t, err) + + rsaKey, err := c.PrivateRSAKey() + assert.NoError(t, err) + assert.NotEmpty(t, rsaKey) + + keyID, err := c.KeyID() + assert.NoError(t, err) + assert.NotEmpty(t, keyID) + + assert.Equal(t, keyID, "ocid1.tenancy.oc1..aaaaaaaaxf3fuazos/ocid1.user.oc1..aaaaaaaa3p67n2kmpxnbcnff/af:81:71:8e:d2") + +} + +func TestEnvironmentConfigurationProvider(t *testing.T) { + envVars := []string{"region", "fingerprint", "user_ocid", "tenancy_ocid"} + keyFile := writeTempFile(testPrivateKeyConf) + defer removeFileFn(keyFile) + + for _, v := range envVars { + os.Setenv(fmt.Sprintf("OCI_TEST_%s", v), "someval") + } + os.Setenv("OCI_TEST_private_key_path", keyFile) + + conf := ConfigurationProviderEnvironmentVariables("OCI_TEST", "") + b, _ := IsConfigurationProviderValid(conf) + assert.True(t, b) +} + +func TestEnvironmentConfigurationProvider_BadRegion(t *testing.T) { + envVars := []string{"fingerprint", "user_ocid", "tenancy_ocid"} + keyFile := writeTempFile(testPrivateKeyConf) + defer removeFileFn(keyFile) + + for _, v := range envVars { + os.Setenv(fmt.Sprintf("OCI_TEST_%s", v), "someval") + } + os.Setenv("OCI_TEST_private_key_path", keyFile) + os.Setenv("OCI_TEST_region", "asdfas ") + + conf := ConfigurationProviderEnvironmentVariables("OCI_TEST", "") + b, _ := IsConfigurationProviderValid(conf) + assert.False(t, b) + _, e := conf.Region() + assert.Error(t, e) +} + func TestFileConfigurationProvider_parseConfigFileData(t *testing.T) { data := `[DEFAULT] user=someuser @@ -160,6 +253,27 @@ } } +func TestFileConfigurationProvider_FromFileBadRegion(t *testing.T) { + data := `[DEFAULT] +user=someuser +fingerprint=somefingerprint +key_file=somelocation +tenancy=sometenancy +compartment = somecompartment +region= asdf asdf +` + filename := writeTempFile(data) + defer removeFileFn(filename) + + c := fileConfigurationProvider{ConfigPath: filename, Profile: "DEFAULT"} + fns := []func() (string, error){c.Region} + + for _, fn := range fns { + _, e := fn() + assert.Error(t, e) + } +} + func TestFileConfigurationProvider_FromFileEmptyProfile(t *testing.T) { expected := []string{ttenancy, tuser, tfingerprint, tkeyfile} data := ` @@ -550,7 +664,7 @@ tenancy=sometenancy compartment = somecompartment region=someregion -passphrase=%s +pass_phrase=%s ` keyFile := writeTempFile(testEncryptedPrivateKeyConf) @@ -651,3 +765,107 @@ assert.NoError(t, err) assert.NotNil(t, key) } + +func TestConfigurationWithTilde(t *testing.T) { + dataTpl := `[DEFAULT] +user=someuser +fingerprint=somefingerprint +key_file=%s +tenancy=sometenancy +compartment = somecompartment +region=someregion +` + + tmpKeyLocation := path.Join(getHomeFolder(), "testKey") + e := ioutil.WriteFile(tmpKeyLocation, []byte(testEncryptedPrivateKeyConf), 777) + if e != nil { + assert.FailNow(t, e.Error()) + } + + newlocation := strings.Replace(tmpKeyLocation, getHomeFolder(), "~/", 1) + data := fmt.Sprintf(dataTpl, newlocation) + tmpConfFile := writeTempFile(data) + + defer removeFileFn(tmpConfFile) + defer removeFileFn(tmpKeyLocation) + + provider, err := ConfigurationProviderFromFile(tmpConfFile, testKeyPassphrase) + assert.NoError(t, err) + ok, err := IsConfigurationProviderValid(provider) + assert.NoError(t, err) + assert.True(t, ok) + + fns := []func() (string, error){provider.TenancyOCID, provider.UserOCID, provider.KeyFingerprint} + + for _, fn := range fns { + val, e := fn() + assert.NoError(t, e) + assert.NotEmpty(t, val) + } + + key, err := provider.PrivateRSAKey() + assert.NoError(t, err) + assert.NotNil(t, key) +} + +func TestExpandPath(t *testing.T) { + home := getHomeFolder() + testIO := []struct { + name, inPath, expectedPath string + }{ + { + name: "should expand tilde and return appended home dir", + inPath: "~/somepath", + expectedPath: path.Join(home, "somepath"), + }, + { + name: "should not do anything", + inPath: "/somepath/some/dir/~/file", + expectedPath: "/somepath/some/dir/~/file", + }, + { + name: "should replace one tilde only", + inPath: "~/~/some/path", + expectedPath: path.Join(home, "~/some/path"), + }, + } + for _, tio := range testIO { + t.Run(tio.name, func(t *testing.T) { + p := expandPath(tio.inPath) + assert.Equal(t, tio.expectedPath, p) + }) + } +} + +func TestIsRegionValid(t *testing.T) { + testIO := []struct { + name string + input string + expected bool + }{ + {"valid", "aasb asdf", true}, + {"valid", "aasb-asdf", false}, + {"empty", "", true}, + {"leading strings", " aasb", true}, + {"single leading string", " aasb", true}, + {"single trailing string", "aasb ", true}, + {"trailing string", "aasb ", true}, + {"single trailing and leading", " aasb ", true}, + {"tab", "aasb ", true}, + {"carriage return", "\raasb", true}, + {"new line", "aasb\n", true}, + {"feed", "aa\fsb", true}, + {"trailing and leading", " aasb ", true}, + } + + for _, tIO := range testIO { + t.Run(tIO.name, func(t *testing.T) { + _, err := canStringBeRegion(tIO.input) + if tIO.expected { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + }) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors.go 2019-06-28 17:13:01.000000000 +0000 @@ -18,45 +18,48 @@ GetMessage() string // A short error code that defines the error, meant for programmatic parsing. - // See https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm + // See https://docs.cloud.oracle.com/Content/API/References/apierrors.htm GetCode() string + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + GetOpcRequestID() string } type servicefailure struct { - StatusCode int - Code string `json:"code,omitempty"` - Message string `json:"message,omitempty"` + StatusCode int + Code string `json:"code,omitempty"` + Message string `json:"message,omitempty"` + OpcRequestID string `json:"opc-request-id"` } func newServiceFailureFromResponse(response *http.Response) error { var err error + se := servicefailure{ + StatusCode: response.StatusCode, + Code: "BadErrorResponse", + OpcRequestID: response.Header.Get("opc-request-id")} + //If there is an error consume the body, entirely body, err := ioutil.ReadAll(response.Body) if err != nil { - return servicefailure{ - StatusCode: response.StatusCode, - Code: "BadErrorResponse", - Message: fmt.Sprintf("The body of the response was not readable, due to :%s", err.Error()), - } + se.Message = fmt.Sprintf("The body of the response was not readable, due to :%s", err.Error()) + return se } - se := servicefailure{StatusCode: response.StatusCode} err = json.Unmarshal(body, &se) if err != nil { Debugf("Error response could not be parsed due to: %s", err.Error()) - return servicefailure{ - StatusCode: response.StatusCode, - Code: "BadErrorResponse", - Message: fmt.Sprintf("Error while parsing failure from response"), - } + se.Message = fmt.Sprintf("Failed to parse json from response body due to: %s. With response body %s.", err.Error(), string(body[:])) + return se } return se } func (se servicefailure) Error() string { - return fmt.Sprintf("Service error:%s. %s. http status code: %d", - se.Code, se.Message, se.StatusCode) + return fmt.Sprintf("Service error:%s. %s. http status code: %d. Opc request id: %s", + se.Code, se.Message, se.StatusCode, se.OpcRequestID) } func (se servicefailure) GetHTTPStatusCode() int { @@ -72,9 +75,24 @@ return se.Code } +func (se servicefailure) GetOpcRequestID() string { + return se.OpcRequestID +} + // IsServiceError returns false if the error is not service side, otherwise true // additionally it returns an interface representing the ServiceError func IsServiceError(err error) (failure ServiceError, ok bool) { failure, ok = err.(servicefailure) return } + +type deadlineExceededByBackoffError struct{} + +func (deadlineExceededByBackoffError) Error() string { + return "now() + computed backoff duration exceeds request deadline" +} + +// DeadlineExceededByBackoff is the error returned by Call() when GetNextDuration() returns a time.Duration that would +// force the user to wait past the request deadline before re-issuing a request. This enables us to exit early, since +// we cannot succeed based on the configured retry policy. +var DeadlineExceededByBackoff error = deadlineExceededByBackoffError{} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/errors_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package common + +import ( + "bytes" + "io/ioutil" + "net/http" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestErrors_ServiceFailureFromResponse(t *testing.T) { + header := http.Header{} + opcID := "111" + header.Set("opc-request-id", opcID) + sampleResponse := `{"key" : "test"}` + + httpResponse := http.Response{Header: header} + bodyBuffer := bytes.NewBufferString(sampleResponse) + httpResponse.Body = ioutil.NopCloser(bodyBuffer) + httpResponse.StatusCode = 200 + err := newServiceFailureFromResponse(&httpResponse) + assert.Equal(t, err.(ServiceError).GetOpcRequestID(), opcID) + assert.Equal(t, strings.Contains(err.Error(), "Service error:"), true) + + failure, ok := IsServiceError(err) + assert.Equal(t, ok, true) + assert.Equal(t, failure.GetHTTPStatusCode(), httpResponse.StatusCode) +} + +func TestErrors_FailedToParseJson(t *testing.T) { + // invalid json + sampleResponse := `{"key" : test"}` + + httpResponse := http.Response{} + bodyBuffer := bytes.NewBufferString(sampleResponse) + httpResponse.Body = ioutil.NopCloser(bodyBuffer) + err := newServiceFailureFromResponse(&httpResponse) + + failure, ok := IsServiceError(err) + assert.Equal(t, ok, true) + assert.Equal(t, failure.GetCode(), "BadErrorResponse") + assert.Equal(t, strings.Contains(failure.GetMessage(), "Failed to parse json from response body due to"), true) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers.go 2019-06-28 17:13:01.000000000 +0000 @@ -3,11 +3,13 @@ package common import ( + "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "reflect" + "strconv" "strings" "time" ) @@ -22,6 +24,11 @@ return &value } +// Int64 returns a pointer to the provided int64 +func Int64(value int64) *int64 { + return &value +} + // Uint returns a pointer to the provided uint func Uint(value uint) *uint { return &value @@ -75,15 +82,33 @@ return } -// SDKTime a time struct, which renders to/from json using RFC339 +// SDKTime a struct that parses/renders to/from json using RFC339 date-time information type SDKTime struct { time.Time } +// SDKDate a struct that parses/renders to/from json using only date information +type SDKDate struct { + //Date date information + Date time.Time +} + func sdkTimeFromTime(t time.Time) SDKTime { return SDKTime{t} } +func sdkDateFromTime(t time.Time) SDKDate { + return SDKDate{Date: t} +} + +func formatTime(t SDKTime) string { + return t.Format(sdkTimeFormat) +} + +func formatDate(t SDKDate) string { + return t.Date.Format(sdkDateFormat) +} + func now() *SDKTime { t := SDKTime{time.Now()} return &t @@ -92,19 +117,19 @@ var timeType = reflect.TypeOf(SDKTime{}) var timeTypePtr = reflect.TypeOf(&SDKTime{}) -const sdkTimeFormat = time.RFC3339 +var sdkDateType = reflect.TypeOf(SDKDate{}) +var sdkDateTypePtr = reflect.TypeOf(&SDKDate{}) +//Formats for sdk supported time representations +const sdkTimeFormat = time.RFC3339Nano const rfc1123OptionalLeadingDigitsInDay = "Mon, _2 Jan 2006 15:04:05 MST" - -func formatTime(t SDKTime) string { - return t.Format(sdkTimeFormat) -} +const sdkDateFormat = "2006-01-02" func tryParsingTimeWithValidFormatsForHeaders(data []byte, headerName string) (t time.Time, err error) { header := strings.ToLower(headerName) switch header { case "lastmodified", "date": - t, err = tryParsing(data, time.RFC3339, time.RFC1123, rfc1123OptionalLeadingDigitsInDay, time.RFC850, time.ANSIC) + t, err = tryParsing(data, time.RFC3339Nano, time.RFC3339, time.RFC1123, rfc1123OptionalLeadingDigitsInDay, time.RFC850, time.ANSIC) return default: //By default we parse with RFC3339 t, err = time.Parse(sdkTimeFormat, string(data)) @@ -124,6 +149,21 @@ return } +// String returns string representation of SDKDate +func (t *SDKDate) String() string { + return t.Date.Format(sdkDateFormat) +} + +// NewSDKDateFromString parses the dateString into SDKDate +func NewSDKDateFromString(dateString string) (*SDKDate, error) { + parsedTime, err := time.Parse(sdkDateFormat, dateString) + if err != nil { + return nil, err + } + + return &SDKDate{Date: parsedTime}, nil +} + // UnmarshalJSON unmarshals from json func (t *SDKTime) UnmarshalJSON(data []byte) (e error) { s := string(data) @@ -143,6 +183,26 @@ return } +// UnmarshalJSON unmarshals from json +func (t *SDKDate) UnmarshalJSON(data []byte) (e error) { + if string(data) == `"null"` { + t.Date = time.Time{} + return + } + + t.Date, e = tryParsing(data, + strconv.Quote(sdkDateFormat), + ) + return +} + +// MarshalJSON marshals to JSON +func (t *SDKDate) MarshalJSON() (buff []byte, e error) { + s := t.Date.Format(sdkDateFormat) + buff = []byte(strconv.Quote(s)) + return +} + // PrivateKeyFromBytes is a helper function that will produce a RSA private // key from bytes. func PrivateKeyFromBytes(pemData []byte, password *string) (key *rsa.PrivateKey, e error) { @@ -166,3 +226,20 @@ } return } + +func generateRandUUID() (string, error) { + b := make([]byte, 16) + _, err := rand.Read(b) + if err != nil { + return "", err + } + uuid := fmt.Sprintf("%x%x%x%x%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) + + return uuid, nil +} + +func makeACopy(original []string) []string { + tmp := make([]string, len(original)) + copy(tmp, original) + return tmp +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/helpers_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -3,9 +3,12 @@ package common import ( + "encoding/json" "fmt" "github.com/stretchr/testify/assert" + "reflect" "testing" + "time" ) func TestStructToString(t *testing.T) { @@ -82,3 +85,96 @@ assert.Equal(t, tt.Day(), 2) } } + +func TestFormattedTimeMarshaling(t *testing.T) { + sampleTime, _ := time.Parse(time.UnixDate, "Mon Jan 02 15:04:05 MST 2006") + testIO := []struct { + name string + t *SDKDate + expectedJSON string + expectedError error + }{ + { + name: "formatting time to simple date format", + t: &SDKDate{Date: sampleTime}, + expectedJSON: `"2006-01-02"`, + expectedError: nil, + }, + { + name: "formatting nil", + t: nil, + expectedJSON: `null`, + expectedError: nil, + }, + } + + for _, tc := range testIO { + t.Run(tc.name, func(t *testing.T) { + bytes, e := json.Marshal(&tc.t) + assert.Equal(t, tc.expectedError, e) + assert.Equal(t, tc.expectedJSON, string(bytes)) + }) + } + +} + +func TestFormattedTimeUnMarshaling(t *testing.T) { + sampleTime, _ := time.Parse(time.UnixDate, "Mon Jan 02 15:04:05 MST 2006") + testIO := []struct { + name string + json string + expectedTime *SDKDate + expectedError error + }{ + { + name: "unmarshaling time to simple date format", + expectedTime: &SDKDate{Date: sampleTime}, + json: `"2006-01-02"`, + expectedError: nil, + }, + { + name: "unmarshaling time to simple RFC3339 format", + expectedTime: &SDKDate{Date: sampleTime}, + json: `"2006-01-02T15:04:05Z"`, + expectedError: &time.ParseError{}, + }, + { + name: "unmarshaling null", + expectedTime: &SDKDate{}, + json: `"null"`, + expectedError: nil, + }, + } + + for _, tc := range testIO { + t.Run(tc.name, func(t *testing.T) { + newTime := SDKDate{} + e := json.Unmarshal([]byte(tc.json), &newTime) + assert.IsType(t, reflect.TypeOf(tc.expectedError), reflect.TypeOf(e)) + if tc.expectedError != nil { + return + } + assert.Equal(t, tc.expectedTime.Date.Format(sdkDateFormat), newTime.Date.Format(sdkDateFormat)) + }) + } + +} + +func TestSDKDateToAndFromString(t *testing.T) { + _, err := NewSDKDateFromString("InvalidFormat") + s, _ := NewSDKDateFromString("2018-09-13") + str := fmt.Sprintf("%s", s) + + assert.Equal(t, "2018-09-13", str) + assert.IsType(t, &time.ParseError{}, err) +} + +func TestMakeACopy(t *testing.T) { + original := []string{"a", "b", "c"} + + copy := makeACopy(original) + + assert.Equal(t, original, copy) + copy[0] = "mutate" + assert.NotEqual(t, original, copy) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http.go 2019-06-28 17:13:01.000000000 +0000 @@ -10,7 +10,6 @@ "io/ioutil" "net/http" "net/url" - "path" "reflect" "regexp" "strconv" @@ -43,6 +42,11 @@ return formatTime(t), nil } + if v.Type() == sdkDateType { + t := v.Interface().(SDKDate) + return formatDate(t), nil + } + switch v.Kind() { case reflect.Bool: return strconv.FormatBool(v.Bool()), nil @@ -72,8 +76,8 @@ request.Body = readCloser //Set the default content type to application/octet-stream if not set - if request.Header.Get("Content-Type") == "" { - request.Header.Set("Content-Type", "application/octet-stream") + if request.Header.Get(requestHeaderContentType) == "" { + request.Header.Set(requestHeaderContentType, "application/octet-stream") } return nil } @@ -128,7 +132,7 @@ return false } -// omitNilFieldsInJSON, removes json keys whose struct value is nil, and the field is tag with the json and +// omitNilFieldsInJSON, removes json keys whose struct value is nil, and the field is tagged with the json and // mandatory:false tags func omitNilFieldsInJSON(data interface{}, value reflect.Value) (interface{}, error) { switch value.Kind() { @@ -160,7 +164,14 @@ continue } - if currentFieldValue.Type() == timeType || currentFieldValue.Type() == timeTypePtr { + // Check to make sure the field is part of the json representation of the value + if _, contains := jsonMap[jsonFieldName]; !contains { + Debugf("Field %s is not present in json, omitting", jsonFieldName) + continue + } + + if currentFieldValue.Type() == timeType || currentFieldValue.Type() == timeTypePtr || + currentField.Type == sdkDateType || currentField.Type == sdkDateTypePtr { continue } // does it need to be adjusted? @@ -174,7 +185,14 @@ } return jsonMap, nil case reflect.Slice, reflect.Array: - jsonList := data.([]interface{}) + // Special case: a []byte may have been marshalled as a string + if data != nil && reflect.TypeOf(data).Kind() == reflect.String && value.Type().Elem().Kind() == reflect.Uint8 { + return data, nil + } + jsonList, ok := data.([]interface{}) + if !ok { + return nil, fmt.Errorf("can not omit nil fields, data was expected to be a not-nil list") + } newList := make([]interface{}, len(jsonList)) var err error for i, val := range jsonList { @@ -185,7 +203,10 @@ } return newList, nil case reflect.Map: - jsonMap := data.(map[string]interface{}) + jsonMap, ok := data.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("can not omit nil fields, data was expected to be a not-nil map") + } newMap := make(map[string]interface{}, len(jsonMap)) var err error for key, val := range jsonMap { @@ -207,9 +228,15 @@ // removeNilFieldsInJSONWithTaggedStruct remove struct fields tagged with json and mandatory false // that are nil func removeNilFieldsInJSONWithTaggedStruct(rawJSON []byte, value reflect.Value) ([]byte, error) { - rawMap := make(map[string]interface{}) - json.Unmarshal(rawJSON, &rawMap) - fixedMap, err := omitNilFieldsInJSON(rawMap, value) + var rawInterface interface{} + decoder := json.NewDecoder(bytes.NewBuffer(rawJSON)) + decoder.UseNumber() + var err error + if err = decoder.Decode(&rawInterface); err != nil { + return nil, err + } + + fixedMap, err := omitNilFieldsInJSON(rawInterface, value) if err != nil { return nil, err } @@ -219,7 +246,7 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to body from field:", field.Name) if request.Body != nil { - Logln("The body of the request is already set. Structure: ", field.Name, " will overwrite it") + Logf("The body of the request is already set. Structure: %s will overwrite it\n", field.Name) } tag := field.Tag encoding := tag.Get("encoding") @@ -236,11 +263,15 @@ if e != nil { return } - Debugf("Marshaled body is: %s", string(marshaled)) + + if defaultLogger.LogLevel() == verboseLogging { + Debugf("Marshaled body is: %s\n", string(marshaled)) + } + bodyBytes := bytes.NewReader(marshaled) request.ContentLength = int64(bodyBytes.Len()) - request.Header.Set("Content-Length", strconv.FormatInt(request.ContentLength, 10)) - request.Header.Set("Content-Type", "application/json") + request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10)) + request.Header.Set(requestHeaderContentType, "application/json") request.Body = ioutil.NopCloser(bodyBytes) request.GetBody = func() (io.ReadCloser, error) { return ioutil.NopCloser(bodyBytes), nil @@ -249,7 +280,7 @@ } func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { - Debugln("Marshaling to query from field:", field.Name) + Debugln("Marshaling to query from field: ", field.Name) if request.URL == nil { request.URL = &url.URL{} } @@ -274,22 +305,23 @@ } encoding := strings.ToLower(field.Tag.Get("collectionFormat")) + var collectionFormatStringValues []string switch encoding { - case "csv": + case "csv", "multi": if value.Kind() != reflect.Slice && value.Kind() != reflect.Array { - e = fmt.Errorf("query paramater is tagged as csv yet its type is neither an Array nor a Slice: %s", field.Name) + e = fmt.Errorf("query parameter is tagged as csv or multi yet its type is neither an Array nor a Slice: %s", field.Name) break } numOfElements := value.Len() - stringValues := make([]string, numOfElements) + collectionFormatStringValues = make([]string, numOfElements) for i := 0; i < numOfElements; i++ { - stringValues[i], e = toStringValue(value.Index(i), field) + collectionFormatStringValues[i], e = toStringValue(value.Index(i), field) if e != nil { break } } - queryParameterValue = strings.Join(stringValues, ",") + queryParameterValue = strings.Join(collectionFormatStringValues, ",") case "": queryParameterValue, e = toStringValue(value, field) default: @@ -305,18 +337,28 @@ if omitEmpty, present := field.Tag.Lookup("omitEmpty"); present { omitEmptyBool, _ := strconv.ParseBool(strings.ToLower(omitEmpty)) if queryParameterValue != "" || !omitEmptyBool { - query.Set(queryParameterName, queryParameterValue) + addToQueryForEncoding(&query, encoding, queryParameterName, queryParameterValue, collectionFormatStringValues) } else { Debugf("Omitting %s, is empty and omitEmpty tag is set", field.Name) } } else { - query.Set(queryParameterName, queryParameterValue) + addToQueryForEncoding(&query, encoding, queryParameterName, queryParameterValue, collectionFormatStringValues) } request.URL.RawQuery = query.Encode() return } +func addToQueryForEncoding(query *url.Values, encoding string, queryParameterName string, queryParameterValue string, collectionFormatStringValues []string) { + if encoding == "multi" { + for _, stringValue := range collectionFormatStringValues { + query.Add(queryParameterName, stringValue) + } + } else { + query.Set(queryParameterName, queryParameterValue) + } +} + // Adds to the path of the url in the order they appear in the structure func addToPath(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { var additionalURLPathPart string @@ -339,8 +381,7 @@ if !templatedPathRegex.MatchString(currentURLPath) { Debugln("Marshaling request to path by appending field:", field.Name) allPath := []string{currentURLPath, additionalURLPathPart} - newPath := strings.Join(allPath, "/") - request.URL.Path = path.Clean(newPath) + request.URL.Path = strings.Join(allPath, "/") } else { var fieldName string if fieldName = field.Tag.Get("name"); fieldName == "" { @@ -348,8 +389,8 @@ return } urlTemplate := currentURLPath - Debugln("Marshaling to path from field:", field.Name, "in template:", urlTemplate) - request.URL.Path = path.Clean(strings.Replace(urlTemplate, "{"+fieldName+"}", additionalURLPathPart, -1)) + Debugln("Marshaling to path from field: ", field.Name, " in template: ", urlTemplate) + request.URL.Path = strings.Replace(urlTemplate, "{"+fieldName+"}", additionalURLPathPart, -1) } return } @@ -368,7 +409,7 @@ } func addToHeader(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { - Debugln("Marshaling to header from field:", field.Name) + Debugln("Marshaling to header from field: ", field.Name) if request.Header == nil { request.Header = http.Header{} } @@ -384,6 +425,9 @@ return fmt.Errorf("marshaling request to a header requires not nil pointer for field: %s", field.Name) } + // generate opc-request-id if header value is nil and header name matches + value = generateOpcRequestID(headerName, value) + //if not mandatory and nil. Omit if !mandatory && isNil(value) { Debugf("Header value is not mandatory and is nil pointer in field: %s. Skipping header", field.Name) @@ -399,7 +443,7 @@ return } - request.Header.Set(headerName, headerValue) + request.Header.Add(headerName, headerValue) return } @@ -492,15 +536,15 @@ case "body": err = addToBody(request, sv, sf) case "": - Debugln(sf.Name, "does not contain contributes tag. Skipping.") + Debugln(sf.Name, " does not contain contributes tag. Skipping.") default: err = fmt.Errorf("can not marshal field: %s. It needs to contain valid contributesTo tag", sf.Name) } } //If headers are and the content type was not set, we default to application/json - if request.Header != nil && request.Header.Get("Content-Type") == "" { - request.Header.Set("Content-Type", "application/json") + if request.Header != nil && request.Header.Get(requestHeaderContentType) == "" { + request.Header.Set(requestHeaderContentType, "application/json") } return @@ -524,7 +568,7 @@ return } - Debugln("Marshaling to Request:", val.Type().Name()) + Debugln("Marshaling to Request: ", val.Type().Name()) err = structToRequestPart(httpRequest, *val) return } @@ -539,10 +583,10 @@ URL: &url.URL{}, } - httpRequest.Header.Set("Content-Length", "0") - httpRequest.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) - httpRequest.Header.Set("Opc-Client-Info", strings.Join([]string{defaultSDKMarker, Version()}, "/")) - httpRequest.Header.Set("Accept", "*/*") + httpRequest.Header.Set(requestHeaderContentLength, "0") + httpRequest.Header.Set(requestHeaderDate, time.Now().UTC().Format(http.TimeFormat)) + httpRequest.Header.Set(requestHeaderOpcClientInfo, strings.Join([]string{defaultSDKMarker, Version()}, "/")) + httpRequest.Header.Set(requestHeaderAccept, "*/*") httpRequest.Method = method httpRequest.URL.Path = path return @@ -597,7 +641,7 @@ case reflect.Int, reflect.Uint: return strconv.IntSize default: - Debugln("The type is not valid: %v. Returing int size for arch", kind.String()) + Debugf("The type is not valid: %v. Returing int size for arch\n", kind.String()) return strconv.IntSize } @@ -615,6 +659,16 @@ val = reflect.ValueOf(sdkTime) valPointer = reflect.ValueOf(&sdkTime) return + case sdkDateType.Kind(): + var t time.Time + t, err = tryParsingTimeWithValidFormatsForHeaders([]byte(stringValue), field.Name) + if err != nil { + return + } + sdkDate := sdkDateFromTime(t) + val = reflect.ValueOf(sdkDate) + valPointer = reflect.ValueOf(&sdkDate) + return case reflect.Bool: var bVal bool if bVal, err = strconv.ParseBool(stringValue); err != nil { @@ -743,7 +797,7 @@ } func addFromBody(response *http.Response, value *reflect.Value, field reflect.StructField, unmarshaler PolymorphicJSONUnmarshaler) (err error) { - Debugln("Unmarshaling from body to field:", field.Name) + Debugln("Unmarshaling from body to field: ", field.Name) if response.Body == nil { Debugln("Unmarshaling body skipped due to nil body content for field: ", field.Name) return nil @@ -781,7 +835,7 @@ } func addFromHeader(response *http.Response, value *reflect.Value, field reflect.StructField) (err error) { - Debugln("Unmarshaling from header to field:", field.Name) + Debugln("Unmarshaling from header to field: ", field.Name) var headerName string if headerName = field.Tag.Get("name"); headerName == "" { return fmt.Errorf("unmarshaling response to a header requires the 'name' tag for field: %s", field.Name) @@ -846,7 +900,7 @@ case "body": err = addFromBody(response, &sv, sf, unmarshaler) case "": - Debugln(sf.Name, "does not contain presentIn tag. Skipping") + Debugln(sf.Name, " does not contain presentIn tag. Skipping") default: err = fmt.Errorf("can not unmarshal field: %s. It needs to contain valid presentIn tag", sf.Name) } @@ -889,3 +943,24 @@ return nil } + +// generate request id if user not provided and for each retry operation re-gen a new request id +func generateOpcRequestID(headerName string, value reflect.Value) (newValue reflect.Value) { + newValue = value + isNilValue := isNil(newValue) + isOpcRequestIDHeader := headerName == requestHeaderOpcRequestID || headerName == requestHeaderOpcClientRequestID + + if isNilValue && isOpcRequestIDHeader { + requestID, err := generateRandUUID() + + if err != nil { + // this will not fail the request, just skip add opc-request-id + Debugf("unable to generate opc-request-id. %s", err.Error()) + } else { + newValue = reflect.ValueOf(String(requestID)) + Debugf("add request id for header: %s, with value: %s", headerName, requestID) + } + } + + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer.go 2019-06-28 17:13:01.000000000 +0000 @@ -46,15 +46,50 @@ defaultGenericHeaders = []string{"date", "(request-target)", "host"} defaultBodyHeaders = []string{"content-length", "content-type", "x-content-sha256"} defaultBodyHashPredicate = func(r *http.Request) bool { - return r.Method == http.MethodPost || r.Method == http.MethodPut + return r.Method == http.MethodPost || r.Method == http.MethodPut || r.Method == http.MethodPatch } ) +// DefaultGenericHeaders list of default generic headers that is used in signing +func DefaultGenericHeaders() []string { + return makeACopy(defaultGenericHeaders) +} + +// DefaultBodyHeaders list of default body headers that is used in signing +func DefaultBodyHeaders() []string { + return makeACopy(defaultBodyHeaders) +} + // DefaultRequestSigner creates a signer with default parameters. func DefaultRequestSigner(provider KeyProvider) HTTPRequestSigner { return RequestSigner(provider, defaultGenericHeaders, defaultBodyHeaders) } +// RequestSignerExcludeBody creates a signer without hash the body. +func RequestSignerExcludeBody(provider KeyProvider) HTTPRequestSigner { + bodyHashPredicate := func(r *http.Request) bool { + // week request signer will not hash the body + return false + } + return RequestSignerWithBodyHashingPredicate(provider, defaultGenericHeaders, defaultBodyHeaders, bodyHashPredicate) +} + +// NewSignerFromOCIRequestSigner creates a copy of the request signer and attaches the new SignerBodyHashPredicate +// returns an error if the passed signer is not of type ociRequestSigner +func NewSignerFromOCIRequestSigner(oldSigner HTTPRequestSigner, predicate SignerBodyHashPredicate) (HTTPRequestSigner, error) { + if oldS, ok := oldSigner.(ociRequestSigner); ok { + s := ociRequestSigner{ + KeyProvider: oldS.KeyProvider, + GenericHeaders: oldS.GenericHeaders, + BodyHeaders: oldS.BodyHeaders, + ShouldHashBody: predicate, + } + return s, nil + + } + return nil, fmt.Errorf("can not create a signer, input signer needs to be of type ociRequestSigner") +} + // RequestSigner creates a signer that utilizes the specified headers for signing // and the default predicate for using the body of the request as part of the signature func RequestSigner(provider KeyProvider, genericHeaders, bodyHeaders []string) HTTPRequestSigner { @@ -91,6 +126,7 @@ signingParts := make([]string, len(signingHeaders)) for i, part := range signingHeaders { var value string + part = strings.ToLower(part) switch part { case "(request-target)": value = getRequestTarget(request) @@ -117,15 +153,11 @@ func calculateHashOfBody(request *http.Request) (err error) { var hash string - if request.ContentLength > 0 { - hash, err = GetBodyHash(request) - if err != nil { - return - } - } else { - hash = hashAndEncode([]byte("")) + hash, err = GetBodyHash(request) + if err != nil { + return } - request.Header.Set("X-Content-Sha256", hash) + request.Header.Set(requestHeaderXContentSHA256, hash) return } @@ -158,7 +190,9 @@ // GetBodyHash creates a base64 string from the hash of body the request func GetBodyHash(request *http.Request) (hashString string, err error) { if request.Body == nil { - return "", fmt.Errorf("can not read body of request while calculating body hash, nil body?") + request.ContentLength = 0 + request.Header.Set(requestHeaderContentLength, fmt.Sprintf("%v", request.ContentLength)) + return hashAndEncode([]byte("")), nil } var data []byte @@ -172,6 +206,11 @@ if err != nil { return "", fmt.Errorf("can not read body of request while calculating body hash: %s", err.Error()) } + + // Since the request can be coming from a binary body. Make an attempt to set the body length + request.ContentLength = int64(len(data)) + request.Header.Set(requestHeaderContentLength, fmt.Sprintf("%v", request.ContentLength)) + hashString = hashAndEncode(data) return } @@ -224,7 +263,7 @@ authValue := fmt.Sprintf("Signature version=\"%s\",headers=\"%s\",keyId=\"%s\",algorithm=\"rsa-sha256\",signature=\"%s\"", signerVersion, signingHeaders, keyID, signature) - request.Header.Set("Authorization", authValue) + request.Header.Set(requestHeaderAuthorization, authValue) return } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_signer_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -5,6 +5,7 @@ import ( "bytes" "crypto/rsa" + "fmt" "io/ioutil" "net/http" "net/url" @@ -91,7 +92,7 @@ r, err := http.NewRequest("GET", "http://localhost:7000/api", nil) assert.NoError(t, err) - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") err = s.Sign(r) assert.NoError(t, err) @@ -115,7 +116,29 @@ Header: make(http.Header), URL: url, } - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + r.Method = http.MethodGet + signature := s.getSigningString(&r) + + assert.Equal(t, expectedSigningString, signature) +} + +func TestOCIRequestSigner_SigningString_Uppercase(t *testing.T) { + s := ociRequestSigner{ + KeyProvider: testKeyProvider{}, + GenericHeaders: []string{"Date", "(Request-target)", "host"}, + ShouldHashBody: defaultBodyHashPredicate, + BodyHeaders: defaultBodyHeaders} + + url, _ := url.Parse(testURL) + r := http.Request{ + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: make(http.Header), + URL: url, + } + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") r.Method = http.MethodGet signature := s.getSigningString(&r) @@ -136,7 +159,7 @@ Header: make(http.Header), URL: url, } - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") r.Method = http.MethodGet signature, err := s.computeSignature(&r) @@ -158,7 +181,7 @@ Header: make(http.Header), URL: url, } - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") r.Method = http.MethodGet err := s.Sign(&r) @@ -169,7 +192,7 @@ 8fmTZVwKZOKHYPtrLJIJQHJjNvxFWeHQjMaR7M="`, "\n", "", -1) assert.NoError(t, err) - assert.Equal(t, expectedAuthHeader, r.Header.Get("Authorization")) + assert.Equal(t, expectedAuthHeader, r.Header.Get(requestHeaderAuthorization)) } @@ -190,9 +213,9 @@ bodyBuffer := bytes.NewBufferString(testBody) r.Body = ioutil.NopCloser(bodyBuffer) r.ContentLength = int64(bodyBuffer.Len()) - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Content-Length", strconv.FormatInt(r.ContentLength, 10)) + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderContentType, "application/json") + r.Header.Set(requestHeaderContentLength, strconv.FormatInt(r.ContentLength, 10)) r.Method = http.MethodPost calculateHashOfBody(&r) signingString := s.getSigningString(&r) @@ -218,9 +241,9 @@ bodyBuffer := bytes.NewBufferString(testBody) r.Body = ioutil.NopCloser(bodyBuffer) r.ContentLength = int64(bodyBuffer.Len()) - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Content-Length", strconv.FormatInt(r.ContentLength, 10)) + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderContentType, "application/json") + r.Header.Set(requestHeaderContentLength, strconv.FormatInt(r.ContentLength, 10)) r.Method = http.MethodPost calculateHashOfBody(&r) signature, err := s.computeSignature(&r) @@ -247,16 +270,16 @@ bodyBuffer := bytes.NewBufferString(testBody) r.Body = ioutil.NopCloser(bodyBuffer) r.ContentLength = int64(bodyBuffer.Len()) - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Content-Length", strconv.FormatInt(r.ContentLength, 10)) + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderContentType, "application/json") + r.Header.Set(requestHeaderContentLength, strconv.FormatInt(r.ContentLength, 10)) r.Method = http.MethodPost err := s.Sign(&r) expectedAuthHeader := `Signature version="1",headers="date (request-target) host content-length content-type x-content-sha256",keyId="ocid1.tenancy.oc1..aaaaaaaaba3pv6wkcr4jqae5f15p2b2m2yt2j6rx32uzr4h25vqstifsfdsq/ocid1.user.oc1..aaaaaaaat5nvwcna5j6aqzjcaty5eqbb6qt2jvpkanghtgdaqedqw3rynjq/20:3b:97:13:55:1c:5b:0d:d3:37:d8:50:4e:c5:3a:34",algorithm="rsa-sha256",signature="Mje8vIDPlwIHmD/cTDwRxE7HaAvBg16JnVcsuqaNRim23fFPgQfLoOOxae6WqKb1uPjYEl0qIdazWaBy/Ml8DRhqlocMwoSXv0fbukP8J5N80LCmzT/FFBvIvTB91XuXI3hYfP9Zt1l7S6ieVadHUfqBedWH0itrtPJBgKmrWso="` assert.NoError(t, err) assert.Equal(t, r.ContentLength, int64(316)) - assert.Equal(t, expectedAuthHeader, r.Header.Get("Authorization")) + assert.Equal(t, expectedAuthHeader, r.Header.Get(requestHeaderAuthorization)) } func TestOCIRequestSigner_SignEmptyBody(t *testing.T) { @@ -274,14 +297,119 @@ bodyBuffer := bytes.NewBufferString("") r.Body = ioutil.NopCloser(bodyBuffer) r.ContentLength = int64(bodyBuffer.Len()) - r.Header.Set("Date", "Thu, 05 Jan 2014 21:31:40 GMT") - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Content-Length", strconv.FormatInt(r.ContentLength, 10)) + r.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + r.Header.Set(requestHeaderContentType, "application/json") + r.Header.Set(requestHeaderContentLength, strconv.FormatInt(r.ContentLength, 10)) r.Method = http.MethodPost err := s.Sign(&r) assert.NoError(t, err) assert.Equal(t, r.ContentLength, int64(0)) - assert.NotEmpty(t, r.Header.Get("Authorization")) - assert.NotEmpty(t, r.Header.Get("x-content-sha256")) + assert.NotEmpty(t, r.Header.Get(requestHeaderAuthorization)) + assert.NotEmpty(t, r.Header.Get(requestHeaderXContentSHA256)) +} + +func TestOCIRequestSigner_SignBinaryBody(t *testing.T) { + s := ociRequestSigner{KeyProvider: testKeyProvider{}, + ShouldHashBody: defaultBodyHashPredicate, + GenericHeaders: defaultGenericHeaders, + BodyHeaders: defaultBodyHeaders, + } + u, _ := url.Parse(testURL2) + + testIO := []struct { + request http.Request + bodyOfRequest *bytes.Buffer + expectSignature bool + }{ + { + request: http.Request{ + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: make(http.Header), + URL: u, + Method: http.MethodPost, + }, + bodyOfRequest: bytes.NewBufferString(testBody), + expectSignature: true, + }, + { + request: http.Request{ + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: make(http.Header), + URL: u, + Method: http.MethodPost, + }, + bodyOfRequest: bytes.NewBufferString(""), + expectSignature: true, + }, + { + request: http.Request{ + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: make(http.Header), + URL: u, + Method: http.MethodPost, + }, + bodyOfRequest: nil, + expectSignature: true, + }, + } + + for i, testC := range testIO { + t.Run(fmt.Sprintf("%v", i), func(t *testing.T) { + lenOfBody := 0 + if testC.bodyOfRequest != nil { + lenOfBody = testC.bodyOfRequest.Len() + testC.request.Body = ioutil.NopCloser(testC.bodyOfRequest) + } else { + testC.request.Body = nil + } + testC.request.Header.Set(requestHeaderDate, "Thu, 05 Jan 2014 21:31:40 GMT") + testC.request.Header.Set(requestHeaderContentType, "application/json") + + err := s.Sign(&testC.request) + assert.NoError(t, err) + + bl, err := strconv.Atoi(testC.request.Header.Get(requestHeaderContentLength)) + assert.NoError(t, err) + + if testC.request.Body != nil { + assert.Equal(t, lenOfBody, int(testC.request.ContentLength)) + assert.Equal(t, lenOfBody, bl) + + } else { + assert.Equal(t, 0, int(testC.request.ContentLength)) + assert.Equal(t, 0, bl) + } + + if testC.expectSignature { + assert.NotEmpty(t, testC.request.Header.Get(requestHeaderAuthorization)) + assert.NotEmpty(t, testC.request.Header.Get(requestHeaderXContentSHA256)) + assert.Contains(t, testC.request.Header.Get(requestHeaderAuthorization), "content-length") + if lenOfBody != 0 { + expectedAuthHeader := `Signature version="1",headers="date (request-target) host content-length content-type x-content-sha256",keyId="ocid1.tenancy.oc1..aaaaaaaaba3pv6wkcr4jqae5f15p2b2m2yt2j6rx32uzr4h25vqstifsfdsq/ocid1.user.oc1..aaaaaaaat5nvwcna5j6aqzjcaty5eqbb6qt2jvpkanghtgdaqedqw3rynjq/20:3b:97:13:55:1c:5b:0d:d3:37:d8:50:4e:c5:3a:34",algorithm="rsa-sha256",signature="Mje8vIDPlwIHmD/cTDwRxE7HaAvBg16JnVcsuqaNRim23fFPgQfLoOOxae6WqKb1uPjYEl0qIdazWaBy/Ml8DRhqlocMwoSXv0fbukP8J5N80LCmzT/FFBvIvTB91XuXI3hYfP9Zt1l7S6ieVadHUfqBedWH0itrtPJBgKmrWso="` + assert.Equal(t, expectedAuthHeader, testC.request.Header.Get(requestHeaderAuthorization)) + } + } + }) + } +} + +func TestDefaultHeadersReturnsCopy(t *testing.T) { + genericHeaders := DefaultGenericHeaders() + bodyHeaders := DefaultBodyHeaders() + + assert.Equal(t, defaultGenericHeaders, genericHeaders) + assert.Equal(t, defaultBodyHeaders, bodyHeaders) + + genericHeaders[0] = "mutate" + bodyHeaders[0] = "mutate" + + assert.NotEqual(t, defaultGenericHeaders, genericHeaders) + assert.NotEqual(t, defaultBodyHeaders, bodyHeaders) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/http_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -17,6 +17,7 @@ "time" "github.com/stretchr/testify/assert" + "math" ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -38,6 +39,8 @@ UserID string `mandatory:"true" contributesTo:"path" name:"userId"` TestupdateUserDetails `contributesTo:"body"` IfMatch string `mandatory:"false" contributesTo:"header" name:"if-match"` + HeaderValueOne string `mandatory:"false" contributesTo:"header" name:"listInHeader"` + HeaderValueTwo string `mandatory:"false" contributesTo:"header" name:"listInHeader"` } type TestcreateAPIKeyDetails struct { @@ -61,6 +64,19 @@ OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` } +type EmbeddedByteSlice struct { + Key *[]byte `mandatory:"false" json:"key"` + Value []byte `mandatory:"true" json:"value"` +} + +type KVList struct { + KVs []EmbeddedByteSlice `mandatory:"true" json:"kvs"` +} + +type KVRequest struct { + KVList `contributesTo:"body"` +} + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// func TestHttpMarshallerInvalidStruct(t *testing.T) { @@ -83,16 +99,26 @@ func TestMakeDefault(t *testing.T) { r := MakeDefaultHTTPRequest(http.MethodPost, "/one/two") - assert.NotEmpty(t, r.Header.Get("Date")) - assert.NotEmpty(t, r.Header.Get("Opc-Client-Info")) + assert.NotEmpty(t, r.Header.Get(requestHeaderDate)) + assert.NotEmpty(t, r.Header.Get(requestHeaderOpcClientInfo)) } func TestHttpMarshallerSimpleHeader(t *testing.T) { - s := updateUserRequest{UserID: "id1", IfMatch: "n=as", TestupdateUserDetails: TestupdateUserDetails{Description: "name of"}} + s := updateUserRequest{ + UserID: "id1", + IfMatch: "n=as", + TestupdateUserDetails: TestupdateUserDetails{Description: "name of"}, + HeaderValueOne: "1", + HeaderValueTwo: "2", + } request := MakeDefaultHTTPRequest(http.MethodPost, "/random") HTTPRequestMarshaller(s, &request) header := request.Header - assert.True(t, header.Get("if-match") == "n=as") + assert.True(t, header.Get(requestHeaderIfMatch) == "n=as") + listInHeader := header["Listinheader"] + assert.True(t, len(listInHeader) == 2) + hone, htwo := listInHeader[0], listInHeader[1] + assert.True(t, hone == "1" && htwo == "2") } func TestHttpMarshallerSimpleStruct(t *testing.T) { @@ -176,15 +202,16 @@ includes := []inc{inc("One"), inc("Two")} s := struct { - ID string `contributesTo:"path"` - Name string `contributesTo:"query" name:"name"` - When *SDKTime `contributesTo:"query" name:"when"` - Income float32 `contributesTo:"query" name:"income"` - Include []inc `contributesTo:"query" name:"includes" collectionFormat:"csv"` - Male bool `contributesTo:"header" name:"male"` - Details TestupdateUserDetails `contributesTo:"body"` + ID string `contributesTo:"path"` + Name string `contributesTo:"query" name:"name"` + When *SDKTime `contributesTo:"query" name:"when"` + Income float32 `contributesTo:"query" name:"income"` + Include []inc `contributesTo:"query" name:"includes" collectionFormat:"csv"` + IncludeMulti []inc `contributesTo:"query" name:"includesMulti" collectionFormat:"multi"` + Male bool `contributesTo:"header" name:"male"` + Details TestupdateUserDetails `contributesTo:"body"` }{ - "101", "tapir", now(), 3.23, includes, true, TestupdateUserDetails{Description: desc}, + "101", "tapir", now(), 3.23, includes, includes, true, TestupdateUserDetails{Description: desc}, } request := MakeDefaultHTTPRequest(http.MethodPost, "/") e := HTTPRequestMarshaller(s, &request) @@ -192,14 +219,15 @@ var content map[string]string body, _ := ioutil.ReadAll(request.Body) json.Unmarshal(body, &content) - when := s.When.Format(time.RFC3339) - assert.True(t, request.URL.Path == "/101") + when := s.When.Format(time.RFC3339Nano) + assert.True(t, request.URL.Path == "//101") assert.True(t, request.URL.Query().Get("name") == s.Name) assert.True(t, request.URL.Query().Get("income") == strconv.FormatFloat(float64(s.Income), 'f', 6, 32)) assert.True(t, request.URL.Query().Get("when") == when) assert.True(t, request.URL.Query().Get("includes") == "One,Two") + assert.True(t, reflect.DeepEqual(request.URL.Query()["includesMulti"], []string{"One", "Two"})) assert.Contains(t, content, "description") - assert.Equal(t, request.Header.Get("Content-Type"), "application/json") + assert.Equal(t, request.Header.Get(requestHeaderContentType), "application/json") if val, ok := content["description"]; !ok || val != desc { assert.Fail(t, "Should contain: "+desc) } @@ -261,10 +289,10 @@ HTTPRequestMarshaller(s, &request) all, _ := ioutil.ReadAll(request.Body) assert.True(t, len(all) > 2) - assert.Equal(t, "", request.Header.Get("opc-retry-token")) + assert.Equal(t, "", request.Header.Get(requestHeaderOpcRetryToken)) assert.True(t, strings.Contains(request.URL.Path, "111")) assert.True(t, strings.Contains(string(all), "thekey")) - assert.Contains(t, string(all), now.Format(time.RFC3339)) + assert.Contains(t, string(all), now.Format(time.RFC3339Nano)) } func TestHttpMarshallerSimpleStructPointersFilled(t *testing.T) { @@ -274,7 +302,7 @@ TestcreateAPIKeyDetailsPtr: TestcreateAPIKeyDetailsPtr{Key: String("thekey")}} request := MakeDefaultHTTPRequest(http.MethodPost, "/random") HTTPRequestMarshaller(s, &request) - assert.Equal(t, "token", request.Header.Get("opc-retry-token")) + assert.Equal(t, "token", request.Header.Get(requestHeaderOpcRetryToken)) assert.True(t, strings.Contains(request.URL.Path, "111")) } @@ -357,6 +385,22 @@ } } +func TestHttpMarshallerEmbeddedBytes(t *testing.T) { + s := KVRequest{ + KVList{ + KVs: []EmbeddedByteSlice{ + {Value: []byte{1, 2, 3, 4}}, + {Key: &[]byte{6, 7, 8, 9}, Value: []byte{1, 2, 3, 4}}, + {Value: []byte{}}, + }, + }} + request := MakeDefaultHTTPRequest(http.MethodPost, "/random") + HTTPRequestMarshaller(s, &request) + b, _ := ioutil.ReadAll(request.Body) + st := string(b) + assert.Equal(t, `{"kvs":[{"value":"AQIDBA=="},{"key":"BgcICQ==","value":"AQIDBA=="},{"value":""}]}`, st) +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Response Unmarshaling @@ -608,6 +652,32 @@ assert.Equal(t, data, string(all)) } +func TestMarshalBinaryRequestIsSigned(t *testing.T) { + signer := ociRequestSigner{KeyProvider: testKeyProvider{}, + ShouldHashBody: defaultBodyHashPredicate, + GenericHeaders: defaultGenericHeaders, + BodyHeaders: defaultBodyHeaders, + } + data := "some data in a file" + buffer := bytes.NewBufferString(data) + r := reqWithBinaryFiled{Content: ioutil.NopCloser(buffer)} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("POST", "/obj", r) + assert.NoError(t, err) + err = signer.Sign(&httpRequest) + assert.NoError(t, err) + all, err := ioutil.ReadAll(httpRequest.Body) + assert.NoError(t, err) + assert.Equal(t, data, string(all)) + + assert.Equal(t, fmt.Sprintf("%v", len(data)), httpRequest.Header.Get(requestHeaderContentLength)) + assert.NotEmpty(t, httpRequest.Header.Get(requestHeaderAuthorization)) + assert.NotEmpty(t, httpRequest.Header.Get(requestHeaderXContentSHA256)) + assert.Equal(t, "application/octet-stream", httpRequest.Header.Get(requestHeaderContentType)) + assert.Contains(t, httpRequest.Header.Get(requestHeaderAuthorization), "content-length") + assert.Contains(t, httpRequest.Header.Get(requestHeaderAuthorization), "x-content-sha256") + assert.Contains(t, httpRequest.Header.Get(requestHeaderAuthorization), "content-type") +} + type structWithBinaryField struct { Content io.Reader `presentIn:"body" encoding:"binary"` } @@ -816,17 +886,15 @@ AString *string `mandatory:"false" json:"a"` ANilString *string `mandatory:"false" json:"anil"` EmptyNumbers []int `mandatory:"false" json:"aempty"` + NilNumbers []int `mandatory:"false" json:"nilnumbers"` + Numbers []int `mandatory:"true" json:"numbers"` } type Nested struct { - //N *string `mandatory:"false" json:"n"` - //Numbers []int `mandatory:"false" json:"numbers"` ZComplex []InSstruct `mandatory:"false" json:"complex"` } val := "" - //numbers := []int{1, 3} - //s := Nested{N:&val, Numbers: numbers, ZComplex:InSstruct{AString:&val, EmptyNumbers:[]int{}}} - s := Nested{ZComplex: []InSstruct{{AString: &val, EmptyNumbers: []int{}}}} + s := Nested{ZComplex: []InSstruct{{AString: &val, EmptyNumbers: []int{}, NilNumbers: nil, Numbers: []int{1, 2}}}} sVal := reflect.ValueOf(s) jsonIn, _ := json.Marshal(s) m := make(map[string]interface{}) @@ -836,7 +904,28 @@ jsonRet, err := json.Marshal(mapRet) assert.NotContains(t, "nilnumbers", mapRet) assert.NoError(t, err) - assert.Equal(t, `{"complex":[{"a":"","aempty":[]}]}`, string(jsonRet)) + assert.Equal(t, `{"complex":[{"a":"","aempty":[],"numbers":[1,2]}]}`, string(jsonRet)) +} + +func TestOmitFieldsInJson_SimpleStructWithMandatorySliceAndError(t *testing.T) { + + type Nested struct { + Numbers []int `mandatory:"true" json:"numbers"` + Letters []string `mandatory:"false" json:"letters"` + } + + type Outer struct { + Nested Nested `mandatory:"false" json:"aempty"` + } + + s := Outer{Nested: Nested{Numbers: nil}} + sVal := reflect.ValueOf(s) + jsonIn, _ := json.Marshal(s) + + m := make(map[string]interface{}) + json.Unmarshal(jsonIn, &m) + _, err := omitNilFieldsInJSON(m, sVal) + assert.Error(t, err) } func TestOmitEmptyEnumInJson_SimpleStructWithEnum(t *testing.T) { @@ -914,14 +1003,18 @@ } func TestOmitFieldsInJson_removeFields(t *testing.T) { + type MyEnum string type InSstruct struct { AString *string `mandatory:"false" json:"a"` ANilString *string `mandatory:"false" json:"anil"` + ASecondEnum MyEnum `mandatory:"false" json:"secenum,omitempty"` + ThirdEnum MyEnum `mandatory:"false" json:"tnum,omitempty"` EmptyNumbers []int `mandatory:"false" json:"aempty"` } type Nested struct { - N *string `mandatory:"false" json:"n"` - //Numbers []int `mandatory:"false" json:"numbers"` + N *string `mandatory:"false" json:"n"` + AnEnum MyEnum `mandatory:"false" json:"anenum,omitempty"` + AnEnum2 MyEnum `mandatory:"false" json:"anenum2,omitempty"` ZComplex map[string]InSstruct `mandatory:"false" json:"complex"` } val := "" @@ -929,16 +1022,16 @@ //numbers := []int{1, 3} //s := Nested{N:&val, Numbers: numbers, ZComplex:InSstruct{AString:&val, EmptyNumbers:[]int{}}} data := make(map[string]InSstruct) - data["one"] = InSstruct{AString: &val, EmptyNumbers: []int{}} + data["one"] = InSstruct{AString: &val, EmptyNumbers: []int{}, ThirdEnum: MyEnum("enum")} data["two"] = InSstruct{AString: &val2, EmptyNumbers: []int{1}} data["ten"] = InSstruct{AString: &val2} - s := Nested{ZComplex: data} + s := Nested{ZComplex: data, AnEnum2: MyEnum("hello")} jsonIn, _ := json.Marshal(s) sVal := reflect.ValueOf(s) jsonRet, err := removeNilFieldsInJSONWithTaggedStruct(jsonIn, sVal) assert.NoError(t, err) - assert.Equal(t, `{"complex":{"one":{"a":"","aempty":[]},"ten":{"a":"two"},"two":{"a":"two","aempty":[1]}}}`, string(jsonRet)) + assert.Equal(t, `{"anenum2":"hello","complex":{"one":{"a":"","aempty":[],"tnum":"enum"},"ten":{"a":"two"},"two":{"a":"two","aempty":[1]}}}`, string(jsonRet)) } func TestOmitFieldsInJson_SimpleStructWithTime(t *testing.T) { @@ -962,3 +1055,343 @@ assert.Contains(t, mapRet, "theTime") assert.Equal(t, theTime, mapRet.(map[string]interface{})["theTime"]) } + +func TestToStringValue_TimeFormat(t *testing.T) { + testingData := []struct { + TheTime *SDKTime `mandatory:"true" json:"theTime"` + Input string + Expected string + }{ + { + Input: "2018-10-15T19:43:05.080Z", + Expected: "2018-10-15T19:43:05.08Z", + }, + { + Input: "2018-10-15T19:43:05Z", + Expected: "2018-10-15T19:43:05Z", + }, + } + + for _, item := range testingData { + time, err := time.Parse(time.RFC3339, item.Input) + assert.NoError(t, err) + item.TheTime = &SDKTime{time} + + reflectValue := reflect.ValueOf(item) + reflectType := reflectValue.Type() + + str, err := toStringValue(reflectValue.Field(0), reflectType.Field(0)) + assert.NoError(t, err) + + assert.Equal(t, item.Expected, str) + } +} + +func TestSDKDate_Unmarshal(t *testing.T) { + type structWithTime struct { + Name string `json:"name"` + Date *SDKDate `json:"date"` + DateOptional *SDKDate `json:"optdate" mandatory:"false"` + } + + type req struct { + Body structWithTime `presentIn:"body"` + } + + sampleDate, _ := time.Parse(time.UnixDate, "Mon Jan 02 15:04:05 MST 2006") + sampleDateStr := sampleDate.Format(sdkDateFormat) + + testIO := []struct { + name string + expectedReq req + jsonRes string + err error + }{ + { + name: "sdk date with simple date", + expectedReq: req{structWithTime{Name: "hello", Date: &SDKDate{Date: sampleDate}}}, + jsonRes: fmt.Sprintf(`{"date":"%s","name":"hello"}`, sampleDateStr), + err: nil, + }, + { + name: "sdk date with nil date", + expectedReq: req{structWithTime{Name: "hello", Date: nil}}, + jsonRes: fmt.Sprintf(`{"date":%s,"name":"hello"}`, "null"), + err: nil, + }, + { + name: "sdk date with nil date with mandatory date field set", + expectedReq: req{structWithTime{Name: "hello", Date: nil, DateOptional: &SDKDate{Date: sampleDate}}}, + jsonRes: fmt.Sprintf(`{"date":%s,"name":"hello","optdate":"%s"}`, "null", sampleDateStr), + err: nil, + }, + } + + for _, tc := range testIO { + response := http.Response{ + Body: ioutil.NopCloser(bytes.NewBuffer([]byte(tc.jsonRes))), + } + req := req{} + err := UnmarshalResponse(&response, &req) + assert.NoError(t, err) + assert.Equal(t, tc.expectedReq.Body.Name, req.Body.Name) + if tc.expectedReq.Body.Date == nil { + assert.Nil(t, req.Body.Date) + + } else { + assert.Equal(t, tc.expectedReq.Body.Date.Date.Format(sdkDateFormat), req.Body.Date.Date.Format(sdkDateFormat)) + } + if tc.expectedReq.Body.DateOptional == nil { + assert.Nil(t, req.Body.DateOptional) + + } else { + assert.Equal(t, tc.expectedReq.Body.DateOptional.Date.Format(sdkDateFormat), req.Body.DateOptional.Date.Format(sdkDateFormat)) + } + } + +} +func TestSDKDate_Marshal(t *testing.T) { + type structWithTime struct { + Name string `json:"name"` + Date *SDKDate `json:"date"` + DateOptional *SDKDate `json:"optdate" mandatory:"false"` + } + + type req struct { + Body structWithTime `contributesTo:"body"` + } + + sampleDate, _ := time.Parse(time.UnixDate, "Mon Jan 02 15:04:05 MST 2006") + sampleDateStr := sampleDate.Format(sdkDateFormat) + + testIO := []struct { + name string + req req + expectedJSON string + err error + }{ + { + name: "sdk date with simple date", + req: req{structWithTime{Name: "hello", Date: &SDKDate{Date: sampleDate}}}, + expectedJSON: fmt.Sprintf(`{"date":"%s","name":"hello"}`, sampleDateStr), + err: nil, + }, + { + name: "sdk date with nil date", + req: req{structWithTime{Name: "hello", Date: nil}}, + expectedJSON: fmt.Sprintf(`{"date":%s,"name":"hello"}`, "null"), + err: nil, + }, + { + name: "sdk date with nil date with mandatory date field set", + req: req{structWithTime{Name: "hello", Date: nil, DateOptional: &SDKDate{Date: sampleDate}}}, + expectedJSON: fmt.Sprintf(`{"date":%s,"name":"hello","optdate":"%s"}`, "null", sampleDateStr), + err: nil, + }, + } + + for _, tc := range testIO { + httpRequest, errM := MakeDefaultHTTPRequestWithTaggedStruct("GET", "/", tc.req) + assert.NoError(t, errM) + all, _ := ioutil.ReadAll(httpRequest.Body) + assert.Equal(t, tc.expectedJSON, string(all)) + } + +} + +func TestAddRequestID(t *testing.T) { + type testStructType struct { + OpcRequestID *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + } + + inputTestDataSet := []testStructType{ + {}, + {OpcRequestID: String("testid")}, + } + + for _, testData := range inputTestDataSet { + request := MakeDefaultHTTPRequest(http.MethodPost, "/random") + HTTPRequestMarshaller(testData, &request) + assert.NotEmpty(t, request.Header["Opc-Request-Id"]) + assert.Equal(t, 1, len(request.Header["Opc-Request-Id"])) + + if testData.OpcRequestID != nil { + assert.Equal(t, "testid", request.Header["Opc-Request-Id"][0]) + } + } +} + +type shape interface { +} + +type square struct { + Color string `json:"color"` +} + +type triangle struct { + Texture string `json:"texture"` +} + +type unknown struct { + JSONData []byte + Type string `json:"type"` +} + +func (p *unknown) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + switch p.Type { + case "square": + n := square{} + err := json.Unmarshal(data, &n) + return n, err + case "triangle": + n := triangle{} + err := json.Unmarshal(data, &n) + return n, err + default: + return *p, nil + } +} +func (p *unknown) UnmarshalJSON(data []byte) error { + p.JSONData = data + type mm unknown + s := mm{} + err := json.Unmarshal(data, &s) + if err != nil { + return err + } + p.Type = s.Type + return nil +} + +type bodyWithPolymorphicField struct { + Name string `json:"name"` + Shape shape `json:"shape"` +} + +func (p *bodyWithPolymorphicField) UnmarshalJSON(data []byte) error { + model := struct { + Name string `json:"name"` + Shape unknown `json:"shape"` + }{} + + e := json.Unmarshal(data, &model) + if e != nil { + return e + } + + p.Name = model.Name + ss, e := model.Shape.UnmarshalPolymorphicJSON(model.Shape.JSONData) + if e != nil { + return e + } + if ss != nil { + p.Shape = ss.(shape) + } else { + p.Shape = nil + } + return nil +} + +func TestUnmarshalPolymorphic(t *testing.T) { + testIO := []struct { + name string + jsonBody string + expectedName string + expectedShape interface{} + }{ + { + + name: "Nil polymorphic type", + jsonBody: `{"name": "hello", "shape": null }`, + expectedShape: nil, + expectedName: "hello", + }, + { + + name: "polymorphic type set to square", + jsonBody: `{"name": "hello", "shape": {"type": "square", "color": "red" }}`, + expectedShape: square{Color: "red"}, + expectedName: "hello", + }, + { + + name: "polymorphic type set to triangle", + jsonBody: `{"name": "hello", "shape": {"type": "triangle", "texture": "soft" }}`, + expectedShape: triangle{Texture: "soft"}, + expectedName: "hello", + }, + { + + name: "polymorphic type set to unknown", + jsonBody: `{"name": "hello", "shape": {"type": "random", "value": "one" }}`, + expectedShape: unknown{Type: "random", JSONData: []byte(`{"type": "random", "value": "one" }`)}, + expectedName: "hello", + }, + } + for _, td := range testIO { + t.Run(td.name, func(t *testing.T) { + type response struct { + Content bodyWithPolymorphicField `presentIn:"body"` + } + r := http.Response{} + bodyBuffer := bytes.NewBufferString(td.jsonBody) + r.Body = ioutil.NopCloser(bodyBuffer) + + res := response{} + err := UnmarshalResponse(&r, &res) + assert.Equal(t, td.expectedShape, res.Content.Shape) + assert.Equal(t, td.expectedName, res.Content.Name) + assert.NoError(t, err) + }) + } +} + +func TestMarshalStructsNumberLimits(t *testing.T) { + type numberLimits struct { + Integer64 *int64 `json:"integer64" mandatory:"true"` + Float64 *float64 `json:"float64" mandatory:"true"` + } + + type req struct { + Body numberLimits `contributesTo:"body" presentIn:"body"` + } + + s := req{Body: numberLimits{Integer64: Int64(math.MaxInt64), Float64: Float64(math.MaxFloat64)}} + request, err := MakeDefaultHTTPRequestWithTaggedStruct("put", "/", &s) + assert.NoError(t, err) + response := http.Response{Body: request.Body} + + unmarshalledStruct := req{} + UnmarshalResponse(&response, &unmarshalledStruct) + + assert.Equal(t, *s.Body.Integer64, *unmarshalledStruct.Body.Integer64) + assert.Equal(t, *s.Body.Float64, *unmarshalledStruct.Body.Float64) + assert.Equal(t, int64(math.MaxInt64), *unmarshalledStruct.Body.Integer64) + assert.Equal(t, float64(math.MaxFloat64), *unmarshalledStruct.Body.Float64) + +} +func TestRemoveNilWithInt64Values(t *testing.T) { + type withInt64 struct { + Data *int64 `json:"data"` + NoData *int64 `json:"nodata" mandatory:"false"` + } + + s := withInt64{Data: Int64(math.MaxInt64)} + jsonIn, _ := json.Marshal(s) + + sVal := reflect.ValueOf(s) + jsonRet, err := removeNilFieldsInJSONWithTaggedStruct(jsonIn, sVal) + assert.NoError(t, err) + assert.False(t, strings.Contains(string(jsonRet), "nodata")) + + ss := withInt64{} + json.Unmarshal(jsonRet, &ss) + + assert.True(t, strings.Contains(string(jsonRet), "9223372036854775807")) + assert.Equal(t, int64(9223372036854775807), *ss.Data) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/log.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/log.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/log.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/log.go 2019-06-28 17:13:01.000000000 +0000 @@ -4,64 +4,167 @@ import ( "fmt" - "io" "io/ioutil" "log" "os" + "strings" "sync" ) -// Simple logging proxy to distinguish control for logging messages +//sdkLogger an interface for logging in the SDK +type sdkLogger interface { + //LogLevel returns the log level of sdkLogger + LogLevel() int + + //Log logs v with the provided format if the current log level is loglevel + Log(logLevel int, format string, v ...interface{}) error +} + +//noLogging no logging messages +const noLogging = 0 + +//infoLogging minimal logging messages +const infoLogging = 1 + +//debugLogging some logging messages +const debugLogging = 2 + +//verboseLogging all logging messages +const verboseLogging = 3 + +//defaultSDKLogger the default implementation of the sdkLogger +type defaultSDKLogger struct { + currentLoggingLevel int + verboseLogger *log.Logger + debugLogger *log.Logger + infoLogger *log.Logger + nullLogger *log.Logger +} + +//defaultLogger is the defaultLogger in the SDK +var defaultLogger sdkLogger +var loggerLock sync.Mutex + +//initializes the SDK defaultLogger as a defaultLogger +func init() { + l, _ := newSDKLogger() + setSDKLogger(l) +} + +//setSDKLogger sets the logger used by the sdk +func setSDKLogger(logger sdkLogger) { + loggerLock.Lock() + defaultLogger = logger + loggerLock.Unlock() +} + +// newSDKLogger creates a defaultSDKLogger // Debug logging is turned on/off by the presence of the environment variable "OCI_GO_SDK_DEBUG" -var debugLog = log.New(os.Stderr, "DEBUG ", log.Ldate|log.Ltime|log.Lshortfile) -var mainLog = log.New(os.Stderr, "", log.Ldate|log.Ltime|log.Lshortfile) -var isDebugLogEnabled bool -var checkDebug sync.Once - -func getOutputForEnv() (writer io.Writer) { - checkDebug.Do(func() { - isDebugLogEnabled = *new(bool) - _, isDebugLogEnabled = os.LookupEnv("OCI_GO_SDK_DEBUG") - }) - - writer = ioutil.Discard - if isDebugLogEnabled { - writer = os.Stderr +// The value of the "OCI_GO_SDK_DEBUG" environment variable controls the logging level. +// "null" outputs no log messages +// "i" or "info" outputs minimal log messages +// "d" or "debug" outputs some logs messages +// "v" or "verbose" outputs all logs messages, including body of requests +func newSDKLogger() (defaultSDKLogger, error) { + logger := defaultSDKLogger{} + + logger.currentLoggingLevel = noLogging + logger.verboseLogger = log.New(os.Stderr, "VERBOSE ", log.Ldate|log.Lmicroseconds|log.Lshortfile) + logger.debugLogger = log.New(os.Stderr, "DEBUG ", log.Ldate|log.Lmicroseconds|log.Lshortfile) + logger.infoLogger = log.New(os.Stderr, "INFO ", log.Ldate|log.Lmicroseconds|log.Lshortfile) + logger.nullLogger = log.New(ioutil.Discard, "", log.Ldate|log.Lmicroseconds|log.Lshortfile) + + configured, isLogEnabled := os.LookupEnv("OCI_GO_SDK_DEBUG") + + // If env variable not present turn logging of + if !isLogEnabled { + logger.currentLoggingLevel = noLogging + } else { + + switch strings.ToLower(configured) { + case "null": + logger.currentLoggingLevel = noLogging + break + case "i", "info": + logger.currentLoggingLevel = infoLogging + break + case "d", "debug": + logger.currentLoggingLevel = debugLogging + break + //1 here for backwards compatibility + case "v", "verbose", "1": + logger.currentLoggingLevel = verboseLogging + break + default: + logger.currentLoggingLevel = infoLogging + } + logger.infoLogger.Println("logger level set to: ", logger.currentLoggingLevel) + } + + return logger, nil +} + +func (l defaultSDKLogger) getLoggerForLevel(logLevel int) *log.Logger { + if logLevel > l.currentLoggingLevel { + return l.nullLogger + } + + switch logLevel { + case noLogging: + return l.nullLogger + case infoLogging: + return l.infoLogger + case debugLogging: + return l.debugLogger + case verboseLogging: + return l.verboseLogger + default: + return l.nullLogger } - return +} + +//LogLevel returns the current debug level +func (l defaultSDKLogger) LogLevel() int { + return l.currentLoggingLevel +} + +func (l defaultSDKLogger) Log(logLevel int, format string, v ...interface{}) error { + logger := l.getLoggerForLevel(logLevel) + logger.Output(4, fmt.Sprintf(format, v...)) + return nil +} + +//Logln logs v appending a new line at the end +//Deprecated +func Logln(v ...interface{}) { + defaultLogger.Log(infoLogging, "%v\n", v...) +} + +// Logf logs v with the provided format +func Logf(format string, v ...interface{}) { + defaultLogger.Log(infoLogging, format, v...) } // Debugf logs v with the provided format if debug mode is set func Debugf(format string, v ...interface{}) { - debugLog.SetOutput(getOutputForEnv()) - debugLog.Output(3, fmt.Sprintf(format, v...)) + defaultLogger.Log(debugLogging, format, v...) } // Debug logs v if debug mode is set func Debug(v ...interface{}) { - debugLog.SetOutput(getOutputForEnv()) - debugLog.Output(3, fmt.Sprint(v...)) + m := fmt.Sprint(v...) + defaultLogger.Log(debugLogging, "%s", m) } // Debugln logs v appending a new line if debug mode is set func Debugln(v ...interface{}) { - debugLog.SetOutput(getOutputForEnv()) - debugLog.Output(3, fmt.Sprintln(v...)) + m := fmt.Sprint(v...) + defaultLogger.Log(debugLogging, "%s\n", m) } // IfDebug executes closure if debug is enabled func IfDebug(fn func()) { - if isDebugLogEnabled { + if defaultLogger.LogLevel() >= debugLogging { fn() } } - -// Logln logs v appending a new line at the end -func Logln(v ...interface{}) { - mainLog.Output(3, fmt.Sprintln(v...)) -} - -// Logf logs v with the provided format -func Logf(format string, v ...interface{}) { - mainLog.Output(3, fmt.Sprintf(format, v...)) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,159 @@ +package common + +import ( + "context" + "fmt" + "math/rand" + "runtime" + "time" +) + +const ( + // UnlimitedNumAttemptsValue is the value for indicating unlimited attempts for reaching success + UnlimitedNumAttemptsValue = uint(0) + + // number of characters contained in the generated retry token + generatedRetryTokenLength = 32 +) + +// OCIRetryableRequest represents a request that can be reissued according to the specified policy. +type OCIRetryableRequest interface { + // Any retryable request must implement the OCIRequest interface + OCIRequest + + // Each operation specifies default retry behavior. By passing no arguments to this method, the default retry + // behavior, as determined on a per-operation-basis, will be honored. Variadic retry policy option arguments + // passed to this method will override the default behavior. + RetryPolicy() *RetryPolicy +} + +// OCIOperationResponse represents the output of an OCIOperation, with additional context of error message +// and operation attempt number. +type OCIOperationResponse struct { + // Response from OCI Operation + Response OCIResponse + + // Error from OCI Operation + Error error + + // Operation Attempt Number (one-based) + AttemptNumber uint +} + +// NewOCIOperationResponse assembles an OCI Operation Response object. +func NewOCIOperationResponse(response OCIResponse, err error, attempt uint) OCIOperationResponse { + return OCIOperationResponse{ + Response: response, + Error: err, + AttemptNumber: attempt, + } +} + +// RetryPolicy is the class that holds all relevant information for retrying operations. +type RetryPolicy struct { + // MaximumNumberAttempts is the maximum number of times to retry a request. Zero indicates an unlimited + // number of attempts. + MaximumNumberAttempts uint + + // ShouldRetryOperation inspects the http response, error, and operation attempt number, and + // - returns true if we should retry the operation + // - returns false otherwise + ShouldRetryOperation func(OCIOperationResponse) bool + + // GetNextDuration computes the duration to pause between operation retries. + NextDuration func(OCIOperationResponse) time.Duration +} + +// NoRetryPolicy is a helper method that assembles and returns a return policy that indicates an operation should +// never be retried (the operation is performed exactly once). +func NoRetryPolicy() RetryPolicy { + dontRetryOperation := func(OCIOperationResponse) bool { return false } + zeroNextDuration := func(OCIOperationResponse) time.Duration { return 0 * time.Second } + return NewRetryPolicy(uint(1), dontRetryOperation, zeroNextDuration) +} + +// NewRetryPolicy is a helper method for assembling a Retry Policy object. +func NewRetryPolicy(attempts uint, retryOperation func(OCIOperationResponse) bool, nextDuration func(OCIOperationResponse) time.Duration) RetryPolicy { + return RetryPolicy{ + MaximumNumberAttempts: attempts, + ShouldRetryOperation: retryOperation, + NextDuration: nextDuration, + } +} + +// shouldContinueIssuingRequests returns true if we should continue retrying a request, based on the current attempt +// number and the maximum number of attempts specified, or false otherwise. +func shouldContinueIssuingRequests(current, maximum uint) bool { + return maximum == UnlimitedNumAttemptsValue || current <= maximum +} + +// RetryToken generates a retry token that must be included on any request passed to the Retry method. +func RetryToken() string { + alphanumericChars := []rune("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") + retryToken := make([]rune, generatedRetryTokenLength) + for i := range retryToken { + retryToken[i] = alphanumericChars[rand.Intn(len(alphanumericChars))] + } + return string(retryToken) +} + +// Retry is a package-level operation that executes the retryable request using the specified operation and retry policy. +func Retry(ctx context.Context, request OCIRetryableRequest, operation OCIOperation, policy RetryPolicy) (OCIResponse, error) { + + type retrierResult struct { + response OCIResponse + err error + } + + var response OCIResponse + var err error + retrierChannel := make(chan retrierResult) + + go func() { + + // Deal with panics more graciously + defer func() { + if r := recover(); r != nil { + stackBuffer := make([]byte, 1024) + bytesWritten := runtime.Stack(stackBuffer, false) + stack := string(stackBuffer[:bytesWritten]) + retrierChannel <- retrierResult{nil, fmt.Errorf("panicked while retrying operation. Panic was: %s\nStack: %s", r, stack)} + } + }() + + // use a one-based counter because it's easier to think about operation retry in terms of attempt numbering + for currentOperationAttempt := uint(1); shouldContinueIssuingRequests(currentOperationAttempt, policy.MaximumNumberAttempts); currentOperationAttempt++ { + Debugln(fmt.Sprintf("operation attempt #%v", currentOperationAttempt)) + response, err = operation(ctx, request) + operationResponse := NewOCIOperationResponse(response, err, currentOperationAttempt) + + if !policy.ShouldRetryOperation(operationResponse) { + // we should NOT retry operation based on response and/or error => return + retrierChannel <- retrierResult{response, err} + return + } + + duration := policy.NextDuration(operationResponse) + //The following condition is kept for backwards compatibility reasons + if deadline, ok := ctx.Deadline(); ok && time.Now().Add(duration).After(deadline) { + // we want to retry the operation, but the policy is telling us to wait for a duration that exceeds + // the specified overall deadline for the operation => instead of waiting for however long that + // time period is and then aborting, abort now and save the cycles + retrierChannel <- retrierResult{response, DeadlineExceededByBackoff} + return + } + Debugln(fmt.Sprintf("waiting %v before retrying operation", duration)) + // sleep before retrying the operation + <-time.After(duration) + } + + retrierChannel <- retrierResult{nil, fmt.Errorf("maximum number of attempts exceeded (%v)", policy.MaximumNumberAttempts)} + }() + + select { + case <-ctx.Done(): + return response, ctx.Err() + case result := <-retrierChannel: + return result.response, result.err + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/retry_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,149 @@ +package common + +import ( + "bytes" + "context" + "github.com/stretchr/testify/assert" + "math" + "net/http" + "testing" + "time" +) + +// testing resource for mocking responses +type mockedResponse struct { + RawResponse *http.Response +} + +// HTTPResponse implements the OCIResponse interface +func (response mockedResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +func getMockedOCIOperationResponse(statusCode int, attemptNumber uint) OCIOperationResponse { + httpResponse := http.Response{ + Header: http.Header{}, + StatusCode: statusCode, + } + response := mockedResponse{ + RawResponse: &httpResponse, + } + return NewOCIOperationResponse(response, nil, attemptNumber) +} + +func getExponentialBackoffRetryPolicy(attempts uint) RetryPolicy { + shouldRetry := func(OCIOperationResponse) bool { + return true + } + nextDuration := func(response OCIOperationResponse) time.Duration { + return time.Duration(math.Pow(float64(2), float64(response.AttemptNumber-1))) * time.Second + } + return NewRetryPolicy(attempts, shouldRetry, nextDuration) +} + +func TestNoRetryPolicyDefaults(t *testing.T) { + response := getMockedOCIOperationResponse(200, 1) + policy := NoRetryPolicy() + assert.False(t, policy.ShouldRetryOperation(response)) +} + +func TestShouldContinueIssuingRequests(t *testing.T) { + assert.True(t, shouldContinueIssuingRequests(uint(1), uint(2))) + assert.True(t, shouldContinueIssuingRequests(uint(2), uint(2))) + assert.True(t, shouldContinueIssuingRequests(uint(150), UnlimitedNumAttemptsValue)) +} + +func TestRetryPolicyExponentialBackoffNextDurationUnrolled(t *testing.T) { + responses := []OCIOperationResponse{ + getMockedOCIOperationResponse(500, 1), + getMockedOCIOperationResponse(500, 2), + getMockedOCIOperationResponse(500, 3), + getMockedOCIOperationResponse(500, 4), + getMockedOCIOperationResponse(500, 5), + } + policy := getExponentialBackoffRetryPolicy(5) + // unroll an exponential retry policy with a specified maximum + // number of attempts so it's more obvious what's happening + // request #1 + assert.True(t, shouldContinueIssuingRequests(1, policy.MaximumNumberAttempts)) + assert.True(t, policy.ShouldRetryOperation(responses[0])) + assert.Equal(t, 1*time.Second, policy.NextDuration(responses[0])) + // request #2 + assert.True(t, shouldContinueIssuingRequests(2, policy.MaximumNumberAttempts)) + assert.True(t, policy.ShouldRetryOperation(responses[1])) + assert.Equal(t, 2*time.Second, policy.NextDuration(responses[1])) + // request #3 + assert.True(t, shouldContinueIssuingRequests(3, policy.MaximumNumberAttempts)) + assert.True(t, policy.ShouldRetryOperation(responses[2])) + assert.Equal(t, 4*time.Second, policy.NextDuration(responses[2])) + // request #4 + assert.True(t, shouldContinueIssuingRequests(4, policy.MaximumNumberAttempts)) + assert.True(t, policy.ShouldRetryOperation(responses[3])) + assert.Equal(t, 8*time.Second, policy.NextDuration(responses[3])) + // request #5 + assert.True(t, shouldContinueIssuingRequests(5, policy.MaximumNumberAttempts)) + assert.True(t, policy.ShouldRetryOperation(responses[4])) + assert.Equal(t, 16*time.Second, policy.NextDuration(responses[4])) + // done + assert.False(t, shouldContinueIssuingRequests(6, policy.MaximumNumberAttempts)) +} + +type mockedRequest struct { + Request http.Request + Policy *RetryPolicy +} + +func (m mockedRequest) HTTPRequest(method, path string) (http.Request, error) { + return m.Request, nil +} + +func (m mockedRequest) RetryPolicy() *RetryPolicy { + return m.Policy +} + +func TestRetryTokenPersists(t *testing.T) { + body := bytes.NewBufferString("YES") + req, _ := http.NewRequest("POST", "/some", body) + token := RetryToken() + req.Header.Set(requestHeaderOpcRetryToken, token) + policy := getExponentialBackoffRetryPolicy(2) + r := mockedRequest{Request: *req, Policy: &policy} + operation := func(i context.Context, request OCIRequest) (OCIResponse, error) { + httpResponse := http.Response{ + Header: http.Header{}, + StatusCode: 200, + } + httpReq, _ := request.HTTPRequest("POST", "/some") + headerToken := httpReq.Header.Get(requestHeaderOpcRetryToken) + + assert.Equal(t, token, headerToken) + return mockedResponse{RawResponse: &httpResponse}, nil + } + + Retry(context.Background(), r, operation, *r.Policy) +} +func TestRetryWithPanicInOperation(t *testing.T) { + body := bytes.NewBufferString("YES") + req, _ := http.NewRequest("POST", "/some", body) + token := RetryToken() + req.Header.Set(requestHeaderOpcRetryToken, token) + policy := getExponentialBackoffRetryPolicy(3) + r := mockedRequest{Request: *req, Policy: &policy} + times := 0 + operation := func(i context.Context, request OCIRequest) (OCIResponse, error) { + httpResponse := http.Response{ + Header: http.Header{}, + StatusCode: 200, + } + + if times <= 0 { + times++ + return mockedResponse{RawResponse: &httpResponse}, nil + } + panic("test panic") + } + + resp, err := Retry(context.Background(), r, operation, *r.Policy) + assert.Nil(t, resp) + assert.Error(t, err) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/version.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/version.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/version.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/common/version.go 2019-06-28 17:13:01.000000000 +0000 @@ -10,8 +10,8 @@ ) const ( - major = "1" - minor = "2" + major = "5" + minor = "7" patch = "0" tag = "" ) @@ -26,7 +26,7 @@ verBuilder := bytes.NewBufferString(ver) if tag != "" && tag != "-" { _, err := verBuilder.WriteString(tag) - if err == nil { + if err != nil { verBuilder = bytes.NewBufferString(ver) } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/add_on_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/add_on_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/add_on_options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/add_on_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AddOnOptions The properties that define options for supported add-ons. +type AddOnOptions struct { + + // Whether or not to enable the Kubernetes Dashboard add-on. + IsKubernetesDashboardEnabled *bool `mandatory:"false" json:"isKubernetesDashboardEnabled"` + + // Whether or not to enable the Tiller add-on. + IsTillerEnabled *bool `mandatory:"false" json:"isTillerEnabled"` +} + +func (m AddOnOptions) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_create_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_create_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_create_options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_create_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterCreateOptions The properties that define extra options for a cluster. +type ClusterCreateOptions struct { + + // The OCIDs of the subnets used for Kubernetes services load balancers. + ServiceLbSubnetIds []string `mandatory:"false" json:"serviceLbSubnetIds"` + + // Network configuration for Kubernetes. + KubernetesNetworkConfig *KubernetesNetworkConfig `mandatory:"false" json:"kubernetesNetworkConfig"` + + // Configurable cluster add-ons + AddOns *AddOnOptions `mandatory:"false" json:"addOns"` +} + +func (m ClusterCreateOptions) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_endpoints.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_endpoints.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_endpoints.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_endpoints.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterEndpoints The properties that define endpoints for a cluster. +type ClusterEndpoints struct { + + // The Kubernetes API server endpoint. + Kubernetes *string `mandatory:"false" json:"kubernetes"` +} + +func (m ClusterEndpoints) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Cluster A Kubernetes cluster. Avoid entering confidential information. +type Cluster struct { + + // The OCID of the cluster. + Id *string `mandatory:"false" json:"id"` + + // The name of the cluster. + Name *string `mandatory:"false" json:"name"` + + // The OCID of the compartment in which the cluster exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID of the virtual cloud network (VCN) in which the cluster exists. + VcnId *string `mandatory:"false" json:"vcnId"` + + // The version of Kubernetes running on the cluster masters. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` + + // Optional attributes for the cluster. + Options *ClusterCreateOptions `mandatory:"false" json:"options"` + + // Metadata about the cluster. + Metadata *ClusterMetadata `mandatory:"false" json:"metadata"` + + // The state of the cluster masters. + LifecycleState ClusterLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Details about the state of the cluster masters. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Endpoints served up by the cluster masters. + Endpoints *ClusterEndpoints `mandatory:"false" json:"endpoints"` + + // Available Kubernetes versions to which the clusters masters may be upgraded. + AvailableKubernetesUpgrades []string `mandatory:"false" json:"availableKubernetesUpgrades"` +} + +func (m Cluster) String() string { + return common.PointerString(m) +} + +// ClusterLifecycleStateEnum Enum with underlying type: string +type ClusterLifecycleStateEnum string + +// Set of constants representing the allowable values for ClusterLifecycleStateEnum +const ( + ClusterLifecycleStateCreating ClusterLifecycleStateEnum = "CREATING" + ClusterLifecycleStateActive ClusterLifecycleStateEnum = "ACTIVE" + ClusterLifecycleStateFailed ClusterLifecycleStateEnum = "FAILED" + ClusterLifecycleStateDeleting ClusterLifecycleStateEnum = "DELETING" + ClusterLifecycleStateDeleted ClusterLifecycleStateEnum = "DELETED" + ClusterLifecycleStateUpdating ClusterLifecycleStateEnum = "UPDATING" +) + +var mappingClusterLifecycleState = map[string]ClusterLifecycleStateEnum{ + "CREATING": ClusterLifecycleStateCreating, + "ACTIVE": ClusterLifecycleStateActive, + "FAILED": ClusterLifecycleStateFailed, + "DELETING": ClusterLifecycleStateDeleting, + "DELETED": ClusterLifecycleStateDeleted, + "UPDATING": ClusterLifecycleStateUpdating, +} + +// GetClusterLifecycleStateEnumValues Enumerates the set of values for ClusterLifecycleStateEnum +func GetClusterLifecycleStateEnumValues() []ClusterLifecycleStateEnum { + values := make([]ClusterLifecycleStateEnum, 0) + for _, v := range mappingClusterLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_lifecycle_state.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_lifecycle_state.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_lifecycle_state.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_lifecycle_state.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterLifecycleState The lifecycle state of a cluster. +type ClusterLifecycleState struct { +} + +func (m ClusterLifecycleState) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_metadata.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_metadata.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_metadata.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_metadata.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterMetadata The properties that define meta data for a cluster. +type ClusterMetadata struct { + + // The time the cluster was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The user who created the cluster. + CreatedByUserId *string `mandatory:"false" json:"createdByUserId"` + + // The OCID of the work request which created the cluster. + CreatedByWorkRequestId *string `mandatory:"false" json:"createdByWorkRequestId"` + + // The time the cluster was deleted. + TimeDeleted *common.SDKTime `mandatory:"false" json:"timeDeleted"` + + // The user who deleted the cluster. + DeletedByUserId *string `mandatory:"false" json:"deletedByUserId"` + + // The OCID of the work request which deleted the cluster. + DeletedByWorkRequestId *string `mandatory:"false" json:"deletedByWorkRequestId"` + + // The time the cluster was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The user who updated the cluster. + UpdatedByUserId *string `mandatory:"false" json:"updatedByUserId"` + + // The OCID of the work request which updated the cluster. + UpdatedByWorkRequestId *string `mandatory:"false" json:"updatedByWorkRequestId"` +} + +func (m ClusterMetadata) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterOptions Options for creating or updating clusters. +type ClusterOptions struct { + + // Available Kubernetes versions. + KubernetesVersions []string `mandatory:"false" json:"kubernetesVersions"` +} + +func (m ClusterOptions) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/cluster_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClusterSummary The properties that define a cluster summary. +type ClusterSummary struct { + + // The OCID of the cluster. + Id *string `mandatory:"false" json:"id"` + + // The name of the cluster. + Name *string `mandatory:"false" json:"name"` + + // The OCID of the compartment in which the cluster exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID of the virtual cloud network (VCN) in which the cluster exists + VcnId *string `mandatory:"false" json:"vcnId"` + + // The version of Kubernetes running on the cluster masters. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` + + // Optional attributes for the cluster. + Options *ClusterCreateOptions `mandatory:"false" json:"options"` + + // Metadata about the cluster. + Metadata *ClusterMetadata `mandatory:"false" json:"metadata"` + + // The state of the cluster masters. + LifecycleState ClusterSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Details about the state of the cluster masters. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Endpoints served up by the cluster masters. + Endpoints *ClusterEndpoints `mandatory:"false" json:"endpoints"` + + // Available Kubernetes versions to which the clusters masters may be upgraded. + AvailableKubernetesUpgrades []string `mandatory:"false" json:"availableKubernetesUpgrades"` +} + +func (m ClusterSummary) String() string { + return common.PointerString(m) +} + +// ClusterSummaryLifecycleStateEnum Enum with underlying type: string +type ClusterSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ClusterSummaryLifecycleStateEnum +const ( + ClusterSummaryLifecycleStateCreating ClusterSummaryLifecycleStateEnum = "CREATING" + ClusterSummaryLifecycleStateActive ClusterSummaryLifecycleStateEnum = "ACTIVE" + ClusterSummaryLifecycleStateFailed ClusterSummaryLifecycleStateEnum = "FAILED" + ClusterSummaryLifecycleStateDeleting ClusterSummaryLifecycleStateEnum = "DELETING" + ClusterSummaryLifecycleStateDeleted ClusterSummaryLifecycleStateEnum = "DELETED" + ClusterSummaryLifecycleStateUpdating ClusterSummaryLifecycleStateEnum = "UPDATING" +) + +var mappingClusterSummaryLifecycleState = map[string]ClusterSummaryLifecycleStateEnum{ + "CREATING": ClusterSummaryLifecycleStateCreating, + "ACTIVE": ClusterSummaryLifecycleStateActive, + "FAILED": ClusterSummaryLifecycleStateFailed, + "DELETING": ClusterSummaryLifecycleStateDeleting, + "DELETED": ClusterSummaryLifecycleStateDeleted, + "UPDATING": ClusterSummaryLifecycleStateUpdating, +} + +// GetClusterSummaryLifecycleStateEnumValues Enumerates the set of values for ClusterSummaryLifecycleStateEnum +func GetClusterSummaryLifecycleStateEnumValues() []ClusterSummaryLifecycleStateEnum { + values := make([]ClusterSummaryLifecycleStateEnum, 0) + for _, v := range mappingClusterSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/containerengine_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/containerengine_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/containerengine_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/containerengine_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,826 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//ContainerEngineClient a client for ContainerEngine +type ContainerEngineClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewContainerEngineClientWithConfigurationProvider Creates a new default ContainerEngine client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewContainerEngineClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ContainerEngineClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = ContainerEngineClient{BaseClient: baseClient} + client.BasePath = "20180222" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ContainerEngineClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("containerengine", "https://containerengine.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ContainerEngineClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ContainerEngineClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateCluster Create a new cluster. +func (client ContainerEngineClient) CreateCluster(ctx context.Context, request CreateClusterRequest) (response CreateClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCluster, policy) + if err != nil { + if ociResponse != nil { + response = CreateClusterResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateClusterResponse") + } + return +} + +// createCluster implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) createCluster(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusters") + if err != nil { + return nil, err + } + + var response CreateClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateKubeconfig Create the Kubeconfig YAML for a cluster. +func (client ContainerEngineClient) CreateKubeconfig(ctx context.Context, request CreateKubeconfigRequest) (response CreateKubeconfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createKubeconfig, policy) + if err != nil { + if ociResponse != nil { + response = CreateKubeconfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateKubeconfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateKubeconfigResponse") + } + return +} + +// createKubeconfig implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) createKubeconfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusters/{clusterId}/kubeconfig/content") + if err != nil { + return nil, err + } + + var response CreateKubeconfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateNodePool Create a new node pool. +func (client ContainerEngineClient) CreateNodePool(ctx context.Context, request CreateNodePoolRequest) (response CreateNodePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createNodePool, policy) + if err != nil { + if ociResponse != nil { + response = CreateNodePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateNodePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNodePoolResponse") + } + return +} + +// createNodePool implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) createNodePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/nodePools") + if err != nil { + return nil, err + } + + var response CreateNodePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCluster Delete a cluster. +func (client ContainerEngineClient) DeleteCluster(ctx context.Context, request DeleteClusterRequest) (response DeleteClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCluster, policy) + if err != nil { + if ociResponse != nil { + response = DeleteClusterResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteClusterResponse") + } + return +} + +// deleteCluster implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) deleteCluster(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/clusters/{clusterId}") + if err != nil { + return nil, err + } + + var response DeleteClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNodePool Delete a node pool. +func (client ContainerEngineClient) DeleteNodePool(ctx context.Context, request DeleteNodePoolRequest) (response DeleteNodePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteNodePool, policy) + if err != nil { + if ociResponse != nil { + response = DeleteNodePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNodePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNodePoolResponse") + } + return +} + +// deleteNodePool implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) deleteNodePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/nodePools/{nodePoolId}") + if err != nil { + return nil, err + } + + var response DeleteNodePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteWorkRequest Cancel a work request that has not started. +func (client ContainerEngineClient) DeleteWorkRequest(ctx context.Context, request DeleteWorkRequestRequest) (response DeleteWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = DeleteWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteWorkRequestResponse") + } + return +} + +// deleteWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) deleteWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response DeleteWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCluster Get the details of a cluster. +func (client ContainerEngineClient) GetCluster(ctx context.Context, request GetClusterRequest) (response GetClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCluster, policy) + if err != nil { + if ociResponse != nil { + response = GetClusterResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetClusterResponse") + } + return +} + +// getCluster implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getCluster(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusters/{clusterId}") + if err != nil { + return nil, err + } + + var response GetClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetClusterOptions Get options available for clusters. +func (client ContainerEngineClient) GetClusterOptions(ctx context.Context, request GetClusterOptionsRequest) (response GetClusterOptionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getClusterOptions, policy) + if err != nil { + if ociResponse != nil { + response = GetClusterOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetClusterOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetClusterOptionsResponse") + } + return +} + +// getClusterOptions implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getClusterOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusterOptions/{clusterOptionId}") + if err != nil { + return nil, err + } + + var response GetClusterOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetNodePool Get the details of a node pool. +func (client ContainerEngineClient) GetNodePool(ctx context.Context, request GetNodePoolRequest) (response GetNodePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getNodePool, policy) + if err != nil { + if ociResponse != nil { + response = GetNodePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetNodePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNodePoolResponse") + } + return +} + +// getNodePool implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getNodePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/nodePools/{nodePoolId}") + if err != nil { + return nil, err + } + + var response GetNodePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetNodePoolOptions Get options available for node pools. +func (client ContainerEngineClient) GetNodePoolOptions(ctx context.Context, request GetNodePoolOptionsRequest) (response GetNodePoolOptionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getNodePoolOptions, policy) + if err != nil { + if ociResponse != nil { + response = GetNodePoolOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetNodePoolOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNodePoolOptionsResponse") + } + return +} + +// getNodePoolOptions implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getNodePoolOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/nodePoolOptions/{nodePoolOptionId}") + if err != nil { + return nil, err + } + + var response GetNodePoolOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Get the details of a work request. +func (client ContainerEngineClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = GetWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListClusters List all the cluster objects in a compartment. +func (client ContainerEngineClient) ListClusters(ctx context.Context, request ListClustersRequest) (response ListClustersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listClusters, policy) + if err != nil { + if ociResponse != nil { + response = ListClustersResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListClustersResponse") + } + return +} + +// listClusters implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) listClusters(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusters") + if err != nil { + return nil, err + } + + var response ListClustersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListNodePools List all the node pools in a compartment, and optionally filter by cluster. +func (client ContainerEngineClient) ListNodePools(ctx context.Context, request ListNodePoolsRequest) (response ListNodePoolsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listNodePools, policy) + if err != nil { + if ociResponse != nil { + response = ListNodePoolsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListNodePoolsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNodePoolsResponse") + } + return +} + +// listNodePools implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) listNodePools(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/nodePools") + if err != nil { + return nil, err + } + + var response ListNodePoolsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Get the errors of a work request. +func (client ContainerEngineClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestErrorsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors") + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Get the logs of a work request. +func (client ContainerEngineClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestLogsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs") + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests List all work requests in a compartment. +func (client ContainerEngineClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) listWorkRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests") + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCluster Update the details of a cluster. +func (client ContainerEngineClient) UpdateCluster(ctx context.Context, request UpdateClusterRequest) (response UpdateClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCluster, policy) + if err != nil { + if ociResponse != nil { + response = UpdateClusterResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateClusterResponse") + } + return +} + +// updateCluster implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) updateCluster(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/clusters/{clusterId}") + if err != nil { + return nil, err + } + + var response UpdateClusterResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateNodePool Update the details of a node pool. +func (client ContainerEngineClient) UpdateNodePool(ctx context.Context, request UpdateNodePoolRequest) (response UpdateNodePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateNodePool, policy) + if err != nil { + if ociResponse != nil { + response = UpdateNodePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateNodePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNodePoolResponse") + } + return +} + +// updateNodePool implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) updateNodePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/nodePools/{nodePoolId}") + if err != nil { + return nil, err + } + + var response UpdateNodePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateClusterDetails The properties that define a request to create a cluster. +type CreateClusterDetails struct { + + // The name of the cluster. Avoid entering confidential information. + Name *string `mandatory:"true" json:"name"` + + // The OCID of the compartment in which to create the cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the virtual cloud network (VCN) in which to create the cluster. + VcnId *string `mandatory:"true" json:"vcnId"` + + // The version of Kubernetes to install into the cluster masters. + KubernetesVersion *string `mandatory:"true" json:"kubernetesVersion"` + + // Optional attributes for the cluster. + Options *ClusterCreateOptions `mandatory:"false" json:"options"` +} + +func (m CreateClusterDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_kubeconfig_content_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_kubeconfig_content_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_kubeconfig_content_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_kubeconfig_content_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateClusterKubeconfigContentDetails The properties that define a request to create a cluster kubeconfig. +type CreateClusterKubeconfigContentDetails struct { + + // The version of the kubeconfig token. + TokenVersion *string `mandatory:"false" json:"tokenVersion"` + + // The desired expiration, in seconds, to use for the kubeconfig token. + Expiration *int `mandatory:"false" json:"expiration"` +} + +func (m CreateClusterKubeconfigContentDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_cluster_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateClusterRequest wrapper for the CreateCluster operation +type CreateClusterRequest struct { + + // The details of the cluster to create. + CreateClusterDetails `contributesTo:"body"` + + // A token you supply to uniquely identify the request and provide idempotency if + // the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateClusterRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateClusterResponse wrapper for the CreateCluster operation +type CreateClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_kubeconfig_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_kubeconfig_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_kubeconfig_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_kubeconfig_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// CreateKubeconfigRequest wrapper for the CreateKubeconfig operation +type CreateKubeconfigRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The details of the cluster kubeconfig to create. + CreateClusterKubeconfigContentDetails `contributesTo:"body"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateKubeconfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateKubeconfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateKubeconfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateKubeconfigResponse wrapper for the CreateKubeconfig operation +type CreateKubeconfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateKubeconfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateKubeconfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateNodePoolDetails The properties that define a request to create a node pool. +type CreateNodePoolDetails struct { + + // The OCID of the compartment in which the node pool exists. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the cluster to which this node pool is attached. + ClusterId *string `mandatory:"true" json:"clusterId"` + + // The name of the node pool. Avoid entering confidential information. + Name *string `mandatory:"true" json:"name"` + + // The version of Kubernetes to install on the nodes in the node pool. + KubernetesVersion *string `mandatory:"true" json:"kubernetesVersion"` + + // The name of the image running on the nodes in the node pool. + NodeImageName *string `mandatory:"true" json:"nodeImageName"` + + // The name of the node shape of the nodes in the node pool. + NodeShape *string `mandatory:"true" json:"nodeShape"` + + // The OCIDs of the subnets in which to place nodes for this node pool. + SubnetIds []string `mandatory:"true" json:"subnetIds"` + + // A list of key/value pairs to add to each underlying OCI instance in the node pool. + NodeMetadata map[string]string `mandatory:"false" json:"nodeMetadata"` + + // A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + InitialNodeLabels []KeyValue `mandatory:"false" json:"initialNodeLabels"` + + // The SSH public key to add to each node in the node pool. + SshPublicKey *string `mandatory:"false" json:"sshPublicKey"` + + // The number of nodes to create in each subnet. + QuantityPerSubnet *int `mandatory:"false" json:"quantityPerSubnet"` +} + +func (m CreateNodePoolDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/create_node_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateNodePoolRequest wrapper for the CreateNodePool operation +type CreateNodePoolRequest struct { + + // The details of the node pool to create. + CreateNodePoolDetails `contributesTo:"body"` + + // A token you supply to uniquely identify the request and provide idempotency if + // the request is retried. Idempotency tokens expire after 24 hours. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateNodePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateNodePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateNodePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateNodePoolResponse wrapper for the CreateNodePool operation +type CreateNodePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateNodePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateNodePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_cluster_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_cluster_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_cluster_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_cluster_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteClusterRequest wrapper for the DeleteCluster operation +type DeleteClusterRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteClusterRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteClusterResponse wrapper for the DeleteCluster operation +type DeleteClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_node_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_node_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_node_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_node_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteNodePoolRequest wrapper for the DeleteNodePool operation +type DeleteNodePoolRequest struct { + + // The OCID of the node pool. + NodePoolId *string `mandatory:"true" contributesTo:"path" name:"nodePoolId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteNodePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteNodePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteNodePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteNodePoolResponse wrapper for the DeleteNodePool operation +type DeleteNodePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteNodePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteNodePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/delete_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteWorkRequestRequest wrapper for the DeleteWorkRequest operation +type DeleteWorkRequestRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteWorkRequestResponse wrapper for the DeleteWorkRequest operation +type DeleteWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_options_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetClusterOptionsRequest wrapper for the GetClusterOptions operation +type GetClusterOptionsRequest struct { + + // The id of the option set to retrieve. Only "all" is supported. + ClusterOptionId *string `mandatory:"true" contributesTo:"path" name:"clusterOptionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetClusterOptionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetClusterOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetClusterOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetClusterOptionsResponse wrapper for the GetClusterOptions operation +type GetClusterOptionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ClusterOptions instance + ClusterOptions `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetClusterOptionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetClusterOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_cluster_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetClusterRequest wrapper for the GetCluster operation +type GetClusterRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetClusterRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetClusterResponse wrapper for the GetCluster operation +type GetClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cluster instance + Cluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_options_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetNodePoolOptionsRequest wrapper for the GetNodePoolOptions operation +type GetNodePoolOptionsRequest struct { + + // The id of the option set to retrieve. Use "all" get all options, or use a cluster ID to get options specific to the provided cluster. + NodePoolOptionId *string `mandatory:"true" contributesTo:"path" name:"nodePoolOptionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetNodePoolOptionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNodePoolOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNodePoolOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetNodePoolOptionsResponse wrapper for the GetNodePoolOptions operation +type GetNodePoolOptionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NodePoolOptions instance + NodePoolOptions `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetNodePoolOptionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNodePoolOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_node_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetNodePoolRequest wrapper for the GetNodePool operation +type GetNodePoolRequest struct { + + // The OCID of the node pool. + NodePoolId *string `mandatory:"true" contributesTo:"path" name:"nodePoolId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetNodePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNodePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNodePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetNodePoolResponse wrapper for the GetNodePool operation +type GetNodePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NodePool instance + NodePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetNodePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNodePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/get_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +type GetWorkRequestRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // the number of seconds to should wait before polling this endpoint again + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/key_value.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/key_value.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/key_value.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/key_value.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KeyValue The properties that define a key value pair. +type KeyValue struct { + + // The key of the pair. + Key *string `mandatory:"false" json:"key"` + + // The value of the pair. + Value *string `mandatory:"false" json:"value"` +} + +func (m KeyValue) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/kubernetes_network_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/kubernetes_network_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/kubernetes_network_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/kubernetes_network_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KubernetesNetworkConfig The properties that define the network configuration for Kubernetes. +type KubernetesNetworkConfig struct { + + // The CIDR block for Kubernetes pods. + PodsCidr *string `mandatory:"false" json:"podsCidr"` + + // The CIDR block for Kubernetes services. + ServicesCidr *string `mandatory:"false" json:"servicesCidr"` +} + +func (m KubernetesNetworkConfig) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_clusters_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_clusters_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_clusters_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_clusters_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,165 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListClustersRequest wrapper for the ListClusters operation +type ListClustersRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A cluster lifecycle state to filter on. Can have multiple parameters of this name. + LifecycleState []ListClustersLifecycleStateEnum `contributesTo:"query" name:"lifecycleState" omitEmpty:"true" collectionFormat:"multi"` + + // The name to filter on. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The optional order in which to sort the results. + SortOrder ListClustersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The optional field to sort the results by. + SortBy ListClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListClustersRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListClustersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListClustersResponse wrapper for the ListClusters operation +type ListClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ClusterSummary instances + Items []ClusterSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListClustersLifecycleStateEnum Enum with underlying type: string +type ListClustersLifecycleStateEnum string + +// Set of constants representing the allowable values for ListClustersLifecycleStateEnum +const ( + ListClustersLifecycleStateCreating ListClustersLifecycleStateEnum = "CREATING" + ListClustersLifecycleStateActive ListClustersLifecycleStateEnum = "ACTIVE" + ListClustersLifecycleStateFailed ListClustersLifecycleStateEnum = "FAILED" + ListClustersLifecycleStateDeleting ListClustersLifecycleStateEnum = "DELETING" + ListClustersLifecycleStateDeleted ListClustersLifecycleStateEnum = "DELETED" + ListClustersLifecycleStateUpdating ListClustersLifecycleStateEnum = "UPDATING" +) + +var mappingListClustersLifecycleState = map[string]ListClustersLifecycleStateEnum{ + "CREATING": ListClustersLifecycleStateCreating, + "ACTIVE": ListClustersLifecycleStateActive, + "FAILED": ListClustersLifecycleStateFailed, + "DELETING": ListClustersLifecycleStateDeleting, + "DELETED": ListClustersLifecycleStateDeleted, + "UPDATING": ListClustersLifecycleStateUpdating, +} + +// GetListClustersLifecycleStateEnumValues Enumerates the set of values for ListClustersLifecycleStateEnum +func GetListClustersLifecycleStateEnumValues() []ListClustersLifecycleStateEnum { + values := make([]ListClustersLifecycleStateEnum, 0) + for _, v := range mappingListClustersLifecycleState { + values = append(values, v) + } + return values +} + +// ListClustersSortOrderEnum Enum with underlying type: string +type ListClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListClustersSortOrderEnum +const ( + ListClustersSortOrderAsc ListClustersSortOrderEnum = "ASC" + ListClustersSortOrderDesc ListClustersSortOrderEnum = "DESC" +) + +var mappingListClustersSortOrder = map[string]ListClustersSortOrderEnum{ + "ASC": ListClustersSortOrderAsc, + "DESC": ListClustersSortOrderDesc, +} + +// GetListClustersSortOrderEnumValues Enumerates the set of values for ListClustersSortOrderEnum +func GetListClustersSortOrderEnumValues() []ListClustersSortOrderEnum { + values := make([]ListClustersSortOrderEnum, 0) + for _, v := range mappingListClustersSortOrder { + values = append(values, v) + } + return values +} + +// ListClustersSortByEnum Enum with underlying type: string +type ListClustersSortByEnum string + +// Set of constants representing the allowable values for ListClustersSortByEnum +const ( + ListClustersSortById ListClustersSortByEnum = "ID" + ListClustersSortByName ListClustersSortByEnum = "NAME" + ListClustersSortByTimeCreated ListClustersSortByEnum = "TIME_CREATED" +) + +var mappingListClustersSortBy = map[string]ListClustersSortByEnum{ + "ID": ListClustersSortById, + "NAME": ListClustersSortByName, + "TIME_CREATED": ListClustersSortByTimeCreated, +} + +// GetListClustersSortByEnumValues Enumerates the set of values for ListClustersSortByEnum +func GetListClustersSortByEnumValues() []ListClustersSortByEnum { + values := make([]ListClustersSortByEnum, 0) + for _, v := range mappingListClustersSortBy { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_node_pools_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_node_pools_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_node_pools_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_node_pools_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListNodePoolsRequest wrapper for the ListNodePools operation +type ListNodePoolsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the cluster. + ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` + + // The name to filter on. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The optional order in which to sort the results. + SortOrder ListNodePoolsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The optional field to sort the results by. + SortBy ListNodePoolsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListNodePoolsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNodePoolsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNodePoolsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListNodePoolsResponse wrapper for the ListNodePools operation +type ListNodePoolsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NodePoolSummary instances + Items []NodePoolSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListNodePoolsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNodePoolsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNodePoolsSortOrderEnum Enum with underlying type: string +type ListNodePoolsSortOrderEnum string + +// Set of constants representing the allowable values for ListNodePoolsSortOrderEnum +const ( + ListNodePoolsSortOrderAsc ListNodePoolsSortOrderEnum = "ASC" + ListNodePoolsSortOrderDesc ListNodePoolsSortOrderEnum = "DESC" +) + +var mappingListNodePoolsSortOrder = map[string]ListNodePoolsSortOrderEnum{ + "ASC": ListNodePoolsSortOrderAsc, + "DESC": ListNodePoolsSortOrderDesc, +} + +// GetListNodePoolsSortOrderEnumValues Enumerates the set of values for ListNodePoolsSortOrderEnum +func GetListNodePoolsSortOrderEnumValues() []ListNodePoolsSortOrderEnum { + values := make([]ListNodePoolsSortOrderEnum, 0) + for _, v := range mappingListNodePoolsSortOrder { + values = append(values, v) + } + return values +} + +// ListNodePoolsSortByEnum Enum with underlying type: string +type ListNodePoolsSortByEnum string + +// Set of constants representing the allowable values for ListNodePoolsSortByEnum +const ( + ListNodePoolsSortById ListNodePoolsSortByEnum = "ID" + ListNodePoolsSortByName ListNodePoolsSortByEnum = "NAME" + ListNodePoolsSortByTimeCreated ListNodePoolsSortByEnum = "TIME_CREATED" +) + +var mappingListNodePoolsSortBy = map[string]ListNodePoolsSortByEnum{ + "ID": ListNodePoolsSortById, + "NAME": ListNodePoolsSortByName, + "TIME_CREATED": ListNodePoolsSortByTimeCreated, +} + +// GetListNodePoolsSortByEnumValues Enumerates the set of values for ListNodePoolsSortByEnum +func GetListNodePoolsSortByEnumValues() []ListNodePoolsSortByEnum { + values := make([]ListNodePoolsSortByEnum, 0) + for _, v := range mappingListNodePoolsSortBy { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_errors_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_errors_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_errors_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_errors_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []WorkRequestError instance + Items []WorkRequestError `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_logs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_logs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_logs_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_request_logs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []WorkRequestLogEntry instance + Items []WorkRequestLogEntry `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/list_work_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +type ListWorkRequestsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the cluster. + ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` + + // The OCID of the resource associated with a work request + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // Type of the resource associated with a work request + ResourceType ListWorkRequestsResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"resourceType" omitEmpty:"true"` + + // A work request status to filter on. Can have multiple parameters of this name. + Status []ListWorkRequestsStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The optional order in which to sort the results. + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The optional field to sort the results by. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestSummary instances + Items []WorkRequestSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsResourceTypeEnum Enum with underlying type: string +type ListWorkRequestsResourceTypeEnum string + +// Set of constants representing the allowable values for ListWorkRequestsResourceTypeEnum +const ( + ListWorkRequestsResourceTypeCluster ListWorkRequestsResourceTypeEnum = "CLUSTER" + ListWorkRequestsResourceTypeNodepool ListWorkRequestsResourceTypeEnum = "NODEPOOL" +) + +var mappingListWorkRequestsResourceType = map[string]ListWorkRequestsResourceTypeEnum{ + "CLUSTER": ListWorkRequestsResourceTypeCluster, + "NODEPOOL": ListWorkRequestsResourceTypeNodepool, +} + +// GetListWorkRequestsResourceTypeEnumValues Enumerates the set of values for ListWorkRequestsResourceTypeEnum +func GetListWorkRequestsResourceTypeEnumValues() []ListWorkRequestsResourceTypeEnum { + values := make([]ListWorkRequestsResourceTypeEnum, 0) + for _, v := range mappingListWorkRequestsResourceType { + values = append(values, v) + } + return values +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatus = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatus { + values = append(values, v) + } + return values +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrder = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrder { + values = append(values, v) + } + return values +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortById ListWorkRequestsSortByEnum = "ID" + ListWorkRequestsSortByOperationType ListWorkRequestsSortByEnum = "OPERATION_TYPE" + ListWorkRequestsSortByStatus ListWorkRequestsSortByEnum = "STATUS" + ListWorkRequestsSortByTimeAccepted ListWorkRequestsSortByEnum = "TIME_ACCEPTED" + ListWorkRequestsSortByTimeStarted ListWorkRequestsSortByEnum = "TIME_STARTED" + ListWorkRequestsSortByTimeFinished ListWorkRequestsSortByEnum = "TIME_FINISHED" +) + +var mappingListWorkRequestsSortBy = map[string]ListWorkRequestsSortByEnum{ + "ID": ListWorkRequestsSortById, + "OPERATION_TYPE": ListWorkRequestsSortByOperationType, + "STATUS": ListWorkRequestsSortByStatus, + "TIME_ACCEPTED": ListWorkRequestsSortByTimeAccepted, + "TIME_STARTED": ListWorkRequestsSortByTimeStarted, + "TIME_FINISHED": ListWorkRequestsSortByTimeFinished, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortBy { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NodeError The properties that define an upstream error while managing a node. +type NodeError struct { + + // A short error code that defines the upstream error, meant for programmatic parsing. See API Errors (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // A human-readable error string of the upstream error. + Message *string `mandatory:"true" json:"message"` + + // The status of the HTTP response encountered in the upstream error. + Status *string `mandatory:"false" json:"status"` + + // Unique Oracle-assigned identifier for the upstream request. If you need to contact Oracle about a particular upstream request, please provide the request ID. + OpcRequestId *string `mandatory:"false" json:"opc-request-id"` +} + +func (m NodeError) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Node The properties that define a node. +type Node struct { + + // The OCID of the compute instance backing this node. + Id *string `mandatory:"false" json:"id"` + + // The name of the node. + Name *string `mandatory:"false" json:"name"` + + // The name of the availability domain in which this node is placed. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The OCID of the subnet in which this node is placed. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // The OCID of the node pool to which this node belongs. + NodePoolId *string `mandatory:"false" json:"nodePoolId"` + + // The public IP address of this node. + PublicIp *string `mandatory:"false" json:"publicIp"` + + // An error that may be associated with the node. + NodeError *NodeError `mandatory:"false" json:"nodeError"` + + // The state of the node. + LifecycleState NodeLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Details about the state of the node. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m Node) String() string { + return common.PointerString(m) +} + +// NodeLifecycleStateEnum Enum with underlying type: string +type NodeLifecycleStateEnum string + +// Set of constants representing the allowable values for NodeLifecycleStateEnum +const ( + NodeLifecycleStateCreating NodeLifecycleStateEnum = "CREATING" + NodeLifecycleStateActive NodeLifecycleStateEnum = "ACTIVE" + NodeLifecycleStateUpdating NodeLifecycleStateEnum = "UPDATING" + NodeLifecycleStateDeleting NodeLifecycleStateEnum = "DELETING" + NodeLifecycleStateDeleted NodeLifecycleStateEnum = "DELETED" + NodeLifecycleStateFailing NodeLifecycleStateEnum = "FAILING" + NodeLifecycleStateInactive NodeLifecycleStateEnum = "INACTIVE" +) + +var mappingNodeLifecycleState = map[string]NodeLifecycleStateEnum{ + "CREATING": NodeLifecycleStateCreating, + "ACTIVE": NodeLifecycleStateActive, + "UPDATING": NodeLifecycleStateUpdating, + "DELETING": NodeLifecycleStateDeleting, + "DELETED": NodeLifecycleStateDeleted, + "FAILING": NodeLifecycleStateFailing, + "INACTIVE": NodeLifecycleStateInactive, +} + +// GetNodeLifecycleStateEnumValues Enumerates the set of values for NodeLifecycleStateEnum +func GetNodeLifecycleStateEnumValues() []NodeLifecycleStateEnum { + values := make([]NodeLifecycleStateEnum, 0) + for _, v := range mappingNodeLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NodePool A pool of compute nodes attached to a cluster. Avoid entering confidential information. +type NodePool struct { + + // The OCID of the node pool. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the compartment in which the node pool exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID of the cluster to which this node pool is attached. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The name of the node pool. + Name *string `mandatory:"false" json:"name"` + + // The version of Kubernetes running on the nodes in the node pool. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` + + // A list of key/value pairs to add to each underlying OCI instance in the node pool. + NodeMetadata map[string]string `mandatory:"false" json:"nodeMetadata"` + + // The OCID of the image running on the nodes in the node pool. + NodeImageId *string `mandatory:"false" json:"nodeImageId"` + + // The name of the image running on the nodes in the node pool. + NodeImageName *string `mandatory:"false" json:"nodeImageName"` + + // The name of the node shape of the nodes in the node pool. + NodeShape *string `mandatory:"false" json:"nodeShape"` + + // A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + InitialNodeLabels []KeyValue `mandatory:"false" json:"initialNodeLabels"` + + // The SSH public key on each node in the node pool. + SshPublicKey *string `mandatory:"false" json:"sshPublicKey"` + + // The number of nodes in each subnet. + QuantityPerSubnet *int `mandatory:"false" json:"quantityPerSubnet"` + + // The OCIDs of the subnets in which to place nodes for this node pool. + SubnetIds []string `mandatory:"false" json:"subnetIds"` + + // The nodes in the node pool. + Nodes []Node `mandatory:"false" json:"nodes"` +} + +func (m NodePool) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NodePoolOptions Options for creating or updating node pools. +type NodePoolOptions struct { + + // Available Kubernetes versions. + KubernetesVersions []string `mandatory:"false" json:"kubernetesVersions"` + + // Available Kubernetes versions. + Images []string `mandatory:"false" json:"images"` + + // Available shapes for nodes. + Shapes []string `mandatory:"false" json:"shapes"` +} + +func (m NodePoolOptions) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/node_pool_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NodePoolSummary The properties that define a node pool summary. +type NodePoolSummary struct { + + // The OCID of the node pool. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the compartment in which the node pool exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID of the cluster to which this node pool is attached. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The name of the node pool. + Name *string `mandatory:"false" json:"name"` + + // The version of Kubernetes running on the nodes in the node pool. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` + + // The OCID of the image running on the nodes in the node pool. + NodeImageId *string `mandatory:"false" json:"nodeImageId"` + + // The name of the image running on the nodes in the node pool. + NodeImageName *string `mandatory:"false" json:"nodeImageName"` + + // The name of the node shape of the nodes in the node pool. + NodeShape *string `mandatory:"false" json:"nodeShape"` + + // A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + InitialNodeLabels []KeyValue `mandatory:"false" json:"initialNodeLabels"` + + // The SSH public key on each node in the node pool. + SshPublicKey *string `mandatory:"false" json:"sshPublicKey"` + + // The number of nodes in each subnet. + QuantityPerSubnet *int `mandatory:"false" json:"quantityPerSubnet"` + + // The OCIDs of the subnets in which to place nodes for this node pool. + SubnetIds []string `mandatory:"false" json:"subnetIds"` +} + +func (m NodePoolSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/sort_order.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/sort_order.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/sort_order.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/sort_order.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SortOrder The sort order for a list operation. +type SortOrder struct { +} + +func (m SortOrder) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateClusterDetails The properties that define a request to update a cluster. +type UpdateClusterDetails struct { + + // The new name for the cluster. Avoid entering confidential information. + Name *string `mandatory:"false" json:"name"` + + // The version of Kubernetes to which the cluster masters should be upgraded. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` +} + +func (m UpdateClusterDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_cluster_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateClusterRequest wrapper for the UpdateCluster operation +type UpdateClusterRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // The details of the cluster to update. + UpdateClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateClusterRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateClusterResponse wrapper for the UpdateCluster operation +type UpdateClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateNodePoolDetails The properties that define a request to update a node pool. +type UpdateNodePoolDetails struct { + + // The new name for the cluster. Avoid entering confidential information. + Name *string `mandatory:"false" json:"name"` + + // The version of Kubernetes to which the nodes in the node pool should be upgraded. + KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"` + + // The number of nodes to ensure in each subnet. + QuantityPerSubnet *int `mandatory:"false" json:"quantityPerSubnet"` + + // A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + InitialNodeLabels []KeyValue `mandatory:"false" json:"initialNodeLabels"` + + // The OCIDs of the subnets in which to place nodes for this node pool. + SubnetIds []string `mandatory:"false" json:"subnetIds"` +} + +func (m UpdateNodePoolDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/update_node_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateNodePoolRequest wrapper for the UpdateNodePool operation +type UpdateNodePoolRequest struct { + + // The OCID of the node pool. + NodePoolId *string `mandatory:"true" contributesTo:"path" name:"nodePoolId"` + + // The fields to update in a node pool. + UpdateNodePoolDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateNodePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateNodePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNodePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateNodePoolResponse wrapper for the UpdateNodePool operation +type UpdateNodePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateNodePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNodePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestError Errors related to a specific work request. +type WorkRequestError struct { + + // A short error code that defines the error, meant for programmatic parsing. See API Errors (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // A human-readable error string. + Message *string `mandatory:"true" json:"message"` + + // The date and time the error occurred. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequest An asynchronous work request. +type WorkRequest struct { + + // The OCID of the work request. + Id *string `mandatory:"false" json:"id"` + + // The type of work the work request is doing. + OperationType WorkRequestOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // The current status of the work request. + Status WorkRequestStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The OCID of the compartment in which the work request exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The resources this work request affects. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The time the work request was accepted. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // The time the work request was started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The time the work request was finished. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// WorkRequestOperationTypeEnum Enum with underlying type: string +type WorkRequestOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestOperationTypeEnum +const ( + WorkRequestOperationTypeClusterCreate WorkRequestOperationTypeEnum = "CLUSTER_CREATE" + WorkRequestOperationTypeClusterUpdate WorkRequestOperationTypeEnum = "CLUSTER_UPDATE" + WorkRequestOperationTypeClusterDelete WorkRequestOperationTypeEnum = "CLUSTER_DELETE" + WorkRequestOperationTypeNodepoolCreate WorkRequestOperationTypeEnum = "NODEPOOL_CREATE" + WorkRequestOperationTypeNodepoolUpdate WorkRequestOperationTypeEnum = "NODEPOOL_UPDATE" + WorkRequestOperationTypeNodepoolDelete WorkRequestOperationTypeEnum = "NODEPOOL_DELETE" + WorkRequestOperationTypeWorkrequestCancel WorkRequestOperationTypeEnum = "WORKREQUEST_CANCEL" +) + +var mappingWorkRequestOperationType = map[string]WorkRequestOperationTypeEnum{ + "CLUSTER_CREATE": WorkRequestOperationTypeClusterCreate, + "CLUSTER_UPDATE": WorkRequestOperationTypeClusterUpdate, + "CLUSTER_DELETE": WorkRequestOperationTypeClusterDelete, + "NODEPOOL_CREATE": WorkRequestOperationTypeNodepoolCreate, + "NODEPOOL_UPDATE": WorkRequestOperationTypeNodepoolUpdate, + "NODEPOOL_DELETE": WorkRequestOperationTypeNodepoolDelete, + "WORKREQUEST_CANCEL": WorkRequestOperationTypeWorkrequestCancel, +} + +// GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum { + values := make([]WorkRequestOperationTypeEnum, 0) + for _, v := range mappingWorkRequestOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestStatusEnum Enum with underlying type: string +type WorkRequestStatusEnum string + +// Set of constants representing the allowable values for WorkRequestStatusEnum +const ( + WorkRequestStatusAccepted WorkRequestStatusEnum = "ACCEPTED" + WorkRequestStatusInProgress WorkRequestStatusEnum = "IN_PROGRESS" + WorkRequestStatusFailed WorkRequestStatusEnum = "FAILED" + WorkRequestStatusSucceeded WorkRequestStatusEnum = "SUCCEEDED" + WorkRequestStatusCanceling WorkRequestStatusEnum = "CANCELING" + WorkRequestStatusCanceled WorkRequestStatusEnum = "CANCELED" +) + +var mappingWorkRequestStatus = map[string]WorkRequestStatusEnum{ + "ACCEPTED": WorkRequestStatusAccepted, + "IN_PROGRESS": WorkRequestStatusInProgress, + "FAILED": WorkRequestStatusFailed, + "SUCCEEDED": WorkRequestStatusSucceeded, + "CANCELING": WorkRequestStatusCanceling, + "CANCELED": WorkRequestStatusCanceled, +} + +// GetWorkRequestStatusEnumValues Enumerates the set of values for WorkRequestStatusEnum +func GetWorkRequestStatusEnumValues() []WorkRequestStatusEnum { + values := make([]WorkRequestStatusEnum, 0) + for _, v := range mappingWorkRequestStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_log_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_log_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_log_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_log_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestLogEntry Log entries related to a specific work request. +type WorkRequestLogEntry struct { + + // The description of an action that occurred. + Message *string `mandatory:"false" json:"message"` + + // The date and time the log entry occurred. + Timestamp *string `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_operation_type.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_operation_type.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_operation_type.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_operation_type.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestOperationType The types of work request operations. +type WorkRequestOperationType struct { +} + +func (m WorkRequestOperationType) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestResource The properties that define a work request resource. +type WorkRequestResource struct { + + // The way in which this resource was affected by the work tracked by the work request. + ActionType WorkRequestResourceActionTypeEnum `mandatory:"false" json:"actionType,omitempty"` + + // The resource type the work request affects. + EntityType *string `mandatory:"false" json:"entityType"` + + // The OCID of the resource the work request affects. + Identifier *string `mandatory:"false" json:"identifier"` + + // The URI path on which the user can issue a GET request to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// WorkRequestResourceActionTypeEnum Enum with underlying type: string +type WorkRequestResourceActionTypeEnum string + +// Set of constants representing the allowable values for WorkRequestResourceActionTypeEnum +const ( + WorkRequestResourceActionTypeCreated WorkRequestResourceActionTypeEnum = "CREATED" + WorkRequestResourceActionTypeUpdated WorkRequestResourceActionTypeEnum = "UPDATED" + WorkRequestResourceActionTypeDeleted WorkRequestResourceActionTypeEnum = "DELETED" + WorkRequestResourceActionTypeRelated WorkRequestResourceActionTypeEnum = "RELATED" + WorkRequestResourceActionTypeInProgress WorkRequestResourceActionTypeEnum = "IN_PROGRESS" + WorkRequestResourceActionTypeFailed WorkRequestResourceActionTypeEnum = "FAILED" +) + +var mappingWorkRequestResourceActionType = map[string]WorkRequestResourceActionTypeEnum{ + "CREATED": WorkRequestResourceActionTypeCreated, + "UPDATED": WorkRequestResourceActionTypeUpdated, + "DELETED": WorkRequestResourceActionTypeDeleted, + "RELATED": WorkRequestResourceActionTypeRelated, + "IN_PROGRESS": WorkRequestResourceActionTypeInProgress, + "FAILED": WorkRequestResourceActionTypeFailed, +} + +// GetWorkRequestResourceActionTypeEnumValues Enumerates the set of values for WorkRequestResourceActionTypeEnum +func GetWorkRequestResourceActionTypeEnumValues() []WorkRequestResourceActionTypeEnum { + values := make([]WorkRequestResourceActionTypeEnum, 0) + for _, v := range mappingWorkRequestResourceActionType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_status.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_status.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_status.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_status.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestStatus The status of a work request. +type WorkRequestStatus struct { +} + +func (m WorkRequestStatus) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/containerengine/work_request_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestSummary The properties that define a work request summary. +type WorkRequestSummary struct { + + // The OCID of the work request. + Id *string `mandatory:"false" json:"id"` + + // The type of work the work request is doing. + OperationType WorkRequestSummaryOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // The current status of the work request. + Status WorkRequestSummaryStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The OCID of the compartment in which the work request exists. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The resources this work request affects. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The time the work request was accepted. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // The time the work request was started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The time the work request was finished. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// WorkRequestSummaryOperationTypeEnum Enum with underlying type: string +type WorkRequestSummaryOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryOperationTypeEnum +const ( + WorkRequestSummaryOperationTypeClusterCreate WorkRequestSummaryOperationTypeEnum = "CLUSTER_CREATE" + WorkRequestSummaryOperationTypeClusterUpdate WorkRequestSummaryOperationTypeEnum = "CLUSTER_UPDATE" + WorkRequestSummaryOperationTypeClusterDelete WorkRequestSummaryOperationTypeEnum = "CLUSTER_DELETE" + WorkRequestSummaryOperationTypeNodepoolCreate WorkRequestSummaryOperationTypeEnum = "NODEPOOL_CREATE" + WorkRequestSummaryOperationTypeNodepoolUpdate WorkRequestSummaryOperationTypeEnum = "NODEPOOL_UPDATE" + WorkRequestSummaryOperationTypeNodepoolDelete WorkRequestSummaryOperationTypeEnum = "NODEPOOL_DELETE" + WorkRequestSummaryOperationTypeWorkrequestCancel WorkRequestSummaryOperationTypeEnum = "WORKREQUEST_CANCEL" +) + +var mappingWorkRequestSummaryOperationType = map[string]WorkRequestSummaryOperationTypeEnum{ + "CLUSTER_CREATE": WorkRequestSummaryOperationTypeClusterCreate, + "CLUSTER_UPDATE": WorkRequestSummaryOperationTypeClusterUpdate, + "CLUSTER_DELETE": WorkRequestSummaryOperationTypeClusterDelete, + "NODEPOOL_CREATE": WorkRequestSummaryOperationTypeNodepoolCreate, + "NODEPOOL_UPDATE": WorkRequestSummaryOperationTypeNodepoolUpdate, + "NODEPOOL_DELETE": WorkRequestSummaryOperationTypeNodepoolDelete, + "WORKREQUEST_CANCEL": WorkRequestSummaryOperationTypeWorkrequestCancel, +} + +// GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum +func GetWorkRequestSummaryOperationTypeEnumValues() []WorkRequestSummaryOperationTypeEnum { + values := make([]WorkRequestSummaryOperationTypeEnum, 0) + for _, v := range mappingWorkRequestSummaryOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestSummaryStatusEnum Enum with underlying type: string +type WorkRequestSummaryStatusEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryStatusEnum +const ( + WorkRequestSummaryStatusAccepted WorkRequestSummaryStatusEnum = "ACCEPTED" + WorkRequestSummaryStatusInProgress WorkRequestSummaryStatusEnum = "IN_PROGRESS" + WorkRequestSummaryStatusFailed WorkRequestSummaryStatusEnum = "FAILED" + WorkRequestSummaryStatusSucceeded WorkRequestSummaryStatusEnum = "SUCCEEDED" + WorkRequestSummaryStatusCanceling WorkRequestSummaryStatusEnum = "CANCELING" + WorkRequestSummaryStatusCanceled WorkRequestSummaryStatusEnum = "CANCELED" +) + +var mappingWorkRequestSummaryStatus = map[string]WorkRequestSummaryStatusEnum{ + "ACCEPTED": WorkRequestSummaryStatusAccepted, + "IN_PROGRESS": WorkRequestSummaryStatusInProgress, + "FAILED": WorkRequestSummaryStatusFailed, + "SUCCEEDED": WorkRequestSummaryStatusSucceeded, + "CANCELING": WorkRequestSummaryStatusCanceling, + "CANCELED": WorkRequestSummaryStatusCanceled, +} + +// GetWorkRequestSummaryStatusEnumValues Enumerates the set of values for WorkRequestSummaryStatusEnum +func GetWorkRequestSummaryStatusEnumValues() []WorkRequestSummaryStatusEnum { + values := make([]WorkRequestSummaryStatusEnum, 0) + for _, v := range mappingWorkRequestSummaryStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogListing Listing details. +type AppCatalogListing struct { + + // Listing's contact URL. + ContactUrl *string `mandatory:"false" json:"contactUrl"` + + // Description of the listing. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the listing. + ListingId *string `mandatory:"false" json:"listingId"` + + // Name of the listing. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Date and time the listing was published, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` + + // Publisher's logo URL. + PublisherLogoUrl *string `mandatory:"false" json:"publisherLogoUrl"` + + // Name of the publisher who published this listing. + PublisherName *string `mandatory:"false" json:"publisherName"` + + // Summary of the listing. + Summary *string `mandatory:"false" json:"summary"` +} + +func (m AppCatalogListing) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_agreements.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_agreements.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_agreements.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_agreements.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogListingResourceVersionAgreements Agreements for a listing resource version. +type AppCatalogListingResourceVersionAgreements struct { + + // The OCID of the listing associated with these agreements. + ListingId *string `mandatory:"false" json:"listingId"` + + // Listing resource version associated with these agreements. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` + + // Oracle TOU link + OracleTermsOfUseLink *string `mandatory:"false" json:"oracleTermsOfUseLink"` + + // EULA link + EulaLink *string `mandatory:"false" json:"eulaLink"` + + // Date and time the agreements were retrieved, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimeRetrieved *common.SDKTime `mandatory:"false" json:"timeRetrieved"` + + // A generated signature for this agreement retrieval operation which should be used in the create subscription call. + Signature *string `mandatory:"false" json:"signature"` +} + +func (m AppCatalogListingResourceVersionAgreements) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogListingResourceVersion Listing Resource Version +type AppCatalogListingResourceVersion struct { + + // The OCID of the listing this resource version belongs to. + ListingId *string `mandatory:"false" json:"listingId"` + + // Date and time the listing resource version was published, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` + + // OCID of the listing resource. + ListingResourceId *string `mandatory:"false" json:"listingResourceId"` + + // Resource Version. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` + + // List of regions that this listing resource version is available. + // For information about Regions, see + // Regions (https://docs.cloud.oracle.comGeneral/Concepts/regions.htm). + // Example: `["us-ashburn-1", "us-phoenix-1"]` + AvailableRegions []string `mandatory:"false" json:"availableRegions"` + + // Array of shapes compatible with this resource. + // You may enumerate all available shapes by calling listShapes. + // Example: `["VM.Standard1.1", "VM.Standard1.2"]` + CompatibleShapes []string `mandatory:"false" json:"compatibleShapes"` + + // List of accessible ports for instances launched with this listing resource version. + AccessiblePorts []int `mandatory:"false" json:"accessiblePorts"` + + // Allowed actions for the listing resource. + AllowedActions []AppCatalogListingResourceVersionAllowedActionsEnum `mandatory:"false" json:"allowedActions,omitempty"` +} + +func (m AppCatalogListingResourceVersion) String() string { + return common.PointerString(m) +} + +// AppCatalogListingResourceVersionAllowedActionsEnum Enum with underlying type: string +type AppCatalogListingResourceVersionAllowedActionsEnum string + +// Set of constants representing the allowable values for AppCatalogListingResourceVersionAllowedActionsEnum +const ( + AppCatalogListingResourceVersionAllowedActionsSnapshot AppCatalogListingResourceVersionAllowedActionsEnum = "SNAPSHOT" + AppCatalogListingResourceVersionAllowedActionsBootVolumeDetach AppCatalogListingResourceVersionAllowedActionsEnum = "BOOT_VOLUME_DETACH" + AppCatalogListingResourceVersionAllowedActionsPreserveBootVolume AppCatalogListingResourceVersionAllowedActionsEnum = "PRESERVE_BOOT_VOLUME" + AppCatalogListingResourceVersionAllowedActionsSerialConsoleAccess AppCatalogListingResourceVersionAllowedActionsEnum = "SERIAL_CONSOLE_ACCESS" + AppCatalogListingResourceVersionAllowedActionsBootRecovery AppCatalogListingResourceVersionAllowedActionsEnum = "BOOT_RECOVERY" + AppCatalogListingResourceVersionAllowedActionsBackupBootVolume AppCatalogListingResourceVersionAllowedActionsEnum = "BACKUP_BOOT_VOLUME" + AppCatalogListingResourceVersionAllowedActionsCaptureConsoleHistory AppCatalogListingResourceVersionAllowedActionsEnum = "CAPTURE_CONSOLE_HISTORY" +) + +var mappingAppCatalogListingResourceVersionAllowedActions = map[string]AppCatalogListingResourceVersionAllowedActionsEnum{ + "SNAPSHOT": AppCatalogListingResourceVersionAllowedActionsSnapshot, + "BOOT_VOLUME_DETACH": AppCatalogListingResourceVersionAllowedActionsBootVolumeDetach, + "PRESERVE_BOOT_VOLUME": AppCatalogListingResourceVersionAllowedActionsPreserveBootVolume, + "SERIAL_CONSOLE_ACCESS": AppCatalogListingResourceVersionAllowedActionsSerialConsoleAccess, + "BOOT_RECOVERY": AppCatalogListingResourceVersionAllowedActionsBootRecovery, + "BACKUP_BOOT_VOLUME": AppCatalogListingResourceVersionAllowedActionsBackupBootVolume, + "CAPTURE_CONSOLE_HISTORY": AppCatalogListingResourceVersionAllowedActionsCaptureConsoleHistory, +} + +// GetAppCatalogListingResourceVersionAllowedActionsEnumValues Enumerates the set of values for AppCatalogListingResourceVersionAllowedActionsEnum +func GetAppCatalogListingResourceVersionAllowedActionsEnumValues() []AppCatalogListingResourceVersionAllowedActionsEnum { + values := make([]AppCatalogListingResourceVersionAllowedActionsEnum, 0) + for _, v := range mappingAppCatalogListingResourceVersionAllowedActions { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogListingResourceVersionSummary Listing Resource Version summary +type AppCatalogListingResourceVersionSummary struct { + + // The OCID of the listing this resource version belongs to. + ListingId *string `mandatory:"false" json:"listingId"` + + // Date and time the listing resource version was published, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` + + // OCID of the listing resource. + ListingResourceId *string `mandatory:"false" json:"listingResourceId"` + + // Resource Version. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` +} + +func (m AppCatalogListingResourceVersionSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogListingSummary A summary of a listing. +type AppCatalogListingSummary struct { + + // the region free ocid of the listing resource. + ListingId *string `mandatory:"false" json:"listingId"` + + // The display name of the listing. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The short summary for the listing. + Summary *string `mandatory:"false" json:"summary"` + + // The name of the publisher who published this listing. + PublisherName *string `mandatory:"false" json:"publisherName"` +} + +func (m AppCatalogListingSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogSubscription a subscription for a listing resource version. +type AppCatalogSubscription struct { + + // Name of the publisher who published this listing. + PublisherName *string `mandatory:"false" json:"publisherName"` + + // The ocid of the listing resource. + ListingId *string `mandatory:"false" json:"listingId"` + + // Listing resource version. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` + + // Listing resource id. + ListingResourceId *string `mandatory:"false" json:"listingResourceId"` + + // The display name of the listing. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The short summary to the listing. + Summary *string `mandatory:"false" json:"summary"` + + // The compartmentID of the subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Date and time at which the subscription was created, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m AppCatalogSubscription) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AppCatalogSubscriptionSummary a subscription summary for a listing resource version. +type AppCatalogSubscriptionSummary struct { + + // Name of the publisher who published this listing. + PublisherName *string `mandatory:"false" json:"publisherName"` + + // The ocid of the listing resource. + ListingId *string `mandatory:"false" json:"listingId"` + + // Listing resource version. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` + + // Listing resource id. + ListingResourceId *string `mandatory:"false" json:"listingResourceId"` + + // The display name of the listing. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The short summary to the listing. + Summary *string `mandatory:"false" json:"summary"` + + // The compartmentID of the subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Date and time at which the subscription was created, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m AppCatalogSubscriptionSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request AttachBootVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request AttachBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // AttachBootVolumeResponse wrapper for the AttachBootVolume operation type AttachBootVolumeResponse struct { @@ -46,3 +64,8 @@ func (response AttachBootVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response AttachBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_i_scsi_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_i_scsi_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_i_scsi_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_i_scsi_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,6 +26,9 @@ // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` + // The device name. + Device *string `mandatory:"false" json:"device"` + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -32,6 +39,11 @@ UseChap *bool `mandatory:"false" json:"useChap"` } +//GetDevice returns Device +func (m AttachIScsiVolumeDetails) GetDevice() *string { + return m.Device +} + //GetDisplayName returns DisplayName func (m AttachIScsiVolumeDetails) GetDisplayName() *string { return m.DisplayName diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AttachLoadBalancerDetails Represents a load balancer that is to be attached to an instance pool. +type AttachLoadBalancerDetails struct { + + // The OCID of the load balancer to attach to the instance pool. + LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` + + // The name of the backend set on the load balancer to add instances to. + BackendSetName *string `mandatory:"true" json:"backendSetName"` + + // The port value to use when creating the backend set. + Port *int `mandatory:"true" json:"port"` + + // Indicates which VNIC on each instance in the pool should be used to associate with the load balancer. Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration that is associated with the instance pool. + VnicSelection *string `mandatory:"true" json:"vnicSelection"` +} + +func (m AttachLoadBalancerDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// AttachLoadBalancerRequest wrapper for the AttachLoadBalancer operation +type AttachLoadBalancerRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // Load balancer being attached + AttachLoadBalancerDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AttachLoadBalancerRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// AttachLoadBalancerResponse wrapper for the AttachLoadBalancer operation +type AttachLoadBalancerResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response AttachLoadBalancerResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_paravirtualized_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_paravirtualized_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_paravirtualized_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_paravirtualized_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,11 +26,22 @@ // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` + // The device name. + Device *string `mandatory:"false" json:"device"` + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + + // Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` +} + +//GetDevice returns Device +func (m AttachParavirtualizedVolumeDetails) GetDevice() *string { + return m.Device } //GetDisplayName returns DisplayName diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_service_id_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_service_id_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_service_id_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_service_id_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// AttachServiceIdRequest wrapper for the AttachServiceId operation +type AttachServiceIdRequest struct { + + // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` + + // ServiceId of Service to be attached to a service gateway. + AttachServiceDetails ServiceIdRequestDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AttachServiceIdRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachServiceIdRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachServiceIdRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// AttachServiceIdResponse wrapper for the AttachServiceId operation +type AttachServiceIdResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceGateway instance + ServiceGateway `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response AttachServiceIdResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachServiceIdResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -28,7 +32,7 @@ // Certain bare metal instance shapes have two active physical NICs (0 and 1). If // you add a secondary VNIC to one of these instances, you can specify which NIC // the VNIC will use. For more information, see - // Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). + // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). NicIndex *int `mandatory:"false" json:"nicIndex"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request AttachVnicRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request AttachVnicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachVnicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // AttachVnicResponse wrapper for the AttachVnic operation type AttachVnicResponse struct { @@ -46,3 +64,8 @@ func (response AttachVnicResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response AttachVnicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,6 +26,9 @@ // The OCID of the volume. GetVolumeId() *string + // The device name. + GetDevice() *string + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. GetDisplayName() *string @@ -33,6 +40,7 @@ JsonData []byte InstanceId *string `mandatory:"true" json:"instanceId"` VolumeId *string `mandatory:"true" json:"volumeId"` + Device *string `mandatory:"false" json:"device"` DisplayName *string `mandatory:"false" json:"displayName"` IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` Type string `json:"type"` @@ -51,6 +59,7 @@ } m.InstanceId = s.Model.InstanceId m.VolumeId = s.Model.VolumeId + m.Device = s.Model.Device m.DisplayName = s.Model.DisplayName m.IsReadOnly = s.Model.IsReadOnly m.Type = s.Model.Type @@ -60,6 +69,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *attachvolumedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Type { case "iscsi": @@ -71,7 +85,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -85,6 +99,11 @@ return m.VolumeId } +//GetDevice returns Device +func (m attachvolumedetails) GetDevice() *string { + return m.Device +} + //GetDisplayName returns DisplayName func (m attachvolumedetails) GetDisplayName() *string { return m.DisplayName diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request AttachVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request AttachVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // AttachVolumeResponse wrapper for the AttachVolume operation type AttachVolumeResponse struct { @@ -46,3 +64,8 @@ func (response AttachVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response AttachVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bgp_session_info.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bgp_session_info.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bgp_session_info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bgp_session_info.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BgpSessionInfo Information for establishing a BGP session for the IPSec tunnel. +type BgpSessionInfo struct { + + // The IP address for the Oracle end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this IP address + // is required and used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP + // address so you can troubleshoot or monitor the tunnel. + // The value must be a /30 or /31. + // Example: `10.0.0.4/31` + OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` + + // The IP address for the CPE end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this IP address + // is required and used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP + // address so you can troubleshoot or monitor the tunnel. + // The value must be a /30 or /31. + // Example: `10.0.0.5/31` + CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` + + // The Oracle BGP ASN. + OracleBgpAsn *string `mandatory:"false" json:"oracleBgpAsn"` + + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this ASN + // is required and used for the tunnel's BGP session. This is the ASN of the network on the + // CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. Uses "asplain" format. + // If the tunnel uses static routing, the `customerBgpAsn` must be null. + // Example: `12345` (2-byte) or `1587232876` (4-byte) + CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` + + // The state of the BGP session. + BgpState BgpSessionInfoBgpStateEnum `mandatory:"false" json:"bgpState,omitempty"` +} + +func (m BgpSessionInfo) String() string { + return common.PointerString(m) +} + +// BgpSessionInfoBgpStateEnum Enum with underlying type: string +type BgpSessionInfoBgpStateEnum string + +// Set of constants representing the allowable values for BgpSessionInfoBgpStateEnum +const ( + BgpSessionInfoBgpStateUp BgpSessionInfoBgpStateEnum = "UP" + BgpSessionInfoBgpStateDown BgpSessionInfoBgpStateEnum = "DOWN" +) + +var mappingBgpSessionInfoBgpState = map[string]BgpSessionInfoBgpStateEnum{ + "UP": BgpSessionInfoBgpStateUp, + "DOWN": BgpSessionInfoBgpStateDown, +} + +// GetBgpSessionInfoBgpStateEnumValues Enumerates the set of values for BgpSessionInfoBgpStateEnum +func GetBgpSessionInfoBgpStateEnumValues() []BgpSessionInfoBgpStateEnum { + values := make([]BgpSessionInfoBgpStateEnum, 0) + for _, v := range mappingBgpSessionInfoBgpState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,9 +17,11 @@ ) // BootVolumeAttachment Represents an attachment between a boot volume and an instance. +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type BootVolumeAttachment struct { - // The Availability Domain of an instance. + // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -42,6 +48,9 @@ // Avoid entering confidential information. // Example: `My boot volume` DisplayName *string `mandatory:"false" json:"displayName"` + + // Whether in-transit encryption for the boot volume's paravirtualized attachment is enabled or not. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` } func (m BootVolumeAttachment) String() string { @@ -51,7 +60,7 @@ // BootVolumeAttachmentLifecycleStateEnum Enum with underlying type: string type BootVolumeAttachmentLifecycleStateEnum string -// Set of constants representing the allowable values for BootVolumeAttachmentLifecycleState +// Set of constants representing the allowable values for BootVolumeAttachmentLifecycleStateEnum const ( BootVolumeAttachmentLifecycleStateAttaching BootVolumeAttachmentLifecycleStateEnum = "ATTACHING" BootVolumeAttachmentLifecycleStateAttached BootVolumeAttachmentLifecycleStateEnum = "ATTACHED" @@ -66,7 +75,7 @@ "DETACHED": BootVolumeAttachmentLifecycleStateDetached, } -// GetBootVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for BootVolumeAttachmentLifecycleState +// GetBootVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for BootVolumeAttachmentLifecycleStateEnum func GetBootVolumeAttachmentLifecycleStateEnumValues() []BootVolumeAttachmentLifecycleStateEnum { values := make([]BootVolumeAttachmentLifecycleStateEnum, 0) for _, v := range mappingBootVolumeAttachmentLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_backup.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,167 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BootVolumeBackup A point-in-time copy of a boot volume that can then be used to create +// a new boot volume or recover a boot volume. For more information, see Overview +// of Boot Volume Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumebackups.htm) +// To use any of the API operations, you must be authorized in an IAM policy. +// If you're not authorized, talk to an administrator. If you're an administrator +// who needs to write policies to give users access, see Getting Started with +// Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. +type BootVolumeBackup struct { + + // The OCID of the compartment that contains the boot volume backup. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the boot volume backup. + Id *string `mandatory:"true" json:"id"` + + // The current state of a boot volume backup. + LifecycleState BootVolumeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the boot volume backup was created. This is the time the actual point-in-time image + // of the volume data was taken. Format defined by RFC3339. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID of the boot volume. + BootVolumeId *string `mandatory:"false" json:"bootVolumeId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The date and time the volume backup will expire and be automatically deleted. + // Format defined by RFC3339. This parameter will always be present for backups that + // were created automatically by a scheduled-backup policy. For manually created backups, + // it will be absent, signifying that there is no expiration time and the backup will + // last forever until manually deleted. + ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The image OCID used to create the boot volume the backup is taken from. + ImageId *string `mandatory:"false" json:"imageId"` + + // The size of the boot volume, in GBs. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` + + // Specifies whether the backup was created manually, or via scheduled backup policy. + SourceType BootVolumeBackupSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // The date and time the request to create the boot volume backup was received. Format defined by RFC3339. + TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` + + // The type of a volume backup. + Type BootVolumeBackupTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The size used by the backup, in GBs. It is typically smaller than sizeInGBs, depending on the space + // consumed on the boot volume and whether the backup is full or incremental. + UniqueSizeInGBs *int64 `mandatory:"false" json:"uniqueSizeInGBs"` +} + +func (m BootVolumeBackup) String() string { + return common.PointerString(m) +} + +// BootVolumeBackupLifecycleStateEnum Enum with underlying type: string +type BootVolumeBackupLifecycleStateEnum string + +// Set of constants representing the allowable values for BootVolumeBackupLifecycleStateEnum +const ( + BootVolumeBackupLifecycleStateCreating BootVolumeBackupLifecycleStateEnum = "CREATING" + BootVolumeBackupLifecycleStateAvailable BootVolumeBackupLifecycleStateEnum = "AVAILABLE" + BootVolumeBackupLifecycleStateTerminating BootVolumeBackupLifecycleStateEnum = "TERMINATING" + BootVolumeBackupLifecycleStateTerminated BootVolumeBackupLifecycleStateEnum = "TERMINATED" + BootVolumeBackupLifecycleStateFaulty BootVolumeBackupLifecycleStateEnum = "FAULTY" + BootVolumeBackupLifecycleStateRequestReceived BootVolumeBackupLifecycleStateEnum = "REQUEST_RECEIVED" +) + +var mappingBootVolumeBackupLifecycleState = map[string]BootVolumeBackupLifecycleStateEnum{ + "CREATING": BootVolumeBackupLifecycleStateCreating, + "AVAILABLE": BootVolumeBackupLifecycleStateAvailable, + "TERMINATING": BootVolumeBackupLifecycleStateTerminating, + "TERMINATED": BootVolumeBackupLifecycleStateTerminated, + "FAULTY": BootVolumeBackupLifecycleStateFaulty, + "REQUEST_RECEIVED": BootVolumeBackupLifecycleStateRequestReceived, +} + +// GetBootVolumeBackupLifecycleStateEnumValues Enumerates the set of values for BootVolumeBackupLifecycleStateEnum +func GetBootVolumeBackupLifecycleStateEnumValues() []BootVolumeBackupLifecycleStateEnum { + values := make([]BootVolumeBackupLifecycleStateEnum, 0) + for _, v := range mappingBootVolumeBackupLifecycleState { + values = append(values, v) + } + return values +} + +// BootVolumeBackupSourceTypeEnum Enum with underlying type: string +type BootVolumeBackupSourceTypeEnum string + +// Set of constants representing the allowable values for BootVolumeBackupSourceTypeEnum +const ( + BootVolumeBackupSourceTypeManual BootVolumeBackupSourceTypeEnum = "MANUAL" + BootVolumeBackupSourceTypeScheduled BootVolumeBackupSourceTypeEnum = "SCHEDULED" +) + +var mappingBootVolumeBackupSourceType = map[string]BootVolumeBackupSourceTypeEnum{ + "MANUAL": BootVolumeBackupSourceTypeManual, + "SCHEDULED": BootVolumeBackupSourceTypeScheduled, +} + +// GetBootVolumeBackupSourceTypeEnumValues Enumerates the set of values for BootVolumeBackupSourceTypeEnum +func GetBootVolumeBackupSourceTypeEnumValues() []BootVolumeBackupSourceTypeEnum { + values := make([]BootVolumeBackupSourceTypeEnum, 0) + for _, v := range mappingBootVolumeBackupSourceType { + values = append(values, v) + } + return values +} + +// BootVolumeBackupTypeEnum Enum with underlying type: string +type BootVolumeBackupTypeEnum string + +// Set of constants representing the allowable values for BootVolumeBackupTypeEnum +const ( + BootVolumeBackupTypeFull BootVolumeBackupTypeEnum = "FULL" + BootVolumeBackupTypeIncremental BootVolumeBackupTypeEnum = "INCREMENTAL" +) + +var mappingBootVolumeBackupType = map[string]BootVolumeBackupTypeEnum{ + "FULL": BootVolumeBackupTypeFull, + "INCREMENTAL": BootVolumeBackupTypeIncremental, +} + +// GetBootVolumeBackupTypeEnumValues Enumerates the set of values for BootVolumeBackupTypeEnum +func GetBootVolumeBackupTypeEnumValues() []BootVolumeBackupTypeEnum { + values := make([]BootVolumeBackupTypeEnum, 0) + for _, v := range mappingBootVolumeBackupType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,25 +1,32 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core import ( + "encoding/json" "github.com/oracle/oci-go-sdk/common" ) -// BootVolume A detachable boot volume device that contains the image used to boot an Compute instance. For more information, see -// Overview of Boot Volumes (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/bootvolumes.htm). +// BootVolume A detachable boot volume device that contains the image used to boot a Compute instance. For more information, see +// Overview of Boot Volumes (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumes.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type BootVolume struct { - // The Availability Domain of the boot volume. + // The availability domain of the boot volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -34,30 +41,104 @@ // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Please use sizeInGBs. - SizeInMBs *int `mandatory:"true" json:"sizeInMBs"` + SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` // The date and time the boot volume was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The image OCID used to create the boot volume. ImageId *string `mandatory:"false" json:"imageId"` + // Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup. + IsHydrated *bool `mandatory:"false" json:"isHydrated"` + // The size of the boot volume in GBs. - SizeInGBs *int `mandatory:"false" json:"sizeInGBs"` + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` + + // The boot volume source, either an existing boot volume in the same availability domain or a boot volume backup. + // If null, this means that the boot volume was created from an image. + SourceDetails BootVolumeSourceDetails `mandatory:"false" json:"sourceDetails"` + + // The OCID of the source volume group. + VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` + + // The OCID of the KMS key which is the master encryption key for the boot volume. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m BootVolume) String() string { return common.PointerString(m) } +// UnmarshalJSON unmarshals from json +func (m *BootVolume) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + ImageId *string `json:"imageId"` + IsHydrated *bool `json:"isHydrated"` + SizeInGBs *int64 `json:"sizeInGBs"` + SourceDetails bootvolumesourcedetails `json:"sourceDetails"` + VolumeGroupId *string `json:"volumeGroupId"` + KmsKeyId *string `json:"kmsKeyId"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + Id *string `json:"id"` + LifecycleState BootVolumeLifecycleStateEnum `json:"lifecycleState"` + SizeInMBs *int64 `json:"sizeInMBs"` + TimeCreated *common.SDKTime `json:"timeCreated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.ImageId = model.ImageId + m.IsHydrated = model.IsHydrated + m.SizeInGBs = model.SizeInGBs + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(BootVolumeSourceDetails) + } else { + m.SourceDetails = nil + } + m.VolumeGroupId = model.VolumeGroupId + m.KmsKeyId = model.KmsKeyId + m.AvailabilityDomain = model.AvailabilityDomain + m.CompartmentId = model.CompartmentId + m.Id = model.Id + m.LifecycleState = model.LifecycleState + m.SizeInMBs = model.SizeInMBs + m.TimeCreated = model.TimeCreated + return +} + // BootVolumeLifecycleStateEnum Enum with underlying type: string type BootVolumeLifecycleStateEnum string -// Set of constants representing the allowable values for BootVolumeLifecycleState +// Set of constants representing the allowable values for BootVolumeLifecycleStateEnum const ( BootVolumeLifecycleStateProvisioning BootVolumeLifecycleStateEnum = "PROVISIONING" BootVolumeLifecycleStateRestoring BootVolumeLifecycleStateEnum = "RESTORING" @@ -76,7 +157,7 @@ "FAULTY": BootVolumeLifecycleStateFaulty, } -// GetBootVolumeLifecycleStateEnumValues Enumerates the set of values for BootVolumeLifecycleState +// GetBootVolumeLifecycleStateEnumValues Enumerates the set of values for BootVolumeLifecycleStateEnum func GetBootVolumeLifecycleStateEnumValues() []BootVolumeLifecycleStateEnum { values := make([]BootVolumeLifecycleStateEnum, 0) for _, v := range mappingBootVolumeLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_kms_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_kms_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_kms_key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_kms_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BootVolumeKmsKey Kms key id associated with this volume. +type BootVolumeKmsKey struct { + + // The OCID of the KMS key associated with this volume. If volume is not using KMS, then the `kmsKeyId` will be a null string. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` +} + +func (m BootVolumeKmsKey) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// BootVolumeSourceDetails The representation of BootVolumeSourceDetails +type BootVolumeSourceDetails interface { +} + +type bootvolumesourcedetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *bootvolumesourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerbootvolumesourcedetails bootvolumesourcedetails + s := struct { + Model Unmarshalerbootvolumesourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *bootvolumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "bootVolumeBackup": + mm := BootVolumeSourceFromBootVolumeBackupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "bootVolume": + mm := BootVolumeSourceFromBootVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m bootvolumesourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// BootVolumeSourceFromBootVolumeBackupDetails Specifies the boot volume backup. +type BootVolumeSourceFromBootVolumeBackupDetails struct { + + // The OCID of the boot volume backup. + Id *string `mandatory:"true" json:"id"` +} + +func (m BootVolumeSourceFromBootVolumeBackupDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m BootVolumeSourceFromBootVolumeBackupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails BootVolumeSourceFromBootVolumeBackupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails + }{ + "bootVolumeBackup", + (MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_from_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// BootVolumeSourceFromBootVolumeDetails Specifies the source boot volume. +type BootVolumeSourceFromBootVolumeDetails struct { + + // The OCID of the boot volume. + Id *string `mandatory:"true" json:"id"` +} + +func (m BootVolumeSourceFromBootVolumeDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m BootVolumeSourceFromBootVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBootVolumeSourceFromBootVolumeDetails BootVolumeSourceFromBootVolumeDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeBootVolumeSourceFromBootVolumeDetails + }{ + "bootVolume", + (MarshalTypeBootVolumeSourceFromBootVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_add_virtual_circuit_public_prefixes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -16,12 +16,30 @@ // Request with publix prefixes to be added to the virtual circuit BulkAddVirtualCircuitPublicPrefixesDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request BulkAddVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request BulkAddVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkAddVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // BulkAddVirtualCircuitPublicPrefixesResponse wrapper for the BulkAddVirtualCircuitPublicPrefixes operation type BulkAddVirtualCircuitPublicPrefixesResponse struct { @@ -32,3 +50,8 @@ func (response BulkAddVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response BulkAddVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/bulk_delete_virtual_circuit_public_prefixes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -16,12 +16,30 @@ // Request with publix prefixes to be deleted from the virtual circuit BulkDeleteVirtualCircuitPublicPrefixesDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // BulkDeleteVirtualCircuitPublicPrefixesResponse wrapper for the BulkDeleteVirtualCircuitPublicPrefixes operation type BulkDeleteVirtualCircuitPublicPrefixesResponse struct { @@ -32,3 +50,8 @@ func (response BulkDeleteVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response BulkDeleteVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -19,7 +23,7 @@ InstanceId *string `mandatory:"true" json:"instanceId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -28,7 +32,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CaptureConsoleHistoryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CaptureConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CaptureConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CaptureConsoleHistoryResponse wrapper for the CaptureConsoleHistory operation type CaptureConsoleHistoryResponse struct { @@ -46,3 +64,8 @@ func (response CaptureConsoleHistoryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CaptureConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/compute_instance_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/compute_instance_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/compute_instance_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/compute_instance_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ComputeInstanceDetails Compute Instance Configuration instance details. +type ComputeInstanceDetails struct { + BlockVolumes []InstanceConfigurationBlockVolumeDetails `mandatory:"false" json:"blockVolumes"` + + LaunchDetails *InstanceConfigurationLaunchInstanceDetails `mandatory:"false" json:"launchDetails"` + + SecondaryVnics []InstanceConfigurationAttachVnicDetails `mandatory:"false" json:"secondaryVnics"` +} + +func (m ComputeInstanceDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m ComputeInstanceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeComputeInstanceDetails ComputeInstanceDetails + s := struct { + DiscriminatorParam string `json:"instanceType"` + MarshalTypeComputeInstanceDetails + }{ + "compute", + (MarshalTypeComputeInstanceDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -16,12 +16,30 @@ // Details regarding the local peering gateway to connect. ConnectLocalPeeringGatewaysDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ConnectLocalPeeringGatewaysRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ConnectLocalPeeringGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConnectLocalPeeringGatewaysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ConnectLocalPeeringGatewaysResponse wrapper for the ConnectLocalPeeringGateways operation type ConnectLocalPeeringGatewaysResponse struct { @@ -36,3 +54,8 @@ func (response ConnectLocalPeeringGatewaysResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ConnectLocalPeeringGatewaysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/connect_remote_peering_connections_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -16,12 +16,30 @@ // Details to connect peering connection with peering connection from remote region ConnectRemotePeeringConnectionsDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ConnectRemotePeeringConnectionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ConnectRemotePeeringConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConnectRemotePeeringConnectionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ConnectRemotePeeringConnectionsResponse wrapper for the ConnectRemotePeeringConnections operation type ConnectRemotePeeringConnectionsResponse struct { @@ -36,3 +54,8 @@ func (response ConnectRemotePeeringConnectionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ConnectRemotePeeringConnectionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/console_history.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/console_history.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/console_history.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/console_history.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,11 @@ // ConsoleHistory An instance's serial console data. It includes configuration messages that occur when the // instance boots, such as kernel and BIOS messages, and is useful for checking the status of // the instance or diagnosing problems. The console data is minimally formatted ASCII text. +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type ConsoleHistory struct { - // The Availability Domain of an instance. + // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -38,7 +44,7 @@ TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -49,7 +55,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -61,7 +67,7 @@ // ConsoleHistoryLifecycleStateEnum Enum with underlying type: string type ConsoleHistoryLifecycleStateEnum string -// Set of constants representing the allowable values for ConsoleHistoryLifecycleState +// Set of constants representing the allowable values for ConsoleHistoryLifecycleStateEnum const ( ConsoleHistoryLifecycleStateRequested ConsoleHistoryLifecycleStateEnum = "REQUESTED" ConsoleHistoryLifecycleStateGettingHistory ConsoleHistoryLifecycleStateEnum = "GETTING-HISTORY" @@ -76,7 +82,7 @@ "FAILED": ConsoleHistoryLifecycleStateFailed, } -// GetConsoleHistoryLifecycleStateEnumValues Enumerates the set of values for ConsoleHistoryLifecycleState +// GetConsoleHistoryLifecycleStateEnumValues Enumerates the set of values for ConsoleHistoryLifecycleStateEnum func GetConsoleHistoryLifecycleStateEnumValues() []ConsoleHistoryLifecycleStateEnum { values := make([]ConsoleHistoryLifecycleStateEnum, 0) for _, v := range mappingConsoleHistoryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CopyVolumeBackupDetails The representation of CopyVolumeBackupDetails +type CopyVolumeBackupDetails struct { + + // The name of the destination region. + // Example: `us-ashburn-1` + DestinationRegion *string `mandatory:"true" json:"destinationRegion"` + + // A user-friendly name for the volume backup. Does not have to be unique and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CopyVolumeBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CopyVolumeBackupRequest wrapper for the CopyVolumeBackup operation +type CopyVolumeBackupRequest struct { + + // The OCID of the volume backup. + VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` + + // Request to create a cross-region copy of given backup. + CopyVolumeBackupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CopyVolumeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CopyVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CopyVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CopyVolumeBackupResponse wrapper for the CopyVolumeBackup operation +type CopyVolumeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeBackup instance + VolumeBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CopyVolumeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CopyVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_blockstorage_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_blockstorage_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_blockstorage_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_blockstorage_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -37,7 +41,7 @@ // SetRegion overrides the region of this client. func (client *BlockstorageClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "iaas", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +52,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -58,389 +62,1892 @@ return client.config } -// CreateVolume Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from -// 50 GB (51200 MB) to 16 TB (16777216 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB). -// For general information about block volumes, see -// Overview of Block Volume Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm). -// A volume and instance can be in separate compartments but must be in the same Availability Domain. -// For information about access control and compartments, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about -// Availability Domains, see Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). -// To get a list of Availability Domains, use the `ListAvailabilityDomains` operation -// in the Identity and Access Management Service API. -// 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. Avoid entering confidential information. -func (client BlockstorageClient) CreateVolume(ctx context.Context, request CreateVolumeRequest) (response CreateVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/volumes", request) +// CopyVolumeBackup Creates a volume backup copy in specified region. For general information about volume backups, +// see Overview of Block Volume Service Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumebackups.htm) +func (client BlockstorageClient) CopyVolumeBackup(ctx context.Context, request CopyVolumeBackupRequest) (response CopyVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.copyVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = CopyVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CopyVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CopyVolumeBackupResponse") + } + return +} + +// copyVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) copyVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackups/{volumeBackupId}/actions/copy") + if err != nil { + return nil, err + } + + var response CopyVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateBootVolume Creates a new boot volume in the specified compartment from an existing boot volume or a boot volume backup. +// For general information about boot volumes, see Boot Volumes (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumes.htm). +// 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. Avoid entering confidential information. +func (client BlockstorageClient) CreateBootVolume(ctx context.Context, request CreateBootVolumeRequest) (response CreateBootVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBootVolume, policy) + if err != nil { + if ociResponse != nil { + response = CreateBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBootVolumeResponse") + } + return +} + +// createBootVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumes") + if err != nil { + return nil, err + } + + var response CreateBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateBootVolumeBackup Creates a new boot volume backup of the specified boot volume. For general information about boot volume backups, +// see Overview of Boot Volume Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumebackups.htm) +// When the request is received, the backup object is in a REQUEST_RECEIVED state. +// 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. +func (client BlockstorageClient) CreateBootVolumeBackup(ctx context.Context, request CreateBootVolumeBackupRequest) (response CreateBootVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBootVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateBootVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateBootVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBootVolumeBackupResponse") + } + return +} + +// createBootVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeBackups") + if err != nil { + return nil, err + } + + var response CreateBootVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVolume Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from +// 50 GB (51200 MB) to 32 TB (33554432 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB). +// For general information about block volumes, see +// Overview of Block Volume Service (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). +// A volume and instance can be in separate compartments but must be in the same availability domain. +// For information about access control and compartments, see +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about +// availability domains, see Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). +// To get a list of availability domains, use the `ListAvailabilityDomains` operation +// in the Identity and Access Management Service API. +// 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. Avoid entering confidential information. +func (client BlockstorageClient) CreateVolume(ctx context.Context, request CreateVolumeRequest) (response CreateVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVolume, policy) + if err != nil { + if ociResponse != nil { + response = CreateVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeResponse") + } + return +} + +// createVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumes") + if err != nil { + return nil, err + } + + var response CreateVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVolumeBackup Creates a new backup of the specified volume. For general information about volume backups, +// see Overview of Block Volume Service Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumebackups.htm) +// When the request is received, the backup object is in a REQUEST_RECEIVED state. +// 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. +func (client BlockstorageClient) CreateVolumeBackup(ctx context.Context, request CreateVolumeBackupRequest) (response CreateVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeBackupResponse") + } + return +} + +// createVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackups") + if err != nil { + return nil, err + } + + var response CreateVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVolumeBackupPolicyAssignment Assigns a policy to the specified asset, such as a volume. Note that a given asset can +// only have one policy assigned to it; if this method is called for an asset that previously +// has a different policy assigned, the prior assignment will be silently deleted. +func (client BlockstorageClient) CreateVolumeBackupPolicyAssignment(ctx context.Context, request CreateVolumeBackupPolicyAssignmentRequest) (response CreateVolumeBackupPolicyAssignmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createVolumeBackupPolicyAssignment, policy) + if err != nil { + if ociResponse != nil { + response = CreateVolumeBackupPolicyAssignmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVolumeBackupPolicyAssignmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeBackupPolicyAssignmentResponse") + } + return +} + +// createVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackupPolicyAssignments") + if err != nil { + return nil, err + } + + var response CreateVolumeBackupPolicyAssignmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVolumeGroup Creates a new volume group in the specified compartment. +// A volume group is a collection of volumes and may be created from a list of volumes, cloning an existing +// volume group, or by restoring a volume group backup. A volume group can contain up to 64 volumes. +// You may optionally specify a *display name* for the volume group, which is simply a friendly name or +// description. It does not have to be unique, and you can change it. Avoid entering confidential information. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) CreateVolumeGroup(ctx context.Context, request CreateVolumeGroupRequest) (response CreateVolumeGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVolumeGroup, policy) + if err != nil { + if ociResponse != nil { + response = CreateVolumeGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVolumeGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeGroupResponse") + } + return +} + +// createVolumeGroup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroups") + if err != nil { + return nil, err + } + + var response CreateVolumeGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVolumeGroupBackup Creates a new backup volume group of the specified volume group. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) CreateVolumeGroupBackup(ctx context.Context, request CreateVolumeGroupBackupRequest) (response CreateVolumeGroupBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVolumeGroupBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateVolumeGroupBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVolumeGroupBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeGroupBackupResponse") + } + return +} + +// createVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) createVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroupBackups") + if err != nil { + return nil, err + } + + var response CreateVolumeGroupBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteBootVolume Deletes the specified boot volume. The volume cannot have an active connection to an instance. +// To disconnect the boot volume from a connected instance, see +// Disconnecting From a Boot Volume (https://docs.cloud.oracle.com/Content/Block/Tasks/deletingbootvolume.htm). +// **Warning:** All data on the boot volume will be permanently lost when the boot volume is deleted. +func (client BlockstorageClient) DeleteBootVolume(ctx context.Context, request DeleteBootVolumeRequest) (response DeleteBootVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBootVolume, policy) + if err != nil { + if ociResponse != nil { + response = DeleteBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeResponse") + } + return +} + +// deleteBootVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumes/{bootVolumeId}") + if err != nil { + return nil, err + } + + var response DeleteBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteBootVolumeBackup Deletes a boot volume backup. +func (client BlockstorageClient) DeleteBootVolumeBackup(ctx context.Context, request DeleteBootVolumeBackupRequest) (response DeleteBootVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBootVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = DeleteBootVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteBootVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeBackupResponse") + } + return +} + +// deleteBootVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumeBackups/{bootVolumeBackupId}") + if err != nil { + return nil, err + } + + var response DeleteBootVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteBootVolumeKmsKey Removes the KMS key for the specified boot volume. +func (client BlockstorageClient) DeleteBootVolumeKmsKey(ctx context.Context, request DeleteBootVolumeKmsKeyRequest) (response DeleteBootVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBootVolumeKmsKey, policy) + if err != nil { + if ociResponse != nil { + response = DeleteBootVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteBootVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeKmsKeyResponse") + } + return +} + +// deleteBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumes/{bootVolumeId}/kmsKey") + if err != nil { + return nil, err + } + + var response DeleteBootVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolume Deletes the specified volume. The volume cannot have an active connection to an instance. +// To disconnect the volume from a connected instance, see +// Disconnecting From a Volume (https://docs.cloud.oracle.com/Content/Block/Tasks/disconnectingfromavolume.htm). +// **Warning:** All data on the volume will be permanently lost when the volume is deleted. +func (client BlockstorageClient) DeleteVolume(ctx context.Context, request DeleteVolumeRequest) (response DeleteVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolume, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeResponse") + } + return +} + +// deleteVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumes/{volumeId}") + if err != nil { + return nil, err + } + + var response DeleteVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolumeBackup Deletes a volume backup. +func (client BlockstorageClient) DeleteVolumeBackup(ctx context.Context, request DeleteVolumeBackupRequest) (response DeleteVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeBackupResponse") + } + return +} + +// deleteVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeBackups/{volumeBackupId}") + if err != nil { + return nil, err + } + + var response DeleteVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolumeBackupPolicyAssignment Deletes a volume backup policy assignment (i.e. unassigns the policy from an asset). +func (client BlockstorageClient) DeleteVolumeBackupPolicyAssignment(ctx context.Context, request DeleteVolumeBackupPolicyAssignmentRequest) (response DeleteVolumeBackupPolicyAssignmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolumeBackupPolicyAssignment, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeBackupPolicyAssignmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeBackupPolicyAssignmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeBackupPolicyAssignmentResponse") + } + return +} + +// deleteVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeBackupPolicyAssignments/{policyAssignmentId}") + if err != nil { + return nil, err + } + + var response DeleteVolumeBackupPolicyAssignmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolumeGroup Deletes the specified volume group. Individual volumes are not deleted, only the volume group is deleted. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) DeleteVolumeGroup(ctx context.Context, request DeleteVolumeGroupRequest) (response DeleteVolumeGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolumeGroup, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeGroupResponse") + } + return +} + +// deleteVolumeGroup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeGroups/{volumeGroupId}") + if err != nil { + return nil, err + } + + var response DeleteVolumeGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolumeGroupBackup Deletes a volume group backup. This operation deletes all the backups in the volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) DeleteVolumeGroupBackup(ctx context.Context, request DeleteVolumeGroupBackupRequest) (response DeleteVolumeGroupBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolumeGroupBackup, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeGroupBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeGroupBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeGroupBackupResponse") + } + return +} + +// deleteVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeGroupBackups/{volumeGroupBackupId}") + if err != nil { + return nil, err + } + + var response DeleteVolumeGroupBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteVolumeKmsKey Removes the KMS key for the specified volume. +func (client BlockstorageClient) DeleteVolumeKmsKey(ctx context.Context, request DeleteVolumeKmsKeyRequest) (response DeleteVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVolumeKmsKey, policy) + if err != nil { + if ociResponse != nil { + response = DeleteVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeKmsKeyResponse") + } + return +} + +// deleteVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) deleteVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumes/{volumeId}/kmsKey") + if err != nil { + return nil, err + } + + var response DeleteVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBootVolume Gets information for the specified boot volume. +func (client BlockstorageClient) GetBootVolume(ctx context.Context, request GetBootVolumeRequest) (response GetBootVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBootVolume, policy) + if err != nil { + if ociResponse != nil { + response = GetBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeResponse") + } + return +} + +// getBootVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes/{bootVolumeId}") + if err != nil { + return nil, err + } + + var response GetBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBootVolumeBackup Gets information for the specified boot volume backup. +func (client BlockstorageClient) GetBootVolumeBackup(ctx context.Context, request GetBootVolumeBackupRequest) (response GetBootVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBootVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = GetBootVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBootVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeBackupResponse") + } + return +} + +// getBootVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeBackups/{bootVolumeBackupId}") + if err != nil { + return nil, err + } + + var response GetBootVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBootVolumeKmsKey Gets the KMS key ID for the specified boot volume. +func (client BlockstorageClient) GetBootVolumeKmsKey(ctx context.Context, request GetBootVolumeKmsKeyRequest) (response GetBootVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBootVolumeKmsKey, policy) + if err != nil { + if ociResponse != nil { + response = GetBootVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBootVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeKmsKeyResponse") + } + return +} + +// getBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes/{bootVolumeId}/kmsKey") + if err != nil { + return nil, err + } + + var response GetBootVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVolume Gets information for the specified volume. +func (client BlockstorageClient) GetVolume(ctx context.Context, request GetVolumeRequest) (response GetVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolume, policy) + if err != nil { + if ociResponse != nil { + response = GetVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeResponse") + } + return +} + +// getVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes/{volumeId}") + if err != nil { + return nil, err + } + + var response GetVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVolumeBackup Gets information for the specified volume backup. +func (client BlockstorageClient) GetVolumeBackup(ctx context.Context, request GetVolumeBackupRequest) (response GetVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeBackup, policy) + if err != nil { + if ociResponse != nil { + response = GetVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupResponse") + } + return +} + +// getVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackups/{volumeBackupId}") + if err != nil { + return nil, err + } + + var response GetVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVolumeBackupPolicy Gets information for the specified volume backup policy. +func (client BlockstorageClient) GetVolumeBackupPolicy(ctx context.Context, request GetVolumeBackupPolicyRequest) (response GetVolumeBackupPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicy, policy) + if err != nil { + if ociResponse != nil { + response = GetVolumeBackupPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyResponse") + } + return +} + +// getVolumeBackupPolicy implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeBackupPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicies/{policyId}") + if err != nil { + return nil, err + } + + var response GetVolumeBackupPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVolumeBackupPolicyAssetAssignment Gets the volume backup policy assignment for the specified asset. Note that the +// assetId query parameter is required, and that the returned list will contain at most +// one item (since any given asset can only have one policy assigned to it). +func (client BlockstorageClient) GetVolumeBackupPolicyAssetAssignment(ctx context.Context, request GetVolumeBackupPolicyAssetAssignmentRequest) (response GetVolumeBackupPolicyAssetAssignmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicyAssetAssignment, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeBackupPolicyAssetAssignmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyAssetAssignmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyAssetAssignmentResponse") + } + return +} + +// getVolumeBackupPolicyAssetAssignment implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeBackupPolicyAssetAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicyAssignments") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeBackupPolicyAssetAssignmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateVolumeBackup Creates a new backup of the specified volume. For general information about volume backups, -// see Overview of Block Volume Service Backups (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/blockvolumebackups.htm) -// When the request is received, the backup object is in a REQUEST_RECEIVED state. -// 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. -func (client BlockstorageClient) CreateVolumeBackup(ctx context.Context, request CreateVolumeBackupRequest) (response CreateVolumeBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/volumeBackups", request) +// GetVolumeBackupPolicyAssignment Gets information for the specified volume backup policy assignment. +func (client BlockstorageClient) GetVolumeBackupPolicyAssignment(ctx context.Context, request GetVolumeBackupPolicyAssignmentRequest) (response GetVolumeBackupPolicyAssignmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicyAssignment, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeBackupPolicyAssignmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyAssignmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyAssignmentResponse") + } + return +} + +// getVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicyAssignments/{policyAssignmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeBackupPolicyAssignmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateVolumeBackupPolicyAssignment Assigns a policy to the specified asset, such as a volume. Note that a given asset can -// only have one policy assigned to it; if this method is called for an asset that previously -// has a different policy assigned, the prior assignment will be silently deleted. -func (client BlockstorageClient) CreateVolumeBackupPolicyAssignment(ctx context.Context, request CreateVolumeBackupPolicyAssignmentRequest) (response CreateVolumeBackupPolicyAssignmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/volumeBackupPolicyAssignments", request) +// GetVolumeGroup Gets information for the specified volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) GetVolumeGroup(ctx context.Context, request GetVolumeGroupRequest) (response GetVolumeGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeGroup, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeGroupResponse") + } + return +} + +// getVolumeGroup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroups/{volumeGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteBootVolume Deletes the specified boot volume. The volume cannot have an active connection to an instance. -// To disconnect the boot volume from a connected instance, see -// Disconnecting From a Boot Volume (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/deletingbootvolume.htm). -// **Warning:** All data on the boot volume will be permanently lost when the boot volume is deleted. -func (client BlockstorageClient) DeleteBootVolume(ctx context.Context, request DeleteBootVolumeRequest) (response DeleteBootVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/bootVolumes/{bootVolumeId}", request) +// GetVolumeGroupBackup Gets information for the specified volume group backup. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) GetVolumeGroupBackup(ctx context.Context, request GetVolumeGroupBackupRequest) (response GetVolumeGroupBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeGroupBackup, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeGroupBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeGroupBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeGroupBackupResponse") + } + return +} + +// getVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroupBackups/{volumeGroupBackupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeGroupBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteVolume Deletes the specified volume. The volume cannot have an active connection to an instance. -// To disconnect the volume from a connected instance, see -// Disconnecting From a Volume (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/disconnectingfromavolume.htm). -// **Warning:** All data on the volume will be permanently lost when the volume is deleted. -func (client BlockstorageClient) DeleteVolume(ctx context.Context, request DeleteVolumeRequest) (response DeleteVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/volumes/{volumeId}", request) +// GetVolumeKmsKey Gets the KMS key ID for the specified volume. +func (client BlockstorageClient) GetVolumeKmsKey(ctx context.Context, request GetVolumeKmsKeyRequest) (response GetVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeKmsKey, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeKmsKeyResponse") + } + return +} + +// getVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) getVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes/{volumeId}/kmsKey") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteVolumeBackup Deletes a volume backup. -func (client BlockstorageClient) DeleteVolumeBackup(ctx context.Context, request DeleteVolumeBackupRequest) (response DeleteVolumeBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/volumeBackups/{volumeBackupId}", request) +// ListBootVolumeBackups Lists the boot volume backups in the specified compartment. You can filter the results by boot volume. +func (client BlockstorageClient) ListBootVolumeBackups(ctx context.Context, request ListBootVolumeBackupsRequest) (response ListBootVolumeBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBootVolumeBackups, policy) if err != nil { + if ociResponse != nil { + response = ListBootVolumeBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListBootVolumeBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumeBackupsResponse") + } + return +} + +// listBootVolumeBackups implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listBootVolumeBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeBackups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListBootVolumeBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteVolumeBackupPolicyAssignment Deletes a volume backup policy assignment (i.e. unassigns the policy from an asset). -func (client BlockstorageClient) DeleteVolumeBackupPolicyAssignment(ctx context.Context, request DeleteVolumeBackupPolicyAssignmentRequest) (response DeleteVolumeBackupPolicyAssignmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/volumeBackupPolicyAssignments/{policyAssignmentId}", request) +// ListBootVolumes Lists the boot volumes in the specified compartment and availability domain. +func (client BlockstorageClient) ListBootVolumes(ctx context.Context, request ListBootVolumesRequest) (response ListBootVolumesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBootVolumes, policy) if err != nil { + if ociResponse != nil { + response = ListBootVolumesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListBootVolumesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumesResponse") + } + return +} + +// listBootVolumes implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listBootVolumes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListBootVolumesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetBootVolume Gets information for the specified boot volume. -func (client BlockstorageClient) GetBootVolume(ctx context.Context, request GetBootVolumeRequest) (response GetBootVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/bootVolumes/{bootVolumeId}", request) +// ListVolumeBackupPolicies Lists all volume backup policies available to the caller. +func (client BlockstorageClient) ListVolumeBackupPolicies(ctx context.Context, request ListVolumeBackupPoliciesRequest) (response ListVolumeBackupPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumeBackupPolicies, policy) if err != nil { + if ociResponse != nil { + response = ListVolumeBackupPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumeBackupPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumeBackupPoliciesResponse") + } + return +} + +// listVolumeBackupPolicies implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listVolumeBackupPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicies") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumeBackupPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolume Gets information for the specified volume. -func (client BlockstorageClient) GetVolume(ctx context.Context, request GetVolumeRequest) (response GetVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumes/{volumeId}", request) +// ListVolumeBackups Lists the volume backups in the specified compartment. You can filter the results by volume. +func (client BlockstorageClient) ListVolumeBackups(ctx context.Context, request ListVolumeBackupsRequest) (response ListVolumeBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumeBackups, policy) if err != nil { + if ociResponse != nil { + response = ListVolumeBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumeBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumeBackupsResponse") + } + return +} + +// listVolumeBackups implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listVolumeBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumeBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolumeBackup Gets information for the specified volume backup. -func (client BlockstorageClient) GetVolumeBackup(ctx context.Context, request GetVolumeBackupRequest) (response GetVolumeBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackups/{volumeBackupId}", request) +// ListVolumeGroupBackups Lists the volume group backups in the specified compartment. You can filter the results by volume group. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) ListVolumeGroupBackups(ctx context.Context, request ListVolumeGroupBackupsRequest) (response ListVolumeGroupBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumeGroupBackups, policy) if err != nil { + if ociResponse != nil { + response = ListVolumeGroupBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumeGroupBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumeGroupBackupsResponse") + } + return +} + +// listVolumeGroupBackups implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listVolumeGroupBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroupBackups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumeGroupBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolumeBackupPolicy Gets information for the specified volume backup policy. -func (client BlockstorageClient) GetVolumeBackupPolicy(ctx context.Context, request GetVolumeBackupPolicyRequest) (response GetVolumeBackupPolicyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackupPolicies/{policyId}", request) +// ListVolumeGroups Lists the volume groups in the specified compartment and availability domain. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) ListVolumeGroups(ctx context.Context, request ListVolumeGroupsRequest) (response ListVolumeGroupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumeGroups, policy) if err != nil { + if ociResponse != nil { + response = ListVolumeGroupsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumeGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumeGroupsResponse") + } + return +} + +// listVolumeGroups implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listVolumeGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumeGroupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolumeBackupPolicyAssetAssignment Gets the volume backup policy assignment for the specified asset. Note that the -// assetId query parameter is required, and that the returned list will contain at most -// one item (since any given asset can only have one policy assigned to it). -func (client BlockstorageClient) GetVolumeBackupPolicyAssetAssignment(ctx context.Context, request GetVolumeBackupPolicyAssetAssignmentRequest) (response GetVolumeBackupPolicyAssetAssignmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackupPolicyAssignments", request) +// ListVolumes Lists the volumes in the specified compartment and availability domain. +func (client BlockstorageClient) ListVolumes(ctx context.Context, request ListVolumesRequest) (response ListVolumesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumes, policy) if err != nil { + if ociResponse != nil { + response = ListVolumesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumesResponse") + } + return +} + +// listVolumes implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) listVolumes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolumeBackupPolicyAssignment Gets information for the specified volume backup policy assignment. -func (client BlockstorageClient) GetVolumeBackupPolicyAssignment(ctx context.Context, request GetVolumeBackupPolicyAssignmentRequest) (response GetVolumeBackupPolicyAssignmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackupPolicyAssignments/{policyAssignmentId}", request) +// UpdateBootVolume Updates the specified boot volume's display name, defined tags, and free-form tags. +func (client BlockstorageClient) UpdateBootVolume(ctx context.Context, request UpdateBootVolumeRequest) (response UpdateBootVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateBootVolume, policy) if err != nil { + if ociResponse != nil { + response = UpdateBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeResponse") + } + return +} + +// updateBootVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumes/{bootVolumeId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListBootVolumes Lists the boot volumes in the specified compartment and Availability Domain. -func (client BlockstorageClient) ListBootVolumes(ctx context.Context, request ListBootVolumesRequest) (response ListBootVolumesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/bootVolumes", request) +// UpdateBootVolumeBackup Updates the display name for the specified boot volume backup. +// Avoid entering confidential information. +func (client BlockstorageClient) UpdateBootVolumeBackup(ctx context.Context, request UpdateBootVolumeBackupRequest) (response UpdateBootVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateBootVolumeBackup, policy) if err != nil { + if ociResponse != nil { + response = UpdateBootVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBootVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeBackupResponse") + } + return +} + +// updateBootVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumeBackups/{bootVolumeBackupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateBootVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListVolumeBackupPolicies Lists all volume backup policies available to the caller. -func (client BlockstorageClient) ListVolumeBackupPolicies(ctx context.Context, request ListVolumeBackupPoliciesRequest) (response ListVolumeBackupPoliciesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackupPolicies", request) +// UpdateBootVolumeKmsKey Updates the KMS key ID for the specified volume. +func (client BlockstorageClient) UpdateBootVolumeKmsKey(ctx context.Context, request UpdateBootVolumeKmsKeyRequest) (response UpdateBootVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateBootVolumeKmsKey, policy) if err != nil { + if ociResponse != nil { + response = UpdateBootVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBootVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeKmsKeyResponse") + } + return +} + +// updateBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumes/{bootVolumeId}/kmsKey") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateBootVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListVolumeBackups Lists the volume backups in the specified compartment. You can filter the results by volume. -func (client BlockstorageClient) ListVolumeBackups(ctx context.Context, request ListVolumeBackupsRequest) (response ListVolumeBackupsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeBackups", request) +// UpdateVolume Updates the specified volume's display name. +// Avoid entering confidential information. +func (client BlockstorageClient) UpdateVolume(ctx context.Context, request UpdateVolumeRequest) (response UpdateVolumeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVolume, policy) if err != nil { + if ociResponse != nil { + response = UpdateVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeResponse") + } + return +} + +// updateVolume implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumes/{volumeId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListVolumes Lists the volumes in the specified compartment and Availability Domain. -func (client BlockstorageClient) ListVolumes(ctx context.Context, request ListVolumesRequest) (response ListVolumesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumes", request) +// UpdateVolumeBackup Updates the display name for the specified volume backup. +// Avoid entering confidential information. +func (client BlockstorageClient) UpdateVolumeBackup(ctx context.Context, request UpdateVolumeBackupRequest) (response UpdateVolumeBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVolumeBackup, policy) if err != nil { + if ociResponse != nil { + response = UpdateVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVolumeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeBackupResponse") + } + return +} + +// updateVolumeBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeBackups/{volumeBackupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVolumeBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateBootVolume Updates the specified boot volume's display name. -func (client BlockstorageClient) UpdateBootVolume(ctx context.Context, request UpdateBootVolumeRequest) (response UpdateBootVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/bootVolumes/{bootVolumeId}", request) +// UpdateVolumeGroup Updates the set of volumes in a volume group along with the display name. Use this operation +// to add or remove volumes in a volume group. Specify the full list of volume IDs to include in the +// volume group. If the volume ID is not specified in the call, it will be removed from the volume group. +// Avoid entering confidential information. +// For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) UpdateVolumeGroup(ctx context.Context, request UpdateVolumeGroupRequest) (response UpdateVolumeGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVolumeGroup, policy) if err != nil { + if ociResponse != nil { + response = UpdateVolumeGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVolumeGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeGroupResponse") + } + return +} + +// updateVolumeGroup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeGroups/{volumeGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVolumeGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateVolume Updates the specified volume's display name. -// Avoid entering confidential information. -func (client BlockstorageClient) UpdateVolume(ctx context.Context, request UpdateVolumeRequest) (response UpdateVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/volumes/{volumeId}", request) +// UpdateVolumeGroupBackup Updates the display name for the specified volume group backup. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +func (client BlockstorageClient) UpdateVolumeGroupBackup(ctx context.Context, request UpdateVolumeGroupBackupRequest) (response UpdateVolumeGroupBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVolumeGroupBackup, policy) if err != nil { + if ociResponse != nil { + response = UpdateVolumeGroupBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVolumeGroupBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeGroupBackupResponse") + } + return +} + +// updateVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeGroupBackups/{volumeGroupBackupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVolumeGroupBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateVolumeBackup Updates the display name for the specified volume backup. -// Avoid entering confidential information. -func (client BlockstorageClient) UpdateVolumeBackup(ctx context.Context, request UpdateVolumeBackupRequest) (response UpdateVolumeBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/volumeBackups/{volumeBackupId}", request) +// UpdateVolumeKmsKey Updates the KMS key ID for the specified volume. +func (client BlockstorageClient) UpdateVolumeKmsKey(ctx context.Context, request UpdateVolumeKmsKeyRequest) (response UpdateVolumeKmsKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVolumeKmsKey, policy) if err != nil { + if ociResponse != nil { + response = UpdateVolumeKmsKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVolumeKmsKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeKmsKeyResponse") + } + return +} + +// updateVolumeKmsKey implements the OCIOperation interface (enables retrying operations) +func (client BlockstorageClient) updateVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumes/{volumeId}/kmsKey") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVolumeKmsKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_compute_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_compute_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_compute_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_compute_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -37,7 +41,7 @@ // SetRegion overrides the region of this client. func (client *ComputeClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "iaas", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +52,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -60,58 +64,145 @@ // AttachBootVolume Attaches the specified boot volume to the specified instance. func (client ComputeClient) AttachBootVolume(ctx context.Context, request AttachBootVolumeRequest) (response AttachBootVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/bootVolumeAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachBootVolume, policy) if err != nil { + if ociResponse != nil { + response = AttachBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(AttachBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachBootVolumeResponse") + } + return +} + +// attachBootVolume implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) attachBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response AttachBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // AttachVnic Creates a secondary VNIC and attaches it to the specified instance. // For more information about secondary VNICs, see -// Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). +// Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). func (client ComputeClient) AttachVnic(ctx context.Context, request AttachVnicRequest) (response AttachVnicResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/vnicAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachVnic, policy) if err != nil { + if ociResponse != nil { + response = AttachVnicResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(AttachVnicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachVnicResponse") + } + return +} + +// attachVnic implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) attachVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vnicAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response AttachVnicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // AttachVolume Attaches the specified storage volume to the specified instance. func (client ComputeClient) AttachVolume(ctx context.Context, request AttachVolumeRequest) (response AttachVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/volumeAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachVolume, policy) if err != nil { + if ociResponse != nil { + response = AttachVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(AttachVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachVolumeResponse") + } + return +} + +// attachVolume implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) attachVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response AttachVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &volumeattachment{}) - return + return response, err } // CaptureConsoleHistory Captures the most recent serial console data (up to a megabyte) for the @@ -130,149 +221,421 @@ // 4. Optionally, use `DeleteConsoleHistory` to delete the console history metadata // and the console history data. func (client ComputeClient) CaptureConsoleHistory(ctx context.Context, request CaptureConsoleHistoryRequest) (response CaptureConsoleHistoryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/instanceConsoleHistories/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.captureConsoleHistory, policy) if err != nil { + if ociResponse != nil { + response = CaptureConsoleHistoryResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CaptureConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CaptureConsoleHistoryResponse") + } + return +} + +// captureConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) captureConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConsoleHistories/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CaptureConsoleHistoryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAppCatalogSubscription Create a subscription for listing resource version for a compartment. It will take some time to propagate to all regions. +func (client ComputeClient) CreateAppCatalogSubscription(ctx context.Context, request CreateAppCatalogSubscriptionRequest) (response CreateAppCatalogSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAppCatalogSubscription, policy) + if err != nil { + if ociResponse != nil { + response = CreateAppCatalogSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAppCatalogSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAppCatalogSubscriptionResponse") + } return } +// createAppCatalogSubscription implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) createAppCatalogSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/appCatalogSubscriptions") + if err != nil { + return nil, err + } + + var response CreateAppCatalogSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateImage Creates a boot disk image for the specified instance or imports an exported image from the Oracle Cloud Infrastructure Object Storage service. // When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and // the OCID of the compartment containing that instance. For more information about images, -// see Managing Custom Images (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm). +// see Managing Custom Images (https://docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm). // When importing an exported image from Object Storage, you specify the source information // in ImageSourceDetails. // When importing an image based on the namespace, bucket name, and object name, // use ImageSourceViaObjectStorageTupleDetails. // When importing an image based on the Object Storage URL, use // ImageSourceViaObjectStorageUriDetails. -// See Object Storage URLs (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and pre-authenticated requests (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm#pre-auth) +// See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) // for constructing URLs for image import/export. // For more information about importing exported images, see -// Image Import/Export (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm). +// Image Import/Export (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm). // 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 UpdateImage. // Avoid entering confidential information. func (client ComputeClient) CreateImage(ctx context.Context, request CreateImageRequest) (response CreateImageResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/images", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createImage, policy) if err != nil { + if ociResponse != nil { + response = CreateImageResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateImageResponse") + } + return +} + +// createImage implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) createImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/images") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateImageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateInstanceConsoleConnection Creates a new console connection to the specified instance. // Once the console connection has been created and is available, // you connect to the console using SSH. -// For more information about console access, see Accessing the Console (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). +// For more information about console access, see Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). func (client ComputeClient) CreateInstanceConsoleConnection(ctx context.Context, request CreateInstanceConsoleConnectionRequest) (response CreateInstanceConsoleConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/instanceConsoleConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createInstanceConsoleConnection, policy) if err != nil { + if ociResponse != nil { + response = CreateInstanceConsoleConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateInstanceConsoleConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateInstanceConsoleConnectionResponse") + } + return +} + +// createInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) createInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConsoleConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateInstanceConsoleConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAppCatalogSubscription Delete a subscription for a listing resource version for a compartment. +func (client ComputeClient) DeleteAppCatalogSubscription(ctx context.Context, request DeleteAppCatalogSubscriptionRequest) (response DeleteAppCatalogSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAppCatalogSubscription, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAppCatalogSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAppCatalogSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAppCatalogSubscriptionResponse") + } return } +// deleteAppCatalogSubscription implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) deleteAppCatalogSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/appCatalogSubscriptions") + if err != nil { + return nil, err + } + + var response DeleteAppCatalogSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteConsoleHistory Deletes the specified console history metadata and the console history data. func (client ComputeClient) DeleteConsoleHistory(ctx context.Context, request DeleteConsoleHistoryRequest) (response DeleteConsoleHistoryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/instanceConsoleHistories/{instanceConsoleHistoryId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteConsoleHistory, policy) if err != nil { + if ociResponse != nil { + response = DeleteConsoleHistoryResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteConsoleHistoryResponse") + } + return +} + +// deleteConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) deleteConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConsoleHistories/{instanceConsoleHistoryId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteConsoleHistoryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteImage Deletes an image. func (client ComputeClient) DeleteImage(ctx context.Context, request DeleteImageRequest) (response DeleteImageResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/images/{imageId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteImage, policy) if err != nil { + if ociResponse != nil { + response = DeleteImageResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteImageResponse") + } + return +} + +// deleteImage implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) deleteImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/images/{imageId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteImageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteInstanceConsoleConnection Deletes the specified instance console connection. func (client ComputeClient) DeleteInstanceConsoleConnection(ctx context.Context, request DeleteInstanceConsoleConnectionRequest) (response DeleteInstanceConsoleConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/instanceConsoleConnections/{instanceConsoleConnectionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteInstanceConsoleConnection, policy) if err != nil { + if ociResponse != nil { + response = DeleteInstanceConsoleConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteInstanceConsoleConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteInstanceConsoleConnectionResponse") + } + return +} + +// deleteInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) deleteInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConsoleConnections/{instanceConsoleConnectionId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteInstanceConsoleConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DetachBootVolume Detaches a boot volume from an instance. You must specify the OCID of the boot volume attachment. // This is an asynchronous operation. The attachment's `lifecycleState` will change to DETACHING temporarily // until the attachment is completely removed. func (client ComputeClient) DetachBootVolume(ctx context.Context, request DetachBootVolumeRequest) (response DetachBootVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/bootVolumeAttachments/{bootVolumeAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.detachBootVolume, policy) if err != nil { + if ociResponse != nil { + response = DetachBootVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DetachBootVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachBootVolumeResponse") + } + return +} + +// detachBootVolume implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) detachBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumeAttachments/{bootVolumeAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DetachBootVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DetachVnic Detaches and deletes the specified secondary VNIC. @@ -281,273 +644,717 @@ // and secondary) are automatically detached and deleted. // **Important:** If the VNIC has a // PrivateIp that is the -// target of a route rule (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip), +// target of a route rule (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip), // deleting the VNIC causes that route rule to blackhole and the traffic // will be dropped. func (client ComputeClient) DetachVnic(ctx context.Context, request DetachVnicRequest) (response DetachVnicResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/vnicAttachments/{vnicAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.detachVnic, policy) if err != nil { + if ociResponse != nil { + response = DetachVnicResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DetachVnicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachVnicResponse") + } + return +} + +// detachVnic implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) detachVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vnicAttachments/{vnicAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DetachVnicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DetachVolume Detaches a storage volume from an instance. You must specify the OCID of the volume attachment. // This is an asynchronous operation. The attachment's `lifecycleState` will change to DETACHING temporarily // until the attachment is completely removed. func (client ComputeClient) DetachVolume(ctx context.Context, request DetachVolumeRequest) (response DetachVolumeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/volumeAttachments/{volumeAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.detachVolume, policy) if err != nil { + if ociResponse != nil { + response = DetachVolumeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DetachVolumeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachVolumeResponse") + } + return +} + +// detachVolume implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) detachVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeAttachments/{volumeAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DetachVolumeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ExportImage Exports the specified image to the Oracle Cloud Infrastructure Object Storage service. You can use the Object Storage URL, // or the namespace, bucket name, and object name when specifying the location to export to. -// For more information about exporting images, see Image Import/Export (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm). +// For more information about exporting images, see Image Import/Export (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm). // To perform an image export, you need write access to the Object Storage bucket for the image, -// see Let Users Write Objects to Object Storage Buckets (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm#Let4). -// See Object Storage URLs (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and pre-authenticated requests (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm#pre-auth) +// see Let Users Write Objects to Object Storage Buckets (https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm#Let4). +// See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) // for constructing URLs for image import/export. func (client ComputeClient) ExportImage(ctx context.Context, request ExportImageRequest) (response ExportImageResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/images/{imageId}/actions/export", request) - if err != nil { - return + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.exportImage, policy) if err != nil { + if ociResponse != nil { + response = ExportImageResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(ExportImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ExportImageResponse") + } return } -// GetBootVolumeAttachment Gets information about the specified boot volume attachment. -func (client ComputeClient) GetBootVolumeAttachment(ctx context.Context, request GetBootVolumeAttachmentRequest) (response GetBootVolumeAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/bootVolumeAttachments/{bootVolumeAttachmentId}", request) +// exportImage implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) exportImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/images/{imageId}/actions/export") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ExportImageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetConsoleHistory Shows the metadata for the specified console history. -// See CaptureConsoleHistory -// for details about using the console history operations. -func (client ComputeClient) GetConsoleHistory(ctx context.Context, request GetConsoleHistoryRequest) (response GetConsoleHistoryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}", request) - if err != nil { - return +// GetAppCatalogListing Gets the specified listing. +func (client ComputeClient) GetAppCatalogListing(ctx context.Context, request GetAppCatalogListingRequest) (response GetAppCatalogListingResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListing, policy) if err != nil { + if ociResponse != nil { + response = GetAppCatalogListingResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(GetAppCatalogListingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingResponse") + } return } -// GetConsoleHistoryContent Gets the actual console history data (not the metadata). -// See CaptureConsoleHistory -// for details about using the console history operations. -func (client ComputeClient) GetConsoleHistoryContent(ctx context.Context, request GetConsoleHistoryContentRequest) (response GetConsoleHistoryContentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}/data", request) +// getAppCatalogListing implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getAppCatalogListing(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetAppCatalogListingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetImage Gets the specified image. -func (client ComputeClient) GetImage(ctx context.Context, request GetImageRequest) (response GetImageResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/images/{imageId}", request) - if err != nil { - return +// GetAppCatalogListingAgreements Retrieves the agreements for a particular resource version of a listing. +func (client ComputeClient) GetAppCatalogListingAgreements(ctx context.Context, request GetAppCatalogListingAgreementsRequest) (response GetAppCatalogListingAgreementsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListingAgreements, policy) if err != nil { + if ociResponse != nil { + response = GetAppCatalogListingAgreementsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(GetAppCatalogListingAgreementsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingAgreementsResponse") + } return } -// GetInstance Gets information about the specified instance. -func (client ComputeClient) GetInstance(ctx context.Context, request GetInstanceRequest) (response GetInstanceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instances/{instanceId}", request) +// getAppCatalogListingAgreements implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getAppCatalogListingAgreements(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}/agreements") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetAppCatalogListingAgreementsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetInstanceConsoleConnection Gets the specified instance console connection's information. -func (client ComputeClient) GetInstanceConsoleConnection(ctx context.Context, request GetInstanceConsoleConnectionRequest) (response GetInstanceConsoleConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instanceConsoleConnections/{instanceConsoleConnectionId}", request) +// GetAppCatalogListingResourceVersion Gets the specified listing resource version. +func (client ComputeClient) GetAppCatalogListingResourceVersion(ctx context.Context, request GetAppCatalogListingResourceVersionRequest) (response GetAppCatalogListingResourceVersionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListingResourceVersion, policy) if err != nil { + if ociResponse != nil { + response = GetAppCatalogListingResourceVersionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetAppCatalogListingResourceVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingResourceVersionResponse") + } + return +} + +// getAppCatalogListingResourceVersion implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getAppCatalogListingResourceVersion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetAppCatalogListingResourceVersionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVnicAttachment Gets the information for the specified VNIC attachment. -func (client ComputeClient) GetVnicAttachment(ctx context.Context, request GetVnicAttachmentRequest) (response GetVnicAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/vnicAttachments/{vnicAttachmentId}", request) +// GetBootVolumeAttachment Gets information about the specified boot volume attachment. +func (client ComputeClient) GetBootVolumeAttachment(ctx context.Context, request GetBootVolumeAttachmentRequest) (response GetBootVolumeAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBootVolumeAttachment, policy) if err != nil { + if ociResponse != nil { + response = GetBootVolumeAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetBootVolumeAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeAttachmentResponse") + } + return +} + +// getBootVolumeAttachment implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getBootVolumeAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeAttachments/{bootVolumeAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetBootVolumeAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetVolumeAttachment Gets information about the specified volume attachment. -func (client ComputeClient) GetVolumeAttachment(ctx context.Context, request GetVolumeAttachmentRequest) (response GetVolumeAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeAttachments/{volumeAttachmentId}", request) +// GetConsoleHistory Shows the metadata for the specified console history. +// See CaptureConsoleHistory +// for details about using the console history operations. +func (client ComputeClient) GetConsoleHistory(ctx context.Context, request GetConsoleHistoryRequest) (response GetConsoleHistoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConsoleHistory, policy) if err != nil { + if ociResponse != nil { + response = GetConsoleHistoryResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryResponse") + } + return +} + +// getConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetConsoleHistoryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetConsoleHistoryContent Gets the actual console history data (not the metadata). +// See CaptureConsoleHistory +// for details about using the console history operations. +func (client ComputeClient) GetConsoleHistoryContent(ctx context.Context, request GetConsoleHistoryContentRequest) (response GetConsoleHistoryContentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConsoleHistoryContent, policy) + if err != nil { + if ociResponse != nil { + response = GetConsoleHistoryContentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetConsoleHistoryContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryContentResponse") + } + return +} - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &volumeattachment{}) +// getConsoleHistoryContent implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getConsoleHistoryContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}/data") + if err != nil { + return nil, err + } + + var response GetConsoleHistoryContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetImage Gets the specified image. +func (client ComputeClient) GetImage(ctx context.Context, request GetImageRequest) (response GetImageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getImage, policy) + if err != nil { + if ociResponse != nil { + response = GetImageResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetImageResponse") + } return } -// GetWindowsInstanceInitialCredentials Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials -// are only valid for the initial login. -func (client ComputeClient) GetWindowsInstanceInitialCredentials(ctx context.Context, request GetWindowsInstanceInitialCredentialsRequest) (response GetWindowsInstanceInitialCredentialsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instances/{instanceId}/initialCredentials", request) +// getImage implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/images/{imageId}") + if err != nil { + return nil, err + } + + var response GetImageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetInstance Gets information about the specified instance. +func (client ComputeClient) GetInstance(ctx context.Context, request GetInstanceRequest) (response GetInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getInstance, policy) if err != nil { + if ociResponse != nil { + response = GetInstanceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetInstanceResponse") + } + return +} + +// getInstance implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetInstanceConsoleConnection Gets the specified instance console connection's information. +func (client ComputeClient) GetInstanceConsoleConnection(ctx context.Context, request GetInstanceConsoleConnectionRequest) (response GetInstanceConsoleConnectionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getInstanceConsoleConnection, policy) + if err != nil { + if ociResponse != nil { + response = GetInstanceConsoleConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetInstanceConsoleConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetInstanceConsoleConnectionResponse") + } + return +} + +// getInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleConnections/{instanceConsoleConnectionId}") + if err != nil { + return nil, err + } + + var response GetInstanceConsoleConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVnicAttachment Gets the information for the specified VNIC attachment. +func (client ComputeClient) GetVnicAttachment(ctx context.Context, request GetVnicAttachmentRequest) (response GetVnicAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVnicAttachment, policy) + if err != nil { + if ociResponse != nil { + response = GetVnicAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetVnicAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVnicAttachmentResponse") + } return } -// InstanceAction Performs one of the power actions (start, stop, softreset, or reset) -// on the specified instance. -// **start** - power on -// **stop** - power off -// **softreset** - ACPI shutdown and power on -// **reset** - power off and power on -// Note that the **stop** state has no effect on the resources you consume. -// Billing continues for instances that you stop, and related resources continue -// to apply against any relevant quotas. You must terminate an instance -// (TerminateInstance) -// to remove its resources from billing and quotas. -func (client ComputeClient) InstanceAction(ctx context.Context, request InstanceActionRequest) (response InstanceActionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/instances/{instanceId}", request) +// getVnicAttachment implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getVnicAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnicAttachments/{vnicAttachmentId}") + if err != nil { + return nil, err + } + + var response GetVnicAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVolumeAttachment Gets information about the specified volume attachment. +func (client ComputeClient) GetVolumeAttachment(ctx context.Context, request GetVolumeAttachmentRequest) (response GetVolumeAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVolumeAttachment, policy) if err != nil { + if ociResponse != nil { + response = GetVolumeAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVolumeAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVolumeAttachmentResponse") + } + return +} + +// getVolumeAttachment implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getVolumeAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeAttachments/{volumeAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVolumeAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &volumeattachment{}) + return response, err +} + +// GetWindowsInstanceInitialCredentials Gets the generated credentials for the instance. Only works for instances that require password to log in (E.g. Windows). +// For certain OS'es, users will be forced to change the initial credentials. +func (client ComputeClient) GetWindowsInstanceInitialCredentials(ctx context.Context, request GetWindowsInstanceInitialCredentialsRequest) (response GetWindowsInstanceInitialCredentialsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWindowsInstanceInitialCredentials, policy) + if err != nil { + if ociResponse != nil { + response = GetWindowsInstanceInitialCredentialsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetWindowsInstanceInitialCredentialsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWindowsInstanceInitialCredentialsResponse") + } + return +} + +// getWindowsInstanceInitialCredentials implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) getWindowsInstanceInitialCredentials(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}/initialCredentials") + if err != nil { + return nil, err + } + + var response GetWindowsInstanceInitialCredentialsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// InstanceAction Performs one of the following power actions on the specified instance: +// - **START** - Powers on the instance. +// - **STOP** - Powers off the instance. +// - **SOFTRESET** - Gracefully reboots instance by sending a shutdown command to the operating system and then powers the instance back on. +// - **SOFTSTOP** - Gracefully shuts down instance by sending a shutdown command to the operating system. +// - **RESET** - Powers off the instance and then powers it back on. +// For more information see Stopping and Starting an Instance (https://docs.cloud.oracle.com/Content/Compute/Tasks/restartinginstance.htm). +func (client ComputeClient) InstanceAction(ctx context.Context, request InstanceActionRequest) (response InstanceActionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.instanceAction, policy) + if err != nil { + if ociResponse != nil { + response = InstanceActionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(InstanceActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InstanceActionResponse") + } return } -// LaunchInstance Creates a new instance in the specified compartment and the specified Availability Domain. +// instanceAction implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) instanceAction(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instances/{instanceId}") + if err != nil { + return nil, err + } + + var response InstanceActionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LaunchInstance Creates a new instance in the specified compartment and the specified availability domain. // For general information about instances, see -// Overview of the Compute Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm). +// Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // For information about access control and compartments, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about Availability Domains, see -// Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). -// To get a list of Availability Domains, use the `ListAvailabilityDomains` operation +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about availability domains, see +// Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). +// To get a list of availability domains, use the `ListAvailabilityDomains` operation // in the Identity and Access Management Service API. // All Oracle Cloud Infrastructure resources, including instances, get an Oracle-assigned, // unique ID called an Oracle Cloud Identifier (OCID). @@ -564,159 +1371,525 @@ // operation to get the VNIC ID for the instance, and then call // GetVnic with the VNIC ID. // You can later add secondary VNICs to an instance. For more information, see -// Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). +// Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). func (client ComputeClient) LaunchInstance(ctx context.Context, request LaunchInstanceRequest) (response LaunchInstanceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/instances/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.launchInstance, policy) + if err != nil { + if ociResponse != nil { + response = LaunchInstanceResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(LaunchInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LaunchInstanceResponse") + } + return +} + +// launchInstance implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) launchInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instances/") + if err != nil { + return nil, err + } + + var response LaunchInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAppCatalogListingResourceVersions Gets all resource versions for a particular listing. +func (client ComputeClient) ListAppCatalogListingResourceVersions(ctx context.Context, request ListAppCatalogListingResourceVersionsRequest) (response ListAppCatalogListingResourceVersionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAppCatalogListingResourceVersions, policy) if err != nil { + if ociResponse != nil { + response = ListAppCatalogListingResourceVersionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListAppCatalogListingResourceVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogListingResourceVersionsResponse") + } + return +} + +// listAppCatalogListingResourceVersions implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listAppCatalogListingResourceVersions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListAppCatalogListingResourceVersionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAppCatalogListings Lists the published listings. +func (client ComputeClient) ListAppCatalogListings(ctx context.Context, request ListAppCatalogListingsRequest) (response ListAppCatalogListingsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAppCatalogListings, policy) + if err != nil { + if ociResponse != nil { + response = ListAppCatalogListingsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListAppCatalogListingsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogListingsResponse") + } + return +} + +// listAppCatalogListings implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listAppCatalogListings(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings") + if err != nil { + return nil, err + } + + var response ListAppCatalogListingsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAppCatalogSubscriptions Lists subscriptions for a compartment. +func (client ComputeClient) ListAppCatalogSubscriptions(ctx context.Context, request ListAppCatalogSubscriptionsRequest) (response ListAppCatalogSubscriptionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAppCatalogSubscriptions, policy) + if err != nil { + if ociResponse != nil { + response = ListAppCatalogSubscriptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAppCatalogSubscriptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogSubscriptionsResponse") + } return } +// listAppCatalogSubscriptions implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listAppCatalogSubscriptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogSubscriptions") + if err != nil { + return nil, err + } + + var response ListAppCatalogSubscriptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListBootVolumeAttachments Lists the boot volume attachments in the specified compartment. You can filter the // list by specifying an instance OCID, boot volume OCID, or both. func (client ComputeClient) ListBootVolumeAttachments(ctx context.Context, request ListBootVolumeAttachmentsRequest) (response ListBootVolumeAttachmentsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/bootVolumeAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBootVolumeAttachments, policy) if err != nil { + if ociResponse != nil { + response = ListBootVolumeAttachmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListBootVolumeAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumeAttachmentsResponse") + } + return +} + +// listBootVolumeAttachments implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listBootVolumeAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListBootVolumeAttachmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListConsoleHistories Lists the console history metadata for the specified compartment or instance. func (client ComputeClient) ListConsoleHistories(ctx context.Context, request ListConsoleHistoriesRequest) (response ListConsoleHistoriesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instanceConsoleHistories/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listConsoleHistories, policy) if err != nil { + if ociResponse != nil { + response = ListConsoleHistoriesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListConsoleHistoriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListConsoleHistoriesResponse") + } + return +} + +// listConsoleHistories implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listConsoleHistories(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListConsoleHistoriesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListImages Lists the available images in the specified compartment. -// If you specify a value for the `sortBy` parameter, Oracle-provided images appear first in the list, followed by custom images. -// For more -// information about images, see -// Managing Custom Images (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm). +// ListImages Lists the available images in the specified compartment, including both +// Oracle-provided images (https://docs.cloud.oracle.com/Content/Compute/References/images.htm) and +// custom images (https://docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm) that have +// been created. The list of images returned is ordered to first show all +// Oracle-provided images, then all custom images. +// The order of images returned may change when new images are released. func (client ComputeClient) ListImages(ctx context.Context, request ListImagesRequest) (response ListImagesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/images", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listImages, policy) if err != nil { + if ociResponse != nil { + response = ListImagesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListImagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListImagesResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listImages implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listImages(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/images") + if err != nil { + return nil, err + } + + var response ListImagesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListInstanceConsoleConnections Lists the console connections for the specified compartment or instance. -// For more information about console access, see Accessing the Instance Console (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). +// For more information about console access, see Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). func (client ComputeClient) ListInstanceConsoleConnections(ctx context.Context, request ListInstanceConsoleConnectionsRequest) (response ListInstanceConsoleConnectionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instanceConsoleConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstanceConsoleConnections, policy) if err != nil { + if ociResponse != nil { + response = ListInstanceConsoleConnectionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListInstanceConsoleConnectionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstanceConsoleConnectionsResponse") + } + return +} + +// listInstanceConsoleConnections implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listInstanceConsoleConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListInstanceConsoleConnectionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListInstanceDevices Gets a list of all the devices for given instance. You can optionally filter results by device availability. +func (client ComputeClient) ListInstanceDevices(ctx context.Context, request ListInstanceDevicesRequest) (response ListInstanceDevicesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstanceDevices, policy) + if err != nil { + if ociResponse != nil { + response = ListInstanceDevicesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListInstanceDevicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstanceDevicesResponse") + } return } -// ListInstances Lists the instances in the specified compartment and the specified Availability Domain. +// listInstanceDevices implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listInstanceDevices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}/devices") + if err != nil { + return nil, err + } + + var response ListInstanceDevicesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListInstances Lists the instances in the specified compartment and the specified availability domain. // You can filter the results by specifying an instance name (the list will include all the identically-named // instances in the compartment). func (client ComputeClient) ListInstances(ctx context.Context, request ListInstancesRequest) (response ListInstancesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/instances/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstances, policy) if err != nil { + if ociResponse != nil { + response = ListInstancesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstancesResponse") + } + return +} + +// listInstances implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListInstancesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListShapes Lists the shapes that can be used to launch an instance within the specified compartment. You can // filter the list by compatibility with a specific image. func (client ComputeClient) ListShapes(ctx context.Context, request ListShapesRequest) (response ListShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/shapes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listShapes, policy) if err != nil { + if ociResponse != nil { + response = ListShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListShapesResponse") + } + return +} + +// listShapes implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/shapes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListVnicAttachments Lists the VNIC attachments in the specified compartment. A VNIC attachment // resides in the same compartment as the attached instance. The list can be -// filtered by instance, VNIC, or Availability Domain. +// filtered by instance, VNIC, or availability domain. func (client ComputeClient) ListVnicAttachments(ctx context.Context, request ListVnicAttachmentsRequest) (response ListVnicAttachmentsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/vnicAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVnicAttachments, policy) if err != nil { + if ociResponse != nil { + response = ListVnicAttachmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVnicAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVnicAttachmentsResponse") + } + return +} + +// listVnicAttachments implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listVnicAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnicAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVnicAttachmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } //listvolumeattachment allows to unmarshal list of polymorphic VolumeAttachment @@ -740,20 +1913,44 @@ // Currently, the only supported volume attachment type are IScsiVolumeAttachment and // ParavirtualizedVolumeAttachment. func (client ComputeClient) ListVolumeAttachments(ctx context.Context, request ListVolumeAttachmentsRequest) (response ListVolumeAttachmentsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/volumeAttachments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVolumeAttachments, policy) if err != nil { + if ociResponse != nil { + response = ListVolumeAttachmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVolumeAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVolumeAttachmentsResponse") + } + return +} + +// listVolumeAttachments implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) listVolumeAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeAttachments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVolumeAttachmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listvolumeattachment{}) - return + return response, err } // TerminateInstance Terminates the specified instance. Any attached VNICs and volumes are automatically detached @@ -763,73 +1960,182 @@ // This is an asynchronous operation. The instance's `lifecycleState` will change to TERMINATING temporarily // until the instance is completely removed. func (client ComputeClient) TerminateInstance(ctx context.Context, request TerminateInstanceRequest) (response TerminateInstanceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/instances/{instanceId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.terminateInstance, policy) if err != nil { + if ociResponse != nil { + response = TerminateInstanceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(TerminateInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into TerminateInstanceResponse") + } + return +} + +// terminateInstance implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) terminateInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instances/{instanceId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response TerminateInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateConsoleHistory Updates the specified console history metadata. func (client ComputeClient) UpdateConsoleHistory(ctx context.Context, request UpdateConsoleHistoryRequest) (response UpdateConsoleHistoryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/instanceConsoleHistories/{instanceConsoleHistoryId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateConsoleHistory, policy) if err != nil { + if ociResponse != nil { + response = UpdateConsoleHistoryResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateConsoleHistoryResponse") + } + return +} + +// updateConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) updateConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/instanceConsoleHistories/{instanceConsoleHistoryId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateConsoleHistoryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateImage Updates the display name of the image. Avoid entering confidential information. func (client ComputeClient) UpdateImage(ctx context.Context, request UpdateImageRequest) (response UpdateImageResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/images/{imageId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateImage, policy) if err != nil { + if ociResponse != nil { + response = UpdateImageResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateImageResponse") + } + return +} + +// updateImage implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) updateImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/images/{imageId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateImageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateInstance Updates the display name of the specified instance. Avoid entering confidential information. +// UpdateInstance Updates certain fields on the specified instance. Fields that are not provided in the +// request will not be updated. Avoid entering confidential information. +// Changes to metadata fields will be reflected in the instance metadata service (this may take +// up to a minute). // The OCID of the instance remains the same. func (client ComputeClient) UpdateInstance(ctx context.Context, request UpdateInstanceRequest) (response UpdateInstanceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/instances/{instanceId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateInstance, policy) if err != nil { + if ociResponse != nil { + response = UpdateInstanceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateInstanceResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateInstance implements the OCIOperation interface (enables retrying operations) +func (client ComputeClient) updateInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/instances/{instanceId}") + if err != nil { + return nil, err + } + + var response UpdateInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_computemanagement_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_computemanagement_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_computemanagement_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_computemanagement_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,879 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//ComputeManagementClient a client for ComputeManagement +type ComputeManagementClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewComputeManagementClientWithConfigurationProvider Creates a new default ComputeManagement client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewComputeManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ComputeManagementClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = ComputeManagementClient{BaseClient: baseClient} + client.BasePath = "20160918" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ComputeManagementClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ComputeManagementClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ComputeManagementClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AttachLoadBalancer Attach a load balancer to the instance pool. +func (client ComputeManagementClient) AttachLoadBalancer(ctx context.Context, request AttachLoadBalancerRequest) (response AttachLoadBalancerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachLoadBalancer, policy) + if err != nil { + if ociResponse != nil { + response = AttachLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(AttachLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachLoadBalancerResponse") + } + return +} + +// attachLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) attachLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/attachLoadBalancer") + if err != nil { + return nil, err + } + + var response AttachLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateInstanceConfiguration Creates an instance configuration +func (client ComputeManagementClient) CreateInstanceConfiguration(ctx context.Context, request CreateInstanceConfigurationRequest) (response CreateInstanceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createInstanceConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = CreateInstanceConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateInstanceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateInstanceConfigurationResponse") + } + return +} + +// createInstanceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) createInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConfigurations") + if err != nil { + return nil, err + } + + var response CreateInstanceConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateInstancePool Create an instance pool. +func (client ComputeManagementClient) CreateInstancePool(ctx context.Context, request CreateInstancePoolRequest) (response CreateInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = CreateInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateInstancePoolResponse") + } + return +} + +// createInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) createInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools") + if err != nil { + return nil, err + } + + var response CreateInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteInstanceConfiguration Deletes an instance configuration. +func (client ComputeManagementClient) DeleteInstanceConfiguration(ctx context.Context, request DeleteInstanceConfigurationRequest) (response DeleteInstanceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteInstanceConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = DeleteInstanceConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteInstanceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteInstanceConfigurationResponse") + } + return +} + +// deleteInstanceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) deleteInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConfigurations/{instanceConfigurationId}") + if err != nil { + return nil, err + } + + var response DeleteInstanceConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachLoadBalancer Detach a load balancer from the instance pool. +func (client ComputeManagementClient) DetachLoadBalancer(ctx context.Context, request DetachLoadBalancerRequest) (response DetachLoadBalancerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.detachLoadBalancer, policy) + if err != nil { + if ociResponse != nil { + response = DetachLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DetachLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachLoadBalancerResponse") + } + return +} + +// detachLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) detachLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/detachLoadBalancer") + if err != nil { + return nil, err + } + + var response DetachLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetInstanceConfiguration Gets the specified instance configuration +func (client ComputeManagementClient) GetInstanceConfiguration(ctx context.Context, request GetInstanceConfigurationRequest) (response GetInstanceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getInstanceConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = GetInstanceConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetInstanceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetInstanceConfigurationResponse") + } + return +} + +// getInstanceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) getInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConfigurations/{instanceConfigurationId}") + if err != nil { + return nil, err + } + + var response GetInstanceConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetInstancePool Gets the specified instance pool +func (client ComputeManagementClient) GetInstancePool(ctx context.Context, request GetInstancePoolRequest) (response GetInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = GetInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetInstancePoolResponse") + } + return +} + +// getInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) getInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools/{instancePoolId}") + if err != nil { + return nil, err + } + + var response GetInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LaunchInstanceConfiguration Launch an instance from an instance configuration +func (client ComputeManagementClient) LaunchInstanceConfiguration(ctx context.Context, request LaunchInstanceConfigurationRequest) (response LaunchInstanceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.launchInstanceConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = LaunchInstanceConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(LaunchInstanceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LaunchInstanceConfigurationResponse") + } + return +} + +// launchInstanceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) launchInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConfigurations/{instanceConfigurationId}/actions/launch") + if err != nil { + return nil, err + } + + var response LaunchInstanceConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListInstanceConfigurations Lists the available instanceConfigurations in the specific compartment. +func (client ComputeManagementClient) ListInstanceConfigurations(ctx context.Context, request ListInstanceConfigurationsRequest) (response ListInstanceConfigurationsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstanceConfigurations, policy) + if err != nil { + if ociResponse != nil { + response = ListInstanceConfigurationsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListInstanceConfigurationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstanceConfigurationsResponse") + } + return +} + +// listInstanceConfigurations implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) listInstanceConfigurations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConfigurations") + if err != nil { + return nil, err + } + + var response ListInstanceConfigurationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListInstancePoolInstances List the instances in the specified instance pool. +func (client ComputeManagementClient) ListInstancePoolInstances(ctx context.Context, request ListInstancePoolInstancesRequest) (response ListInstancePoolInstancesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstancePoolInstances, policy) + if err != nil { + if ociResponse != nil { + response = ListInstancePoolInstancesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListInstancePoolInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstancePoolInstancesResponse") + } + return +} + +// listInstancePoolInstances implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) listInstancePoolInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools/{instancePoolId}/instances") + if err != nil { + return nil, err + } + + var response ListInstancePoolInstancesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListInstancePools Lists the instance pools in the specified compartment. +func (client ComputeManagementClient) ListInstancePools(ctx context.Context, request ListInstancePoolsRequest) (response ListInstancePoolsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInstancePools, policy) + if err != nil { + if ociResponse != nil { + response = ListInstancePoolsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListInstancePoolsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInstancePoolsResponse") + } + return +} + +// listInstancePools implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) listInstancePools(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools") + if err != nil { + return nil, err + } + + var response ListInstancePoolsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ResetInstancePool Performs the reset (power off and power on) action on the specified instance pool, +// which performs the action on all the instances in the pool. +func (client ComputeManagementClient) ResetInstancePool(ctx context.Context, request ResetInstancePoolRequest) (response ResetInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.resetInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = ResetInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ResetInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResetInstancePoolResponse") + } + return +} + +// resetInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) resetInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/reset") + if err != nil { + return nil, err + } + + var response ResetInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SoftresetInstancePool Performs the softreset (ACPI shutdown and power on) action on the specified instance pool, +// which performs the action on all the instances in the pool. +func (client ComputeManagementClient) SoftresetInstancePool(ctx context.Context, request SoftresetInstancePoolRequest) (response SoftresetInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.softresetInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = SoftresetInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(SoftresetInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SoftresetInstancePoolResponse") + } + return +} + +// softresetInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) softresetInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/softreset") + if err != nil { + return nil, err + } + + var response SoftresetInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StartInstancePool Performs the start (power on) action on the specified instance pool, +// which performs the action on all the instances in the pool. +func (client ComputeManagementClient) StartInstancePool(ctx context.Context, request StartInstancePoolRequest) (response StartInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.startInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = StartInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(StartInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartInstancePoolResponse") + } + return +} + +// startInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) startInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/start") + if err != nil { + return nil, err + } + + var response StartInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StopInstancePool Performs the stop (power off) action on the specified instance pool, +// which performs the action on all the instances in the pool. +func (client ComputeManagementClient) StopInstancePool(ctx context.Context, request StopInstancePoolRequest) (response StopInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.stopInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = StopInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(StopInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopInstancePoolResponse") + } + return +} + +// stopInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) stopInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/stop") + if err != nil { + return nil, err + } + + var response StopInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// TerminateInstancePool Terminate the specified instance pool. +func (client ComputeManagementClient) TerminateInstancePool(ctx context.Context, request TerminateInstancePoolRequest) (response TerminateInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.terminateInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = TerminateInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(TerminateInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into TerminateInstancePoolResponse") + } + return +} + +// terminateInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) terminateInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instancePools/{instancePoolId}") + if err != nil { + return nil, err + } + + var response TerminateInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateInstanceConfiguration Updates the freeFormTags, definedTags, and display name of an instance configuration. +func (client ComputeManagementClient) UpdateInstanceConfiguration(ctx context.Context, request UpdateInstanceConfigurationRequest) (response UpdateInstanceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateInstanceConfiguration, policy) + if err != nil { + if ociResponse != nil { + response = UpdateInstanceConfigurationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateInstanceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateInstanceConfigurationResponse") + } + return +} + +// updateInstanceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) updateInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/instanceConfigurations/{instanceConfigurationId}") + if err != nil { + return nil, err + } + + var response UpdateInstanceConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateInstancePool Update the specified instance pool. +// The OCID of the instance pool remains the same. +func (client ComputeManagementClient) UpdateInstancePool(ctx context.Context, request UpdateInstancePoolRequest) (response UpdateInstancePoolResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateInstancePool, policy) + if err != nil { + if ociResponse != nil { + response = UpdateInstancePoolResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateInstancePoolResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateInstancePoolResponse") + } + return +} + +// updateInstancePool implements the OCIOperation interface (enables retrying operations) +func (client ComputeManagementClient) updateInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/instancePools/{instancePoolId}") + if err != nil { + return nil, err + } + + var response UpdateInstancePoolResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_virtualnetwork_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_virtualnetwork_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_virtualnetwork_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/core_virtualnetwork_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -37,7 +41,7 @@ // SetRegion overrides the region of this client. func (client *VirtualNetworkClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "iaas", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +52,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -58,18 +62,87 @@ return client.config } +// AttachServiceId Adds the specified Service to the list of enabled +// `Service` objects for the specified gateway. You must also set up a route rule with the +// `cidrBlock` of the `Service` as the rule's destination and the service gateway as the rule's +// target. See RouteTable. +// **Note:** The `AttachServiceId` operation is an easy way to add an individual `Service` to +// the service gateway. Compare it with +// UpdateServiceGateway, which replaces +// the entire existing list of enabled `Service` objects with the list that you provide in the +// `Update` call. +func (client VirtualNetworkClient) AttachServiceId(ctx context.Context, request AttachServiceIdRequest) (response AttachServiceIdResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.attachServiceId, policy) + if err != nil { + if ociResponse != nil { + response = AttachServiceIdResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(AttachServiceIdResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachServiceIdResponse") + } + return +} + +// attachServiceId implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) attachServiceId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways/{serviceGatewayId}/actions/attachService") + if err != nil { + return nil, err + } + + var response AttachServiceIdResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // BulkAddVirtualCircuitPublicPrefixes Adds one or more customer public IP prefixes to the specified public virtual circuit. // Use this operation (and not UpdateVirtualCircuit) // to add prefixes to the virtual circuit. Oracle must verify the customer's ownership // of each prefix before traffic for that prefix will flow across the virtual circuit. func (client VirtualNetworkClient) BulkAddVirtualCircuitPublicPrefixes(ctx context.Context, request BulkAddVirtualCircuitPublicPrefixesRequest) (err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkAddPublicPrefixes", request) + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + _, err = common.Retry(ctx, request, client.bulkAddVirtualCircuitPublicPrefixes, policy) + return +} + +// bulkAddVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) bulkAddVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkAddPublicPrefixes") if err != nil { - return + return nil, err } - _, err = client.Call(ctx, &httpRequest) - return + var response BulkAddVirtualCircuitPublicPrefixesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err } // BulkDeleteVirtualCircuitPublicPrefixes Removes one or more customer public IP prefixes from the specified public virtual circuit. @@ -77,13 +150,32 @@ // to remove prefixes from the virtual circuit. When the virtual circuit's state switches // back to PROVISIONED, Oracle stops advertising the specified prefixes across the connection. func (client VirtualNetworkClient) BulkDeleteVirtualCircuitPublicPrefixes(ctx context.Context, request BulkDeleteVirtualCircuitPublicPrefixesRequest) (err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkDeletePublicPrefixes", request) + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + _, err = common.Retry(ctx, request, client.bulkDeleteVirtualCircuitPublicPrefixes, policy) + return +} + +// bulkDeleteVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) bulkDeleteVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkDeletePublicPrefixes") if err != nil { - return + return nil, err } - _, err = client.Call(ctx, &httpRequest) - return + var response BulkDeleteVirtualCircuitPublicPrefixesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err } // ConnectLocalPeeringGateways Connects this local peering gateway (LPG) to another one in the same region. @@ -92,22 +184,46 @@ // an Identity and Access Management (IAM) policy that gives the requestor permission // to connect to LPGs in the acceptor's compartment. Without that permission, this // operation will fail. For more information, see -// VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ConnectLocalPeeringGateways(ctx context.Context, request ConnectLocalPeeringGatewaysRequest) (response ConnectLocalPeeringGatewaysResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/localPeeringGateways/{localPeeringGatewayId}/actions/connect", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.connectLocalPeeringGateways, policy) if err != nil { + if ociResponse != nil { + response = ConnectLocalPeeringGatewaysResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ConnectLocalPeeringGatewaysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConnectLocalPeeringGatewaysResponse") + } + return +} + +// connectLocalPeeringGateways implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) connectLocalPeeringGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/localPeeringGateways/{localPeeringGatewayId}/actions/connect") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ConnectLocalPeeringGatewaysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ConnectRemotePeeringConnections Connects this RPC to another one in a different region. @@ -116,51 +232,104 @@ // an Identity and Access Management (IAM) policy that gives the requestor permission // to connect to RPCs in the acceptor's compartment. Without that permission, this // operation will fail. For more information, see -// VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ConnectRemotePeeringConnections(ctx context.Context, request ConnectRemotePeeringConnectionsRequest) (response ConnectRemotePeeringConnectionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/remotePeeringConnections/{remotePeeringConnectionId}/actions/connect", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.connectRemotePeeringConnections, policy) if err != nil { + if ociResponse != nil { + response = ConnectRemotePeeringConnectionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ConnectRemotePeeringConnectionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConnectRemotePeeringConnectionsResponse") + } + return +} + +// connectRemotePeeringConnections implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) connectRemotePeeringConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/remotePeeringConnections/{remotePeeringConnectionId}/actions/connect") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ConnectRemotePeeringConnectionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateCpe Creates a new virtual Customer-Premises Equipment (CPE) object in the specified compartment. For -// more information, see IPSec VPNs (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPsec.htm). +// CreateCpe Creates a new virtual customer-premises equipment (CPE) object in the specified compartment. For +// more information, see IPSec VPNs (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want // the CPE to reside. Notice that the CPE doesn't have to be in the same compartment as the IPSec // connection or other Networking Service components. If you're not sure which compartment to // use, put the CPE in the same compartment as the DRG. For more information about -// compartments and access control, see Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about OCIDs, see Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// compartments and access control, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must provide the public IP address of your on-premises router. See -// Configuring Your On-Premises Router for an IPSec VPN (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/configuringCPE.htm). +// Configuring Your On-Premises Router for an IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/configuringCPE.htm). // You may optionally specify a *display name* for the CPE, otherwise a default is provided. It does not have to // be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCpe(ctx context.Context, request CreateCpeRequest) (response CreateCpeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/cpes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCpe, policy) if err != nil { + if ociResponse != nil { + response = CreateCpeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCpeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCpeResponse") + } + return +} + +// createCpe implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cpes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCpeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateCrossConnect Creates a new cross-connect. Oracle recommends you create each cross-connect in a @@ -168,62 +337,120 @@ // with the connection. // After creating the `CrossConnect` object, you need to go the FastConnect location // and request to have the physical cable installed. For more information, see -// FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the cross-connect to reside. If you're // not sure which compartment to use, put the cross-connect in the // same compartment with your VCN. For more information about // compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the cross-connect. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCrossConnect(ctx context.Context, request CreateCrossConnectRequest) (response CreateCrossConnectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/crossConnects", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCrossConnect, policy) if err != nil { + if ociResponse != nil { + response = CreateCrossConnectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCrossConnectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCrossConnectResponse") + } + return +} + +// createCrossConnect implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnects") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCrossConnectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateCrossConnectGroup Creates a new cross-connect group to use with Oracle Cloud Infrastructure // FastConnect. For more information, see -// FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the cross-connect group to reside. If you're // not sure which compartment to use, put the cross-connect group in the // same compartment with your VCN. For more information about // compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the cross-connect group. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCrossConnectGroup(ctx context.Context, request CreateCrossConnectGroupRequest) (response CreateCrossConnectGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/crossConnectGroups", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCrossConnectGroup, policy) if err != nil { + if ociResponse != nil { + response = CreateCrossConnectGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCrossConnectGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCrossConnectGroupResponse") + } + return +} + +// createCrossConnectGroup implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnectGroups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCrossConnectGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateDhcpOptions Creates a new set of DHCP options for the specified VCN. For more information, see @@ -232,198 +459,452 @@ // DHCP options to reside. Notice that the set of options doesn't have to be in the same compartment as the VCN, // subnets, or other Networking Service components. If you're not sure which compartment to use, put the set // of DHCP options in the same compartment as the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the set of DHCP options, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateDhcpOptions(ctx context.Context, request CreateDhcpOptionsRequest) (response CreateDhcpOptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/dhcps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDhcpOptions, policy) if err != nil { + if ociResponse != nil { + response = CreateDhcpOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDhcpOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDhcpOptionsResponse") + } + return +} + +// createDhcpOptions implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dhcps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDhcpOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateDrg Creates a new Dynamic Routing Gateway (DRG) in the specified compartment. For more information, -// see Dynamic Routing Gateways (DRGs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDRGs.htm). +// CreateDrg Creates a new dynamic routing gateway (DRG) in the specified compartment. For more information, +// see Dynamic Routing Gateways (DRGs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDRGs.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want // the DRG to reside. Notice that the DRG doesn't have to be in the same compartment as the VCN, // the DRG attachment, or other Networking Service components. If you're not sure which compartment // to use, put the DRG in the same compartment as the VCN. For more information about compartments -// and access control, see Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about OCIDs, see Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// and access control, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the DRG, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateDrg(ctx context.Context, request CreateDrgRequest) (response CreateDrgResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/drgs", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDrg, policy) if err != nil { + if ociResponse != nil { + response = CreateDrgResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDrgResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDrgResponse") + } + return +} + +// createDrg implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/drgs") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDrgResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateDrgAttachment Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time, // and vice versa. The response includes a `DrgAttachment` object with its own OCID. For more // information about DRGs, see -// Dynamic Routing Gateways (DRGs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDRGs.htm). +// Dynamic Routing Gateways (DRGs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDRGs.htm). // You may optionally specify a *display name* for the attachment, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // For the purposes of access control, the DRG attachment is automatically placed into the same compartment // as the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). func (client VirtualNetworkClient) CreateDrgAttachment(ctx context.Context, request CreateDrgAttachmentRequest) (response CreateDrgAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/drgAttachments", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDrgAttachment, policy) if err != nil { + if ociResponse != nil { + response = CreateDrgAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDrgAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDrgAttachmentResponse") + } + return +} + +// createDrgAttachment implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/drgAttachments") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDrgAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateIPSecConnection Creates a new IPSec connection between the specified DRG and CPE. For more information, see -// IPSec VPNs (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPsec.htm). -// In the request, you must include at least one static route to the CPE object (you're allowed a maximum -// of 10). For example: 10.0.8.0/16. +// IPSec VPNs (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). +// If you configure at least one tunnel to use static routing, then in the request you must provide +// at least one valid static route (you're allowed a maximum of 10). For example: 10.0.0.0/16. +// If you configure both tunnels to use BGP dynamic routing, you can provide an empty list for +// the static routes. For more information, see the important note in +// IPSecConnection. // For the purposes of access control, you must provide the OCID of the compartment where you want the // IPSec connection to reside. Notice that the IPSec connection doesn't have to be in the same compartment // as the DRG, CPE, or other Networking Service components. If you're not sure which compartment to // use, put the IPSec connection in the same compartment as the DRG. For more information about // compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about OCIDs, see Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the IPSec connection, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // After creating the IPSec connection, you need to configure your on-premises router -// with tunnel-specific information returned by -// GetIPSecConnectionDeviceConfig. -// For each tunnel, that operation gives you the IP address of Oracle's VPN headend and the shared secret +// with tunnel-specific information. For tunnel status and the required configuration information, see: +// * IPSecConnectionTunnel +// * IPSecConnectionTunnelSharedSecret +// For each tunnel, you need the IP address of Oracle's VPN headend and the shared secret // (that is, the pre-shared key). For more information, see -// Configuring Your On-Premises Router for an IPSec VPN (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/configuringCPE.htm). -// To get the status of the tunnels (whether they're up or down), use -// GetIPSecConnectionDeviceStatus. +// Configuring Your On-Premises Router for an IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/configuringCPE.htm). func (client VirtualNetworkClient) CreateIPSecConnection(ctx context.Context, request CreateIPSecConnectionRequest) (response CreateIPSecConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/ipsecConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createIPSecConnection, policy) if err != nil { + if ociResponse != nil { + response = CreateIPSecConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateIPSecConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateIPSecConnectionResponse") + } + return +} + +// createIPSecConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/ipsecConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateIPSecConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateInternetGateway Creates a new Internet Gateway for the specified VCN. For more information, see -// Connectivity to the Internet (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIGs.htm). +// CreateInternetGateway Creates a new internet gateway for the specified VCN. For more information, see +// Access to the Internet (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIGs.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the Internet -// Gateway to reside. Notice that the Internet Gateway doesn't have to be in the same compartment as the VCN or +// Gateway to reside. Notice that the internet gateway doesn't have to be in the same compartment as the VCN or // other Networking Service components. If you're not sure which compartment to use, put the Internet // Gateway in the same compartment with the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). -// You may optionally specify a *display name* for the Internet Gateway, otherwise a default is provided. It +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). +// You may optionally specify a *display name* for the internet gateway, otherwise a default is provided. It // does not have to be unique, and you can change it. Avoid entering confidential information. -// For traffic to flow between a subnet and an Internet Gateway, you must create a route rule accordingly in -// the subnet's route table (for example, 0.0.0.0/0 > Internet Gateway). See +// For traffic to flow between a subnet and an internet gateway, you must create a route rule accordingly in +// the subnet's route table (for example, 0.0.0.0/0 > internet gateway). See // UpdateRouteTable. -// You must specify whether the Internet Gateway is enabled when you create it. If it's disabled, that means no +// You must specify whether the internet gateway is enabled when you create it. If it's disabled, that means no // traffic will flow to/from the internet even if there's a route rule that enables that traffic. You can later // use UpdateInternetGateway to easily disable/enable // the gateway without changing the route rule. func (client VirtualNetworkClient) CreateInternetGateway(ctx context.Context, request CreateInternetGatewayRequest) (response CreateInternetGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/internetGateways", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createInternetGateway, policy) if err != nil { + if ociResponse != nil { + response = CreateInternetGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateInternetGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateInternetGatewayResponse") + } + return +} + +// createInternetGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/internetGateways") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateInternetGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateLocalPeeringGateway Creates a new local peering gateway (LPG) for the specified VCN. func (client VirtualNetworkClient) CreateLocalPeeringGateway(ctx context.Context, request CreateLocalPeeringGatewayRequest) (response CreateLocalPeeringGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/localPeeringGateways", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createLocalPeeringGateway, policy) if err != nil { + if ociResponse != nil { + response = CreateLocalPeeringGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateLocalPeeringGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateLocalPeeringGatewayResponse") + } + return +} + +// createLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/localPeeringGateways") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateLocalPeeringGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateNatGateway Creates a new NAT gateway for the specified VCN. You must also set up a route rule with the +// NAT gateway as the rule's target. See RouteTable. +func (client VirtualNetworkClient) CreateNatGateway(ctx context.Context, request CreateNatGatewayRequest) (response CreateNatGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createNatGateway, policy) + if err != nil { + if ociResponse != nil { + response = CreateNatGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateNatGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNatGatewayResponse") + } return } +// createNatGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/natGateways") + if err != nil { + return nil, err + } + + var response CreateNatGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreatePrivateIp Creates a secondary private IP for the specified VNIC. // For more information about secondary private IPs, see -// IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPaddresses.htm). +// IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). func (client VirtualNetworkClient) CreatePrivateIp(ctx context.Context, request CreatePrivateIpRequest) (response CreatePrivateIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/privateIps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createPrivateIp, policy) if err != nil { + if ociResponse != nil { + response = CreatePrivateIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreatePrivateIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePrivateIpResponse") + } + return +} + +// createPrivateIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createPrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/privateIps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreatePrivateIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreatePublicIp Creates a public IP. Use the `lifetime` property to specify whether it's an ephemeral or // reserved public IP. For information about limits on how many you can create, see -// Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). -// * **For an ephemeral public IP:** You must also specify a `privateIpId` with the OCID of -// the primary private IP you want to assign the public IP to. The public IP is created in -// the same Availability Domain as the private IP. An ephemeral public IP must always be +// Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). +// * **For an ephemeral public IP assigned to a private IP:** You must also specify a `privateIpId` +// with the OCID of the primary private IP you want to assign the public IP to. The public IP is +// created in the same availability domain as the private IP. An ephemeral public IP must always be // assigned to a private IP, and only to the *primary* private IP on a VNIC, not a secondary -// private IP. +// private IP. Exception: If you create a NatGateway, Oracle +// automatically assigns the NAT gateway a regional ephemeral public IP that you cannot remove. // * **For a reserved public IP:** You may also optionally assign the public IP to a private // IP by specifying `privateIpId`. Or you can later assign the public IP with // UpdatePublicIp. @@ -433,143 +914,341 @@ // asynchronous. Poll the public IP's `lifecycleState` to determine if the assignment // succeeded. func (client VirtualNetworkClient) CreatePublicIp(ctx context.Context, request CreatePublicIpRequest) (response CreatePublicIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/publicIps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createPublicIp, policy) if err != nil { + if ociResponse != nil { + response = CreatePublicIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreatePublicIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePublicIpResponse") + } + return +} + +// createPublicIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createPublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreatePublicIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateRemotePeeringConnection Creates a new remote peering connection (RPC) for the specified DRG. func (client VirtualNetworkClient) CreateRemotePeeringConnection(ctx context.Context, request CreateRemotePeeringConnectionRequest) (response CreateRemotePeeringConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/remotePeeringConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createRemotePeeringConnection, policy) if err != nil { + if ociResponse != nil { + response = CreateRemotePeeringConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateRemotePeeringConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRemotePeeringConnectionResponse") + } + return +} + +// createRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/remotePeeringConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateRemotePeeringConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateRouteTable Creates a new route table for the specified VCN. In the request you must also include at least one route // rule for the new route table. For information on the number of rules you can have in a route table, see -// Service Limits (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/servicelimits.htm). For general information about route +// Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). For general information about route // tables in your VCN and the types of targets you can use in route rules, -// see Route Tables (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). +// see Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the route // table to reside. Notice that the route table doesn't have to be in the same compartment as the VCN, subnets, // or other Networking Service components. If you're not sure which compartment to use, put the route // table in the same compartment as the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the route table, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateRouteTable(ctx context.Context, request CreateRouteTableRequest) (response CreateRouteTableResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/routeTables", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createRouteTable, policy) if err != nil { + if ociResponse != nil { + response = CreateRouteTableResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateRouteTableResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRouteTableResponse") + } + return +} + +// createRouteTable implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/routeTables") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateRouteTableResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateSecurityList Creates a new security list for the specified VCN. For more information -// about security lists, see Security Lists (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). +// about security lists, see Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // For information on the number of rules you can have in a security list, see -// Service Limits (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/servicelimits.htm). +// Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the security // list to reside. Notice that the security list doesn't have to be in the same compartment as the VCN, subnets, // or other Networking Service components. If you're not sure which compartment to use, put the security // list in the same compartment as the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the security list, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateSecurityList(ctx context.Context, request CreateSecurityListRequest) (response CreateSecurityListResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/securityLists", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSecurityList, policy) if err != nil { + if ociResponse != nil { + response = CreateSecurityListResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateSecurityListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSecurityListResponse") + } + return +} + +// createSecurityList implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/securityLists") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSecurityListResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateSubnet Creates a new subnet in the specified VCN. You can't change the size of the subnet after creation, -// so it's important to think about the size of subnets you need before creating them. -// For more information, see VCNs and Subnets (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVCNs.htm). -// For information on the number of subnets you can have in a VCN, see -// Service Limits (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/servicelimits.htm). -// For the purposes of access control, you must provide the OCID of the compartment where you want the subnet -// to reside. Notice that the subnet doesn't have to be in the same compartment as the VCN, route tables, or +// CreateServiceGateway Creates a new service gateway in the specified compartment. +// For the purposes of access control, you must provide the OCID of the compartment where you want +// the service gateway to reside. For more information about compartments and access control, see +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). +// You may optionally specify a *display name* for the service gateway, otherwise a default is provided. +// It does not have to be unique, and you can change it. Avoid entering confidential information. +func (client VirtualNetworkClient) CreateServiceGateway(ctx context.Context, request CreateServiceGatewayRequest) (response CreateServiceGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createServiceGateway, policy) + if err != nil { + if ociResponse != nil { + response = CreateServiceGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateServiceGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateServiceGatewayResponse") + } + return +} + +// createServiceGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways") + if err != nil { + return nil, err + } + + var response CreateServiceGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateSubnet Creates a new subnet in the specified VCN. You can't change the size of the subnet after creation, +// so it's important to think about the size of subnets you need before creating them. +// For more information, see VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). +// For information on the number of subnets you can have in a VCN, see +// Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). +// For the purposes of access control, you must provide the OCID of the compartment where you want the subnet +// to reside. Notice that the subnet doesn't have to be in the same compartment as the VCN, route tables, or // other Networking Service components. If you're not sure which compartment to use, put the subnet in // the same compartment as the VCN. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, -// see Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, +// see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally associate a route table with the subnet. If you don't, the subnet will use the // VCN's default route table. For more information about route tables, see -// Route Tables (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). +// Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). // You may optionally associate a security list with the subnet. If you don't, the subnet will use the // VCN's default security list. For more information about security lists, see -// Security Lists (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). +// Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // You may optionally associate a set of DHCP options with the subnet. If you don't, the subnet will use the // VCN's default set. For more information about DHCP options, see -// DHCP Options (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDHCP.htm). +// DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). // You may optionally specify a *display name* for the subnet, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // You can also add a DNS label for the subnet, which is required if you want the Internet and // VCN Resolver to resolve hostnames for instances in the subnet. For more information, see -// DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). +// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). func (client VirtualNetworkClient) CreateSubnet(ctx context.Context, request CreateSubnetRequest) (response CreateSubnetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/subnets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSubnet, policy) if err != nil { + if ociResponse != nil { + response = CreateSubnetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateSubnetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSubnetResponse") + } + return +} + +// createSubnet implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/subnets") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSubnetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateVcn Creates a new Virtual Cloud Network (VCN). For more information, see -// VCNs and Subnets (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVCNs.htm). +// CreateVcn Creates a new virtual cloud network (VCN). For more information, see +// VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). // For the VCN you must specify a single, contiguous IPv4 CIDR block. Oracle recommends using one of the // private IP address ranges specified in RFC 1918 (https://tools.ietf.org/html/rfc1918) (10.0.0.0/8, // 172.16/12, and 192.168/16). Example: 172.16.0.0/16. The CIDR block can range from /16 to /30, and it @@ -578,128 +1257,258 @@ // reside. Consult an Oracle Cloud Infrastructure administrator in your organization if you're not sure which // compartment to use. Notice that the VCN doesn't have to be in the same compartment as the subnets or other // Networking Service components. For more information about compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the VCN, otherwise a default is provided. It does not have to // be unique, and you can change it. Avoid entering confidential information. // You can also add a DNS label for the VCN, which is required if you want the instances to use the // Interent and VCN Resolver option for DNS in the VCN. For more information, see -// DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). +// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // The VCN automatically comes with a default route table, default security list, and default set of DHCP options. // The OCID for each is returned in the response. You can't delete these default objects, but you can change their // contents (that is, change the route rules, security list rules, and so on). -// The VCN and subnets you create are not accessible until you attach an Internet Gateway or set up an IPSec VPN +// The VCN and subnets you create are not accessible until you attach an internet gateway or set up an IPSec VPN // or FastConnect. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). func (client VirtualNetworkClient) CreateVcn(ctx context.Context, request CreateVcnRequest) (response CreateVcnResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/vcns", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVcn, policy) if err != nil { + if ociResponse != nil { + response = CreateVcnResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateVcnResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVcnResponse") + } + return +} + +// createVcn implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vcns") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateVcnResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateVirtualCircuit Creates a new virtual circuit to use with Oracle Cloud // Infrastructure FastConnect. For more information, see -// FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the virtual circuit to reside. If you're // not sure which compartment to use, put the virtual circuit in the // same compartment with the DRG it's using. For more information about // compartments and access control, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the virtual circuit. // It does not have to be unique, and you can change it. Avoid entering confidential information. // **Important:** When creating a virtual circuit, you specify a DRG for // the traffic to flow through. Make sure you attach the DRG to your // VCN and confirm the VCN's routing sends traffic to the DRG. Otherwise // traffic will not flow. For more information, see -// Route Tables (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). +// Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). func (client VirtualNetworkClient) CreateVirtualCircuit(ctx context.Context, request CreateVirtualCircuitRequest) (response CreateVirtualCircuitResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/virtualCircuits", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVirtualCircuit, policy) if err != nil { + if ociResponse != nil { + response = CreateVirtualCircuitResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateVirtualCircuitResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVirtualCircuitResponse") + } + return +} + +// createVirtualCircuit implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) createVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateVirtualCircuitResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteCpe Deletes the specified CPE object. The CPE must not be connected to a DRG. This is an asynchronous // operation. The CPE's `lifecycleState` will change to TERMINATING temporarily until the CPE is completely // removed. func (client VirtualNetworkClient) DeleteCpe(ctx context.Context, request DeleteCpeRequest) (response DeleteCpeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/cpes/{cpeId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCpe, policy) if err != nil { + if ociResponse != nil { + response = DeleteCpeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteCpeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCpeResponse") + } + return +} + +// deleteCpe implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cpes/{cpeId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCpeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteCrossConnect Deletes the specified cross-connect. It must not be mapped to a // VirtualCircuit. func (client VirtualNetworkClient) DeleteCrossConnect(ctx context.Context, request DeleteCrossConnectRequest) (response DeleteCrossConnectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/crossConnects/{crossConnectId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCrossConnect, policy) if err != nil { + if ociResponse != nil { + response = DeleteCrossConnectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteCrossConnectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCrossConnectResponse") + } + return +} + +// deleteCrossConnect implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/crossConnects/{crossConnectId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCrossConnectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteCrossConnectGroup Deletes the specified cross-connect group. It must not contain any // cross-connects, and it cannot be mapped to a // VirtualCircuit. func (client VirtualNetworkClient) DeleteCrossConnectGroup(ctx context.Context, request DeleteCrossConnectGroupRequest) (response DeleteCrossConnectGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/crossConnectGroups/{crossConnectGroupId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCrossConnectGroup, policy) if err != nil { + if ociResponse != nil { + response = DeleteCrossConnectGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteCrossConnectGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCrossConnectGroupResponse") + } + return +} + +// deleteCrossConnectGroup implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/crossConnectGroups/{crossConnectGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCrossConnectGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteDhcpOptions Deletes the specified set of DHCP options, but only if it's not associated with a subnet. You can't delete a @@ -707,20 +1516,44 @@ // This is an asynchronous operation. The state of the set of options will switch to TERMINATING temporarily // until the set is completely removed. func (client VirtualNetworkClient) DeleteDhcpOptions(ctx context.Context, request DeleteDhcpOptionsRequest) (response DeleteDhcpOptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/dhcps/{dhcpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteDhcpOptions, policy) if err != nil { + if ociResponse != nil { + response = DeleteDhcpOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteDhcpOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDhcpOptionsResponse") + } + return +} + +// deleteDhcpOptions implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dhcps/{dhcpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteDhcpOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteDrg Deletes the specified DRG. The DRG must not be attached to a VCN or be connected to your on-premise @@ -728,40 +1561,88 @@ // operation. The DRG's `lifecycleState` will change to TERMINATING temporarily until the DRG is completely // removed. func (client VirtualNetworkClient) DeleteDrg(ctx context.Context, request DeleteDrgRequest) (response DeleteDrgResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/drgs/{drgId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteDrg, policy) if err != nil { + if ociResponse != nil { + response = DeleteDrgResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteDrgResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDrgResponse") + } + return +} + +// deleteDrg implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/drgs/{drgId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteDrgResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteDrgAttachment Detaches a DRG from a VCN by deleting the corresponding `DrgAttachment`. This is an asynchronous // operation. The attachment's `lifecycleState` will change to DETACHING temporarily until the attachment // is completely removed. func (client VirtualNetworkClient) DeleteDrgAttachment(ctx context.Context, request DeleteDrgAttachmentRequest) (response DeleteDrgAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/drgAttachments/{drgAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteDrgAttachment, policy) if err != nil { + if ociResponse != nil { + response = DeleteDrgAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteDrgAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDrgAttachmentResponse") + } + return +} + +// deleteDrgAttachment implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/drgAttachments/{drgAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteDrgAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteIPSecConnection Deletes the specified IPSec connection. If your goal is to disable the IPSec VPN between your VCN and @@ -772,92 +1653,236 @@ // This is an asynchronous operation. The connection's `lifecycleState` will change to TERMINATING temporarily // until the connection is completely removed. func (client VirtualNetworkClient) DeleteIPSecConnection(ctx context.Context, request DeleteIPSecConnectionRequest) (response DeleteIPSecConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/ipsecConnections/{ipscId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteIPSecConnection, policy) if err != nil { + if ociResponse != nil { + response = DeleteIPSecConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteIPSecConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteIPSecConnectionResponse") + } + return +} + +// deleteIPSecConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/ipsecConnections/{ipscId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteIPSecConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteInternetGateway Deletes the specified Internet Gateway. The Internet Gateway does not have to be disabled, but +// DeleteInternetGateway Deletes the specified internet gateway. The internet gateway does not have to be disabled, but // there must not be a route table that lists it as a target. // This is an asynchronous operation. The gateway's `lifecycleState` will change to TERMINATING temporarily // until the gateway is completely removed. func (client VirtualNetworkClient) DeleteInternetGateway(ctx context.Context, request DeleteInternetGatewayRequest) (response DeleteInternetGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/internetGateways/{igId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteInternetGateway, policy) if err != nil { + if ociResponse != nil { + response = DeleteInternetGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteInternetGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteInternetGatewayResponse") + } + return +} + +// deleteInternetGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/internetGateways/{igId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteInternetGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteLocalPeeringGateway Deletes the specified local peering gateway (LPG). // This is an asynchronous operation; the local peering gateway's `lifecycleState` changes to TERMINATING temporarily // until the local peering gateway is completely removed. func (client VirtualNetworkClient) DeleteLocalPeeringGateway(ctx context.Context, request DeleteLocalPeeringGatewayRequest) (response DeleteLocalPeeringGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/localPeeringGateways/{localPeeringGatewayId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteLocalPeeringGateway, policy) if err != nil { + if ociResponse != nil { + response = DeleteLocalPeeringGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteLocalPeeringGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteLocalPeeringGatewayResponse") + } + return +} + +// deleteLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/localPeeringGateways/{localPeeringGatewayId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteLocalPeeringGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNatGateway Deletes the specified NAT gateway. The NAT gateway does not have to be disabled, but there +// must not be a route rule that lists the NAT gateway as a target. +// This is an asynchronous operation. The NAT gateway's `lifecycleState` will change to +// TERMINATING temporarily until the NAT gateway is completely removed. +func (client VirtualNetworkClient) DeleteNatGateway(ctx context.Context, request DeleteNatGatewayRequest) (response DeleteNatGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteNatGateway, policy) + if err != nil { + if ociResponse != nil { + response = DeleteNatGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNatGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNatGatewayResponse") + } return } +// deleteNatGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/natGateways/{natGatewayId}") + if err != nil { + return nil, err + } + + var response DeleteNatGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeletePrivateIp Unassigns and deletes the specified private IP. You must // specify the object's OCID. The private IP address is returned to // the subnet's pool of available addresses. // This operation cannot be used with primary private IPs, which are // automatically unassigned and deleted when the VNIC is terminated. // **Important:** If a secondary private IP is the -// target of a route rule (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip), +// target of a route rule (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip), // unassigning it from the VNIC causes that route rule to blackhole and the traffic // will be dropped. func (client VirtualNetworkClient) DeletePrivateIp(ctx context.Context, request DeletePrivateIpRequest) (response DeletePrivateIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/privateIps/{privateIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deletePrivateIp, policy) if err != nil { + if ociResponse != nil { + response = DeletePrivateIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeletePrivateIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePrivateIpResponse") + } + return +} + +// deletePrivateIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deletePrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/privateIps/{privateIpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeletePrivateIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeletePublicIp Unassigns and deletes the specified public IP (either ephemeral or reserved). // You must specify the object's OCID. The public IP address is returned to the // Oracle Cloud Infrastructure public IP pool. +// **Note:** You cannot update, unassign, or delete the public IP that Oracle automatically +// assigned to an entity for you (such as a load balancer or NAT gateway). The public IP is +// automatically deleted if the assigned entity is terminated. // For an assigned reserved public IP, the initial unassignment portion of this operation // is asynchronous. Poll the public IP's `lifecycleState` to determine // if the operation succeeded. @@ -865,40 +1890,88 @@ // of reserved public IPs, instead use // UpdatePublicIp. func (client VirtualNetworkClient) DeletePublicIp(ctx context.Context, request DeletePublicIpRequest) (response DeletePublicIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/publicIps/{publicIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deletePublicIp, policy) if err != nil { + if ociResponse != nil { + response = DeletePublicIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeletePublicIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePublicIpResponse") + } + return +} + +// deletePublicIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deletePublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/publicIps/{publicIpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeletePublicIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteRemotePeeringConnection Deletes the remote peering connection (RPC). // This is an asynchronous operation; the RPC's `lifecycleState` changes to TERMINATING temporarily // until the RPC is completely removed. func (client VirtualNetworkClient) DeleteRemotePeeringConnection(ctx context.Context, request DeleteRemotePeeringConnectionRequest) (response DeleteRemotePeeringConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/remotePeeringConnections/{remotePeeringConnectionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteRemotePeeringConnection, policy) if err != nil { + if ociResponse != nil { + response = DeleteRemotePeeringConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteRemotePeeringConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteRemotePeeringConnectionResponse") + } + return +} + +// deleteRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/remotePeeringConnections/{remotePeeringConnectionId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteRemotePeeringConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteRouteTable Deletes the specified route table, but only if it's not associated with a subnet. You can't delete a @@ -906,20 +1979,44 @@ // This is an asynchronous operation. The route table's `lifecycleState` will change to TERMINATING temporarily // until the route table is completely removed. func (client VirtualNetworkClient) DeleteRouteTable(ctx context.Context, request DeleteRouteTableRequest) (response DeleteRouteTableResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/routeTables/{rtId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteRouteTable, policy) if err != nil { + if ociResponse != nil { + response = DeleteRouteTableResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteRouteTableResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteRouteTableResponse") + } + return +} + +// deleteRouteTable implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/routeTables/{rtId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteRouteTableResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteSecurityList Deletes the specified security list, but only if it's not associated with a subnet. You can't delete @@ -927,60 +2024,175 @@ // This is an asynchronous operation. The security list's `lifecycleState` will change to TERMINATING temporarily // until the security list is completely removed. func (client VirtualNetworkClient) DeleteSecurityList(ctx context.Context, request DeleteSecurityListRequest) (response DeleteSecurityListResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/securityLists/{securityListId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSecurityList, policy) if err != nil { + if ociResponse != nil { + response = DeleteSecurityListResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteSecurityListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSecurityListResponse") + } + return +} + +// deleteSecurityList implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/securityLists/{securityListId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSecurityListResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteServiceGateway Deletes the specified service gateway. There must not be a route table that lists the service +// gateway as a target. +func (client VirtualNetworkClient) DeleteServiceGateway(ctx context.Context, request DeleteServiceGatewayRequest) (response DeleteServiceGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteServiceGateway, policy) + if err != nil { + if ociResponse != nil { + response = DeleteServiceGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteServiceGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteServiceGatewayResponse") + } return } +// deleteServiceGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/serviceGateways/{serviceGatewayId}") + if err != nil { + return nil, err + } + + var response DeleteServiceGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteSubnet Deletes the specified subnet, but only if there are no instances in the subnet. This is an asynchronous // operation. The subnet's `lifecycleState` will change to TERMINATING temporarily. If there are any // instances in the subnet, the state will instead change back to AVAILABLE. func (client VirtualNetworkClient) DeleteSubnet(ctx context.Context, request DeleteSubnetRequest) (response DeleteSubnetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/subnets/{subnetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSubnet, policy) if err != nil { + if ociResponse != nil { + response = DeleteSubnetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteSubnetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSubnetResponse") + } + return +} + +// deleteSubnet implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/subnets/{subnetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSubnetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteVcn Deletes the specified VCN. The VCN must be empty and have no attached gateways. This is an asynchronous // operation. The VCN's `lifecycleState` will change to TERMINATING temporarily until the VCN is completely // removed. func (client VirtualNetworkClient) DeleteVcn(ctx context.Context, request DeleteVcnRequest) (response DeleteVcnResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/vcns/{vcnId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteVcn, policy) if err != nil { + if ociResponse != nil { + response = DeleteVcnResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteVcnResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVcnResponse") + } + return +} + +// deleteVcn implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vcns/{vcnId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteVcnResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteVirtualCircuit Deletes the specified virtual circuit. @@ -988,297 +2200,907 @@ // make sure to also terminate the connection with // the provider, or else the provider may continue to bill you. func (client VirtualNetworkClient) DeleteVirtualCircuit(ctx context.Context, request DeleteVirtualCircuitRequest) (response DeleteVirtualCircuitResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/virtualCircuits/{virtualCircuitId}", request) - if err != nil { - return + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteVirtualCircuit, policy) if err != nil { + if ociResponse != nil { + response = DeleteVirtualCircuitResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteVirtualCircuitResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteVirtualCircuitResponse") + } return } -// GetCpe Gets the specified CPE's information. -func (client VirtualNetworkClient) GetCpe(ctx context.Context, request GetCpeRequest) (response GetCpeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/cpes/{cpeId}", request) +// deleteVirtualCircuit implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) deleteVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/virtualCircuits/{virtualCircuitId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteVirtualCircuitResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetCrossConnect Gets the specified cross-connect's information. -func (client VirtualNetworkClient) GetCrossConnect(ctx context.Context, request GetCrossConnectRequest) (response GetCrossConnectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnects/{crossConnectId}", request) +// DetachServiceId Removes the specified Service from the list of enabled +// `Service` objects for the specified gateway. You do not need to remove any route +// rules that specify this `Service` object's `cidrBlock` as the destination CIDR. However, consider +// removing the rules if your intent is to permanently disable use of the `Service` through this +// service gateway. +// **Note:** The `DetachServiceId` operation is an easy way to remove an individual `Service` from +// the service gateway. Compare it with +// UpdateServiceGateway, which replaces +// the entire existing list of enabled `Service` objects with the list that you provide in the +// `Update` call. `UpdateServiceGateway` also lets you block all traffic through the service +// gateway without having to remove each of the individual `Service` objects. +func (client VirtualNetworkClient) DetachServiceId(ctx context.Context, request DetachServiceIdRequest) (response DetachServiceIdResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.detachServiceId, policy) if err != nil { + if ociResponse != nil { + response = DetachServiceIdResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DetachServiceIdResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachServiceIdResponse") + } + return +} + +// detachServiceId implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) detachServiceId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways/{serviceGatewayId}/actions/detachService") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DetachServiceIdResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCpe Gets the specified CPE's information. +func (client VirtualNetworkClient) GetCpe(ctx context.Context, request GetCpeRequest) (response GetCpeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCpe, policy) + if err != nil { + if ociResponse != nil { + response = GetCpeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetCpeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCpeResponse") + } + return +} + +// getCpe implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpes/{cpeId}") + if err != nil { + return nil, err + } + + var response GetCpeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCrossConnect Gets the specified cross-connect's information. +func (client VirtualNetworkClient) GetCrossConnect(ctx context.Context, request GetCrossConnectRequest) (response GetCrossConnectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCrossConnect, policy) + if err != nil { + if ociResponse != nil { + response = GetCrossConnectResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetCrossConnectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectResponse") + } return } +// getCrossConnect implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}") + if err != nil { + return nil, err + } + + var response GetCrossConnectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetCrossConnectGroup Gets the specified cross-connect group's information. func (client VirtualNetworkClient) GetCrossConnectGroup(ctx context.Context, request GetCrossConnectGroupRequest) (response GetCrossConnectGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnectGroups/{crossConnectGroupId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCrossConnectGroup, policy) if err != nil { + if ociResponse != nil { + response = GetCrossConnectGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetCrossConnectGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectGroupResponse") + } + return +} + +// getCrossConnectGroup implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectGroups/{crossConnectGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetCrossConnectGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetCrossConnectLetterOfAuthority Gets the Letter of Authority for the specified cross-connect. func (client VirtualNetworkClient) GetCrossConnectLetterOfAuthority(ctx context.Context, request GetCrossConnectLetterOfAuthorityRequest) (response GetCrossConnectLetterOfAuthorityResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnects/{crossConnectId}/letterOfAuthority", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCrossConnectLetterOfAuthority, policy) if err != nil { + if ociResponse != nil { + response = GetCrossConnectLetterOfAuthorityResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetCrossConnectLetterOfAuthorityResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectLetterOfAuthorityResponse") + } + return +} + +// getCrossConnectLetterOfAuthority implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getCrossConnectLetterOfAuthority(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}/letterOfAuthority") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetCrossConnectLetterOfAuthorityResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetCrossConnectStatus Gets the status of the specified cross-connect. func (client VirtualNetworkClient) GetCrossConnectStatus(ctx context.Context, request GetCrossConnectStatusRequest) (response GetCrossConnectStatusResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnects/{crossConnectId}/status", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCrossConnectStatus, policy) if err != nil { + if ociResponse != nil { + response = GetCrossConnectStatusResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetCrossConnectStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectStatusResponse") + } + return +} + +// getCrossConnectStatus implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getCrossConnectStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}/status") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetCrossConnectStatusResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetDhcpOptions Gets the specified set of DHCP options. func (client VirtualNetworkClient) GetDhcpOptions(ctx context.Context, request GetDhcpOptionsRequest) (response GetDhcpOptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dhcps/{dhcpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDhcpOptions, policy) if err != nil { + if ociResponse != nil { + response = GetDhcpOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetDhcpOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDhcpOptionsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getDhcpOptions implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dhcps/{dhcpId}") + if err != nil { + return nil, err + } + + var response GetDhcpOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetDrg Gets the specified DRG's information. func (client VirtualNetworkClient) GetDrg(ctx context.Context, request GetDrgRequest) (response GetDrgResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/drgs/{drgId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDrg, policy) if err != nil { + if ociResponse != nil { + response = GetDrgResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetDrgResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDrgResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getDrg implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgs/{drgId}") + if err != nil { + return nil, err + } + + var response GetDrgResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetDrgAttachment Gets the information for the specified `DrgAttachment`. func (client VirtualNetworkClient) GetDrgAttachment(ctx context.Context, request GetDrgAttachmentRequest) (response GetDrgAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/drgAttachments/{drgAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDrgAttachment, policy) if err != nil { + if ociResponse != nil { + response = GetDrgAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetDrgAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDrgAttachmentResponse") + } + return +} + +// getDrgAttachment implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgAttachments/{drgAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetDrgAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetFastConnectProviderService Gets the specified provider service. -// For more information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) GetFastConnectProviderService(ctx context.Context, request GetFastConnectProviderServiceRequest) (response GetFastConnectProviderServiceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getFastConnectProviderService, policy) if err != nil { + if ociResponse != nil { + response = GetFastConnectProviderServiceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetFastConnectProviderServiceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetFastConnectProviderServiceResponse") + } + return +} + +// getFastConnectProviderService implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getFastConnectProviderService(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetFastConnectProviderServiceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetFastConnectProviderServiceKey Gets the specified provider service key's information. Use this operation to validate a +// provider service key. An invalid key returns a 404 error. +func (client VirtualNetworkClient) GetFastConnectProviderServiceKey(ctx context.Context, request GetFastConnectProviderServiceKeyRequest) (response GetFastConnectProviderServiceKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getFastConnectProviderServiceKey, policy) + if err != nil { + if ociResponse != nil { + response = GetFastConnectProviderServiceKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetFastConnectProviderServiceKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetFastConnectProviderServiceKeyResponse") + } return } +// getFastConnectProviderServiceKey implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getFastConnectProviderServiceKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}/providerServiceKeys/{providerServiceKeyName}") + if err != nil { + return nil, err + } + + var response GetFastConnectProviderServiceKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetIPSecConnection Gets the specified IPSec connection's basic information, including the static routes for the // on-premises router. If you want the status of the connection (whether it's up or down), use -// GetIPSecConnectionDeviceStatus. +// GetIPSecConnectionTunnel. func (client VirtualNetworkClient) GetIPSecConnection(ctx context.Context, request GetIPSecConnectionRequest) (response GetIPSecConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/ipsecConnections/{ipscId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIPSecConnection, policy) if err != nil { + if ociResponse != nil { + response = GetIPSecConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIPSecConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getIPSecConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}") + if err != nil { + return nil, err + } + + var response GetIPSecConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetIPSecConnectionDeviceConfig Gets the configuration information for the specified IPSec connection. For each tunnel, the -// response includes the IP address of Oracle's VPN headend and the shared secret. +// GetIPSecConnectionDeviceConfig Deprecated. To get tunnel information, instead use: +// * GetIPSecConnectionTunnel +// * GetIPSecConnectionTunnelSharedSecret func (client VirtualNetworkClient) GetIPSecConnectionDeviceConfig(ctx context.Context, request GetIPSecConnectionDeviceConfigRequest) (response GetIPSecConnectionDeviceConfigResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/ipsecConnections/{ipscId}/deviceConfig", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionDeviceConfig, policy) if err != nil { + if ociResponse != nil { + response = GetIPSecConnectionDeviceConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIPSecConnectionDeviceConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionDeviceConfigResponse") + } + return +} + +// getIPSecConnectionDeviceConfig implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getIPSecConnectionDeviceConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/deviceConfig") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetIPSecConnectionDeviceConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetIPSecConnectionDeviceStatus Gets the status of the specified IPSec connection (whether it's up or down). +// GetIPSecConnectionDeviceStatus Deprecated. To get the tunnel status, instead use +// GetIPSecConnectionTunnel. func (client VirtualNetworkClient) GetIPSecConnectionDeviceStatus(ctx context.Context, request GetIPSecConnectionDeviceStatusRequest) (response GetIPSecConnectionDeviceStatusResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/ipsecConnections/{ipscId}/deviceStatus", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionDeviceStatus, policy) if err != nil { + if ociResponse != nil { + response = GetIPSecConnectionDeviceStatusResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIPSecConnectionDeviceStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionDeviceStatusResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getIPSecConnectionDeviceStatus implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getIPSecConnectionDeviceStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/deviceStatus") + if err != nil { + return nil, err + } + + var response GetIPSecConnectionDeviceStatusResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetIPSecConnectionTunnel Gets the specified tunnel's information. The resulting object does not include the tunnel's +// shared secret (pre-shared key). To retrieve that, use +// GetIPSecConnectionTunnelSharedSecret. +func (client VirtualNetworkClient) GetIPSecConnectionTunnel(ctx context.Context, request GetIPSecConnectionTunnelRequest) (response GetIPSecConnectionTunnelResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionTunnel, policy) + if err != nil { + if ociResponse != nil { + response = GetIPSecConnectionTunnelResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIPSecConnectionTunnelResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionTunnelResponse") + } + return +} + +// getIPSecConnectionTunnel implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getIPSecConnectionTunnel(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}") + if err != nil { + return nil, err + } + + var response GetIPSecConnectionTunnelResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetIPSecConnectionTunnelSharedSecret Gets the specified tunnel's shared secret (pre-shared key). To get other information +// about the tunnel, use GetIPSecConnectionTunnel. +func (client VirtualNetworkClient) GetIPSecConnectionTunnelSharedSecret(ctx context.Context, request GetIPSecConnectionTunnelSharedSecretRequest) (response GetIPSecConnectionTunnelSharedSecretResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionTunnelSharedSecret, policy) + if err != nil { + if ociResponse != nil { + response = GetIPSecConnectionTunnelSharedSecretResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetIPSecConnectionTunnelSharedSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionTunnelSharedSecretResponse") + } return } -// GetInternetGateway Gets the specified Internet Gateway's information. +// getIPSecConnectionTunnelSharedSecret implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getIPSecConnectionTunnelSharedSecret(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/sharedSecret") + if err != nil { + return nil, err + } + + var response GetIPSecConnectionTunnelSharedSecretResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetInternetGateway Gets the specified internet gateway's information. func (client VirtualNetworkClient) GetInternetGateway(ctx context.Context, request GetInternetGatewayRequest) (response GetInternetGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/internetGateways/{igId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getInternetGateway, policy) if err != nil { + if ociResponse != nil { + response = GetInternetGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetInternetGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetInternetGatewayResponse") + } + return +} + +// getInternetGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/internetGateways/{igId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetInternetGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetLocalPeeringGateway Gets the specified local peering gateway's information. func (client VirtualNetworkClient) GetLocalPeeringGateway(ctx context.Context, request GetLocalPeeringGatewayRequest) (response GetLocalPeeringGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/localPeeringGateways/{localPeeringGatewayId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getLocalPeeringGateway, policy) if err != nil { + if ociResponse != nil { + response = GetLocalPeeringGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetLocalPeeringGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetLocalPeeringGatewayResponse") + } + return +} + +// getLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/localPeeringGateways/{localPeeringGatewayId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetLocalPeeringGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetNatGateway Gets the specified NAT gateway's information. +func (client VirtualNetworkClient) GetNatGateway(ctx context.Context, request GetNatGatewayRequest) (response GetNatGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getNatGateway, policy) + if err != nil { + if ociResponse != nil { + response = GetNatGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetNatGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNatGatewayResponse") + } return } +// getNatGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/natGateways/{natGatewayId}") + if err != nil { + return nil, err + } + + var response GetNatGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetPrivateIp Gets the specified private IP. You must specify the object's OCID. // Alternatively, you can get the object by using // ListPrivateIps // with the private IP address (for example, 10.0.3.3) and subnet OCID. func (client VirtualNetworkClient) GetPrivateIp(ctx context.Context, request GetPrivateIpRequest) (response GetPrivateIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/privateIps/{privateIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPrivateIp, policy) if err != nil { + if ociResponse != nil { + response = GetPrivateIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPrivateIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPrivateIpResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getPrivateIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getPrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateIps/{privateIpId}") + if err != nil { + return nil, err + } + + var response GetPrivateIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetPublicIp Gets the specified public IP. You must specify the object's OCID. @@ -1288,43 +3110,91 @@ // with the OCID of the private IP that the public IP is assigned to. // **Note:** If you're fetching a reserved public IP that is in the process of being // moved to a different private IP, the service returns the public IP object with -// `lifecycleState` = ASSIGNING and `privateIpId` = OCID of the target private IP. +// `lifecycleState` = ASSIGNING and `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIp(ctx context.Context, request GetPublicIpRequest) (response GetPublicIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/publicIps/{publicIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPublicIp, policy) if err != nil { + if ociResponse != nil { + response = GetPublicIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPublicIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpResponse") + } + return +} + +// getPublicIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getPublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/publicIps/{publicIpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetPublicIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetPublicIpByIpAddress Gets the public IP based on the public IP address (for example, 129.146.2.1). // **Note:** If you're fetching a reserved public IP that is in the process of being // moved to a different private IP, the service returns the public IP object with -// `lifecycleState` = ASSIGNING and `privateIpId` = OCID of the target private IP. +// `lifecycleState` = ASSIGNING and `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIpByIpAddress(ctx context.Context, request GetPublicIpByIpAddressRequest) (response GetPublicIpByIpAddressResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/publicIps/actions/getByIpAddress", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPublicIpByIpAddress, policy) if err != nil { + if ociResponse != nil { + response = GetPublicIpByIpAddressResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPublicIpByIpAddressResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpByIpAddressResponse") + } + return +} + +// getPublicIpByIpAddress implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getPublicIpByIpAddress(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps/actions/getByIpAddress") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetPublicIpByIpAddressResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetPublicIpByPrivateIpId Gets the public IP assigned to the specified private IP. You must specify the OCID @@ -1335,131 +3205,383 @@ // private IP, or if you instead call // GetPublicIp or // GetPublicIpByIpAddress, the -// service returns the public IP object with `lifecycleState` = ASSIGNING and `privateIpId` = OCID -// of the target private IP. +// service returns the public IP object with `lifecycleState` = ASSIGNING and +// `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIpByPrivateIpId(ctx context.Context, request GetPublicIpByPrivateIpIdRequest) (response GetPublicIpByPrivateIpIdResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/publicIps/actions/getByPrivateIpId", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPublicIpByPrivateIpId, policy) if err != nil { + if ociResponse != nil { + response = GetPublicIpByPrivateIpIdResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPublicIpByPrivateIpIdResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpByPrivateIpIdResponse") + } + return +} + +// getPublicIpByPrivateIpId implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getPublicIpByPrivateIpId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps/actions/getByPrivateIpId") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetPublicIpByPrivateIpIdResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetRemotePeeringConnection Get the specified remote peering connection's information. func (client VirtualNetworkClient) GetRemotePeeringConnection(ctx context.Context, request GetRemotePeeringConnectionRequest) (response GetRemotePeeringConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/remotePeeringConnections/{remotePeeringConnectionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getRemotePeeringConnection, policy) if err != nil { + if ociResponse != nil { + response = GetRemotePeeringConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetRemotePeeringConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRemotePeeringConnectionResponse") + } + return +} + +// getRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/remotePeeringConnections/{remotePeeringConnectionId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetRemotePeeringConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetRouteTable Gets the specified route table's information. func (client VirtualNetworkClient) GetRouteTable(ctx context.Context, request GetRouteTableRequest) (response GetRouteTableResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/routeTables/{rtId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getRouteTable, policy) if err != nil { + if ociResponse != nil { + response = GetRouteTableResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetRouteTableResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRouteTableResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getRouteTable implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/routeTables/{rtId}") + if err != nil { + return nil, err + } + + var response GetRouteTableResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetSecurityList Gets the specified security list's information. func (client VirtualNetworkClient) GetSecurityList(ctx context.Context, request GetSecurityListRequest) (response GetSecurityListResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/securityLists/{securityListId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSecurityList, policy) if err != nil { + if ociResponse != nil { + response = GetSecurityListResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetSecurityListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSecurityListResponse") + } + return +} + +// getSecurityList implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/securityLists/{securityListId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetSecurityListResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetService Gets the specified Service object. +func (client VirtualNetworkClient) GetService(ctx context.Context, request GetServiceRequest) (response GetServiceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getService, policy) + if err != nil { + if ociResponse != nil { + response = GetServiceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetServiceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceResponse") + } + return +} + +// getService implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getService(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/services/{serviceId}") + if err != nil { + return nil, err + } + + var response GetServiceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetServiceGateway Gets the specified service gateway's information. +func (client VirtualNetworkClient) GetServiceGateway(ctx context.Context, request GetServiceGatewayRequest) (response GetServiceGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getServiceGateway, policy) + if err != nil { + if ociResponse != nil { + response = GetServiceGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetServiceGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceGatewayResponse") + } return } +// getServiceGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceGateways/{serviceGatewayId}") + if err != nil { + return nil, err + } + + var response GetServiceGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetSubnet Gets the specified subnet's information. func (client VirtualNetworkClient) GetSubnet(ctx context.Context, request GetSubnetRequest) (response GetSubnetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/subnets/{subnetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSubnet, policy) if err != nil { + if ociResponse != nil { + response = GetSubnetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetSubnetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSubnetResponse") + } + return +} + +// getSubnet implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subnets/{subnetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetSubnetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetVcn Gets the specified VCN's information. func (client VirtualNetworkClient) GetVcn(ctx context.Context, request GetVcnRequest) (response GetVcnResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/vcns/{vcnId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVcn, policy) if err != nil { + if ociResponse != nil { + response = GetVcnResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVcnResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVcnResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getVcn implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vcns/{vcnId}") + if err != nil { + return nil, err + } + + var response GetVcnResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetVirtualCircuit Gets the specified virtual circuit's information. func (client VirtualNetworkClient) GetVirtualCircuit(ctx context.Context, request GetVirtualCircuitRequest) (response GetVirtualCircuitResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/virtualCircuits/{virtualCircuitId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVirtualCircuit, policy) if err != nil { + if ociResponse != nil { + response = GetVirtualCircuitResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVirtualCircuitResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVirtualCircuitResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getVirtualCircuit implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits/{virtualCircuitId}") + if err != nil { + return nil, err + } + + var response GetVirtualCircuitResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetVnic Gets the information for the specified virtual network interface card (VNIC). @@ -1467,290 +3589,735 @@ // ListVnicAttachments // operation. func (client VirtualNetworkClient) GetVnic(ctx context.Context, request GetVnicRequest) (response GetVnicResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/vnics/{vnicId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVnic, policy) if err != nil { + if ociResponse != nil { + response = GetVnicResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetVnicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVnicResponse") + } + return +} + +// getVnic implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) getVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnics/{vnicId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetVnicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListAllowedPeerRegionsForRemotePeering Lists the regions that support remote VCN peering (which is peering across regions). -// For more information, see VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// For more information, see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ListAllowedPeerRegionsForRemotePeering(ctx context.Context, request ListAllowedPeerRegionsForRemotePeeringRequest) (response ListAllowedPeerRegionsForRemotePeeringResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/allowedPeerRegionsForRemotePeering", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAllowedPeerRegionsForRemotePeering, policy) if err != nil { + if ociResponse != nil { + response = ListAllowedPeerRegionsForRemotePeeringResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListAllowedPeerRegionsForRemotePeeringResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAllowedPeerRegionsForRemotePeeringResponse") + } + return +} + +// listAllowedPeerRegionsForRemotePeering implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listAllowedPeerRegionsForRemotePeering(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/allowedPeerRegionsForRemotePeering") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListAllowedPeerRegionsForRemotePeeringResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCpes Lists the customer-premises equipment objects (CPEs) in the specified compartment. +func (client VirtualNetworkClient) ListCpes(ctx context.Context, request ListCpesRequest) (response ListCpesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCpes, policy) + if err != nil { + if ociResponse != nil { + response = ListCpesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(ListCpesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCpesResponse") + } return } -// ListCpes Lists the Customer-Premises Equipment objects (CPEs) in the specified compartment. -func (client VirtualNetworkClient) ListCpes(ctx context.Context, request ListCpesRequest) (response ListCpesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/cpes", request) +// listCpes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listCpes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpes") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListCpesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListCrossConnectGroups Lists the cross-connect groups in the specified compartment. func (client VirtualNetworkClient) ListCrossConnectGroups(ctx context.Context, request ListCrossConnectGroupsRequest) (response ListCrossConnectGroupsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnectGroups", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCrossConnectGroups, policy) if err != nil { + if ociResponse != nil { + response = ListCrossConnectGroupsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListCrossConnectGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectGroupsResponse") + } + return +} + +// listCrossConnectGroups implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listCrossConnectGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectGroups") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListCrossConnectGroupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListCrossConnectLocations Lists the available FastConnect locations for cross-connect installation. You need // this information so you can specify your desired location when you create a cross-connect. func (client VirtualNetworkClient) ListCrossConnectLocations(ctx context.Context, request ListCrossConnectLocationsRequest) (response ListCrossConnectLocationsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnectLocations", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCrossConnectLocations, policy) if err != nil { + if ociResponse != nil { + response = ListCrossConnectLocationsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListCrossConnectLocationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectLocationsResponse") + } + return +} + +// listCrossConnectLocations implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listCrossConnectLocations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectLocations") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListCrossConnectLocationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListCrossConnects Lists the cross-connects in the specified compartment. You can filter the list // by specifying the OCID of a cross-connect group. func (client VirtualNetworkClient) ListCrossConnects(ctx context.Context, request ListCrossConnectsRequest) (response ListCrossConnectsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnects", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCrossConnects, policy) if err != nil { + if ociResponse != nil { + response = ListCrossConnectsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListCrossConnectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectsResponse") + } + return +} + +// listCrossConnects implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listCrossConnects(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListCrossConnectsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListCrossconnectPortSpeedShapes Lists the available port speeds for cross-connects. You need this information // so you can specify your desired port speed (that is, shape) when you create a // cross-connect. func (client VirtualNetworkClient) ListCrossconnectPortSpeedShapes(ctx context.Context, request ListCrossconnectPortSpeedShapesRequest) (response ListCrossconnectPortSpeedShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/crossConnectPortSpeedShapes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCrossconnectPortSpeedShapes, policy) if err != nil { + if ociResponse != nil { + response = ListCrossconnectPortSpeedShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListCrossconnectPortSpeedShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCrossconnectPortSpeedShapesResponse") + } + return +} + +// listCrossconnectPortSpeedShapes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listCrossconnectPortSpeedShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectPortSpeedShapes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListCrossconnectPortSpeedShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListDhcpOptions Lists the sets of DHCP options in the specified VCN and specified compartment. // The response includes the default set of options that automatically comes with each VCN, // plus any other sets you've created. func (client VirtualNetworkClient) ListDhcpOptions(ctx context.Context, request ListDhcpOptionsRequest) (response ListDhcpOptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dhcps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDhcpOptions, policy) if err != nil { + if ociResponse != nil { + response = ListDhcpOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListDhcpOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDhcpOptionsResponse") + } + return +} + +// listDhcpOptions implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dhcps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListDhcpOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListDrgAttachments Lists the `DrgAttachment` objects for the specified compartment. You can filter the // results by VCN or DRG. func (client VirtualNetworkClient) ListDrgAttachments(ctx context.Context, request ListDrgAttachmentsRequest) (response ListDrgAttachmentsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/drgAttachments", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDrgAttachments, policy) if err != nil { + if ociResponse != nil { + response = ListDrgAttachmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListDrgAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDrgAttachmentsResponse") + } + return +} + +// listDrgAttachments implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listDrgAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgAttachments") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListDrgAttachmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListDrgs Lists the DRGs in the specified compartment. func (client VirtualNetworkClient) ListDrgs(ctx context.Context, request ListDrgsRequest) (response ListDrgsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/drgs", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDrgs, policy) if err != nil { + if ociResponse != nil { + response = ListDrgsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListDrgsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDrgsResponse") + } + return +} + +// listDrgs implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listDrgs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgs") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListDrgsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListFastConnectProviderServices Lists the service offerings from supported providers. You need this // information so you can specify your desired provider and service // offering when you create a virtual circuit. // For the compartment ID, provide the OCID of your tenancy (the root compartment). -// For more information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) ListFastConnectProviderServices(ctx context.Context, request ListFastConnectProviderServicesRequest) (response ListFastConnectProviderServicesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/fastConnectProviderServices", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listFastConnectProviderServices, policy) if err != nil { + if ociResponse != nil { + response = ListFastConnectProviderServicesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListFastConnectProviderServicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListFastConnectProviderServicesResponse") + } + return +} + +// listFastConnectProviderServices implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listFastConnectProviderServices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListFastConnectProviderServicesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListFastConnectProviderVirtualCircuitBandwidthShapes Gets the list of available virtual circuit bandwidth levels for a provider. // You need this information so you can specify your desired bandwidth level (shape) when you create a virtual circuit. -// For more information about virtual circuits, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// For more information about virtual circuits, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) ListFastConnectProviderVirtualCircuitBandwidthShapes(ctx context.Context, request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}/virtualCircuitBandwidthShapes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listFastConnectProviderVirtualCircuitBandwidthShapes, policy) if err != nil { + if ociResponse != nil { + response = ListFastConnectProviderVirtualCircuitBandwidthShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListFastConnectProviderVirtualCircuitBandwidthShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListFastConnectProviderVirtualCircuitBandwidthShapesResponse") + } + return +} + +// listFastConnectProviderVirtualCircuitBandwidthShapes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listFastConnectProviderVirtualCircuitBandwidthShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}/virtualCircuitBandwidthShapes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListIPSecConnectionTunnels Lists the tunnel information for the specified IPSec connection. +func (client VirtualNetworkClient) ListIPSecConnectionTunnels(ctx context.Context, request ListIPSecConnectionTunnelsRequest) (response ListIPSecConnectionTunnelsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listIPSecConnectionTunnels, policy) + if err != nil { + if ociResponse != nil { + response = ListIPSecConnectionTunnelsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListIPSecConnectionTunnelsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListIPSecConnectionTunnelsResponse") + } return } +// listIPSecConnectionTunnels implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listIPSecConnectionTunnels(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels") + if err != nil { + return nil, err + } + + var response ListIPSecConnectionTunnelsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListIPSecConnections Lists the IPSec connections for the specified compartment. You can filter the // results by DRG or CPE. func (client VirtualNetworkClient) ListIPSecConnections(ctx context.Context, request ListIPSecConnectionsRequest) (response ListIPSecConnectionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/ipsecConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listIPSecConnections, policy) if err != nil { + if ociResponse != nil { + response = ListIPSecConnectionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListIPSecConnectionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListIPSecConnectionsResponse") + } + return +} + +// listIPSecConnections implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listIPSecConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListIPSecConnectionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListInternetGateways Lists the Internet Gateways in the specified VCN and the specified compartment. +// ListInternetGateways Lists the internet gateways in the specified VCN and the specified compartment. func (client VirtualNetworkClient) ListInternetGateways(ctx context.Context, request ListInternetGatewaysRequest) (response ListInternetGatewaysResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/internetGateways", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInternetGateways, policy) if err != nil { + if ociResponse != nil { + response = ListInternetGatewaysResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListInternetGatewaysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInternetGatewaysResponse") + } + return +} + +// listInternetGateways implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listInternetGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/internetGateways") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListInternetGatewaysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListLocalPeeringGateways Lists the local peering gateways (LPGs) for the specified VCN and compartment // (the LPG's compartment). func (client VirtualNetworkClient) ListLocalPeeringGateways(ctx context.Context, request ListLocalPeeringGatewaysRequest) (response ListLocalPeeringGatewaysResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/localPeeringGateways", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listLocalPeeringGateways, policy) if err != nil { + if ociResponse != nil { + response = ListLocalPeeringGatewaysResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListLocalPeeringGatewaysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLocalPeeringGatewaysResponse") + } + return +} + +// listLocalPeeringGateways implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listLocalPeeringGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/localPeeringGateways") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListLocalPeeringGatewaysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListNatGateways Lists the NAT gateways in the specified compartment. You may optionally specify a VCN OCID +// to filter the results by VCN. +func (client VirtualNetworkClient) ListNatGateways(ctx context.Context, request ListNatGatewaysRequest) (response ListNatGatewaysResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listNatGateways, policy) + if err != nil { + if ociResponse != nil { + response = ListNatGatewaysResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListNatGatewaysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNatGatewaysResponse") + } return } +// listNatGateways implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listNatGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/natGateways") + if err != nil { + return nil, err + } + + var response ListNatGatewaysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListPrivateIps Lists the PrivateIp objects based // on one of these filters: // - Subnet OCID. @@ -1763,365 +4330,1052 @@ // If you're listing all the private IPs associated with a given subnet // or VNIC, the response includes both primary and secondary private IPs. func (client VirtualNetworkClient) ListPrivateIps(ctx context.Context, request ListPrivateIpsRequest) (response ListPrivateIpsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/privateIps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPrivateIps, policy) if err != nil { + if ociResponse != nil { + response = ListPrivateIpsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListPrivateIpsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPrivateIpsResponse") + } + return +} + +// listPrivateIps implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listPrivateIps(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateIps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListPrivateIpsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListPublicIps Lists either the ephemeral or reserved PublicIp objects -// in the specified compartment. -// To list your reserved public IPs, set `scope` = `REGION`, and leave the -// `availabilityDomain` parameter empty. -// To list your ephemeral public IPs, set `scope` = `AVAILABILITY_DOMAIN`, and set the -// `availabilityDomain` parameter to the desired Availability Domain. An ephemeral public IP -// is always in the same Availability Domain and compartment as the private IP it's assigned to. +// ListPublicIps Lists the PublicIp objects +// in the specified compartment. You can filter the list by using query parameters. +// To list your reserved public IPs: +// * Set `scope` = `REGION` (required) +// * Leave the `availabilityDomain` parameter empty +// * Set `lifetime` = `RESERVED` +// To list the ephemeral public IPs assigned to a regional entity such as a NAT gateway: +// * Set `scope` = `REGION` (required) +// * Leave the `availabilityDomain` parameter empty +// * Set `lifetime` = `EPHEMERAL` +// To list the ephemeral public IPs assigned to private IPs: +// * Set `scope` = `AVAILABILITY_DOMAIN` (required) +// * Set the `availabilityDomain` parameter to the desired availability domain (required) +// * Set `lifetime` = `EPHEMERAL` +// **Note:** An ephemeral public IP assigned to a private IP +// is always in the same availability domain and compartment as the private IP. func (client VirtualNetworkClient) ListPublicIps(ctx context.Context, request ListPublicIpsRequest) (response ListPublicIpsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/publicIps", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPublicIps, policy) if err != nil { + if ociResponse != nil { + response = ListPublicIpsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListPublicIpsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPublicIpsResponse") + } + return +} + +// listPublicIps implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listPublicIps(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/publicIps") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListPublicIpsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListRemotePeeringConnections Lists the remote peering connections (RPCs) for the specified DRG and compartment // (the RPC's compartment). func (client VirtualNetworkClient) ListRemotePeeringConnections(ctx context.Context, request ListRemotePeeringConnectionsRequest) (response ListRemotePeeringConnectionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/remotePeeringConnections", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listRemotePeeringConnections, policy) if err != nil { + if ociResponse != nil { + response = ListRemotePeeringConnectionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListRemotePeeringConnectionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRemotePeeringConnectionsResponse") + } + return +} + +// listRemotePeeringConnections implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listRemotePeeringConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/remotePeeringConnections") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListRemotePeeringConnectionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListRouteTables Lists the route tables in the specified VCN and specified compartment. The response // includes the default route table that automatically comes with each VCN, plus any route tables // you've created. func (client VirtualNetworkClient) ListRouteTables(ctx context.Context, request ListRouteTablesRequest) (response ListRouteTablesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/routeTables", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listRouteTables, policy) if err != nil { + if ociResponse != nil { + response = ListRouteTablesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListRouteTablesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRouteTablesResponse") + } + return +} + +// listRouteTables implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listRouteTables(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/routeTables") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListRouteTablesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListSecurityLists Lists the security lists in the specified VCN and compartment. func (client VirtualNetworkClient) ListSecurityLists(ctx context.Context, request ListSecurityListsRequest) (response ListSecurityListsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/securityLists", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSecurityLists, policy) if err != nil { + if ociResponse != nil { + response = ListSecurityListsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListSecurityListsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSecurityListsResponse") + } + return +} + +// listSecurityLists implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listSecurityLists(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/securityLists") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListSecurityListsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServiceGateways Lists the service gateways in the specified compartment. You may optionally specify a VCN OCID +// to filter the results by VCN. +func (client VirtualNetworkClient) ListServiceGateways(ctx context.Context, request ListServiceGatewaysRequest) (response ListServiceGatewaysResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listServiceGateways, policy) + if err != nil { + if ociResponse != nil { + response = ListServiceGatewaysResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListServiceGatewaysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServiceGatewaysResponse") + } + return +} + +// listServiceGateways implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listServiceGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceGateways") + if err != nil { + return nil, err + } + + var response ListServiceGatewaysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServices Lists the available Service objects that you can enable for a +// service gateway in this region. +func (client VirtualNetworkClient) ListServices(ctx context.Context, request ListServicesRequest) (response ListServicesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listServices, policy) + if err != nil { + if ociResponse != nil { + response = ListServicesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListServicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServicesResponse") + } return } +// listServices implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listServices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/services") + if err != nil { + return nil, err + } + + var response ListServicesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListSubnets Lists the subnets in the specified VCN and the specified compartment. func (client VirtualNetworkClient) ListSubnets(ctx context.Context, request ListSubnetsRequest) (response ListSubnetsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/subnets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSubnets, policy) if err != nil { + if ociResponse != nil { + response = ListSubnetsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListSubnetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSubnetsResponse") + } + return +} + +// listSubnets implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listSubnets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subnets") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListSubnetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListVcns Lists the Virtual Cloud Networks (VCNs) in the specified compartment. +// ListVcns Lists the virtual cloud networks (VCNs) in the specified compartment. func (client VirtualNetworkClient) ListVcns(ctx context.Context, request ListVcnsRequest) (response ListVcnsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/vcns", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVcns, policy) if err != nil { + if ociResponse != nil { + response = ListVcnsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVcnsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVcnsResponse") + } + return +} + +// listVcns implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listVcns(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vcns") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVcnsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListVirtualCircuitBandwidthShapes The deprecated operation lists available bandwidth levels for virtual circuits. For the compartment ID, provide the OCID of your tenancy (the root compartment). +func (client VirtualNetworkClient) ListVirtualCircuitBandwidthShapes(ctx context.Context, request ListVirtualCircuitBandwidthShapesRequest) (response ListVirtualCircuitBandwidthShapesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuitBandwidthShapes, policy) + if err != nil { + if ociResponse != nil { + response = ListVirtualCircuitBandwidthShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListVirtualCircuitBandwidthShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitBandwidthShapesResponse") + } return } -// ListVirtualCircuitBandwidthShapes The deprecated operation lists available bandwidth levels for virtual circuits. For the compartment ID, provide the OCID of your tenancy (the root compartment). -func (client VirtualNetworkClient) ListVirtualCircuitBandwidthShapes(ctx context.Context, request ListVirtualCircuitBandwidthShapesRequest) (response ListVirtualCircuitBandwidthShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/virtualCircuitBandwidthShapes", request) +// listVirtualCircuitBandwidthShapes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listVirtualCircuitBandwidthShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuitBandwidthShapes") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVirtualCircuitBandwidthShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListVirtualCircuitPublicPrefixes Lists the public IP prefixes and their details for the specified // public virtual circuit. func (client VirtualNetworkClient) ListVirtualCircuitPublicPrefixes(ctx context.Context, request ListVirtualCircuitPublicPrefixesRequest) (response ListVirtualCircuitPublicPrefixesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/virtualCircuits/{virtualCircuitId}/publicPrefixes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuitPublicPrefixes, policy) if err != nil { + if ociResponse != nil { + response = ListVirtualCircuitPublicPrefixesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVirtualCircuitPublicPrefixesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitPublicPrefixesResponse") + } + return +} + +// listVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits/{virtualCircuitId}/publicPrefixes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVirtualCircuitPublicPrefixesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListVirtualCircuits Lists the virtual circuits in the specified compartment. func (client VirtualNetworkClient) ListVirtualCircuits(ctx context.Context, request ListVirtualCircuitsRequest) (response ListVirtualCircuitsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/virtualCircuits", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuits, policy) if err != nil { + if ociResponse != nil { + response = ListVirtualCircuitsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListVirtualCircuitsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitsResponse") + } + return +} + +// listVirtualCircuits implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) listVirtualCircuits(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListVirtualCircuitsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateCpe Updates the specified CPE's display name. +// UpdateCpe Updates the specified CPE's display name or tags. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateCpe(ctx context.Context, request UpdateCpeRequest) (response UpdateCpeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/cpes/{cpeId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCpe, policy) if err != nil { + if ociResponse != nil { + response = UpdateCpeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateCpeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCpeResponse") + } + return +} + +// updateCpe implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/cpes/{cpeId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateCpeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateCrossConnect Updates the specified cross-connect. func (client VirtualNetworkClient) UpdateCrossConnect(ctx context.Context, request UpdateCrossConnectRequest) (response UpdateCrossConnectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/crossConnects/{crossConnectId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCrossConnect, policy) if err != nil { + if ociResponse != nil { + response = UpdateCrossConnectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateCrossConnectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCrossConnectResponse") + } + return +} + +// updateCrossConnect implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/crossConnects/{crossConnectId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateCrossConnectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateCrossConnectGroup Updates the specified cross-connect group's display name. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateCrossConnectGroup(ctx context.Context, request UpdateCrossConnectGroupRequest) (response UpdateCrossConnectGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/crossConnectGroups/{crossConnectGroupId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCrossConnectGroup, policy) if err != nil { + if ociResponse != nil { + response = UpdateCrossConnectGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateCrossConnectGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCrossConnectGroupResponse") + } + return +} + +// updateCrossConnectGroup implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/crossConnectGroups/{crossConnectGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateCrossConnectGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateDhcpOptions Updates the specified set of DHCP options. You can update the display name or the options // themselves. Avoid entering confidential information. // Note that the `options` object you provide replaces the entire existing set of options. func (client VirtualNetworkClient) UpdateDhcpOptions(ctx context.Context, request UpdateDhcpOptionsRequest) (response UpdateDhcpOptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/dhcps/{dhcpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateDhcpOptions, policy) if err != nil { + if ociResponse != nil { + response = UpdateDhcpOptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateDhcpOptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDhcpOptionsResponse") + } + return +} + +// updateDhcpOptions implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dhcps/{dhcpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDhcpOptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateDrg Updates the specified DRG's display name. Avoid entering confidential information. +// UpdateDrg Updates the specified DRG's display name or tags. Avoid entering confidential information. func (client VirtualNetworkClient) UpdateDrg(ctx context.Context, request UpdateDrgRequest) (response UpdateDrgResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/drgs/{drgId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateDrg, policy) if err != nil { + if ociResponse != nil { + response = UpdateDrgResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateDrgResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDrgResponse") + } + return +} + +// updateDrg implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/drgs/{drgId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDrgResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateDrgAttachment Updates the display name for the specified `DrgAttachment`. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateDrgAttachment(ctx context.Context, request UpdateDrgAttachmentRequest) (response UpdateDrgAttachmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/drgAttachments/{drgAttachmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateDrgAttachment, policy) if err != nil { + if ociResponse != nil { + response = UpdateDrgAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateDrgAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDrgAttachmentResponse") + } + return +} + +// updateDrgAttachment implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/drgAttachments/{drgAttachmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDrgAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateIPSecConnection Updates the display name for the specified IPSec connection. -// Avoid entering confidential information. +// UpdateIPSecConnection Updates the specified IPSec connection. +// To update an individual IPSec tunnel's attributes, use +// UpdateIPSecConnectionTunnel. func (client VirtualNetworkClient) UpdateIPSecConnection(ctx context.Context, request UpdateIPSecConnectionRequest) (response UpdateIPSecConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/ipsecConnections/{ipscId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnection, policy) if err != nil { + if ociResponse != nil { + response = UpdateIPSecConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionResponse") + } + return +} + +// updateIPSecConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateIPSecConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateIPSecConnectionTunnel Updates the specified tunnel. This operation lets you change tunnel attributes such as the +// routing type (BGP dynamic routing or static routing). Here are some important notes: +// * If you change the tunnel's routing type or BGP session configuration, the tunnel will go +// down while it's reprovisioned. +// * If you want to switch the tunnel's `routing` from `STATIC` to `BGP`, make sure the tunnel's +// BGP session configuration attributes have been set (BgpSessionInfo). +// * If you want to switch the tunnel's `routing` from `BGP` to `STATIC`, make sure the +// IPSecConnection already has at least one valid CIDR +// static route. +func (client VirtualNetworkClient) UpdateIPSecConnectionTunnel(ctx context.Context, request UpdateIPSecConnectionTunnelRequest) (response UpdateIPSecConnectionTunnelResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnectionTunnel, policy) + if err != nil { + if ociResponse != nil { + response = UpdateIPSecConnectionTunnelResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionTunnelResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionTunnelResponse") + } + return +} + +// updateIPSecConnectionTunnel implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateIPSecConnectionTunnel(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}") + if err != nil { + return nil, err + } + + var response UpdateIPSecConnectionTunnelResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateIPSecConnectionTunnelSharedSecret Updates the shared secret (pre-shared key) for the specified tunnel. +// **Important:** If you change the shared secret, the tunnel will go down while it's reprovisioned. +func (client VirtualNetworkClient) UpdateIPSecConnectionTunnelSharedSecret(ctx context.Context, request UpdateIPSecConnectionTunnelSharedSecretRequest) (response UpdateIPSecConnectionTunnelSharedSecretResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnectionTunnelSharedSecret, policy) + if err != nil { + if ociResponse != nil { + response = UpdateIPSecConnectionTunnelSharedSecretResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionTunnelSharedSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionTunnelSharedSecretResponse") + } return } -// UpdateInternetGateway Updates the specified Internet Gateway. You can disable/enable it, or change its display name. -// Avoid entering confidential information. +// updateIPSecConnectionTunnelSharedSecret implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateIPSecConnectionTunnelSharedSecret(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/sharedSecret") + if err != nil { + return nil, err + } + + var response UpdateIPSecConnectionTunnelSharedSecretResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateInternetGateway Updates the specified internet gateway. You can disable/enable it, or change its display name +// or tags. Avoid entering confidential information. // If the gateway is disabled, that means no traffic will flow to/from the internet even if there's // a route rule that enables that traffic. func (client VirtualNetworkClient) UpdateInternetGateway(ctx context.Context, request UpdateInternetGatewayRequest) (response UpdateInternetGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/internetGateways/{igId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateInternetGateway, policy) if err != nil { + if ociResponse != nil { + response = UpdateInternetGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateInternetGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateInternetGatewayResponse") + } + return +} + +// updateInternetGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/internetGateways/{igId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateInternetGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateLocalPeeringGateway Updates the specified local peering gateway (LPG). func (client VirtualNetworkClient) UpdateLocalPeeringGateway(ctx context.Context, request UpdateLocalPeeringGatewayRequest) (response UpdateLocalPeeringGatewayResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/localPeeringGateways/{localPeeringGatewayId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateLocalPeeringGateway, policy) if err != nil { + if ociResponse != nil { + response = UpdateLocalPeeringGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateLocalPeeringGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateLocalPeeringGatewayResponse") + } + return +} + +// updateLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/localPeeringGateways/{localPeeringGatewayId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateLocalPeeringGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateNatGateway Updates the specified NAT gateway. +func (client VirtualNetworkClient) UpdateNatGateway(ctx context.Context, request UpdateNatGatewayRequest) (response UpdateNatGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateNatGateway, policy) + if err != nil { + if ociResponse != nil { + response = UpdateNatGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateNatGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNatGatewayResponse") + } return } +// updateNatGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/natGateways/{natGatewayId}") + if err != nil { + return nil, err + } + + var response UpdateNatGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdatePrivateIp Updates the specified private IP. You must specify the object's OCID. // Use this operation if you want to: // - Move a secondary private IP to a different VNIC in the same subnet. @@ -2131,20 +5385,44 @@ // To update the hostname for the primary IP on a VNIC, use // UpdateVnic. func (client VirtualNetworkClient) UpdatePrivateIp(ctx context.Context, request UpdatePrivateIpRequest) (response UpdatePrivateIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/privateIps/{privateIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updatePrivateIp, policy) if err != nil { + if ociResponse != nil { + response = UpdatePrivateIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdatePrivateIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePrivateIpResponse") + } + return +} + +// updatePrivateIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updatePrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/privateIps/{privateIpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdatePrivateIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdatePublicIp Updates the specified public IP. You must specify the object's OCID. Use this operation if you want to: @@ -2152,7 +5430,7 @@ // * Move a reserved public IP to a different private IP. // * Unassign a reserved public IP from a private IP (which returns it to your pool // of reserved public IPs). -// * Change the display name for a public IP (either ephemeral or reserved). +// * Change the display name or tags for a public IP. // Assigning, moving, and unassigning a reserved public IP are asynchronous // operations. Poll the public IP's `lifecycleState` to determine if the operation // succeeded. @@ -2171,67 +5449,139 @@ // * If you want to unassign an ephemeral public IP from its private IP, use // DeletePublicIp, which // unassigns and deletes the ephemeral public IP. -// **Note:** If a public IP (either ephemeral or reserved) is assigned to a secondary private +// **Note:** If a public IP is assigned to a secondary private // IP (see PrivateIp), and you move that secondary // private IP to another VNIC, the public IP moves with it. // **Note:** There's a limit to the number of PublicIp // a VNIC or instance can have. If you try to move a reserved public IP // to a VNIC or instance that has already reached its public IP limit, an error is // returned. For information about the public IP limits, see -// Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). +// Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). func (client VirtualNetworkClient) UpdatePublicIp(ctx context.Context, request UpdatePublicIpRequest) (response UpdatePublicIpResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/publicIps/{publicIpId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updatePublicIp, policy) if err != nil { + if ociResponse != nil { + response = UpdatePublicIpResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdatePublicIpResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePublicIpResponse") + } + return +} + +// updatePublicIp implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updatePublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/publicIps/{publicIpId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdatePublicIpResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateRemotePeeringConnection Updates the specified remote peering connection (RPC). func (client VirtualNetworkClient) UpdateRemotePeeringConnection(ctx context.Context, request UpdateRemotePeeringConnectionRequest) (response UpdateRemotePeeringConnectionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/remotePeeringConnections/{remotePeeringConnectionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateRemotePeeringConnection, policy) if err != nil { + if ociResponse != nil { + response = UpdateRemotePeeringConnectionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateRemotePeeringConnectionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateRemotePeeringConnectionResponse") + } + return +} + +// updateRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/remotePeeringConnections/{remotePeeringConnectionId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateRemotePeeringConnectionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateRouteTable Updates the specified route table's display name or route rules. // Avoid entering confidential information. // Note that the `routeRules` object you provide replaces the entire existing set of rules. func (client VirtualNetworkClient) UpdateRouteTable(ctx context.Context, request UpdateRouteTableRequest) (response UpdateRouteTableResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/routeTables/{rtId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateRouteTable, policy) if err != nil { + if ociResponse != nil { + response = UpdateRouteTableResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateRouteTableResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateRouteTableResponse") + } + return +} + +// updateRouteTable implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/routeTables/{rtId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateRouteTableResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateSecurityList Updates the specified security list's display name or rules. @@ -2239,57 +5589,171 @@ // Note that the `egressSecurityRules` or `ingressSecurityRules` objects you provide replace the entire // existing objects. func (client VirtualNetworkClient) UpdateSecurityList(ctx context.Context, request UpdateSecurityListRequest) (response UpdateSecurityListResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/securityLists/{securityListId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSecurityList, policy) if err != nil { + if ociResponse != nil { + response = UpdateSecurityListResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateSecurityListResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSecurityListResponse") + } + return +} + +// updateSecurityList implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/securityLists/{securityListId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateSecurityListResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateServiceGateway Updates the specified service gateway. The information you provide overwrites the existing +// attributes of the gateway. +func (client VirtualNetworkClient) UpdateServiceGateway(ctx context.Context, request UpdateServiceGatewayRequest) (response UpdateServiceGatewayResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateServiceGateway, policy) + if err != nil { + if ociResponse != nil { + response = UpdateServiceGatewayResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateServiceGatewayResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateServiceGatewayResponse") + } return } -// UpdateSubnet Updates the specified subnet's display name. Avoid entering confidential information. +// updateServiceGateway implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/serviceGateways/{serviceGatewayId}") + if err != nil { + return nil, err + } + + var response UpdateServiceGatewayResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSubnet Updates the specified subnet. func (client VirtualNetworkClient) UpdateSubnet(ctx context.Context, request UpdateSubnetRequest) (response UpdateSubnetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/subnets/{subnetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSubnet, policy) if err != nil { + if ociResponse != nil { + response = UpdateSubnetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateSubnetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSubnetResponse") + } + return +} + +// updateSubnet implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/subnets/{subnetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateSubnetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateVcn Updates the specified VCN's display name. -// Avoid entering confidential information. +// UpdateVcn Updates the specified VCN. func (client VirtualNetworkClient) UpdateVcn(ctx context.Context, request UpdateVcnRequest) (response UpdateVcnResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/vcns/{vcnId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVcn, policy) if err != nil { + if ociResponse != nil { + response = UpdateVcnResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVcnResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVcnResponse") + } + return +} + +// updateVcn implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/vcns/{vcnId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVcnResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateVirtualCircuit Updates the specified virtual circuit. This can be called by @@ -2306,7 +5770,7 @@ // its state will return to PROVISIONED. Make sure you confirm that // the associated BGP session is back up. For more information // about the various states and how to test connectivity, see -// FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // To change the list of public IP prefixes for a public virtual circuit, // use BulkAddVirtualCircuitPublicPrefixes // and @@ -2315,36 +5779,84 @@ // Oracle must verify the customer's ownership of each added prefix before // traffic for that prefix will flow across the virtual circuit. func (client VirtualNetworkClient) UpdateVirtualCircuit(ctx context.Context, request UpdateVirtualCircuitRequest) (response UpdateVirtualCircuitResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/virtualCircuits/{virtualCircuitId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVirtualCircuit, policy) if err != nil { + if ociResponse != nil { + response = UpdateVirtualCircuitResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVirtualCircuitResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVirtualCircuitResponse") + } + return +} + +// updateVirtualCircuit implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/virtualCircuits/{virtualCircuitId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVirtualCircuitResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateVnic Updates the specified VNIC. func (client VirtualNetworkClient) UpdateVnic(ctx context.Context, request UpdateVnicRequest) (response UpdateVnicResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/vnics/{vnicId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVnic, policy) if err != nil { + if ociResponse != nil { + response = UpdateVnicResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateVnicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVnicResponse") + } + return +} + +// updateVnic implements the OCIOperation interface (enables retrying operations) +func (client VirtualNetworkClient) updateVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/vnics/{vnicId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateVnicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cpe.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cpe.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cpe.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cpe.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,13 +17,15 @@ ) // Cpe An object you create when setting up an IPSec VPN between your on-premises network -// and VCN. The `Cpe` is a virtual representation of your Customer-Premises Equipment, +// and VCN. The `Cpe` is a virtual representation of your customer-premises equipment, // which is the actual router on-premises at your site at your end of the IPSec VPN connection. // For more information, -// see Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// see Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Cpe struct { // The OCID of the compartment containing the CPE. @@ -31,10 +37,21 @@ // The public IP address of the on-premises router. IpAddress *string `mandatory:"true" json:"ipAddress"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The date and time the CPE was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAppCatalogSubscriptionDetails details for creating a subscription for a listing resource version. +type CreateAppCatalogSubscriptionDetails struct { + + // The compartmentID for the subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID of the listing. + ListingId *string `mandatory:"false" json:"listingId"` + + // Listing resource version. + ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` + + // Oracle TOU link + OracleTermsOfUseLink *string `mandatory:"false" json:"oracleTermsOfUseLink"` + + // EULA link + EulaLink *string `mandatory:"false" json:"eulaLink"` + + // Date and time the agreements were retrieved, in RFC3339 format. + // Example: `2018-03-20T12:32:53.532Z` + TimeRetrieved *common.SDKTime `mandatory:"false" json:"timeRetrieved"` + + // A generated signature for this listing resource version retrieved the agreements API. + Signature *string `mandatory:"false" json:"signature"` +} + +func (m CreateAppCatalogSubscriptionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAppCatalogSubscriptionRequest wrapper for the CreateAppCatalogSubscription operation +type CreateAppCatalogSubscriptionRequest struct { + + // Request for the creation of a subscription for listing resource version for a compartment. + CreateAppCatalogSubscriptionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAppCatalogSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAppCatalogSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAppCatalogSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAppCatalogSubscriptionResponse wrapper for the CreateAppCatalogSubscription operation +type CreateAppCatalogSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AppCatalogSubscription instance + AppCatalogSubscription `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAppCatalogSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAppCatalogSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateBootVolumeBackupDetails The representation of CreateBootVolumeBackupDetails +type CreateBootVolumeBackupDetails struct { + + // The OCID of the boot volume that needs to be backed up. + BootVolumeId *string `mandatory:"true" json:"bootVolumeId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The type of backup to create. If omitted, defaults to incremental. + Type CreateBootVolumeBackupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` +} + +func (m CreateBootVolumeBackupDetails) String() string { + return common.PointerString(m) +} + +// CreateBootVolumeBackupDetailsTypeEnum Enum with underlying type: string +type CreateBootVolumeBackupDetailsTypeEnum string + +// Set of constants representing the allowable values for CreateBootVolumeBackupDetailsTypeEnum +const ( + CreateBootVolumeBackupDetailsTypeFull CreateBootVolumeBackupDetailsTypeEnum = "FULL" + CreateBootVolumeBackupDetailsTypeIncremental CreateBootVolumeBackupDetailsTypeEnum = "INCREMENTAL" +) + +var mappingCreateBootVolumeBackupDetailsType = map[string]CreateBootVolumeBackupDetailsTypeEnum{ + "FULL": CreateBootVolumeBackupDetailsTypeFull, + "INCREMENTAL": CreateBootVolumeBackupDetailsTypeIncremental, +} + +// GetCreateBootVolumeBackupDetailsTypeEnumValues Enumerates the set of values for CreateBootVolumeBackupDetailsTypeEnum +func GetCreateBootVolumeBackupDetailsTypeEnumValues() []CreateBootVolumeBackupDetailsTypeEnum { + values := make([]CreateBootVolumeBackupDetailsTypeEnum, 0) + for _, v := range mappingCreateBootVolumeBackupDetailsType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateBootVolumeBackupRequest wrapper for the CreateBootVolumeBackup operation +type CreateBootVolumeBackupRequest struct { + + // Request to create a new backup of given boot volume. + CreateBootVolumeBackupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateBootVolumeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateBootVolumeBackupResponse wrapper for the CreateBootVolumeBackup operation +type CreateBootVolumeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolumeBackup instance + BootVolumeBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateBootVolumeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateBootVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateBootVolumeDetails The representation of CreateBootVolumeDetails +type CreateBootVolumeDetails struct { + + // The availability domain of the boot volume. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the compartment that contains the boot volume. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Specifies the boot volume source details for a new boot volume. The volume source is either another boot volume in the same availability domain or a boot volume backup. + // This is a mandatory field for a boot volume. + SourceDetails BootVolumeSourceDetails `mandatory:"true" json:"sourceDetails"` + + // If provided, specifies the ID of the boot volume backup policy to assign to the newly + // created boot volume. If omitted, no policy will be assigned. + BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The OCID of the KMS key to be used as the master encryption key for the boot volume. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` + + // The size of the volume in GBs. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` +} + +func (m CreateBootVolumeDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateBootVolumeDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + BackupPolicyId *string `json:"backupPolicyId"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + KmsKeyId *string `json:"kmsKeyId"` + SizeInGBs *int64 `json:"sizeInGBs"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + SourceDetails bootvolumesourcedetails `json:"sourceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.BackupPolicyId = model.BackupPolicyId + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.KmsKeyId = model.KmsKeyId + m.SizeInGBs = model.SizeInGBs + m.AvailabilityDomain = model.AvailabilityDomain + m.CompartmentId = model.CompartmentId + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(BootVolumeSourceDetails) + } else { + m.SourceDetails = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateBootVolumeRequest wrapper for the CreateBootVolume operation +type CreateBootVolumeRequest struct { + + // Request to create a new boot volume. + CreateBootVolumeDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateBootVolumeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateBootVolumeResponse wrapper for the CreateBootVolume operation +type CreateBootVolumeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolume instance + BootVolume `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateBootVolumeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,8 +26,19 @@ // Example: `143.19.23.16` IpAddress *string `mandatory:"true" json:"ipAddress"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateCpeDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCpeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCpeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCpeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCpeResponse wrapper for the CreateCpe operation type CreateCpeResponse struct { @@ -46,3 +64,8 @@ func (response CreateCpeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCpeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -46,6 +50,10 @@ // location, and you want this new cross-connect to be on the same router, provide the // OCID of that existing cross-connect or cross-connect group. NearCrossConnectOrCrossConnectGroupId *string `mandatory:"false" json:"nearCrossConnectOrCrossConnectGroupId"` + + // A reference name or identifier for the physical fiber connection that this cross-connect + // uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m CreateCrossConnectDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -21,6 +25,10 @@ // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // A reference name or identifier for the physical fiber connection that this cross-connect + // group uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m CreateCrossConnectGroupDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCrossConnectGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCrossConnectGroupResponse wrapper for the CreateCrossConnectGroup operation type CreateCrossConnectGroupResponse struct { @@ -46,3 +64,8 @@ func (response CreateCrossConnectGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCrossConnectGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCrossConnectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCrossConnectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCrossConnectResponse wrapper for the CreateCrossConnect operation type CreateCrossConnectResponse struct { @@ -46,3 +64,8 @@ func (response CreateCrossConnectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCrossConnectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -26,7 +30,7 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -35,7 +39,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -69,7 +73,11 @@ if err != nil { return err } - m.Options[i] = nn + if nn != nil { + m.Options[i] = nn.(DhcpOption) + } else { + m.Options[i] = nil + } } m.VcnId = model.VcnId return diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_options_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDhcpOptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDhcpOptionsResponse wrapper for the CreateDhcpOptions operation type CreateDhcpOptionsResponse struct { @@ -46,3 +64,8 @@ func (response CreateDhcpOptionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDhcpOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -23,6 +27,14 @@ // A user-friendly name. Does not have to be unique. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID of the route table the DRG attachment will use. + // If you don't specify a route table here, the DRG attachment is created without an associated route + // table. The Networking service does NOT automatically associate the attached VCN's default route table + // with the DRG attachment. + // For information about why you would associate a route table with a DRG attachment, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m CreateDrgAttachmentDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDrgAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDrgAttachmentResponse wrapper for the CreateDrgAttachment operation type CreateDrgAttachmentResponse struct { @@ -46,3 +64,8 @@ func (response CreateDrgAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDrgAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,8 +22,19 @@ // The OCID of the compartment to contain the DRG. CompartmentId *string `mandatory:"true" json:"compartmentId"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateDrgDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_drg_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDrgRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDrgRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDrgRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDrgResponse wrapper for the CreateDrg operation type CreateDrgResponse struct { @@ -46,3 +64,8 @@ func (response CreateDrgResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDrgResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -20,7 +24,7 @@ CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -32,7 +36,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -43,8 +47,9 @@ InstanceId *string `mandatory:"false" json:"instanceId"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: - // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. + // * `NATIVE` - VM instances launch with paravirtualized boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. + // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode CreateImageDetailsLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` } @@ -76,7 +81,11 @@ if e != nil { return } - m.ImageSourceDetails = nn.(ImageSourceDetails) + if nn != nil { + m.ImageSourceDetails = nn.(ImageSourceDetails) + } else { + m.ImageSourceDetails = nil + } m.InstanceId = model.InstanceId m.LaunchMode = model.LaunchMode m.CompartmentId = model.CompartmentId @@ -86,20 +95,22 @@ // CreateImageDetailsLaunchModeEnum Enum with underlying type: string type CreateImageDetailsLaunchModeEnum string -// Set of constants representing the allowable values for CreateImageDetailsLaunchMode +// Set of constants representing the allowable values for CreateImageDetailsLaunchModeEnum const ( - CreateImageDetailsLaunchModeNative CreateImageDetailsLaunchModeEnum = "NATIVE" - CreateImageDetailsLaunchModeEmulated CreateImageDetailsLaunchModeEnum = "EMULATED" - CreateImageDetailsLaunchModeCustom CreateImageDetailsLaunchModeEnum = "CUSTOM" + CreateImageDetailsLaunchModeNative CreateImageDetailsLaunchModeEnum = "NATIVE" + CreateImageDetailsLaunchModeEmulated CreateImageDetailsLaunchModeEnum = "EMULATED" + CreateImageDetailsLaunchModeParavirtualized CreateImageDetailsLaunchModeEnum = "PARAVIRTUALIZED" + CreateImageDetailsLaunchModeCustom CreateImageDetailsLaunchModeEnum = "CUSTOM" ) var mappingCreateImageDetailsLaunchMode = map[string]CreateImageDetailsLaunchModeEnum{ - "NATIVE": CreateImageDetailsLaunchModeNative, - "EMULATED": CreateImageDetailsLaunchModeEmulated, - "CUSTOM": CreateImageDetailsLaunchModeCustom, + "NATIVE": CreateImageDetailsLaunchModeNative, + "EMULATED": CreateImageDetailsLaunchModeEmulated, + "PARAVIRTUALIZED": CreateImageDetailsLaunchModeParavirtualized, + "CUSTOM": CreateImageDetailsLaunchModeCustom, } -// GetCreateImageDetailsLaunchModeEnumValues Enumerates the set of values for CreateImageDetailsLaunchMode +// GetCreateImageDetailsLaunchModeEnumValues Enumerates the set of values for CreateImageDetailsLaunchModeEnum func GetCreateImageDetailsLaunchModeEnumValues() []CreateImageDetailsLaunchModeEnum { values := make([]CreateImageDetailsLaunchModeEnum, 0) for _, v := range mappingCreateImageDetailsLaunchMode { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_image_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateImageRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateImageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateImageResponse wrapper for the CreateImage operation type CreateImageResponse struct { @@ -46,3 +64,8 @@ func (response CreateImageResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateInstanceConfigurationDetails An instance configuration that can be used to launch +type CreateInstanceConfigurationDetails struct { + + // The OCID of the compartment containing the instance configuration. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + InstanceDetails InstanceConfigurationInstanceDetails `mandatory:"true" json:"instanceDetails"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the instance configuration + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateInstanceConfigurationDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateInstanceConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + CompartmentId *string `json:"compartmentId"` + InstanceDetails instanceconfigurationinstancedetails `json:"instanceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.CompartmentId = model.CompartmentId + nn, e := model.InstanceDetails.UnmarshalPolymorphicJSON(model.InstanceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.InstanceDetails = nn.(InstanceConfigurationInstanceDetails) + } else { + m.InstanceDetails = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateInstanceConfigurationRequest wrapper for the CreateInstanceConfiguration operation +type CreateInstanceConfigurationRequest struct { + + // Instance configuration creation details + CreateInstanceConfiguration CreateInstanceConfigurationDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateInstanceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateInstanceConfigurationResponse wrapper for the CreateInstanceConfiguration operation +type CreateInstanceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstanceConfiguration instance + InstanceConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateInstanceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateInstanceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -23,13 +27,13 @@ PublicKey *string `mandatory:"true" json:"publicKey"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_console_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateInstanceConsoleConnectionResponse wrapper for the CreateInstanceConsoleConnection operation type CreateInstanceConsoleConnectionResponse struct { @@ -46,3 +64,8 @@ func (response CreateInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateInstancePoolDetails The data to create an instance pool. +type CreateInstancePoolDetails struct { + + // The OCID of the compartment containing the instance pool + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance configuration associated with the instance pool. + InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` + + // The placement configurations for the instance pool. Provide one placement configuration for + // each availability domain. + // To use the instance pool with a regional subnet, provide a placement configuration for + // each availability domain, and include the regional subnet in each placement + // configuration. + PlacementConfigurations []CreateInstancePoolPlacementConfigurationDetails `mandatory:"true" json:"placementConfigurations"` + + // The number of instances that should be in the instance pool. + Size *int `mandatory:"true" json:"size"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The user-friendly name. Does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The load balancers to attach to the instance pool. + LoadBalancers []AttachLoadBalancerDetails `mandatory:"false" json:"loadBalancers"` +} + +func (m CreateInstancePoolDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_placement_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_placement_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_placement_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_placement_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateInstancePoolPlacementConfigurationDetails The location for where an instance pool will place instances. +type CreateInstancePoolPlacementConfigurationDetails struct { + + // The availability domain to place instances. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the primary subnet to place instances. + PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` + + // The set of secondary VNIC data for instances in the pool. + SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` +} + +func (m CreateInstancePoolPlacementConfigurationDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateInstancePoolRequest wrapper for the CreateInstancePool operation +type CreateInstancePoolRequest struct { + + // Instance pool creation details + CreateInstancePoolDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateInstancePoolResponse wrapper for the CreateInstancePool operation +type CreateInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,17 +19,28 @@ // CreateInternetGatewayDetails The representation of CreateInternetGatewayDetails type CreateInternetGatewayDetails struct { - // The OCID of the compartment to contain the Internet Gateway. + // The OCID of the compartment to contain the internet gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Whether the gateway is enabled upon creation. IsEnabled *bool `mandatory:"true" json:"isEnabled"` - // The OCID of the VCN the Internet Gateway is attached to. + // The OCID of the VCN the internet gateway is attached to. VcnId *string `mandatory:"true" json:"vcnId"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateInternetGatewayDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,7 +11,7 @@ // CreateInternetGatewayRequest wrapper for the CreateInternetGateway operation type CreateInternetGatewayRequest struct { - // Details for creating a new Internet Gateway. + // Details for creating a new internet gateway. CreateInternetGatewayDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateInternetGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateInternetGatewayResponse wrapper for the CreateInternetGateway operation type CreateInternetGatewayResponse struct { @@ -46,3 +64,8 @@ func (response CreateInternetGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateInternetGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,21 +22,79 @@ // The OCID of the compartment to contain the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID of the CPE. + // The OCID of the Cpe object. CpeId *string `mandatory:"true" json:"cpeId"` // The OCID of the DRG. DrgId *string `mandatory:"true" json:"drgId"` - // Static routes to the CPE. At least one route must be included. The CIDR must not be a + // Static routes to the CPE. A static route's CIDR must not be a // multicast address or class E address. + // Used for routing a given IPSec tunnel's traffic only if the tunnel + // is using static routing. If you configure at least one tunnel to use static routing, then + // you must provide at least one valid static route. If you configure both + // tunnels to use BGP dynamic routing, you can provide an empty list for the static routes. + // For more information, see the important note in IPSecConnection. + // // Example: `10.0.1.0/24` StaticRoutes []string `mandatory:"true" json:"staticRoutes"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, the + // fully qualified domain name (FQDN)). The type of identifier you provide here must correspond + // to the value for `cpeLocalIdentifierType`. + // If you don't provide a value, the `ipAddress` attribute for the Cpe + // object specified by `cpeId` is used as the `cpeLocalIdentifier`. + // Example IP address: `10.0.3.3` + // Example hostname: `cpe.example.com` + CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` + + // The type of identifier for your CPE device. The value you provide here must correspond to the value + // for `cpeLocalIdentifier`. + CpeLocalIdentifierType CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` + + // Information for creating the individual tunnels in the IPSec connection. You can provide a + // maximum of 2 `tunnelConfiguration` objects in the array (one for each of the + // two tunnels). + TunnelConfiguration []CreateIpSecConnectionTunnelDetails `mandatory:"false" json:"tunnelConfiguration"` } func (m CreateIpSecConnectionDetails) String() string { return common.PointerString(m) } + +// CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum Enum with underlying type: string +type CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum string + +// Set of constants representing the allowable values for CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum +const ( + CreateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "IP_ADDRESS" + CreateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "HOSTNAME" +) + +var mappingCreateIpSecConnectionDetailsCpeLocalIdentifierType = map[string]CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum{ + "IP_ADDRESS": CreateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress, + "HOSTNAME": CreateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname, +} + +// GetCreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues Enumerates the set of values for CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum +func GetCreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues() []CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum { + values := make([]CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum, 0) + for _, v := range mappingCreateIpSecConnectionDetailsCpeLocalIdentifierType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_i_p_sec_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_i_p_sec_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_i_p_sec_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_i_p_sec_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateIPSecConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateIPSecConnectionResponse wrapper for the CreateIPSecConnection operation type CreateIPSecConnectionResponse struct { @@ -46,3 +64,8 @@ func (response CreateIPSecConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateIPSecConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_tunnel_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_tunnel_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_tunnel_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_tunnel_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateIpSecConnectionTunnelDetails The representation of CreateIpSecConnectionTunnelDetails +type CreateIpSecConnectionTunnelDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid + // entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The type of routing to use for this tunnel (either BGP dynamic routing or static routing). + Routing CreateIpSecConnectionTunnelDetailsRoutingEnum `mandatory:"false" json:"routing,omitempty"` + + // The shared secret (pre-shared key) to use for the IPSec tunnel. If you don't provide a value, + // Oracle generates a value for you. You can specify your own shared secret later if + // you like with UpdateIPSecConnectionTunnelSharedSecret. + // Example: `EXAMPLEToUis6j1c.p8G.dVQxcmdfMO0yXMLi.lZTbYCMDGu4V8o` + SharedSecret *string `mandatory:"false" json:"sharedSecret"` + + // Information for establishing a BGP session for the IPSec tunnel. Required if the tunnel uses + // BGP dynamic routing. + // If the tunnel instead uses static routing, you may optionally provide + // this object and set an IP address for one or both ends of the IPSec tunnel for the purposes + // of troubleshooting or monitoring the tunnel. + BgpSessionConfig *CreateIpSecTunnelBgpSessionDetails `mandatory:"false" json:"bgpSessionConfig"` +} + +func (m CreateIpSecConnectionTunnelDetails) String() string { + return common.PointerString(m) +} + +// CreateIpSecConnectionTunnelDetailsRoutingEnum Enum with underlying type: string +type CreateIpSecConnectionTunnelDetailsRoutingEnum string + +// Set of constants representing the allowable values for CreateIpSecConnectionTunnelDetailsRoutingEnum +const ( + CreateIpSecConnectionTunnelDetailsRoutingBgp CreateIpSecConnectionTunnelDetailsRoutingEnum = "BGP" + CreateIpSecConnectionTunnelDetailsRoutingStatic CreateIpSecConnectionTunnelDetailsRoutingEnum = "STATIC" +) + +var mappingCreateIpSecConnectionTunnelDetailsRouting = map[string]CreateIpSecConnectionTunnelDetailsRoutingEnum{ + "BGP": CreateIpSecConnectionTunnelDetailsRoutingBgp, + "STATIC": CreateIpSecConnectionTunnelDetailsRoutingStatic, +} + +// GetCreateIpSecConnectionTunnelDetailsRoutingEnumValues Enumerates the set of values for CreateIpSecConnectionTunnelDetailsRoutingEnum +func GetCreateIpSecConnectionTunnelDetailsRoutingEnumValues() []CreateIpSecConnectionTunnelDetailsRoutingEnum { + values := make([]CreateIpSecConnectionTunnelDetailsRoutingEnum, 0) + for _, v := range mappingCreateIpSecConnectionTunnelDetailsRouting { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_tunnel_bgp_session_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_tunnel_bgp_session_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_tunnel_bgp_session_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_tunnel_bgp_session_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateIpSecTunnelBgpSessionDetails The representation of CreateIpSecTunnelBgpSessionDetails +type CreateIpSecTunnelBgpSessionDetails struct { + + // The IP address for the Oracle end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this IP address + // is required and used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP + // address to troubleshoot or monitor the tunnel. + // The value must be a /30 or /31. + // Example: `10.0.0.4/31` + OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` + + // The IP address for the CPE end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this IP address + // is required and used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP + // address to troubleshoot or monitor the tunnel. + // The value must be a /30 or /31. + // Example: `10.0.0.5/31` + CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` + + // If the tunnel's `routing` attribute is set to `BGP` + // (see IPSecConnectionTunnel), this ASN + // is required and used for the tunnel's BGP session. This is the ASN of the network on the + // CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. Uses "asplain" format. + // If the tunnel's `routing` attribute is set to `STATIC`, the `customerBgpAsn` must be null. + // Example: `12345` (2-byte) or `1587232876` (4-byte) + CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` +} + +func (m CreateIpSecTunnelBgpSessionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -21,9 +25,28 @@ // The OCID of the VCN the LPG belongs to. VcnId *string `mandatory:"true" json:"vcnId"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The OCID of the route table the LPG will use. + // If you don't specify a route table here, the LPG is created without an associated route + // table. The Networking service does NOT automatically associate the attached VCN's default route table + // with the LPG. + // For information about why you would associate a route table with an LPG, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m CreateLocalPeeringGatewayDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateLocalPeeringGatewayResponse wrapper for the CreateLocalPeeringGateway operation type CreateLocalPeeringGatewayResponse struct { @@ -46,3 +64,8 @@ func (response CreateLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateLocalPeeringGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateNatGatewayDetails The representation of CreateNatGatewayDetails +type CreateNatGatewayDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the + // NAT gateway. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the gateway belongs to. + VcnId *string `mandatory:"true" json:"vcnId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Whether the NAT gateway blocks traffic through it. The default is `false`. + // Example: `true` + BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` +} + +func (m CreateNatGatewayDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateNatGatewayRequest wrapper for the CreateNatGateway operation +type CreateNatGatewayRequest struct { + + // Details for creating a NAT gateway. + CreateNatGatewayDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateNatGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateNatGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateNatGatewayResponse wrapper for the CreateNatGateway operation +type CreateNatGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NatGateway instance + NatGateway `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateNatGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateNatGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -20,7 +24,7 @@ VnicId *string `mandatory:"true" json:"vnicId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -30,7 +34,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -41,7 +45,7 @@ // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreatePrivateIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreatePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePrivateIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreatePrivateIpResponse wrapper for the CreatePrivateIp operation type CreatePrivateIpResponse struct { @@ -46,3 +64,8 @@ func (response CreatePrivateIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreatePrivateIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -21,13 +25,24 @@ // Defines when the public IP is deleted and released back to the Oracle Cloud // Infrastructure public IP pool. For more information, see - // Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). + // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). Lifetime CreatePublicIpDetailsLifetimeEnum `mandatory:"true" json:"lifetime"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The OCID of the private IP to assign the public IP to. // Required for an ephemeral public IP because it must always be assigned to a private IP // (specifically a *primary* private IP). @@ -44,7 +59,7 @@ // CreatePublicIpDetailsLifetimeEnum Enum with underlying type: string type CreatePublicIpDetailsLifetimeEnum string -// Set of constants representing the allowable values for CreatePublicIpDetailsLifetime +// Set of constants representing the allowable values for CreatePublicIpDetailsLifetimeEnum const ( CreatePublicIpDetailsLifetimeEphemeral CreatePublicIpDetailsLifetimeEnum = "EPHEMERAL" CreatePublicIpDetailsLifetimeReserved CreatePublicIpDetailsLifetimeEnum = "RESERVED" @@ -55,7 +70,7 @@ "RESERVED": CreatePublicIpDetailsLifetimeReserved, } -// GetCreatePublicIpDetailsLifetimeEnumValues Enumerates the set of values for CreatePublicIpDetailsLifetime +// GetCreatePublicIpDetailsLifetimeEnumValues Enumerates the set of values for CreatePublicIpDetailsLifetimeEnum func GetCreatePublicIpDetailsLifetimeEnumValues() []CreatePublicIpDetailsLifetimeEnum { values := make([]CreatePublicIpDetailsLifetimeEnum, 0) for _, v := range mappingCreatePublicIpDetailsLifetime { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreatePublicIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreatePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePublicIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreatePublicIpResponse wrapper for the CreatePublicIp operation type CreatePublicIpResponse struct { @@ -46,3 +64,8 @@ func (response CreatePublicIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreatePublicIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_remote_peering_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateRemotePeeringConnectionResponse wrapper for the CreateRemotePeeringConnection operation type CreateRemotePeeringConnectionResponse struct { @@ -46,3 +64,8 @@ func (response CreateRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateRemotePeeringConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -25,7 +29,7 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -34,7 +38,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateRouteTableRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRouteTableRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateRouteTableResponse wrapper for the CreateRouteTable operation type CreateRouteTableResponse struct { @@ -46,3 +64,8 @@ func (response CreateRouteTableResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateRouteTableResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -28,7 +32,7 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -37,7 +41,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSecurityListRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSecurityListRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSecurityListResponse wrapper for the CreateSecurityList operation type CreateSecurityListResponse struct { @@ -46,3 +64,8 @@ func (response CreateSecurityListResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSecurityListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateServiceGatewayDetails The representation of CreateServiceGatewayDetails +type CreateServiceGatewayDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the service gateway. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // List of the OCIDs of the Service objects to + // enable for the service gateway. This list can be empty if you don't want to enable any + // `Service` objects when you create the gateway. You can enable a `Service` + // object later by using either AttachServiceId + // or UpdateServiceGateway. + // For each enabled `Service`, make sure there's a route rule with the `Service` object's `cidrBlock` + // as the rule's destination and the service gateway as the rule's target. See + // RouteTable. + Services []ServiceIdRequestDetails `mandatory:"true" json:"services"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. + VcnId *string `mandatory:"true" json:"vcnId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateServiceGatewayDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateServiceGatewayRequest wrapper for the CreateServiceGateway operation +type CreateServiceGatewayRequest struct { + + // Details for creating a service gateway. + CreateServiceGatewayDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateServiceGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateServiceGatewayResponse wrapper for the CreateServiceGateway operation +type CreateServiceGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceGateway instance + ServiceGateway `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateServiceGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateServiceGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,10 +19,6 @@ // CreateSubnetDetails The representation of CreateSubnetDetails type CreateSubnetDetails struct { - // The Availability Domain to contain the subnet. - // Example: `Uocm:PHX-AD-1` - AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - // The CIDR IP address range of the subnet. // Example: `172.16.1.0/24` CidrBlock *string `mandatory:"true" json:"cidrBlock"` @@ -29,13 +29,25 @@ // The OCID of the VCN to contain the subnet. VcnId *string `mandatory:"true" json:"vcnId"` + // Controls whether the subnet is regional or specific to an availability domain. Oracle + // recommends creating regional subnets because they're more flexible and make it easier to + // implement failover across availability domains. Originally, AD-specific subnets were the + // only kind available to use. + // To create a regional subnet, omit this attribute. Then any resources later created in this + // subnet (such as a Compute instance) can be created in any availability domain in the region. + // To instead create an AD-specific subnet, set this attribute to the availability domain you + // want this subnet to be in. Then any resources later created in this subnet can only be + // created in that availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The OCID of the set of DHCP options the subnet will use. If you don't - // provide a value, the subnet will use the VCN's default set of DHCP options. + // provide a value, the subnet uses the VCN's default set of DHCP options. DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. @@ -50,13 +62,13 @@ // 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 (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -68,17 +80,18 @@ // If `prohibitPublicIpOnVnic` is set to true, VNICs created in this // subnet cannot have public IP addresses (that is, it's a private // subnet). + // // Example: `true` ProhibitPublicIpOnVnic *bool `mandatory:"false" json:"prohibitPublicIpOnVnic"` // The OCID of the route table the subnet will use. If you don't provide a value, - // the subnet will use the VCN's default route table. + // the subnet uses the VCN's default route table. RouteTableId *string `mandatory:"false" json:"routeTableId"` - // OCIDs for the security lists to associate with the subnet. If you don't - // provide a value, the VCN's default security list will be associated with - // the subnet. Remember that security lists are associated at the subnet - // level, but the rules are applied to the individual VNICs in the subnet. + // The OCIDs of the security list or lists the subnet will use. If you don't + // provide a value, the subnet uses the VCN's default security list. + // Remember that security lists are associated *with the subnet*, but the + // rules are applied to the individual VNICs in the subnet. SecurityListIds []string `mandatory:"false" json:"securityListIds"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSubnetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSubnetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSubnetResponse wrapper for the CreateSubnet operation type CreateSubnetResponse struct { @@ -46,3 +64,8 @@ func (response CreateSubnetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSubnetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -23,7 +27,7 @@ CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -40,13 +44,13 @@ // 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 (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateVcnRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateVcnRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVcnRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateVcnResponse wrapper for the CreateVcn operation type CreateVcnResponse struct { @@ -46,3 +64,8 @@ func (response CreateVcnResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateVcnResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -55,6 +59,9 @@ // ListFastConnectProviderServices. ProviderServiceId *string `mandatory:"false" json:"providerServiceId"` + // The service key name offered by the provider (if the customer is connecting via a provider). + ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` + // Deprecated. Instead use `providerServiceId`. // To get a list of the provider names, see // ListFastConnectProviderServices. @@ -77,7 +84,7 @@ // CreateVirtualCircuitDetailsTypeEnum Enum with underlying type: string type CreateVirtualCircuitDetailsTypeEnum string -// Set of constants representing the allowable values for CreateVirtualCircuitDetailsType +// Set of constants representing the allowable values for CreateVirtualCircuitDetailsTypeEnum const ( CreateVirtualCircuitDetailsTypePublic CreateVirtualCircuitDetailsTypeEnum = "PUBLIC" CreateVirtualCircuitDetailsTypePrivate CreateVirtualCircuitDetailsTypeEnum = "PRIVATE" @@ -88,7 +95,7 @@ "PRIVATE": CreateVirtualCircuitDetailsTypePrivate, } -// GetCreateVirtualCircuitDetailsTypeEnumValues Enumerates the set of values for CreateVirtualCircuitDetailsType +// GetCreateVirtualCircuitDetailsTypeEnumValues Enumerates the set of values for CreateVirtualCircuitDetailsTypeEnum func GetCreateVirtualCircuitDetailsTypeEnumValues() []CreateVirtualCircuitDetailsTypeEnum { values := make([]CreateVirtualCircuitDetailsTypeEnum, 0) for _, v := range mappingCreateVirtualCircuitDetailsType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_public_prefix_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_public_prefix_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_public_prefix_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_public_prefix_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type CreateVirtualCircuitPublicPrefixDetails struct { // An individual public IP prefix (CIDR) to add to the public virtual circuit. - // Must be /24 or less specific. + // Must be /31 or less specific. CidrBlock *string `mandatory:"true" json:"cidrBlock"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateVirtualCircuitRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateVirtualCircuitResponse wrapper for the CreateVirtualCircuit operation type CreateVirtualCircuitResponse struct { @@ -46,3 +64,8 @@ func (response CreateVirtualCircuitResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateVirtualCircuitResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vnic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vnic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vnic_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_vnic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,7 +19,7 @@ // CreateVnicDetails Contains properties for a VNIC. You use this object when creating the // primary VNIC during instance launch or when creating a secondary VNIC. // For more information about VNICs, see -// Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). +// Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). type CreateVnicDetails struct { // The OCID of the subnet to create the VNIC in. When launching an instance, @@ -33,20 +37,31 @@ // `prohibitPublicIpOnVnic` = true, an error is returned. // **Note:** This public IP address is associated with the primary private IP // on the VNIC. For more information, see - // IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPaddresses.htm). + // IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // **Note:** There's a limit to the number of PublicIp // a VNIC or instance can have. If you try to create a secondary VNIC // with an assigned public IP for an instance that has already // reached its public IP limit, an error is returned. For information // about the public IP limits, see - // Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). + // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). // Example: `false` AssignPublicIp *bool `mandatory:"false" json:"assignPublicIp"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name for the VNIC. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). @@ -58,7 +73,7 @@ // ListPrivateIps and // GetPrivateIp. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // When launching an instance, use this `hostnameLabel` instead // of the deprecated `hostnameLabel` in // LaunchInstanceDetails. @@ -80,7 +95,7 @@ // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. For information // about why you would skip the source/destination check, see - // Using a Private IP as a Route Target (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip). + // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -19,7 +23,7 @@ VolumeId *string `mandatory:"true" json:"volumeId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -29,7 +33,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -44,7 +48,7 @@ // CreateVolumeBackupDetailsTypeEnum Enum with underlying type: string type CreateVolumeBackupDetailsTypeEnum string -// Set of constants representing the allowable values for CreateVolumeBackupDetailsType +// Set of constants representing the allowable values for CreateVolumeBackupDetailsTypeEnum const ( CreateVolumeBackupDetailsTypeFull CreateVolumeBackupDetailsTypeEnum = "FULL" CreateVolumeBackupDetailsTypeIncremental CreateVolumeBackupDetailsTypeEnum = "INCREMENTAL" @@ -55,7 +59,7 @@ "INCREMENTAL": CreateVolumeBackupDetailsTypeIncremental, } -// GetCreateVolumeBackupDetailsTypeEnumValues Enumerates the set of values for CreateVolumeBackupDetailsType +// GetCreateVolumeBackupDetailsTypeEnumValues Enumerates the set of values for CreateVolumeBackupDetailsTypeEnum func GetCreateVolumeBackupDetailsTypeEnumValues() []CreateVolumeBackupDetailsTypeEnum { values := make([]CreateVolumeBackupDetailsTypeEnum, 0) for _, v := range mappingCreateVolumeBackupDetailsType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_assignment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // Request to assign a specified policy to a particular asset. CreateVolumeBackupPolicyAssignmentDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateVolumeBackupPolicyAssignmentResponse wrapper for the CreateVolumeBackupPolicyAssignment operation type CreateVolumeBackupPolicyAssignmentResponse struct { @@ -39,3 +57,8 @@ func (response CreateVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateVolumeBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateVolumeBackupResponse wrapper for the CreateVolumeBackup operation type CreateVolumeBackupResponse struct { @@ -46,3 +64,8 @@ func (response CreateVolumeBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ // CreateVolumeDetails The representation of CreateVolumeDetails type CreateVolumeDetails struct { - // The Availability Domain of the volume. + // The availability domain of the volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -28,7 +32,7 @@ BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -38,18 +42,21 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The OCID of the KMS key to be used as the master encryption key for the volume. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` + // The size of the volume in GBs. - SizeInGBs *int `mandatory:"false" json:"sizeInGBs"` + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Use sizeInGBs instead. - SizeInMBs *int `mandatory:"false" json:"sizeInMBs"` + SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` - // Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same Availability Domain or a Block volume backup. + // Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same availability domain or a Block volume backup. // This is an optional field. If not specified or set to null, the new Block volume will be empty. // When specified, the new Block volume will contain data from the source volume or backup. SourceDetails VolumeSourceDetails `mandatory:"false" json:"sourceDetails"` @@ -71,8 +78,9 @@ DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` - SizeInGBs *int `json:"sizeInGBs"` - SizeInMBs *int `json:"sizeInMBs"` + KmsKeyId *string `json:"kmsKeyId"` + SizeInGBs *int64 `json:"sizeInGBs"` + SizeInMBs *int64 `json:"sizeInMBs"` SourceDetails volumesourcedetails `json:"sourceDetails"` VolumeBackupId *string `json:"volumeBackupId"` AvailabilityDomain *string `json:"availabilityDomain"` @@ -87,13 +95,18 @@ m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags + m.KmsKeyId = model.KmsKeyId m.SizeInGBs = model.SizeInGBs m.SizeInMBs = model.SizeInMBs nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } - m.SourceDetails = nn.(VolumeSourceDetails) + if nn != nil { + m.SourceDetails = nn.(VolumeSourceDetails) + } else { + m.SourceDetails = nil + } m.VolumeBackupId = model.VolumeBackupId m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateVolumeGroupBackupDetails The representation of CreateVolumeGroupBackupDetails +type CreateVolumeGroupBackupDetails struct { + + // The OCID of the volume group that needs to be backed up. + VolumeGroupId *string `mandatory:"true" json:"volumeGroupId"` + + // The OCID of the compartment that will contain the volume group backup. This parameter is optional, by default backup will be created in the same compartment and source volume group. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the volume group backup. Does not have to be unique and it's changeable. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The type of backup to create. If omitted, defaults to incremental. + Type CreateVolumeGroupBackupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` +} + +func (m CreateVolumeGroupBackupDetails) String() string { + return common.PointerString(m) +} + +// CreateVolumeGroupBackupDetailsTypeEnum Enum with underlying type: string +type CreateVolumeGroupBackupDetailsTypeEnum string + +// Set of constants representing the allowable values for CreateVolumeGroupBackupDetailsTypeEnum +const ( + CreateVolumeGroupBackupDetailsTypeFull CreateVolumeGroupBackupDetailsTypeEnum = "FULL" + CreateVolumeGroupBackupDetailsTypeIncremental CreateVolumeGroupBackupDetailsTypeEnum = "INCREMENTAL" +) + +var mappingCreateVolumeGroupBackupDetailsType = map[string]CreateVolumeGroupBackupDetailsTypeEnum{ + "FULL": CreateVolumeGroupBackupDetailsTypeFull, + "INCREMENTAL": CreateVolumeGroupBackupDetailsTypeIncremental, +} + +// GetCreateVolumeGroupBackupDetailsTypeEnumValues Enumerates the set of values for CreateVolumeGroupBackupDetailsTypeEnum +func GetCreateVolumeGroupBackupDetailsTypeEnumValues() []CreateVolumeGroupBackupDetailsTypeEnum { + values := make([]CreateVolumeGroupBackupDetailsTypeEnum, 0) + for _, v := range mappingCreateVolumeGroupBackupDetailsType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateVolumeGroupBackupRequest wrapper for the CreateVolumeGroupBackup operation +type CreateVolumeGroupBackupRequest struct { + + // Request to create a new backup group of given volume group. + CreateVolumeGroupBackupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateVolumeGroupBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateVolumeGroupBackupResponse wrapper for the CreateVolumeGroupBackup operation +type CreateVolumeGroupBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroupBackup instance + VolumeGroupBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateVolumeGroupBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateVolumeGroupBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateVolumeGroupDetails The representation of CreateVolumeGroupDetails +type CreateVolumeGroupDetails struct { + + // The availability domain of the volume group. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the compartment that contains the volume group. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Specifies the volume group source details for a new volume group. The volume source is either another a list of + // volume ids in the same availability domain, another volume group or a volume group backup. + SourceDetails VolumeGroupSourceDetails `mandatory:"true" json:"sourceDetails"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the volume group. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateVolumeGroupDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateVolumeGroupDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + SourceDetails volumegroupsourcedetails `json:"sourceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.AvailabilityDomain = model.AvailabilityDomain + m.CompartmentId = model.CompartmentId + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(VolumeGroupSourceDetails) + } else { + m.SourceDetails = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateVolumeGroupRequest wrapper for the CreateVolumeGroup operation +type CreateVolumeGroupRequest struct { + + // Request to create a new volume group. + CreateVolumeGroupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateVolumeGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateVolumeGroupResponse wrapper for the CreateVolumeGroup operation +type CreateVolumeGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroup instance + VolumeGroup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateVolumeGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateVolumeGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/create_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateVolumeResponse wrapper for the CreateVolume operation type CreateVolumeResponse struct { @@ -46,3 +64,8 @@ func (response CreateVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,7 +19,7 @@ // CrossConnect For use with Oracle Cloud Infrastructure FastConnect. A cross-connect represents a // physical connection between an existing network and Oracle. Customers who are colocated // with Oracle in a FastConnect location create and use cross-connects. For more -// information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // Oracle recommends you create each cross-connect in a // CrossConnectGroup so you can use link aggregation // with the connection. @@ -24,7 +28,9 @@ // same way as a colocated customer's (with `CrossConnect` and `CrossConnectGroup` objects, and so on). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type CrossConnect struct { // The OCID of the compartment containing the cross-connect group. @@ -53,6 +59,10 @@ // Example: `10 Gbps` PortSpeedShapeName *string `mandatory:"false" json:"portSpeedShapeName"` + // A reference name or identifier for the physical fiber connection that this cross-connect + // uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` + // The date and time the cross-connect was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -65,7 +75,7 @@ // CrossConnectLifecycleStateEnum Enum with underlying type: string type CrossConnectLifecycleStateEnum string -// Set of constants representing the allowable values for CrossConnectLifecycleState +// Set of constants representing the allowable values for CrossConnectLifecycleStateEnum const ( CrossConnectLifecycleStatePendingCustomer CrossConnectLifecycleStateEnum = "PENDING_CUSTOMER" CrossConnectLifecycleStateProvisioning CrossConnectLifecycleStateEnum = "PROVISIONING" @@ -84,7 +94,7 @@ "TERMINATED": CrossConnectLifecycleStateTerminated, } -// GetCrossConnectLifecycleStateEnumValues Enumerates the set of values for CrossConnectLifecycleState +// GetCrossConnectLifecycleStateEnumValues Enumerates the set of values for CrossConnectLifecycleStateEnum func GetCrossConnectLifecycleStateEnumValues() []CrossConnectLifecycleStateEnum { values := make([]CrossConnectLifecycleStateEnum, 0) for _, v := range mappingCrossConnectLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_group.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_group.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_group.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_group.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,19 +20,21 @@ // is a link aggregation group (LAG), which can contain one or more // CrossConnect. Customers who are colocated with // Oracle in a FastConnect location create and use cross-connect groups. For more -// information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // **Note:** If you're a provider who is setting up a physical connection to Oracle so customers // can use FastConnect over the connection, be aware that your connection is modeled the // same way as a colocated customer's (with `CrossConnect` and `CrossConnectGroup` objects, and so on). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type CrossConnectGroup struct { // The OCID of the compartment containing the cross-connect group. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // The display name of A user-friendly name. Does not have to be unique, and it's changeable. + // The display name of a user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -38,6 +44,10 @@ // The cross-connect group's current state. LifecycleState CrossConnectGroupLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + // A reference name or identifier for the physical fiber connection that this cross-connect + // group uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` + // The date and time the cross-connect group was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -50,7 +60,7 @@ // CrossConnectGroupLifecycleStateEnum Enum with underlying type: string type CrossConnectGroupLifecycleStateEnum string -// Set of constants representing the allowable values for CrossConnectGroupLifecycleState +// Set of constants representing the allowable values for CrossConnectGroupLifecycleStateEnum const ( CrossConnectGroupLifecycleStateProvisioning CrossConnectGroupLifecycleStateEnum = "PROVISIONING" CrossConnectGroupLifecycleStateProvisioned CrossConnectGroupLifecycleStateEnum = "PROVISIONED" @@ -67,7 +77,7 @@ "TERMINATED": CrossConnectGroupLifecycleStateTerminated, } -// GetCrossConnectGroupLifecycleStateEnumValues Enumerates the set of values for CrossConnectGroupLifecycleState +// GetCrossConnectGroupLifecycleStateEnumValues Enumerates the set of values for CrossConnectGroupLifecycleStateEnum func GetCrossConnectGroupLifecycleStateEnumValues() []CrossConnectGroupLifecycleStateEnum { values := make([]CrossConnectGroupLifecycleStateEnum, 0) for _, v := range mappingCrossConnectGroupLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_location.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_location.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_location.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_location.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_mapping.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_mapping.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_mapping.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_mapping.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,7 +26,7 @@ // If you're a customer who is colocated with Oracle, that means you own both // the virtual circuit and the physical connection it runs on (cross-connect or // cross-connect group), so you specify all the information in the mapping. There's -// one exception: for a public virtual circuit, Oracle specifies the BGP IP +// one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 // addresses. // If you're a provider, then you own the physical connection that the customer's // virtual circuit runs on, so you contribute information about the cross-connect @@ -32,7 +36,7 @@ // the provider also specifies the BGP peering information. If the BGP session instead // goes from Oracle to the customer's edge router, then the customer specifies the BGP // peering information. There's one exception: for a public virtual circuit, Oracle -// specifies the BGP IP addresses. +// specifies the BGP IPv4 addresses. type CrossConnectMapping struct { // The key for BGP MD5 authentication. Only applicable if your system @@ -46,20 +50,20 @@ // customer is connecting via provider). CrossConnectOrCrossConnectGroupId *string `mandatory:"false" json:"crossConnectOrCrossConnectGroupId"` - // The BGP IP address for the router on the other end of the BGP session from + // The BGP IPv4 address for the router on the other end of the BGP session from // Oracle. Specified by the owner of that router. If the session goes from Oracle - // to a customer, this is the BGP IP address of the customer's edge router. If the - // session goes from Oracle to a provider, this is the BGP IP address of the + // to a customer, this is the BGP IPv4 address of the customer's edge router. If the + // session goes from Oracle to a provider, this is the BGP IPv4 address of the // provider's edge router. Must use a /30 or /31 subnet mask. - // There's one exception: for a public virtual circuit, Oracle specifies the BGP IP addresses. + // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses. // Example: `10.0.0.18/31` CustomerBgpPeeringIp *string `mandatory:"false" json:"customerBgpPeeringIp"` - // The IP address for Oracle's end of the BGP session. Must use a /30 or /31 + // The IPv4 address for Oracle's end of the BGP session. Must use a /30 or /31 // subnet mask. If the session goes from Oracle to a customer's edge router, // the customer specifies this information. If the session goes from Oracle to // a provider's edge router, the provider specifies this. - // There's one exception: for a public virtual circuit, Oracle specifies the BGP IP addresses. + // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses. // Example: `10.0.0.19/31` OracleBgpPeeringIp *string `mandatory:"false" json:"oracleBgpPeeringIp"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_port_speed_shape.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_port_speed_shape.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_port_speed_shape.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_port_speed_shape.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_status.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_status.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_status.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_status.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -41,7 +45,7 @@ // CrossConnectStatusInterfaceStateEnum Enum with underlying type: string type CrossConnectStatusInterfaceStateEnum string -// Set of constants representing the allowable values for CrossConnectStatusInterfaceState +// Set of constants representing the allowable values for CrossConnectStatusInterfaceStateEnum const ( CrossConnectStatusInterfaceStateUp CrossConnectStatusInterfaceStateEnum = "UP" CrossConnectStatusInterfaceStateDown CrossConnectStatusInterfaceStateEnum = "DOWN" @@ -52,7 +56,7 @@ "DOWN": CrossConnectStatusInterfaceStateDown, } -// GetCrossConnectStatusInterfaceStateEnumValues Enumerates the set of values for CrossConnectStatusInterfaceState +// GetCrossConnectStatusInterfaceStateEnumValues Enumerates the set of values for CrossConnectStatusInterfaceStateEnum func GetCrossConnectStatusInterfaceStateEnumValues() []CrossConnectStatusInterfaceStateEnum { values := make([]CrossConnectStatusInterfaceStateEnum, 0) for _, v := range mappingCrossConnectStatusInterfaceState { @@ -64,7 +68,7 @@ // CrossConnectStatusLightLevelIndicatorEnum Enum with underlying type: string type CrossConnectStatusLightLevelIndicatorEnum string -// Set of constants representing the allowable values for CrossConnectStatusLightLevelIndicator +// Set of constants representing the allowable values for CrossConnectStatusLightLevelIndicatorEnum const ( CrossConnectStatusLightLevelIndicatorNoLight CrossConnectStatusLightLevelIndicatorEnum = "NO_LIGHT" CrossConnectStatusLightLevelIndicatorLowWarn CrossConnectStatusLightLevelIndicatorEnum = "LOW_WARN" @@ -81,7 +85,7 @@ "GOOD": CrossConnectStatusLightLevelIndicatorGood, } -// GetCrossConnectStatusLightLevelIndicatorEnumValues Enumerates the set of values for CrossConnectStatusLightLevelIndicator +// GetCrossConnectStatusLightLevelIndicatorEnumValues Enumerates the set of values for CrossConnectStatusLightLevelIndicatorEnum func GetCrossConnectStatusLightLevelIndicatorEnumValues() []CrossConnectStatusLightLevelIndicatorEnum { values := make([]CrossConnectStatusLightLevelIndicatorEnum, 0) for _, v := range mappingCrossConnectStatusLightLevelIndicator { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_app_catalog_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_app_catalog_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_app_catalog_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_app_catalog_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAppCatalogSubscriptionRequest wrapper for the DeleteAppCatalogSubscription operation +type DeleteAppCatalogSubscriptionRequest struct { + + // The OCID of the listing. + ListingId *string `mandatory:"true" contributesTo:"query" name:"listingId"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Listing Resource Version. + ResourceVersion *string `mandatory:"true" contributesTo:"query" name:"resourceVersion"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAppCatalogSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAppCatalogSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAppCatalogSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAppCatalogSubscriptionResponse wrapper for the DeleteAppCatalogSubscription operation +type DeleteAppCatalogSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAppCatalogSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAppCatalogSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteBootVolumeBackupRequest wrapper for the DeleteBootVolumeBackup operation +type DeleteBootVolumeBackupRequest struct { + + // The OCID of the boot volume backup. + BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteBootVolumeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteBootVolumeBackupResponse wrapper for the DeleteBootVolumeBackup operation +type DeleteBootVolumeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteBootVolumeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBootVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteBootVolumeKmsKeyRequest wrapper for the DeleteBootVolumeKmsKey operation +type DeleteBootVolumeKmsKeyRequest struct { + + // The OCID of the boot volume. + BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteBootVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteBootVolumeKmsKeyResponse wrapper for the DeleteBootVolumeKmsKey operation +type DeleteBootVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteBootVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteBootVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteBootVolumeResponse wrapper for the DeleteBootVolume operation type DeleteBootVolumeResponse struct { @@ -38,3 +56,8 @@ func (response DeleteBootVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_console_history_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_console_history_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_console_history_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_console_history_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteConsoleHistoryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteConsoleHistoryResponse wrapper for the DeleteConsoleHistory operation type DeleteConsoleHistoryResponse struct { @@ -38,3 +56,8 @@ func (response DeleteConsoleHistoryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cpe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cpe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cpe_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cpe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteCpeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteCpeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCpeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteCpeResponse wrapper for the DeleteCpe operation type DeleteCpeResponse struct { @@ -38,3 +56,8 @@ func (response DeleteCpeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCpeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteCrossConnectGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteCrossConnectGroupResponse wrapper for the DeleteCrossConnectGroup operation type DeleteCrossConnectGroupResponse struct { @@ -38,3 +56,8 @@ func (response DeleteCrossConnectGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCrossConnectGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteCrossConnectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCrossConnectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteCrossConnectResponse wrapper for the DeleteCrossConnect operation type DeleteCrossConnectResponse struct { @@ -38,3 +56,8 @@ func (response DeleteCrossConnectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCrossConnectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_dhcp_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_dhcp_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_dhcp_options_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_dhcp_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDhcpOptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDhcpOptionsResponse wrapper for the DeleteDhcpOptions operation type DeleteDhcpOptionsResponse struct { @@ -38,3 +56,8 @@ func (response DeleteDhcpOptionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDhcpOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDrgAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDrgAttachmentResponse wrapper for the DeleteDrgAttachment operation type DeleteDrgAttachmentResponse struct { @@ -38,3 +56,8 @@ func (response DeleteDrgAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDrgAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDrgRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDrgRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDrgRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDrgResponse wrapper for the DeleteDrg operation type DeleteDrgResponse struct { @@ -38,3 +56,8 @@ func (response DeleteDrgResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDrgResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_image_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_image_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_image_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_image_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteImageRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteImageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteImageResponse wrapper for the DeleteImage operation type DeleteImageResponse struct { @@ -38,3 +56,8 @@ func (response DeleteImageResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteInstanceConfigurationRequest wrapper for the DeleteInstanceConfiguration operation +type DeleteInstanceConfigurationRequest struct { + + // The OCID of the instance configuration. + InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteInstanceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteInstanceConfigurationResponse wrapper for the DeleteInstanceConfiguration operation +type DeleteInstanceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteInstanceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteInstanceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_console_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_console_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_console_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_instance_console_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,19 +11,37 @@ // DeleteInstanceConsoleConnectionRequest wrapper for the DeleteInstanceConsoleConnection operation type DeleteInstanceConsoleConnectionRequest struct { - // The OCID of the intance console connection + // The OCID of the instance console connection. InstanceConsoleConnectionId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleConnectionId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteInstanceConsoleConnectionResponse wrapper for the DeleteInstanceConsoleConnection operation type DeleteInstanceConsoleConnectionResponse struct { @@ -38,3 +56,8 @@ func (response DeleteInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_internet_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_internet_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_internet_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_internet_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,19 +11,37 @@ // DeleteInternetGatewayRequest wrapper for the DeleteInternetGateway operation type DeleteInternetGatewayRequest struct { - // The OCID of the Internet Gateway. + // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteInternetGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteInternetGatewayResponse wrapper for the DeleteInternetGateway operation type DeleteInternetGatewayResponse struct { @@ -38,3 +56,8 @@ func (response DeleteInternetGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteInternetGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_i_p_sec_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_i_p_sec_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_i_p_sec_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_i_p_sec_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteIPSecConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteIPSecConnectionResponse wrapper for the DeleteIPSecConnection operation type DeleteIPSecConnectionResponse struct { @@ -38,3 +56,8 @@ func (response DeleteIPSecConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteIPSecConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_local_peering_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_local_peering_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_local_peering_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_local_peering_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteLocalPeeringGatewayResponse wrapper for the DeleteLocalPeeringGateway operation type DeleteLocalPeeringGatewayResponse struct { @@ -38,3 +56,8 @@ func (response DeleteLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteLocalPeeringGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_nat_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_nat_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_nat_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_nat_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteNatGatewayRequest wrapper for the DeleteNatGateway operation +type DeleteNatGatewayRequest struct { + + // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteNatGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteNatGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteNatGatewayResponse wrapper for the DeleteNatGateway operation +type DeleteNatGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteNatGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteNatGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_private_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_private_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_private_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_private_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeletePrivateIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeletePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePrivateIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeletePrivateIpResponse wrapper for the DeletePrivateIp operation type DeletePrivateIpResponse struct { @@ -38,3 +56,8 @@ func (response DeletePrivateIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeletePrivateIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_public_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_public_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_public_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_public_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeletePublicIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeletePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePublicIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeletePublicIpResponse wrapper for the DeletePublicIp operation type DeletePublicIpResponse struct { @@ -38,3 +56,8 @@ func (response DeletePublicIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeletePublicIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_remote_peering_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_remote_peering_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_remote_peering_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_remote_peering_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteRemotePeeringConnectionResponse wrapper for the DeleteRemotePeeringConnection operation type DeleteRemotePeeringConnectionResponse struct { @@ -38,3 +56,8 @@ func (response DeleteRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteRemotePeeringConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_route_table_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_route_table_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_route_table_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_route_table_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteRouteTableRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteRouteTableRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteRouteTableResponse wrapper for the DeleteRouteTable operation type DeleteRouteTableResponse struct { @@ -38,3 +56,8 @@ func (response DeleteRouteTableResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteRouteTableResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_security_list_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_security_list_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_security_list_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_security_list_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSecurityListRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSecurityListRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSecurityListResponse wrapper for the DeleteSecurityList operation type DeleteSecurityListResponse struct { @@ -38,3 +56,8 @@ func (response DeleteSecurityListResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSecurityListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_service_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_service_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_service_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_service_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteServiceGatewayRequest wrapper for the DeleteServiceGateway operation +type DeleteServiceGatewayRequest struct { + + // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteServiceGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteServiceGatewayResponse wrapper for the DeleteServiceGateway operation +type DeleteServiceGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteServiceGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteServiceGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_subnet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_subnet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_subnet_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_subnet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSubnetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSubnetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSubnetResponse wrapper for the DeleteSubnet operation type DeleteSubnetResponse struct { @@ -38,3 +56,8 @@ func (response DeleteSubnetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSubnetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_vcn_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_vcn_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_vcn_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_vcn_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteVcnRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteVcnRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVcnRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteVcnResponse wrapper for the DeleteVcn operation type DeleteVcnResponse struct { @@ -38,3 +56,8 @@ func (response DeleteVcnResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVcnResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_public_prefix_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_public_prefix_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_public_prefix_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_public_prefix_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteVirtualCircuitRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteVirtualCircuitResponse wrapper for the DeleteVirtualCircuit operation type DeleteVirtualCircuitResponse struct { @@ -38,3 +56,8 @@ func (response DeleteVirtualCircuitResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVirtualCircuitResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_policy_assignment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_policy_assignment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_policy_assignment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_policy_assignment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteVolumeBackupPolicyAssignmentResponse wrapper for the DeleteVolumeBackupPolicyAssignment operation type DeleteVolumeBackupPolicyAssignmentResponse struct { @@ -38,3 +56,8 @@ func (response DeleteVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteVolumeBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteVolumeBackupResponse wrapper for the DeleteVolumeBackup operation type DeleteVolumeBackupResponse struct { @@ -38,3 +56,8 @@ func (response DeleteVolumeBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteVolumeGroupBackupRequest wrapper for the DeleteVolumeGroupBackup operation +type DeleteVolumeGroupBackupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. + VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteVolumeGroupBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteVolumeGroupBackupResponse wrapper for the DeleteVolumeGroupBackup operation +type DeleteVolumeGroupBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteVolumeGroupBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeGroupBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteVolumeGroupRequest wrapper for the DeleteVolumeGroup operation +type DeleteVolumeGroupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. + VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteVolumeGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteVolumeGroupResponse wrapper for the DeleteVolumeGroup operation +type DeleteVolumeGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteVolumeGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteVolumeKmsKeyRequest wrapper for the DeleteVolumeKmsKey operation +type DeleteVolumeKmsKeyRequest struct { + + // The OCID of the volume. + VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteVolumeKmsKeyResponse wrapper for the DeleteVolumeKmsKey operation +type DeleteVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteVolumeResponse wrapper for the DeleteVolume operation type DeleteVolumeResponse struct { @@ -38,3 +56,8 @@ func (response DeleteVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_boot_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DetachBootVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DetachBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DetachBootVolumeResponse wrapper for the DetachBootVolume operation type DetachBootVolumeResponse struct { @@ -38,3 +56,8 @@ func (response DetachBootVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DetachBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DetachLoadBalancerDetails Represents a load balancer that is to be detached from an instance pool. +type DetachLoadBalancerDetails struct { + + // The OCID of the load balancer to detach from the instance pool. + LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` + + // The name of the backend set on the load balancer to detach from the instance pool. + BackendSetName *string `mandatory:"true" json:"backendSetName"` +} + +func (m DetachLoadBalancerDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DetachLoadBalancerRequest wrapper for the DetachLoadBalancer operation +type DetachLoadBalancerRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // Load balancer being detached + DetachLoadBalancerDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DetachLoadBalancerRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DetachLoadBalancerResponse wrapper for the DetachLoadBalancer operation +type DetachLoadBalancerResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DetachLoadBalancerResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_service_id_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_service_id_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_service_id_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_service_id_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DetachServiceIdRequest wrapper for the DetachServiceId operation +type DetachServiceIdRequest struct { + + // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` + + // ServiceId of Service to be detached from a service gateway. + DetachServiceDetails ServiceIdRequestDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DetachServiceIdRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachServiceIdRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachServiceIdRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DetachServiceIdResponse wrapper for the DetachServiceId operation +type DetachServiceIdResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceGateway instance + ServiceGateway `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DetachServiceIdResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachServiceIdResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_vnic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_vnic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_vnic_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_vnic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DetachVnicRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DetachVnicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachVnicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DetachVnicResponse wrapper for the DetachVnic operation type DetachVnicResponse struct { @@ -38,3 +56,8 @@ func (response DetachVnicResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DetachVnicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/detach_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DetachVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DetachVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DetachVolumeResponse wrapper for the DetachVolume operation type DetachVolumeResponse struct { @@ -38,3 +56,8 @@ func (response DetachVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DetachVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/device.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/device.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/device.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/device.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Device Device Path corresponding to the block devices attached to instances having a name and isAvailable flag. +type Device struct { + + // The device name. + Name *string `mandatory:"true" json:"name"` + + // The flag denoting whether device is available. + IsAvailable *bool `mandatory:"true" json:"isAvailable"` +} + +func (m Device) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_dns_option.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_dns_option.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_dns_option.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_dns_option.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,16 +19,16 @@ // DhcpDnsOption DHCP option for specifying how DNS (hostname resolution) is handled in the subnets in the VCN. // For more information, see -// DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). +// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). type DhcpDnsOption struct { - // If you set `serverType` to `CustomDnsServer`, specify the IP address - // of at least one DNS server of your choice (three maximum). + // If you set `serverType` to `CustomDnsServer`, specify the + // IP address of at least one DNS server of your choice (three maximum). CustomDnsServers []string `mandatory:"false" json:"customDnsServers"` - // - **VcnLocal:** Reserved for future use. - // - **VcnLocalPlusInternet:** Also referred to as "Internet and VCN Resolver". - // Instances can resolve internet hostnames (no Internet Gateway is required), + // * **VcnLocal:** Reserved for future use. + // * **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 Internet and // VCN Resolver to work across the VCN, there must also be a DNS label set for @@ -32,8 +36,9 @@ // 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 (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). - // - **CustomDnsServer:** Instances use a DNS server of your choice (three maximum). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). + // * **CustomDnsServer:** Instances use a DNS server of your choice (three + // maximum). ServerType DhcpDnsOptionServerTypeEnum `mandatory:"true" json:"serverType"` } @@ -58,7 +63,7 @@ // DhcpDnsOptionServerTypeEnum Enum with underlying type: string type DhcpDnsOptionServerTypeEnum string -// Set of constants representing the allowable values for DhcpDnsOptionServerType +// Set of constants representing the allowable values for DhcpDnsOptionServerTypeEnum const ( DhcpDnsOptionServerTypeVcnlocal DhcpDnsOptionServerTypeEnum = "VcnLocal" DhcpDnsOptionServerTypeVcnlocalplusinternet DhcpDnsOptionServerTypeEnum = "VcnLocalPlusInternet" @@ -71,7 +76,7 @@ "CustomDnsServer": DhcpDnsOptionServerTypeCustomdnsserver, } -// GetDhcpDnsOptionServerTypeEnumValues Enumerates the set of values for DhcpDnsOptionServerType +// GetDhcpDnsOptionServerTypeEnumValues Enumerates the set of values for DhcpDnsOptionServerTypeEnum func GetDhcpDnsOptionServerTypeEnumValues() []DhcpDnsOptionServerTypeEnum { values := make([]DhcpDnsOptionServerTypeEnum, 0) for _, v := range mappingDhcpDnsOptionServerType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_option.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_option.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_option.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_option.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,8 +20,8 @@ // DhcpOption A single DHCP option according to RFC 1533 (https://tools.ietf.org/html/rfc1533). // The two options available to use are DhcpDnsOption // and DhcpSearchDomainOption. For more -// information, see DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm) -// and DHCP Options (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDHCP.htm). +// information, see DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm) +// and DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). type DhcpOption interface { } @@ -44,6 +48,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *dhcpoption) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Type { case "DomainNameServer": @@ -55,7 +64,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_options.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -19,11 +23,13 @@ // handled in the subnets in your VCN. // - DhcpSearchDomainOption: Lets you specify // a search domain name to use for DNS queries. -// For more information, see DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm) -// and DHCP Options (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDHCP.htm). +// For more information, see DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm) +// and DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type DhcpOptions struct { // The OCID of the compartment containing the set of DHCP options. @@ -46,7 +52,7 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -56,7 +62,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -95,7 +101,11 @@ if err != nil { return err } - m.Options[i] = nn + if nn != nil { + m.Options[i] = nn.(DhcpOption) + } else { + m.Options[i] = nil + } } m.TimeCreated = model.TimeCreated m.VcnId = model.VcnId @@ -105,7 +115,7 @@ // DhcpOptionsLifecycleStateEnum Enum with underlying type: string type DhcpOptionsLifecycleStateEnum string -// Set of constants representing the allowable values for DhcpOptionsLifecycleState +// Set of constants representing the allowable values for DhcpOptionsLifecycleStateEnum const ( DhcpOptionsLifecycleStateProvisioning DhcpOptionsLifecycleStateEnum = "PROVISIONING" DhcpOptionsLifecycleStateAvailable DhcpOptionsLifecycleStateEnum = "AVAILABLE" @@ -120,7 +130,7 @@ "TERMINATED": DhcpOptionsLifecycleStateTerminated, } -// GetDhcpOptionsLifecycleStateEnumValues Enumerates the set of values for DhcpOptionsLifecycleState +// GetDhcpOptionsLifecycleStateEnumValues Enumerates the set of values for DhcpOptionsLifecycleStateEnum func GetDhcpOptionsLifecycleStateEnumValues() []DhcpOptionsLifecycleStateEnum { values := make([]DhcpOptionsLifecycleStateEnum, 0) for _, v := range mappingDhcpOptionsLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_search_domain_option.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_search_domain_option.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_search_domain_option.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/dhcp_search_domain_option.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -14,7 +18,7 @@ ) // DhcpSearchDomainOption DHCP option for specifying a search domain name for DNS queries. For more information, see -// DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). +// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). type DhcpSearchDomainOption struct { // A single search domain name according to RFC 952 (https://tools.ietf.org/html/rfc952) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,7 +17,9 @@ ) // DrgAttachment A link between a DRG and VCN. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type DrgAttachment struct { // The OCID of the compartment containing the DRG attachment. @@ -35,6 +41,11 @@ // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // The OCID of the route table the DRG attachment is using. For information about why you + // would associate a route table with a DRG attachment, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` + // The date and time the DRG attachment was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -47,7 +58,7 @@ // DrgAttachmentLifecycleStateEnum Enum with underlying type: string type DrgAttachmentLifecycleStateEnum string -// Set of constants representing the allowable values for DrgAttachmentLifecycleState +// Set of constants representing the allowable values for DrgAttachmentLifecycleStateEnum const ( DrgAttachmentLifecycleStateAttaching DrgAttachmentLifecycleStateEnum = "ATTACHING" DrgAttachmentLifecycleStateAttached DrgAttachmentLifecycleStateEnum = "ATTACHED" @@ -62,7 +73,7 @@ "DETACHED": DrgAttachmentLifecycleStateDetached, } -// GetDrgAttachmentLifecycleStateEnumValues Enumerates the set of values for DrgAttachmentLifecycleState +// GetDrgAttachmentLifecycleStateEnumValues Enumerates the set of values for DrgAttachmentLifecycleStateEnum func GetDrgAttachmentLifecycleStateEnumValues() []DrgAttachmentLifecycleStateEnum { values := make([]DrgAttachmentLifecycleStateEnum, 0) for _, v := range mappingDrgAttachmentLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/drg.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,14 +16,16 @@ "github.com/oracle/oci-go-sdk/common" ) -// Drg A Dynamic Routing Gateway (DRG), which is a virtual router that provides a path for private +// Drg A dynamic routing gateway (DRG), which is a virtual router that provides a path for private // network traffic between your VCN and your existing network. You use it with other Networking // Service components to create an IPSec VPN or a connection that uses // Oracle Cloud Infrastructure FastConnect. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Drg struct { // The OCID of the compartment containing the DRG. @@ -31,10 +37,21 @@ // The DRG's current state. LifecycleState DrgLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The date and time the DRG was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -47,7 +64,7 @@ // DrgLifecycleStateEnum Enum with underlying type: string type DrgLifecycleStateEnum string -// Set of constants representing the allowable values for DrgLifecycleState +// Set of constants representing the allowable values for DrgLifecycleStateEnum const ( DrgLifecycleStateProvisioning DrgLifecycleStateEnum = "PROVISIONING" DrgLifecycleStateAvailable DrgLifecycleStateEnum = "AVAILABLE" @@ -62,7 +79,7 @@ "TERMINATED": DrgLifecycleStateTerminated, } -// GetDrgLifecycleStateEnumValues Enumerates the set of values for DrgLifecycleState +// GetDrgLifecycleStateEnumValues Enumerates the set of values for DrgLifecycleStateEnum func GetDrgLifecycleStateEnumValues() []DrgLifecycleStateEnum { values := make([]DrgLifecycleStateEnum, 0) for _, v := range mappingDrgLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/egress_security_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/egress_security_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/egress_security_rule.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/egress_security_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,8 +19,13 @@ // EgressSecurityRule A rule for allowing outbound IP packets. type EgressSecurityRule struct { - // The destination CIDR block for the egress rule. This is the range of IP addresses that a - // packet originating from the instance can go to. + // Conceptually, this is the range of IP addresses that a packet originating from the instance + // can go to. + // Allowed values: + // * IP address range in CIDR notation. For example: `192.168.1.0/24` + // * The `cidrBlock` value for a Service, if you're + // setting up a security list rule for traffic destined for a particular `Service` through + // a service gateway. For example: `oci-phx-objectstorage`. Destination *string `mandatory:"true" json:"destination"` // The transport protocol. Specify either `all` or an IPv4 protocol number as @@ -25,6 +34,14 @@ // Options are supported only for ICMP ("1"), TCP ("6"), and UDP ("17"). Protocol *string `mandatory:"true" json:"protocol"` + // Type of destination for the rule. The default is `CIDR_BLOCK`. + // Allowed values: + // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. + // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a + // Service (the rule is for traffic destined for a + // particular `Service` through a service gateway). + DestinationType EgressSecurityRuleDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` + // Optional and valid only for ICMP. Use to specify a particular ICMP type and code // as defined in // ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml). @@ -54,3 +71,26 @@ func (m EgressSecurityRule) String() string { return common.PointerString(m) } + +// EgressSecurityRuleDestinationTypeEnum Enum with underlying type: string +type EgressSecurityRuleDestinationTypeEnum string + +// Set of constants representing the allowable values for EgressSecurityRuleDestinationTypeEnum +const ( + EgressSecurityRuleDestinationTypeCidrBlock EgressSecurityRuleDestinationTypeEnum = "CIDR_BLOCK" + EgressSecurityRuleDestinationTypeServiceCidrBlock EgressSecurityRuleDestinationTypeEnum = "SERVICE_CIDR_BLOCK" +) + +var mappingEgressSecurityRuleDestinationType = map[string]EgressSecurityRuleDestinationTypeEnum{ + "CIDR_BLOCK": EgressSecurityRuleDestinationTypeCidrBlock, + "SERVICE_CIDR_BLOCK": EgressSecurityRuleDestinationTypeServiceCidrBlock, +} + +// GetEgressSecurityRuleDestinationTypeEnumValues Enumerates the set of values for EgressSecurityRuleDestinationTypeEnum +func GetEgressSecurityRuleDestinationTypeEnumValues() []EgressSecurityRuleDestinationTypeEnum { + values := make([]EgressSecurityRuleDestinationTypeEnum, 0) + for _, v := range mappingEgressSecurityRuleDestinationType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -46,6 +50,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *exportimagedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.DestinationType { case "objectStorageUri": @@ -57,7 +66,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -28,12 +28,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ExportImageRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ExportImageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ExportImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ExportImageResponse wrapper for the ExportImage operation type ExportImageResponse struct { @@ -54,3 +72,8 @@ func (response ExportImageResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ExportImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_tuple_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_tuple_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_tuple_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_tuple_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,13 +21,13 @@ type ExportImageViaObjectStorageTupleDetails struct { // The Object Storage bucket to export the image to. - BucketName *string `mandatory:"false" json:"bucketName"` + BucketName *string `mandatory:"true" json:"bucketName"` // The Object Storage namespace to export the image to. - NamespaceName *string `mandatory:"false" json:"namespaceName"` + NamespaceName *string `mandatory:"true" json:"namespaceName"` // The Object Storage object name for the exported image. - ObjectName *string `mandatory:"false" json:"objectName"` + ObjectName *string `mandatory:"true" json:"objectName"` } func (m ExportImageViaObjectStorageTupleDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_uri_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_uri_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_uri_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/export_image_via_object_storage_uri_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,8 +20,8 @@ // ExportImageViaObjectStorageUriDetails The representation of ExportImageViaObjectStorageUriDetails type ExportImageViaObjectStorageUriDetails struct { - // The Object Storage URL to export the image to. See Object Storage URLs (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm#URLs) - // and pre-authenticated requests (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm#pre-auth) for constructing URLs for image import/export. + // The Object Storage URL to export the image to. See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) + // and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) for constructing URLs for image import/export. DestinationUri *string `mandatory:"true" json:"destinationUri"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,13 +17,13 @@ ) // FastConnectProviderService A service offering from a supported provider. For more information, -// see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). type FastConnectProviderService struct { // The OCID of the service offered by the provider. Id *string `mandatory:"true" json:"id"` - // Private peering BGP management. + // Who is responsible for managing the private peering BGP information. PrivatePeeringBgpManagement FastConnectProviderServicePrivatePeeringBgpManagementEnum `mandatory:"true" json:"privatePeeringBgpManagement"` // The name of the provider. @@ -28,13 +32,29 @@ // The name of the service offered by the provider. ProviderServiceName *string `mandatory:"true" json:"providerServiceName"` - // Public peering BGP management. + // Who is responsible for managing the public peering BGP information. PublicPeeringBgpManagement FastConnectProviderServicePublicPeeringBgpManagementEnum `mandatory:"true" json:"publicPeeringBgpManagement"` + // Who is responsible for managing the ASN information for the network at the other end + // of the connection from Oracle. + CustomerAsnManagement FastConnectProviderServiceCustomerAsnManagementEnum `mandatory:"true" json:"customerAsnManagement"` + + // Who is responsible for managing the provider service key. + ProviderServiceKeyManagement FastConnectProviderServiceProviderServiceKeyManagementEnum `mandatory:"true" json:"providerServiceKeyManagement"` + + // Who is responsible for managing the virtual circuit bandwidth. + BandwithShapeManagement FastConnectProviderServiceBandwithShapeManagementEnum `mandatory:"true" json:"bandwithShapeManagement"` + + // Total number of cross-connect or cross-connect groups required for the virtual circuit. + RequiredTotalCrossConnects *int `mandatory:"true" json:"requiredTotalCrossConnects"` + // Provider service type. Type FastConnectProviderServiceTypeEnum `mandatory:"true" json:"type"` - // A description of the service offered by the provider. + // The location of the provider's website or portal. This portal is where you can get information + // about the provider service, create a virtual circuit connection from the provider to Oracle + // Cloud Infrastructure, and retrieve your provider service key for that virtual circuit connection. + // Example: `https://example.com` Description *string `mandatory:"false" json:"description"` // An array of virtual circuit types supported by this service. @@ -48,7 +68,7 @@ // FastConnectProviderServicePrivatePeeringBgpManagementEnum Enum with underlying type: string type FastConnectProviderServicePrivatePeeringBgpManagementEnum string -// Set of constants representing the allowable values for FastConnectProviderServicePrivatePeeringBgpManagement +// Set of constants representing the allowable values for FastConnectProviderServicePrivatePeeringBgpManagementEnum const ( FastConnectProviderServicePrivatePeeringBgpManagementCustomerManaged FastConnectProviderServicePrivatePeeringBgpManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServicePrivatePeeringBgpManagementProviderManaged FastConnectProviderServicePrivatePeeringBgpManagementEnum = "PROVIDER_MANAGED" @@ -61,7 +81,7 @@ "ORACLE_MANAGED": FastConnectProviderServicePrivatePeeringBgpManagementOracleManaged, } -// GetFastConnectProviderServicePrivatePeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePrivatePeeringBgpManagement +// GetFastConnectProviderServicePrivatePeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePrivatePeeringBgpManagementEnum func GetFastConnectProviderServicePrivatePeeringBgpManagementEnumValues() []FastConnectProviderServicePrivatePeeringBgpManagementEnum { values := make([]FastConnectProviderServicePrivatePeeringBgpManagementEnum, 0) for _, v := range mappingFastConnectProviderServicePrivatePeeringBgpManagement { @@ -73,7 +93,7 @@ // FastConnectProviderServicePublicPeeringBgpManagementEnum Enum with underlying type: string type FastConnectProviderServicePublicPeeringBgpManagementEnum string -// Set of constants representing the allowable values for FastConnectProviderServicePublicPeeringBgpManagement +// Set of constants representing the allowable values for FastConnectProviderServicePublicPeeringBgpManagementEnum const ( FastConnectProviderServicePublicPeeringBgpManagementCustomerManaged FastConnectProviderServicePublicPeeringBgpManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServicePublicPeeringBgpManagementProviderManaged FastConnectProviderServicePublicPeeringBgpManagementEnum = "PROVIDER_MANAGED" @@ -86,7 +106,7 @@ "ORACLE_MANAGED": FastConnectProviderServicePublicPeeringBgpManagementOracleManaged, } -// GetFastConnectProviderServicePublicPeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePublicPeeringBgpManagement +// GetFastConnectProviderServicePublicPeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePublicPeeringBgpManagementEnum func GetFastConnectProviderServicePublicPeeringBgpManagementEnumValues() []FastConnectProviderServicePublicPeeringBgpManagementEnum { values := make([]FastConnectProviderServicePublicPeeringBgpManagementEnum, 0) for _, v := range mappingFastConnectProviderServicePublicPeeringBgpManagement { @@ -98,7 +118,7 @@ // FastConnectProviderServiceSupportedVirtualCircuitTypesEnum Enum with underlying type: string type FastConnectProviderServiceSupportedVirtualCircuitTypesEnum string -// Set of constants representing the allowable values for FastConnectProviderServiceSupportedVirtualCircuitTypes +// Set of constants representing the allowable values for FastConnectProviderServiceSupportedVirtualCircuitTypesEnum const ( FastConnectProviderServiceSupportedVirtualCircuitTypesPublic FastConnectProviderServiceSupportedVirtualCircuitTypesEnum = "PUBLIC" FastConnectProviderServiceSupportedVirtualCircuitTypesPrivate FastConnectProviderServiceSupportedVirtualCircuitTypesEnum = "PRIVATE" @@ -109,7 +129,7 @@ "PRIVATE": FastConnectProviderServiceSupportedVirtualCircuitTypesPrivate, } -// GetFastConnectProviderServiceSupportedVirtualCircuitTypesEnumValues Enumerates the set of values for FastConnectProviderServiceSupportedVirtualCircuitTypes +// GetFastConnectProviderServiceSupportedVirtualCircuitTypesEnumValues Enumerates the set of values for FastConnectProviderServiceSupportedVirtualCircuitTypesEnum func GetFastConnectProviderServiceSupportedVirtualCircuitTypesEnumValues() []FastConnectProviderServiceSupportedVirtualCircuitTypesEnum { values := make([]FastConnectProviderServiceSupportedVirtualCircuitTypesEnum, 0) for _, v := range mappingFastConnectProviderServiceSupportedVirtualCircuitTypes { @@ -118,10 +138,85 @@ return values } +// FastConnectProviderServiceCustomerAsnManagementEnum Enum with underlying type: string +type FastConnectProviderServiceCustomerAsnManagementEnum string + +// Set of constants representing the allowable values for FastConnectProviderServiceCustomerAsnManagementEnum +const ( + FastConnectProviderServiceCustomerAsnManagementCustomerManaged FastConnectProviderServiceCustomerAsnManagementEnum = "CUSTOMER_MANAGED" + FastConnectProviderServiceCustomerAsnManagementProviderManaged FastConnectProviderServiceCustomerAsnManagementEnum = "PROVIDER_MANAGED" + FastConnectProviderServiceCustomerAsnManagementOracleManaged FastConnectProviderServiceCustomerAsnManagementEnum = "ORACLE_MANAGED" +) + +var mappingFastConnectProviderServiceCustomerAsnManagement = map[string]FastConnectProviderServiceCustomerAsnManagementEnum{ + "CUSTOMER_MANAGED": FastConnectProviderServiceCustomerAsnManagementCustomerManaged, + "PROVIDER_MANAGED": FastConnectProviderServiceCustomerAsnManagementProviderManaged, + "ORACLE_MANAGED": FastConnectProviderServiceCustomerAsnManagementOracleManaged, +} + +// GetFastConnectProviderServiceCustomerAsnManagementEnumValues Enumerates the set of values for FastConnectProviderServiceCustomerAsnManagementEnum +func GetFastConnectProviderServiceCustomerAsnManagementEnumValues() []FastConnectProviderServiceCustomerAsnManagementEnum { + values := make([]FastConnectProviderServiceCustomerAsnManagementEnum, 0) + for _, v := range mappingFastConnectProviderServiceCustomerAsnManagement { + values = append(values, v) + } + return values +} + +// FastConnectProviderServiceProviderServiceKeyManagementEnum Enum with underlying type: string +type FastConnectProviderServiceProviderServiceKeyManagementEnum string + +// Set of constants representing the allowable values for FastConnectProviderServiceProviderServiceKeyManagementEnum +const ( + FastConnectProviderServiceProviderServiceKeyManagementCustomerManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "CUSTOMER_MANAGED" + FastConnectProviderServiceProviderServiceKeyManagementProviderManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "PROVIDER_MANAGED" + FastConnectProviderServiceProviderServiceKeyManagementOracleManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "ORACLE_MANAGED" +) + +var mappingFastConnectProviderServiceProviderServiceKeyManagement = map[string]FastConnectProviderServiceProviderServiceKeyManagementEnum{ + "CUSTOMER_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementCustomerManaged, + "PROVIDER_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementProviderManaged, + "ORACLE_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementOracleManaged, +} + +// GetFastConnectProviderServiceProviderServiceKeyManagementEnumValues Enumerates the set of values for FastConnectProviderServiceProviderServiceKeyManagementEnum +func GetFastConnectProviderServiceProviderServiceKeyManagementEnumValues() []FastConnectProviderServiceProviderServiceKeyManagementEnum { + values := make([]FastConnectProviderServiceProviderServiceKeyManagementEnum, 0) + for _, v := range mappingFastConnectProviderServiceProviderServiceKeyManagement { + values = append(values, v) + } + return values +} + +// FastConnectProviderServiceBandwithShapeManagementEnum Enum with underlying type: string +type FastConnectProviderServiceBandwithShapeManagementEnum string + +// Set of constants representing the allowable values for FastConnectProviderServiceBandwithShapeManagementEnum +const ( + FastConnectProviderServiceBandwithShapeManagementCustomerManaged FastConnectProviderServiceBandwithShapeManagementEnum = "CUSTOMER_MANAGED" + FastConnectProviderServiceBandwithShapeManagementProviderManaged FastConnectProviderServiceBandwithShapeManagementEnum = "PROVIDER_MANAGED" + FastConnectProviderServiceBandwithShapeManagementOracleManaged FastConnectProviderServiceBandwithShapeManagementEnum = "ORACLE_MANAGED" +) + +var mappingFastConnectProviderServiceBandwithShapeManagement = map[string]FastConnectProviderServiceBandwithShapeManagementEnum{ + "CUSTOMER_MANAGED": FastConnectProviderServiceBandwithShapeManagementCustomerManaged, + "PROVIDER_MANAGED": FastConnectProviderServiceBandwithShapeManagementProviderManaged, + "ORACLE_MANAGED": FastConnectProviderServiceBandwithShapeManagementOracleManaged, +} + +// GetFastConnectProviderServiceBandwithShapeManagementEnumValues Enumerates the set of values for FastConnectProviderServiceBandwithShapeManagementEnum +func GetFastConnectProviderServiceBandwithShapeManagementEnumValues() []FastConnectProviderServiceBandwithShapeManagementEnum { + values := make([]FastConnectProviderServiceBandwithShapeManagementEnum, 0) + for _, v := range mappingFastConnectProviderServiceBandwithShapeManagement { + values = append(values, v) + } + return values +} + // FastConnectProviderServiceTypeEnum Enum with underlying type: string type FastConnectProviderServiceTypeEnum string -// Set of constants representing the allowable values for FastConnectProviderServiceType +// Set of constants representing the allowable values for FastConnectProviderServiceTypeEnum const ( FastConnectProviderServiceTypeLayer2 FastConnectProviderServiceTypeEnum = "LAYER2" FastConnectProviderServiceTypeLayer3 FastConnectProviderServiceTypeEnum = "LAYER3" @@ -132,7 +227,7 @@ "LAYER3": FastConnectProviderServiceTypeLayer3, } -// GetFastConnectProviderServiceTypeEnumValues Enumerates the set of values for FastConnectProviderServiceType +// GetFastConnectProviderServiceTypeEnumValues Enumerates the set of values for FastConnectProviderServiceTypeEnum func GetFastConnectProviderServiceTypeEnumValues() []FastConnectProviderServiceTypeEnum { values := make([]FastConnectProviderServiceTypeEnum, 0) for _, v := range mappingFastConnectProviderServiceType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service_key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// FastConnectProviderServiceKey A provider service key and its details. A provider service key is an identifier for a provider's +// virtual circuit. +type FastConnectProviderServiceKey struct { + + // The service key that the provider gives you when you set up a virtual circuit connection + // from the provider to Oracle Cloud Infrastructure. Use this value as the `providerServiceKeyName` + // query parameter for + // GetFastConnectProviderServiceKey. + Name *string `mandatory:"false" json:"name"` + + // The provisioned data rate of the connection. To get a list of the + // available bandwidth levels (that is, shapes), see + // ListFastConnectProviderVirtualCircuitBandwidthShapes. + // Example: `10 Gbps` + BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` + + // The provider's peering location. + PeeringLocation *string `mandatory:"false" json:"peeringLocation"` +} + +func (m FastConnectProviderServiceKey) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_agreements_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_agreements_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_agreements_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_agreements_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAppCatalogListingAgreementsRequest wrapper for the GetAppCatalogListingAgreements operation +type GetAppCatalogListingAgreementsRequest struct { + + // The OCID of the listing. + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // Listing Resource Version. + ResourceVersion *string `mandatory:"true" contributesTo:"path" name:"resourceVersion"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAppCatalogListingAgreementsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAppCatalogListingAgreementsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAppCatalogListingAgreementsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAppCatalogListingAgreementsResponse wrapper for the GetAppCatalogListingAgreements operation +type GetAppCatalogListingAgreementsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AppCatalogListingResourceVersionAgreements instance + AppCatalogListingResourceVersionAgreements `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAppCatalogListingAgreementsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAppCatalogListingAgreementsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAppCatalogListingRequest wrapper for the GetAppCatalogListing operation +type GetAppCatalogListingRequest struct { + + // The OCID of the listing. + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAppCatalogListingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAppCatalogListingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAppCatalogListingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAppCatalogListingResponse wrapper for the GetAppCatalogListing operation +type GetAppCatalogListingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AppCatalogListing instance + AppCatalogListing `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAppCatalogListingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAppCatalogListingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_resource_version_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_resource_version_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_resource_version_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_app_catalog_listing_resource_version_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAppCatalogListingResourceVersionRequest wrapper for the GetAppCatalogListingResourceVersion operation +type GetAppCatalogListingResourceVersionRequest struct { + + // The OCID of the listing. + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // Listing Resource Version. + ResourceVersion *string `mandatory:"true" contributesTo:"path" name:"resourceVersion"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAppCatalogListingResourceVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAppCatalogListingResourceVersionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAppCatalogListingResourceVersionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAppCatalogListingResourceVersionResponse wrapper for the GetAppCatalogListingResourceVersion operation +type GetAppCatalogListingResourceVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AppCatalogListingResourceVersion instance + AppCatalogListingResourceVersion `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAppCatalogListingResourceVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAppCatalogListingResourceVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the boot volume attachment. BootVolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeAttachmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBootVolumeAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBootVolumeAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBootVolumeAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBootVolumeAttachmentResponse wrapper for the GetBootVolumeAttachment operation type GetBootVolumeAttachmentResponse struct { @@ -39,3 +57,8 @@ func (response GetBootVolumeAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBootVolumeAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetBootVolumeBackupRequest wrapper for the GetBootVolumeBackup operation +type GetBootVolumeBackupRequest struct { + + // The OCID of the boot volume backup. + BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetBootVolumeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetBootVolumeBackupResponse wrapper for the GetBootVolumeBackup operation +type GetBootVolumeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolumeBackup instance + BootVolumeBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetBootVolumeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetBootVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetBootVolumeKmsKeyRequest wrapper for the GetBootVolumeKmsKey operation +type GetBootVolumeKmsKeyRequest struct { + + // The OCID of the boot volume. + BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetBootVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetBootVolumeKmsKeyResponse wrapper for the GetBootVolumeKmsKey operation +type GetBootVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolumeKmsKey instance + BootVolumeKmsKey `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetBootVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBootVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBootVolumeResponse wrapper for the GetBootVolume operation type GetBootVolumeResponse struct { @@ -39,3 +57,8 @@ func (response GetBootVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_content_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_content_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_content_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_content_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -19,12 +19,30 @@ // Length of the snapshot data to retrieve. Length *int `mandatory:"false" contributesTo:"query" name:"length"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetConsoleHistoryContentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetConsoleHistoryContentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConsoleHistoryContentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetConsoleHistoryContentResponse wrapper for the GetConsoleHistoryContent operation type GetConsoleHistoryContentResponse struct { @@ -45,3 +63,8 @@ func (response GetConsoleHistoryContentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetConsoleHistoryContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the console history. InstanceConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleHistoryId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetConsoleHistoryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetConsoleHistoryResponse wrapper for the GetConsoleHistory operation type GetConsoleHistoryResponse struct { @@ -39,3 +57,8 @@ func (response GetConsoleHistoryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCpeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCpeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCpeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCpeResponse wrapper for the GetCpe operation type GetCpeResponse struct { @@ -39,3 +57,8 @@ func (response GetCpeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCpeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"true" contributesTo:"path" name:"crossConnectGroupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCrossConnectGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCrossConnectGroupResponse wrapper for the GetCrossConnectGroup operation type GetCrossConnectGroupResponse struct { @@ -39,3 +57,8 @@ func (response GetCrossConnectGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCrossConnectGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_letter_of_authority_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_letter_of_authority_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_letter_of_authority_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_letter_of_authority_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCrossConnectLetterOfAuthorityRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCrossConnectLetterOfAuthorityRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCrossConnectLetterOfAuthorityRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCrossConnectLetterOfAuthorityResponse wrapper for the GetCrossConnectLetterOfAuthority operation type GetCrossConnectLetterOfAuthorityResponse struct { @@ -36,3 +54,8 @@ func (response GetCrossConnectLetterOfAuthorityResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCrossConnectLetterOfAuthorityResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCrossConnectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCrossConnectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCrossConnectResponse wrapper for the GetCrossConnect operation type GetCrossConnectResponse struct { @@ -39,3 +57,8 @@ func (response GetCrossConnectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCrossConnectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_status_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_status_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_status_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_status_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCrossConnectStatusRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCrossConnectStatusRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCrossConnectStatusRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCrossConnectStatusResponse wrapper for the GetCrossConnectStatus operation type GetCrossConnectStatusResponse struct { @@ -36,3 +54,8 @@ func (response GetCrossConnectStatusResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCrossConnectStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_dhcp_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_dhcp_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_dhcp_options_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_dhcp_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID for the set of DHCP options. DhcpId *string `mandatory:"true" contributesTo:"path" name:"dhcpId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDhcpOptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDhcpOptionsResponse wrapper for the GetDhcpOptions operation type GetDhcpOptionsResponse struct { @@ -39,3 +57,8 @@ func (response GetDhcpOptionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDhcpOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the DRG attachment. DrgAttachmentId *string `mandatory:"true" contributesTo:"path" name:"drgAttachmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDrgAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDrgAttachmentResponse wrapper for the GetDrgAttachment operation type GetDrgAttachmentResponse struct { @@ -39,3 +57,8 @@ func (response GetDrgAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDrgAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_drg_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDrgRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDrgRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDrgRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDrgResponse wrapper for the GetDrg operation type GetDrgResponse struct { @@ -39,3 +57,8 @@ func (response GetDrgResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDrgResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetFastConnectProviderServiceKeyRequest wrapper for the GetFastConnectProviderServiceKey operation +type GetFastConnectProviderServiceKeyRequest struct { + + // The OCID of the provider service. + ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` + + // The provider service key that the provider gives you when you set up a virtual circuit connection + // from the provider to Oracle Cloud Infrastructure. You can set up that connection and get your + // provider service key at the provider's website or portal. For the portal location, see the `description` + // attribute of the FastConnectProviderService. + ProviderServiceKeyName *string `mandatory:"true" contributesTo:"path" name:"providerServiceKeyName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetFastConnectProviderServiceKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetFastConnectProviderServiceKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetFastConnectProviderServiceKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetFastConnectProviderServiceKeyResponse wrapper for the GetFastConnectProviderServiceKey operation +type GetFastConnectProviderServiceKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FastConnectProviderServiceKey instance + FastConnectProviderServiceKey `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetFastConnectProviderServiceKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetFastConnectProviderServiceKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_fast_connect_provider_service_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the provider service. ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetFastConnectProviderServiceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetFastConnectProviderServiceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetFastConnectProviderServiceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetFastConnectProviderServiceResponse wrapper for the GetFastConnectProviderService operation type GetFastConnectProviderServiceResponse struct { @@ -36,3 +54,8 @@ func (response GetFastConnectProviderServiceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetFastConnectProviderServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_image_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_image_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_image_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_image_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetImageRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetImageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetImageResponse wrapper for the GetImage operation type GetImageResponse struct { @@ -39,3 +57,8 @@ func (response GetImageResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetInstanceConfigurationRequest wrapper for the GetInstanceConfiguration operation +type GetInstanceConfigurationRequest struct { + + // The OCID of the instance configuration. + InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetInstanceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetInstanceConfigurationResponse wrapper for the GetInstanceConfiguration operation +type GetInstanceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstanceConfiguration instance + InstanceConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetInstanceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetInstanceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_console_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_console_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_console_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_console_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,14 +11,32 @@ // GetInstanceConsoleConnectionRequest wrapper for the GetInstanceConsoleConnection operation type GetInstanceConsoleConnectionRequest struct { - // The OCID of the intance console connection + // The OCID of the instance console connection. InstanceConsoleConnectionId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleConnectionId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetInstanceConsoleConnectionResponse wrapper for the GetInstanceConsoleConnection operation type GetInstanceConsoleConnectionResponse struct { @@ -36,3 +54,8 @@ func (response GetInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetInstancePoolRequest wrapper for the GetInstancePool operation +type GetInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetInstancePoolResponse wrapper for the GetInstancePool operation +type GetInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_instance_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetInstanceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetInstanceResponse wrapper for the GetInstance operation type GetInstanceResponse struct { @@ -39,3 +57,8 @@ func (response GetInstanceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_internet_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_internet_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_internet_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_internet_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,14 +11,32 @@ // GetInternetGatewayRequest wrapper for the GetInternetGateway operation type GetInternetGatewayRequest struct { - // The OCID of the Internet Gateway. + // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetInternetGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetInternetGatewayResponse wrapper for the GetInternetGateway operation type GetInternetGatewayResponse struct { @@ -39,3 +57,8 @@ func (response GetInternetGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetInternetGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_config_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionDeviceConfigRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetIPSecConnectionDeviceConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIPSecConnectionDeviceConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetIPSecConnectionDeviceConfigResponse wrapper for the GetIPSecConnectionDeviceConfig operation type GetIPSecConnectionDeviceConfigResponse struct { @@ -39,3 +57,8 @@ func (response GetIPSecConnectionDeviceConfigResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetIPSecConnectionDeviceConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_status_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_status_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_status_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_device_status_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionDeviceStatusRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetIPSecConnectionDeviceStatusRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIPSecConnectionDeviceStatusRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetIPSecConnectionDeviceStatusResponse wrapper for the GetIPSecConnectionDeviceStatus operation type GetIPSecConnectionDeviceStatusResponse struct { @@ -39,3 +57,8 @@ func (response GetIPSecConnectionDeviceStatusResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetIPSecConnectionDeviceStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetIPSecConnectionResponse wrapper for the GetIPSecConnection operation type GetIPSecConnectionResponse struct { @@ -39,3 +57,8 @@ func (response GetIPSecConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetIPSecConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetIPSecConnectionTunnelRequest wrapper for the GetIPSecConnectionTunnel operation +type GetIPSecConnectionTunnelRequest struct { + + // The OCID of the IPSec connection. + IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. + TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetIPSecConnectionTunnelRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetIPSecConnectionTunnelRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIPSecConnectionTunnelRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetIPSecConnectionTunnelResponse wrapper for the GetIPSecConnectionTunnel operation +type GetIPSecConnectionTunnelResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The IpSecConnectionTunnel instance + IpSecConnectionTunnel `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetIPSecConnectionTunnelResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetIPSecConnectionTunnelResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_shared_secret_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_shared_secret_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_shared_secret_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_tunnel_shared_secret_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetIPSecConnectionTunnelSharedSecretRequest wrapper for the GetIPSecConnectionTunnelSharedSecret operation +type GetIPSecConnectionTunnelSharedSecretRequest struct { + + // The OCID of the IPSec connection. + IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. + TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetIPSecConnectionTunnelSharedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetIPSecConnectionTunnelSharedSecretRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIPSecConnectionTunnelSharedSecretRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetIPSecConnectionTunnelSharedSecretResponse wrapper for the GetIPSecConnectionTunnelSharedSecret operation +type GetIPSecConnectionTunnelSharedSecretResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The IpSecConnectionTunnelSharedSecret instance + IpSecConnectionTunnelSharedSecret `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetIPSecConnectionTunnelSharedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetIPSecConnectionTunnelSharedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_local_peering_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_local_peering_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_local_peering_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_local_peering_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetLocalPeeringGatewayResponse wrapper for the GetLocalPeeringGateway operation type GetLocalPeeringGatewayResponse struct { @@ -39,3 +57,8 @@ func (response GetLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetLocalPeeringGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_nat_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_nat_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_nat_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_nat_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetNatGatewayRequest wrapper for the GetNatGateway operation +type GetNatGatewayRequest struct { + + // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetNatGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNatGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetNatGatewayResponse wrapper for the GetNatGateway operation +type GetNatGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NatGateway instance + NatGateway `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetNatGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNatGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_private_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_private_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_private_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_private_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the private IP. PrivateIpId *string `mandatory:"true" contributesTo:"path" name:"privateIpId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPrivateIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPrivateIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPrivateIpResponse wrapper for the GetPrivateIp operation type GetPrivateIpResponse struct { @@ -39,3 +57,8 @@ func (response GetPrivateIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPrivateIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // IP address details for fetching the public IP. GetPublicIpByIpAddressDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPublicIpByIpAddressRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPublicIpByIpAddressRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPublicIpByIpAddressRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPublicIpByIpAddressResponse wrapper for the GetPublicIpByIpAddress operation type GetPublicIpByIpAddressResponse struct { @@ -39,3 +57,8 @@ func (response GetPublicIpByIpAddressResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPublicIpByIpAddressResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // Private IP details for fetching the public IP. GetPublicIpByPrivateIpIdDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPublicIpByPrivateIpIdRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPublicIpByPrivateIpIdRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPublicIpByPrivateIpIdRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPublicIpByPrivateIpIdResponse wrapper for the GetPublicIpByPrivateIpId operation type GetPublicIpByPrivateIpIdResponse struct { @@ -39,3 +57,8 @@ func (response GetPublicIpByPrivateIpIdResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPublicIpByPrivateIpIdResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the public IP. PublicIpId *string `mandatory:"true" contributesTo:"path" name:"publicIpId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPublicIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPublicIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPublicIpResponse wrapper for the GetPublicIp operation type GetPublicIpResponse struct { @@ -39,3 +57,8 @@ func (response GetPublicIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPublicIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_remote_peering_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_remote_peering_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_remote_peering_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_remote_peering_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetRemotePeeringConnectionResponse wrapper for the GetRemotePeeringConnection operation type GetRemotePeeringConnectionResponse struct { @@ -39,3 +57,8 @@ func (response GetRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetRemotePeeringConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_route_table_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_route_table_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_route_table_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_route_table_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the route table. RtId *string `mandatory:"true" contributesTo:"path" name:"rtId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetRouteTableRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRouteTableRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetRouteTableResponse wrapper for the GetRouteTable operation type GetRouteTableResponse struct { @@ -39,3 +57,8 @@ func (response GetRouteTableResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetRouteTableResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_security_list_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_security_list_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_security_list_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_security_list_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the security list. SecurityListId *string `mandatory:"true" contributesTo:"path" name:"securityListId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetSecurityListRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSecurityListRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetSecurityListResponse wrapper for the GetSecurityList operation type GetSecurityListResponse struct { @@ -39,3 +57,8 @@ func (response GetSecurityListResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetSecurityListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetServiceGatewayRequest wrapper for the GetServiceGateway operation +type GetServiceGatewayRequest struct { + + // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetServiceGatewayResponse wrapper for the GetServiceGateway operation +type GetServiceGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceGateway instance + ServiceGateway `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetServiceGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_service_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetServiceRequest wrapper for the GetService operation +type GetServiceRequest struct { + + // The service's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceId *string `mandatory:"true" contributesTo:"path" name:"serviceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetServiceResponse wrapper for the GetService operation +type GetServiceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Service instance + Service `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetServiceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_subnet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_subnet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_subnet_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_subnet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the subnet. SubnetId *string `mandatory:"true" contributesTo:"path" name:"subnetId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetSubnetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSubnetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetSubnetResponse wrapper for the GetSubnet operation type GetSubnetResponse struct { @@ -39,3 +57,8 @@ func (response GetSubnetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetSubnetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vcn_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vcn_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vcn_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vcn_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVcnRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVcnRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVcnRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVcnResponse wrapper for the GetVcn operation type GetVcnResponse struct { @@ -39,3 +57,8 @@ func (response GetVcnResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVcnResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_virtual_circuit_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_virtual_circuit_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_virtual_circuit_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_virtual_circuit_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVirtualCircuitRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVirtualCircuitResponse wrapper for the GetVirtualCircuit operation type GetVirtualCircuitResponse struct { @@ -39,3 +57,8 @@ func (response GetVirtualCircuitResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVirtualCircuitResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the VNIC attachment. VnicAttachmentId *string `mandatory:"true" contributesTo:"path" name:"vnicAttachmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVnicAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVnicAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVnicAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVnicAttachmentResponse wrapper for the GetVnicAttachment operation type GetVnicAttachmentResponse struct { @@ -39,3 +57,8 @@ func (response GetVnicAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVnicAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the VNIC. VnicId *string `mandatory:"true" contributesTo:"path" name:"vnicId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVnicRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVnicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVnicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVnicResponse wrapper for the GetVnic operation type GetVnicResponse struct { @@ -39,3 +57,8 @@ func (response GetVnicResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVnicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the volume attachment. VolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"volumeAttachmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeAttachmentResponse wrapper for the GetVolumeAttachment operation type GetVolumeAttachmentResponse struct { @@ -39,3 +57,8 @@ func (response GetVolumeAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_asset_assignment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_asset_assignment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_asset_assignment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_asset_assignment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of an asset (e.g. a volume). AssetId *string `mandatory:"true" contributesTo:"query" name:"assetId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyAssetAssignmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeBackupPolicyAssetAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeBackupPolicyAssetAssignmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeBackupPolicyAssetAssignmentResponse wrapper for the GetVolumeBackupPolicyAssetAssignment operation type GetVolumeBackupPolicyAssetAssignmentResponse struct { // The underlying http response RawResponse *http.Response - // The []VolumeBackupPolicyAssignment instance + // A list of []VolumeBackupPolicyAssignment instances Items []VolumeBackupPolicyAssignment `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response GetVolumeBackupPolicyAssetAssignmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeBackupPolicyAssetAssignmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_assignment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_assignment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_assignment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_assignment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the volume backup policy assignment. PolicyAssignmentId *string `mandatory:"true" contributesTo:"path" name:"policyAssignmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeBackupPolicyAssignmentResponse wrapper for the GetVolumeBackupPolicyAssignment operation type GetVolumeBackupPolicyAssignmentResponse struct { @@ -39,3 +57,8 @@ func (response GetVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the volume backup policy. PolicyId *string `mandatory:"true" contributesTo:"path" name:"policyId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeBackupPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeBackupPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeBackupPolicyResponse wrapper for the GetVolumeBackupPolicy operation type GetVolumeBackupPolicyResponse struct { @@ -39,3 +57,8 @@ func (response GetVolumeBackupPolicyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeBackupPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeBackupResponse wrapper for the GetVolumeBackup operation type GetVolumeBackupResponse struct { @@ -39,3 +57,8 @@ func (response GetVolumeBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetVolumeGroupBackupRequest wrapper for the GetVolumeGroupBackup operation +type GetVolumeGroupBackupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. + VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetVolumeGroupBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetVolumeGroupBackupResponse wrapper for the GetVolumeGroupBackup operation +type GetVolumeGroupBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroupBackup instance + VolumeGroupBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetVolumeGroupBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeGroupBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetVolumeGroupRequest wrapper for the GetVolumeGroup operation +type GetVolumeGroupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. + VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetVolumeGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetVolumeGroupResponse wrapper for the GetVolumeGroup operation +type GetVolumeGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroup instance + VolumeGroup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetVolumeGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetVolumeKmsKeyRequest wrapper for the GetVolumeKmsKey operation +type GetVolumeKmsKeyRequest struct { + + // The OCID of the volume. + VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetVolumeKmsKeyResponse wrapper for the GetVolumeKmsKey operation +type GetVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeKmsKey instance + VolumeKmsKey `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetVolumeResponse wrapper for the GetVolume operation type GetVolumeResponse struct { @@ -39,3 +57,8 @@ func (response GetVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_windows_instance_initial_credentials_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_windows_instance_initial_credentials_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_windows_instance_initial_credentials_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/get_windows_instance_initial_credentials_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -13,12 +13,30 @@ // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetWindowsInstanceInitialCredentialsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetWindowsInstanceInitialCredentialsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWindowsInstanceInitialCredentialsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetWindowsInstanceInitialCredentialsResponse wrapper for the GetWindowsInstanceInitialCredentials operation type GetWindowsInstanceInitialCredentialsResponse struct { @@ -36,3 +54,8 @@ func (response GetWindowsInstanceInitialCredentialsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetWindowsInstanceInitialCredentialsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/icmp_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/icmp_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/icmp_options.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/icmp_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,10 +17,12 @@ ) // Image A boot disk image for launching an instance. For more information, see -// Overview of the Compute Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm). +// Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Image struct { // The OCID of the compartment containing the instance you want to use as the basis for the image. @@ -48,7 +54,7 @@ BaseImageId *string `mandatory:"false" json:"baseImageId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -60,21 +66,24 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. + // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode ImageLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` LaunchOptions *LaunchOptions `mandatory:"false" json:"launchOptions"` + AgentFeatures *InstanceAgentFeatures `mandatory:"false" json:"agentFeatures"` + // Image size (1 MB = 1048576 bytes) // Example: `47694` - SizeInMBs *int `mandatory:"false" json:"sizeInMBs"` + SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` } func (m Image) String() string { @@ -84,20 +93,22 @@ // ImageLaunchModeEnum Enum with underlying type: string type ImageLaunchModeEnum string -// Set of constants representing the allowable values for ImageLaunchMode +// Set of constants representing the allowable values for ImageLaunchModeEnum const ( - ImageLaunchModeNative ImageLaunchModeEnum = "NATIVE" - ImageLaunchModeEmulated ImageLaunchModeEnum = "EMULATED" - ImageLaunchModeCustom ImageLaunchModeEnum = "CUSTOM" + ImageLaunchModeNative ImageLaunchModeEnum = "NATIVE" + ImageLaunchModeEmulated ImageLaunchModeEnum = "EMULATED" + ImageLaunchModeParavirtualized ImageLaunchModeEnum = "PARAVIRTUALIZED" + ImageLaunchModeCustom ImageLaunchModeEnum = "CUSTOM" ) var mappingImageLaunchMode = map[string]ImageLaunchModeEnum{ - "NATIVE": ImageLaunchModeNative, - "EMULATED": ImageLaunchModeEmulated, - "CUSTOM": ImageLaunchModeCustom, + "NATIVE": ImageLaunchModeNative, + "EMULATED": ImageLaunchModeEmulated, + "PARAVIRTUALIZED": ImageLaunchModeParavirtualized, + "CUSTOM": ImageLaunchModeCustom, } -// GetImageLaunchModeEnumValues Enumerates the set of values for ImageLaunchMode +// GetImageLaunchModeEnumValues Enumerates the set of values for ImageLaunchModeEnum func GetImageLaunchModeEnumValues() []ImageLaunchModeEnum { values := make([]ImageLaunchModeEnum, 0) for _, v := range mappingImageLaunchMode { @@ -109,7 +120,7 @@ // ImageLifecycleStateEnum Enum with underlying type: string type ImageLifecycleStateEnum string -// Set of constants representing the allowable values for ImageLifecycleState +// Set of constants representing the allowable values for ImageLifecycleStateEnum const ( ImageLifecycleStateProvisioning ImageLifecycleStateEnum = "PROVISIONING" ImageLifecycleStateImporting ImageLifecycleStateEnum = "IMPORTING" @@ -128,7 +139,7 @@ "DELETED": ImageLifecycleStateDeleted, } -// GetImageLifecycleStateEnumValues Enumerates the set of values for ImageLifecycleState +// GetImageLifecycleStateEnumValues Enumerates the set of values for ImageLifecycleStateEnum func GetImageLifecycleStateEnumValues() []ImageLifecycleStateEnum { values := make([]ImageLifecycleStateEnum, 0) for _, v := range mappingImageLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,8 +20,8 @@ // ImageSourceDetails The representation of ImageSourceDetails type ImageSourceDetails interface { - // The format of the image to be imported. Exported Oracle images are QCOW2. Only monolithic - // images are supported. + // The format of the image to be imported. Only monolithic + // images are supported. This attribute is not used for exported Oracle images with the OCI image format. GetSourceImageType() ImageSourceDetailsSourceImageTypeEnum } @@ -46,6 +50,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *imagesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.SourceType { case "objectStorageTuple": @@ -57,7 +66,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -73,7 +82,7 @@ // ImageSourceDetailsSourceImageTypeEnum Enum with underlying type: string type ImageSourceDetailsSourceImageTypeEnum string -// Set of constants representing the allowable values for ImageSourceDetailsSourceImageType +// Set of constants representing the allowable values for ImageSourceDetailsSourceImageTypeEnum const ( ImageSourceDetailsSourceImageTypeQcow2 ImageSourceDetailsSourceImageTypeEnum = "QCOW2" ImageSourceDetailsSourceImageTypeVmdk ImageSourceDetailsSourceImageTypeEnum = "VMDK" @@ -84,7 +93,7 @@ "VMDK": ImageSourceDetailsSourceImageTypeVmdk, } -// GetImageSourceDetailsSourceImageTypeEnumValues Enumerates the set of values for ImageSourceDetailsSourceImageType +// GetImageSourceDetailsSourceImageTypeEnumValues Enumerates the set of values for ImageSourceDetailsSourceImageTypeEnum func GetImageSourceDetailsSourceImageTypeEnumValues() []ImageSourceDetailsSourceImageTypeEnum { values := make([]ImageSourceDetailsSourceImageTypeEnum, 0) for _, v := range mappingImageSourceDetailsSourceImageType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_tuple_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_tuple_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_tuple_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_tuple_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -25,8 +29,8 @@ // The Object Storage name for the image. ObjectName *string `mandatory:"true" json:"objectName"` - // The format of the image to be imported. Exported Oracle images are QCOW2. Only monolithic - // images are supported. + // The format of the image to be imported. Only monolithic + // images are supported. This attribute is not used for exported Oracle images with the OCI image format. SourceImageType ImageSourceDetailsSourceImageTypeEnum `mandatory:"false" json:"sourceImageType,omitempty"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_uri_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_uri_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_uri_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/image_source_via_object_storage_uri_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -19,8 +23,8 @@ // The Object Storage URL for the image. SourceUri *string `mandatory:"true" json:"sourceUri"` - // The format of the image to be imported. Exported Oracle images are QCOW2. Only monolithic - // images are supported. + // The format of the image to be imported. Only monolithic + // images are supported. This attribute is not used for exported Oracle images with the OCI image format. SourceImageType ImageSourceDetailsSourceImageTypeEnum `mandatory:"false" json:"sourceImageType,omitempty"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ingress_security_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ingress_security_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ingress_security_rule.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ingress_security_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -21,8 +25,13 @@ // Options are supported only for ICMP ("1"), TCP ("6"), and UDP ("17"). Protocol *string `mandatory:"true" json:"protocol"` - // The source CIDR block for the ingress rule. This is the range of IP addresses that a - // packet coming into the instance can come from. + // Conceptually, this is the range of IP addresses that a packet coming into the instance + // can come from. + // Allowed values: + // * IP address range in CIDR notation. For example: `192.168.1.0/24` + // * The `cidrBlock` value for a Service, if you're + // setting up a security list rule for traffic coming from a particular `Service` through + // a service gateway. For example: `oci-phx-objectstorage`. Source *string `mandatory:"true" json:"source"` // Optional and valid only for ICMP. Use to specify a particular ICMP type and code @@ -42,6 +51,13 @@ // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` + // Type of source for the rule. The default is `CIDR_BLOCK`. + // * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. + // * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a + // Service (the rule is for traffic coming from a + // particular `Service` through a service gateway). + SourceType IngressSecurityRuleSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` @@ -54,3 +70,26 @@ func (m IngressSecurityRule) String() string { return common.PointerString(m) } + +// IngressSecurityRuleSourceTypeEnum Enum with underlying type: string +type IngressSecurityRuleSourceTypeEnum string + +// Set of constants representing the allowable values for IngressSecurityRuleSourceTypeEnum +const ( + IngressSecurityRuleSourceTypeCidrBlock IngressSecurityRuleSourceTypeEnum = "CIDR_BLOCK" + IngressSecurityRuleSourceTypeServiceCidrBlock IngressSecurityRuleSourceTypeEnum = "SERVICE_CIDR_BLOCK" +) + +var mappingIngressSecurityRuleSourceType = map[string]IngressSecurityRuleSourceTypeEnum{ + "CIDR_BLOCK": IngressSecurityRuleSourceTypeCidrBlock, + "SERVICE_CIDR_BLOCK": IngressSecurityRuleSourceTypeServiceCidrBlock, +} + +// GetIngressSecurityRuleSourceTypeEnumValues Enumerates the set of values for IngressSecurityRuleSourceTypeEnum +func GetIngressSecurityRuleSourceTypeEnumValues() []IngressSecurityRuleSourceTypeEnum { + values := make([]IngressSecurityRuleSourceTypeEnum, 0) + for _, v := range mappingIngressSecurityRuleSourceType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_action_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_action_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_action_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_action_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -28,12 +28,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request InstanceActionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request InstanceActionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InstanceActionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // InstanceActionResponse wrapper for the InstanceAction operation type InstanceActionResponse struct { @@ -55,15 +73,21 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response InstanceActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // InstanceActionActionEnum Enum with underlying type: string type InstanceActionActionEnum string -// Set of constants representing the allowable values for InstanceActionAction +// Set of constants representing the allowable values for InstanceActionActionEnum const ( InstanceActionActionStop InstanceActionActionEnum = "STOP" InstanceActionActionStart InstanceActionActionEnum = "START" InstanceActionActionSoftreset InstanceActionActionEnum = "SOFTRESET" InstanceActionActionReset InstanceActionActionEnum = "RESET" + InstanceActionActionSoftstop InstanceActionActionEnum = "SOFTSTOP" ) var mappingInstanceActionAction = map[string]InstanceActionActionEnum{ @@ -71,9 +95,10 @@ "START": InstanceActionActionStart, "SOFTRESET": InstanceActionActionSoftreset, "RESET": InstanceActionActionReset, + "SOFTSTOP": InstanceActionActionSoftstop, } -// GetInstanceActionActionEnumValues Enumerates the set of values for InstanceActionAction +// GetInstanceActionActionEnumValues Enumerates the set of values for InstanceActionActionEnum func GetInstanceActionActionEnumValues() []InstanceActionActionEnum { values := make([]InstanceActionActionEnum, 0) for _, v := range mappingInstanceActionAction { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceAgentConfig Instance agent configuration on the instance +type InstanceAgentConfig struct { + + // Whether the agent running on the instance can gather performance metrics and monitor the instance. + IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` +} + +func (m InstanceAgentConfig) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_features.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_features.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_features.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_features.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceAgentFeatures Instance agent features supported on the image +type InstanceAgentFeatures struct { + + // Whether the agent running on the instance can gather performance metrics and monitor the instance. + IsMonitoringSupported *bool `mandatory:"false" json:"isMonitoringSupported"` +} + +func (m InstanceAgentFeatures) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_vnic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_vnic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_vnic_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_vnic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationAttachVnicDetails The representation of InstanceConfigurationAttachVnicDetails +type InstanceConfigurationAttachVnicDetails struct { + + // Details for creating a new VNIC. + CreateVnicDetails *InstanceConfigurationCreateVnicDetails `mandatory:"false" json:"createVnicDetails"` + + // A user-friendly name for the attachment. Does not have to be unique, and it cannot be changed. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Which physical network interface card (NIC) the VNIC will use. Defaults to 0. + // Certain bare metal instance shapes have two active physical NICs (0 and 1). If + // you add a secondary VNIC to one of these instances, you can specify which NIC + // the VNIC will use. For more information, see + // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). + NicIndex *int `mandatory:"false" json:"nicIndex"` +} + +func (m InstanceConfigurationAttachVnicDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_attach_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationAttachVolumeDetails Volume attachmentDetails. Please see AttachVolumeDetails +type InstanceConfigurationAttachVolumeDetails interface { + + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. + GetDisplayName() *string + + // Whether the attachment should be created in read-only mode. + GetIsReadOnly() *bool +} + +type instanceconfigurationattachvolumedetails struct { + JsonData []byte + DisplayName *string `mandatory:"false" json:"displayName"` + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *instanceconfigurationattachvolumedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinstanceconfigurationattachvolumedetails instanceconfigurationattachvolumedetails + s := struct { + Model Unmarshalerinstanceconfigurationattachvolumedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DisplayName = s.Model.DisplayName + m.IsReadOnly = s.Model.IsReadOnly + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *instanceconfigurationattachvolumedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "iscsi": + mm := InstanceConfigurationIscsiAttachVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "paravirtualized": + mm := InstanceConfigurationParavirtualizedAttachVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetDisplayName returns DisplayName +func (m instanceconfigurationattachvolumedetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetIsReadOnly returns IsReadOnly +func (m instanceconfigurationattachvolumedetails) GetIsReadOnly() *bool { + return m.IsReadOnly +} + +func (m instanceconfigurationattachvolumedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_block_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_block_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_block_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_block_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationBlockVolumeDetails Create new block volumes or attach to an existing volume. Specify either createDetails or volumeId. +type InstanceConfigurationBlockVolumeDetails struct { + AttachDetails InstanceConfigurationAttachVolumeDetails `mandatory:"false" json:"attachDetails"` + + CreateDetails *InstanceConfigurationCreateVolumeDetails `mandatory:"false" json:"createDetails"` + + // The OCID of the volume. + VolumeId *string `mandatory:"false" json:"volumeId"` +} + +func (m InstanceConfigurationBlockVolumeDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *InstanceConfigurationBlockVolumeDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + AttachDetails instanceconfigurationattachvolumedetails `json:"attachDetails"` + CreateDetails *InstanceConfigurationCreateVolumeDetails `json:"createDetails"` + VolumeId *string `json:"volumeId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + nn, e := model.AttachDetails.UnmarshalPolymorphicJSON(model.AttachDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.AttachDetails = nn.(InstanceConfigurationAttachVolumeDetails) + } else { + m.AttachDetails = nil + } + m.CreateDetails = model.CreateDetails + m.VolumeId = model.VolumeId + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_vnic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_vnic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_vnic_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_vnic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationCreateVnicDetails Contains the properties of the VNIC for an instance configuration. See CreateVnicDetails +// and Instance Configurations (https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm#config) for more information. +type InstanceConfigurationCreateVnicDetails struct { + + // Whether the VNIC should be assigned a public IP address. See the `assignPublicIp` attribute of CreateVnicDetails + // for more information. + AssignPublicIp *bool `mandatory:"false" json:"assignPublicIp"` + + // A user-friendly name for the VNIC. Does not have to be unique. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The hostname for the VNIC's primary private IP. + // See the `hostnameLabel` attribute of CreateVnicDetails for more information. + HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` + + // A private IP address of your choice to assign to the VNIC. + // See the `privateIp` attribute of CreateVnicDetails for more information. + PrivateIp *string `mandatory:"false" json:"privateIp"` + + // Whether the source/destination check is disabled on the VNIC. + // See the `skipSourceDestCheck` attribute of CreateVnicDetails for more information. + SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` + + // The OCID of the subnet to create the VNIC in. + // See the `subnetId` attribute of CreateVnicDetails for more information. + SubnetId *string `mandatory:"false" json:"subnetId"` +} + +func (m InstanceConfigurationCreateVnicDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_create_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationCreateVolumeDetails Creates a new block volume. Please see CreateVolumeDetails +type InstanceConfigurationCreateVolumeDetails struct { + + // The availability domain of the volume. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // If provided, specifies the ID of the volume backup policy to assign to the newly + // created volume. If omitted, no policy will be assigned. + BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` + + // The OCID of the compartment that contains the volume. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The size of the volume in GBs. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` + + // Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same availability domain or a Block volume backup. + // This is an optional field. If not specified or set to null, the new Block volume will be empty. + // When specified, the new Block volume will contain data from the source volume or backup. + SourceDetails InstanceConfigurationVolumeSourceDetails `mandatory:"false" json:"sourceDetails"` +} + +func (m InstanceConfigurationCreateVolumeDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *InstanceConfigurationCreateVolumeDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + AvailabilityDomain *string `json:"availabilityDomain"` + BackupPolicyId *string `json:"backupPolicyId"` + CompartmentId *string `json:"compartmentId"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + SizeInGBs *int64 `json:"sizeInGBs"` + SourceDetails instanceconfigurationvolumesourcedetails `json:"sourceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.AvailabilityDomain = model.AvailabilityDomain + m.BackupPolicyId = model.BackupPolicyId + m.CompartmentId = model.CompartmentId + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + m.SizeInGBs = model.SizeInGBs + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(InstanceConfigurationVolumeSourceDetails) + } else { + m.SourceDetails = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfiguration Instance Configuration +type InstanceConfiguration struct { + + // The OCID of the compartment containing the instance configuration. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance configuration + Id *string `mandatory:"true" json:"id"` + + // The date and time the instance configuration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the instance configuration + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + InstanceDetails InstanceConfigurationInstanceDetails `mandatory:"false" json:"instanceDetails"` + + // The required details when using the LaunchInstanceConfiguration operation. + // These attributes are optional when using the CreateInstanceConfiguration operation. + DeferredFields []string `mandatory:"false" json:"deferredFields"` +} + +func (m InstanceConfiguration) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *InstanceConfiguration) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + InstanceDetails instanceconfigurationinstancedetails `json:"instanceDetails"` + DeferredFields []string `json:"deferredFields"` + CompartmentId *string `json:"compartmentId"` + Id *string `json:"id"` + TimeCreated *common.SDKTime `json:"timeCreated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.FreeformTags = model.FreeformTags + nn, e := model.InstanceDetails.UnmarshalPolymorphicJSON(model.InstanceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.InstanceDetails = nn.(InstanceConfigurationInstanceDetails) + } else { + m.InstanceDetails = nil + } + m.DeferredFields = make([]string, len(model.DeferredFields)) + for i, n := range model.DeferredFields { + m.DeferredFields[i] = n + } + m.CompartmentId = model.CompartmentId + m.Id = model.Id + m.TimeCreated = model.TimeCreated + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationInstanceDetails The representation of InstanceConfigurationInstanceDetails +type InstanceConfigurationInstanceDetails interface { +} + +type instanceconfigurationinstancedetails struct { + JsonData []byte + InstanceType string `json:"instanceType"` +} + +// UnmarshalJSON unmarshals json +func (m *instanceconfigurationinstancedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinstanceconfigurationinstancedetails instanceconfigurationinstancedetails + s := struct { + Model Unmarshalerinstanceconfigurationinstancedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.InstanceType = s.Model.InstanceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *instanceconfigurationinstancedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.InstanceType { + case "compute": + mm := ComputeInstanceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m instanceconfigurationinstancedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationInstanceSourceDetails The representation of InstanceConfigurationInstanceSourceDetails +type InstanceConfigurationInstanceSourceDetails interface { +} + +type instanceconfigurationinstancesourcedetails struct { + JsonData []byte + SourceType string `json:"sourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *instanceconfigurationinstancesourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinstanceconfigurationinstancesourcedetails instanceconfigurationinstancesourcedetails + s := struct { + Model Unmarshalerinstanceconfigurationinstancesourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.SourceType = s.Model.SourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *instanceconfigurationinstancesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SourceType { + case "image": + mm := InstanceConfigurationInstanceSourceViaImageDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "bootVolume": + mm := InstanceConfigurationInstanceSourceViaBootVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m instanceconfigurationinstancesourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_boot_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationInstanceSourceViaBootVolumeDetails The representation of InstanceConfigurationInstanceSourceViaBootVolumeDetails +type InstanceConfigurationInstanceSourceViaBootVolumeDetails struct { + + // The OCID of the boot volume used to boot the instance. + BootVolumeId *string `mandatory:"false" json:"bootVolumeId"` +} + +func (m InstanceConfigurationInstanceSourceViaBootVolumeDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationInstanceSourceViaBootVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails InstanceConfigurationInstanceSourceViaBootVolumeDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails + }{ + "bootVolume", + (MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_image_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_image_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_image_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_source_via_image_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationInstanceSourceViaImageDetails The representation of InstanceConfigurationInstanceSourceViaImageDetails +type InstanceConfigurationInstanceSourceViaImageDetails struct { + + // The OCID of the image used to boot the instance. + ImageId *string `mandatory:"false" json:"imageId"` +} + +func (m InstanceConfigurationInstanceSourceViaImageDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationInstanceSourceViaImageDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails InstanceConfigurationInstanceSourceViaImageDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails + }{ + "image", + (MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_iscsi_attach_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_iscsi_attach_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_iscsi_attach_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_iscsi_attach_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationIscsiAttachVolumeDetails The representation of InstanceConfigurationIscsiAttachVolumeDetails +type InstanceConfigurationIscsiAttachVolumeDetails struct { + + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Whether the attachment should be created in read-only mode. + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + + // Whether to use CHAP authentication for the volume attachment. Defaults to false. + UseChap *bool `mandatory:"false" json:"useChap"` +} + +//GetDisplayName returns DisplayName +func (m InstanceConfigurationIscsiAttachVolumeDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetIsReadOnly returns IsReadOnly +func (m InstanceConfigurationIscsiAttachVolumeDetails) GetIsReadOnly() *bool { + return m.IsReadOnly +} + +func (m InstanceConfigurationIscsiAttachVolumeDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationIscsiAttachVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails InstanceConfigurationIscsiAttachVolumeDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails + }{ + "iscsi", + (MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_launch_instance_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_launch_instance_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_launch_instance_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_launch_instance_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,174 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationLaunchInstanceDetails See Instance launch details - LaunchInstanceDetails +type InstanceConfigurationLaunchInstanceDetails struct { + + // The availability domain of the instance. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Details for the primary VNIC, which is automatically created and attached when + // the instance is launched. + CreateVnicDetails *InstanceConfigurationCreateVnicDetails `mandatory:"false" json:"createVnicDetails"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // Example: `My bare metal instance` + DisplayName *string `mandatory:"false" json:"displayName"` + + // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. + // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). + ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // This is an advanced option. + // When a bare metal or virtual machine + // instance boots, the iPXE firmware that runs on the instance is + // configured to run an iPXE script to continue the boot process. + // If you want more control over the boot process, you can provide + // your own custom iPXE script that will run when the instance boots; + // however, you should be aware that the same iPXE script will run + // every time an instance boots; not only after the initial + // LaunchInstance call. + // The default iPXE script connects to the instance's local boot + // volume over iSCSI and performs a network boot. If you use a custom iPXE + // script and want to network-boot from the instance's local boot volume + // over iSCSI the same way as the default iPXE script, you should use the + // 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 Cloud Infrastructure, see + // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). + // For more information about iPXE, see http://ipxe.org. + IpxeScript *string `mandatory:"false" json:"ipxeScript"` + + // Custom metadata key/value pairs that you provide, such as the SSH public key + // required to connect to the instance. + // A metadata service runs on every launched instance. The service is an HTTP + // endpoint listening on 169.254.169.254. You can use the service to: + // * Provide information to Cloud-Init (https://cloudinit.readthedocs.org/en/latest/) + // to be used for various system initialization tasks. + // * Get information about the instance, including the custom metadata that you + // provide when you launch the instance. + // **Providing Cloud-Init Metadata** + // You can use the following metadata key names to provide information to + // Cloud-Init: + // **"ssh_authorized_keys"** - Provide one or more public SSH keys to be + // included in the `~/.ssh/authorized_keys` file for the default user on the + // instance. Use a newline character to separate multiple keys. The SSH + // keys must be in the format necessary for the `authorized_keys` file, as shown + // in the example below. + // **"user_data"** - Provide your own base64-encoded data to be used by + // Cloud-Init to run custom scripts or provide custom Cloud-Init configuration. For + // information about how to take advantage of user data, see the + // Cloud-Init Documentation (http://cloudinit.readthedocs.org/en/latest/topics/format.html). + // **Note:** Cloud-Init does not pull this data from the `http://169.254.169.254/opc/v1/instance/metadata/` + // path. When the instance launches and either of these keys are provided, the key values are formatted as + // OpenStack metadata and copied to the following locations, which are recognized by Cloud-Init: + // `http://169.254.169.254/openstack/latest/meta_data.json` - This JSON blob + // contains, among other things, the SSH keys that you provided for + // **"ssh_authorized_keys"**. + // `http://169.254.169.254/openstack/latest/user_data` - Contains the + // base64-decoded data that you provided for **"user_data"**. + // **Metadata Example** + // "metadata" : { + // "quake_bot_level" : "Severe", + // "ssh_authorized_keys" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ06fccNTQfq+xubFlJ5ZR3kt+uzspdH9tXL+lAejSM1NXM+CFZev7MIxfEjas06y80ZBZ7DUTQO0GxJPeD8NCOb1VorF8M4xuLwrmzRtkoZzU16umt4y1W0Q4ifdp3IiiU0U8/WxczSXcUVZOLqkz5dc6oMHdMVpkimietWzGZ4LBBsH/LjEVY7E0V+a0sNchlVDIZcm7ErReBLcdTGDq0uLBiuChyl6RUkX1PNhusquTGwK7zc8OBXkRuubn5UKXhI3Ul9Nyk4XESkVWIGNKmw8mSpoJSjR8P9ZjRmcZVo8S+x4KVPMZKQEor== ryan.smith@company.com + // ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAzJSAtwEPoB3Jmr58IXrDGzLuDYkWAYg8AsLYlo6JZvKpjY1xednIcfEVQJm4T2DhVmdWhRrwQ8DmayVZvBkLt+zs2LdoAJEVimKwXcJFD/7wtH8Lnk17HiglbbbNXsemjDY0hea4JUE5CfvkIdZBITuMrfqSmA4n3VNoorXYdvtTMoGG8fxMub46RPtuxtqi9bG9Zqenordkg5FJt2mVNfQRqf83CWojcOkklUWq4CjyxaeLf5i9gv1fRoBo4QhiA8I6NCSppO8GnoV/6Ox6TNoh9BiifqGKC9VGYuC89RvUajRBTZSK2TK4DPfaT+2R+slPsFrwiT/oPEhhEK1S5Q== rsa-key-20160227", + // "user_data" : "SWYgeW91IGNhbiBzZWUgdGhpcywgdGhlbiBpdCB3b3JrZWQgbWF5YmUuCg==" + // } + // **Getting Metadata on the Instance** + // To get information about your instance, connect to the instance using SSH and issue any of the + // following GET requests: + // curl http://169.254.169.254/opc/v1/instance/ + // curl http://169.254.169.254/opc/v1/instance/metadata/ + // curl http://169.254.169.254/opc/v1/instance/metadata/ + // You'll get back a response that includes all the instance information; only the metadata information; or + // the metadata information for the specified key name, respectively. + Metadata map[string]string `mandatory:"false" json:"metadata"` + + // The shape of an instance. The shape determines the number of CPUs, amount of memory, + // and other resources allocated to the instance. + // You can enumerate all available shapes by calling ListShapes. + Shape *string `mandatory:"false" json:"shape"` + + // Details for creating an instance. + // Use this parameter to specify whether a boot volume or an image should be used to launch a new instance. + SourceDetails InstanceConfigurationInstanceSourceDetails `mandatory:"false" json:"sourceDetails"` +} + +func (m InstanceConfigurationLaunchInstanceDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *InstanceConfigurationLaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + CreateVnicDetails *InstanceConfigurationCreateVnicDetails `json:"createVnicDetails"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` + FreeformTags map[string]string `json:"freeformTags"` + IpxeScript *string `json:"ipxeScript"` + Metadata map[string]string `json:"metadata"` + Shape *string `json:"shape"` + SourceDetails instanceconfigurationinstancesourcedetails `json:"sourceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.AvailabilityDomain = model.AvailabilityDomain + m.CompartmentId = model.CompartmentId + m.CreateVnicDetails = model.CreateVnicDetails + m.DefinedTags = model.DefinedTags + m.DisplayName = model.DisplayName + m.ExtendedMetadata = model.ExtendedMetadata + m.FreeformTags = model.FreeformTags + m.IpxeScript = model.IpxeScript + m.Metadata = model.Metadata + m.Shape = model.Shape + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(InstanceConfigurationInstanceSourceDetails) + } else { + m.SourceDetails = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_paravirtualized_attach_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_paravirtualized_attach_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_paravirtualized_attach_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_paravirtualized_attach_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationParavirtualizedAttachVolumeDetails The representation of InstanceConfigurationParavirtualizedAttachVolumeDetails +type InstanceConfigurationParavirtualizedAttachVolumeDetails struct { + + // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Whether the attachment should be created in read-only mode. + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` +} + +//GetDisplayName returns DisplayName +func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetIsReadOnly returns IsReadOnly +func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) GetIsReadOnly() *bool { + return m.IsReadOnly +} + +func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails InstanceConfigurationParavirtualizedAttachVolumeDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails + }{ + "paravirtualized", + (MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationSummary Instance Configuration Summary +type InstanceConfigurationSummary struct { + + // The OCID of the compartment containing the instance configuration. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance configuration + Id *string `mandatory:"true" json:"id"` + + // The date and time the instance configuration was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A user-friendly name for the instance configuration + DisplayName *string `mandatory:"false" json:"displayName"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m InstanceConfigurationSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationVolumeSourceDetails The representation of InstanceConfigurationVolumeSourceDetails +type InstanceConfigurationVolumeSourceDetails interface { +} + +type instanceconfigurationvolumesourcedetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *instanceconfigurationvolumesourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinstanceconfigurationvolumesourcedetails instanceconfigurationvolumesourcedetails + s := struct { + Model Unmarshalerinstanceconfigurationvolumesourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *instanceconfigurationvolumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "volumeBackup": + mm := InstanceConfigurationVolumeSourceFromVolumeBackupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "volume": + mm := InstanceConfigurationVolumeSourceFromVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m instanceconfigurationvolumesourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationVolumeSourceFromVolumeBackupDetails Specifies the volume backup. +type InstanceConfigurationVolumeSourceFromVolumeBackupDetails struct { + + // The OCID of the volume backup. + Id *string `mandatory:"false" json:"id"` +} + +func (m InstanceConfigurationVolumeSourceFromVolumeBackupDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationVolumeSourceFromVolumeBackupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails InstanceConfigurationVolumeSourceFromVolumeBackupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails + }{ + "volumeBackup", + (MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_volume_source_from_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceConfigurationVolumeSourceFromVolumeDetails Specifies the source volume. +type InstanceConfigurationVolumeSourceFromVolumeDetails struct { + + // The OCID of the volume. + Id *string `mandatory:"false" json:"id"` +} + +func (m InstanceConfigurationVolumeSourceFromVolumeDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m InstanceConfigurationVolumeSourceFromVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails InstanceConfigurationVolumeSourceFromVolumeDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails + }{ + "volume", + (MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_console_connection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_console_connection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_console_connection.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_console_connection.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,7 +19,7 @@ // InstanceConsoleConnection The `InstanceConsoleConnection` API provides you with console access to virtual machine (VM) instances, // enabling you to troubleshoot malfunctioning instances remotely. // For more information about console access, see -// Accessing the Console (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). +// Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). type InstanceConsoleConnection struct { // The OCID of the compartment to contain the console connection. @@ -25,7 +29,7 @@ ConnectionString *string `mandatory:"false" json:"connectionString"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -34,7 +38,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -59,7 +63,7 @@ // InstanceConsoleConnectionLifecycleStateEnum Enum with underlying type: string type InstanceConsoleConnectionLifecycleStateEnum string -// Set of constants representing the allowable values for InstanceConsoleConnectionLifecycleState +// Set of constants representing the allowable values for InstanceConsoleConnectionLifecycleStateEnum const ( InstanceConsoleConnectionLifecycleStateActive InstanceConsoleConnectionLifecycleStateEnum = "ACTIVE" InstanceConsoleConnectionLifecycleStateCreating InstanceConsoleConnectionLifecycleStateEnum = "CREATING" @@ -76,7 +80,7 @@ "FAILED": InstanceConsoleConnectionLifecycleStateFailed, } -// GetInstanceConsoleConnectionLifecycleStateEnumValues Enumerates the set of values for InstanceConsoleConnectionLifecycleState +// GetInstanceConsoleConnectionLifecycleStateEnumValues Enumerates the set of values for InstanceConsoleConnectionLifecycleStateEnum func GetInstanceConsoleConnectionLifecycleStateEnumValues() []InstanceConsoleConnectionLifecycleStateEnum { values := make([]InstanceConsoleConnectionLifecycleStateEnum, 0) for _, v := range mappingInstanceConsoleConnectionLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_credentials.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_credentials.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_credentials.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_credentials.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,13 +20,15 @@ // Instance A compute host. The image used to launch the instance determines its operating system and other // software. The shape specified during the launch process determines the number of CPUs and memory // allocated to the instance. For more information, see -// Overview of the Compute Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm). +// Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Instance struct { - // The Availability Domain the instance is running in. + // The availability domain the instance is running in. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -35,8 +41,10 @@ // The current state of the instance. LifecycleState InstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The region that contains the Availability Domain the instance is running in. - // Example: `phx` + // The region that contains the availability domain the instance is running in. + // For the us-phoenix-1 and us-ashburn-1 regions, `phx` and `iad` are returned, respectively. + // For all other regions, the full region name is returned. + // Examples: `phx`, `eu-frankfurt-1` Region *string `mandatory:"true" json:"region"` // The shape of the instance. The shape determines the number of CPUs and the amount of memory @@ -49,7 +57,7 @@ TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -58,14 +66,24 @@ // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` - // Additional metadata key/value pairs that you provide. They serve a similar purpose and functionality from fields in the 'metadata' object. + // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). - // If you don't need nested metadata values, it is strongly advised to avoid using this object and use the Metadata object instead. ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` + // The name of the fault domain the instance is running in. + // A fault domain is a grouping of hardware and infrastructure within an availability domain. + // Each availability domain contains three fault domains. Fault domains let you distribute your + // instances so that they are not on the same physical hardware within a single availability domain. + // A hardware failure or Compute hardware maintenance that affects one fault domain does not affect + // instances in other fault domains. + // If you do not specify the fault domain, the system selects one for you. To change the fault + // domain for an instance, terminate it and launch a new instance in the preferred fault domain. + // Example: `FAULT-DOMAIN-1` + FaultDomain *string `mandatory:"false" json:"faultDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -88,13 +106,14 @@ // iqn.2015-02.oracle.boot. // For more information about the Bring Your Own Image feature of // Oracle Cloud Infrastructure, see - // Bring Your Own Image (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/bringyourownimage.htm). + // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). // For more information about iPXE, see http://ipxe.org. IpxeScript *string `mandatory:"false" json:"ipxeScript"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. + // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode InstanceLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` @@ -105,6 +124,14 @@ // Details for creating an instance SourceDetails InstanceSourceDetails `mandatory:"false" json:"sourceDetails"` + + AgentConfig *InstanceAgentConfig `mandatory:"false" json:"agentConfig"` + + // The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. + // After that time if instance hasn't been rebooted, Oracle will reboot the instance within 24 hours of the due time. + // Regardless of how the instance was stopped, the flag will be reset to empty as soon as instance reaches Stopped state. + // Example: `2018-05-25T21:10:29.600Z` + TimeMaintenanceRebootDue *common.SDKTime `mandatory:"false" json:"timeMaintenanceRebootDue"` } func (m Instance) String() string { @@ -114,23 +141,26 @@ // UnmarshalJSON unmarshals from json func (m *Instance) UnmarshalJSON(data []byte) (e error) { model := struct { - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - DisplayName *string `json:"displayName"` - ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` - FreeformTags map[string]string `json:"freeformTags"` - ImageId *string `json:"imageId"` - IpxeScript *string `json:"ipxeScript"` - LaunchMode InstanceLaunchModeEnum `json:"launchMode"` - LaunchOptions *LaunchOptions `json:"launchOptions"` - Metadata map[string]string `json:"metadata"` - SourceDetails instancesourcedetails `json:"sourceDetails"` - AvailabilityDomain *string `json:"availabilityDomain"` - CompartmentId *string `json:"compartmentId"` - Id *string `json:"id"` - LifecycleState InstanceLifecycleStateEnum `json:"lifecycleState"` - Region *string `json:"region"` - Shape *string `json:"shape"` - TimeCreated *common.SDKTime `json:"timeCreated"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` + FaultDomain *string `json:"faultDomain"` + FreeformTags map[string]string `json:"freeformTags"` + ImageId *string `json:"imageId"` + IpxeScript *string `json:"ipxeScript"` + LaunchMode InstanceLaunchModeEnum `json:"launchMode"` + LaunchOptions *LaunchOptions `json:"launchOptions"` + Metadata map[string]string `json:"metadata"` + SourceDetails instancesourcedetails `json:"sourceDetails"` + AgentConfig *InstanceAgentConfig `json:"agentConfig"` + TimeMaintenanceRebootDue *common.SDKTime `json:"timeMaintenanceRebootDue"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + Id *string `json:"id"` + LifecycleState InstanceLifecycleStateEnum `json:"lifecycleState"` + Region *string `json:"region"` + Shape *string `json:"shape"` + TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) @@ -140,6 +170,7 @@ m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.ExtendedMetadata = model.ExtendedMetadata + m.FaultDomain = model.FaultDomain m.FreeformTags = model.FreeformTags m.ImageId = model.ImageId m.IpxeScript = model.IpxeScript @@ -150,7 +181,13 @@ if e != nil { return } - m.SourceDetails = nn.(InstanceSourceDetails) + if nn != nil { + m.SourceDetails = nn.(InstanceSourceDetails) + } else { + m.SourceDetails = nil + } + m.AgentConfig = model.AgentConfig + m.TimeMaintenanceRebootDue = model.TimeMaintenanceRebootDue m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.Id = model.Id @@ -164,20 +201,22 @@ // InstanceLaunchModeEnum Enum with underlying type: string type InstanceLaunchModeEnum string -// Set of constants representing the allowable values for InstanceLaunchMode +// Set of constants representing the allowable values for InstanceLaunchModeEnum const ( - InstanceLaunchModeNative InstanceLaunchModeEnum = "NATIVE" - InstanceLaunchModeEmulated InstanceLaunchModeEnum = "EMULATED" - InstanceLaunchModeCustom InstanceLaunchModeEnum = "CUSTOM" + InstanceLaunchModeNative InstanceLaunchModeEnum = "NATIVE" + InstanceLaunchModeEmulated InstanceLaunchModeEnum = "EMULATED" + InstanceLaunchModeParavirtualized InstanceLaunchModeEnum = "PARAVIRTUALIZED" + InstanceLaunchModeCustom InstanceLaunchModeEnum = "CUSTOM" ) var mappingInstanceLaunchMode = map[string]InstanceLaunchModeEnum{ - "NATIVE": InstanceLaunchModeNative, - "EMULATED": InstanceLaunchModeEmulated, - "CUSTOM": InstanceLaunchModeCustom, + "NATIVE": InstanceLaunchModeNative, + "EMULATED": InstanceLaunchModeEmulated, + "PARAVIRTUALIZED": InstanceLaunchModeParavirtualized, + "CUSTOM": InstanceLaunchModeCustom, } -// GetInstanceLaunchModeEnumValues Enumerates the set of values for InstanceLaunchMode +// GetInstanceLaunchModeEnumValues Enumerates the set of values for InstanceLaunchModeEnum func GetInstanceLaunchModeEnumValues() []InstanceLaunchModeEnum { values := make([]InstanceLaunchModeEnum, 0) for _, v := range mappingInstanceLaunchMode { @@ -189,7 +228,7 @@ // InstanceLifecycleStateEnum Enum with underlying type: string type InstanceLifecycleStateEnum string -// Set of constants representing the allowable values for InstanceLifecycleState +// Set of constants representing the allowable values for InstanceLifecycleStateEnum const ( InstanceLifecycleStateProvisioning InstanceLifecycleStateEnum = "PROVISIONING" InstanceLifecycleStateRunning InstanceLifecycleStateEnum = "RUNNING" @@ -212,7 +251,7 @@ "TERMINATED": InstanceLifecycleStateTerminated, } -// GetInstanceLifecycleStateEnumValues Enumerates the set of values for InstanceLifecycleState +// GetInstanceLifecycleStateEnumValues Enumerates the set of values for InstanceLifecycleStateEnum func GetInstanceLifecycleStateEnumValues() []InstanceLifecycleStateEnum { values := make([]InstanceLifecycleStateEnum, 0) for _, v := range mappingInstanceLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePool Instance Pool +type InstancePool struct { + + // The OCID of the instance pool. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment containing the instance pool. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance configuration associated with the instance pool. + InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` + + // The current state of the instance pool. + LifecycleState InstancePoolLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The placement configurations for the instance pool. + PlacementConfigurations []InstancePoolPlacementConfiguration `mandatory:"true" json:"placementConfigurations"` + + // The number of instances that should be in the instance pool. + Size *int `mandatory:"true" json:"size"` + + // The date and time the instance pool was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The user-friendly name. Does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The load balancers attached to the instance pool. + LoadBalancers []InstancePoolLoadBalancerAttachment `mandatory:"false" json:"loadBalancers"` +} + +func (m InstancePool) String() string { + return common.PointerString(m) +} + +// InstancePoolLifecycleStateEnum Enum with underlying type: string +type InstancePoolLifecycleStateEnum string + +// Set of constants representing the allowable values for InstancePoolLifecycleStateEnum +const ( + InstancePoolLifecycleStateProvisioning InstancePoolLifecycleStateEnum = "PROVISIONING" + InstancePoolLifecycleStateScaling InstancePoolLifecycleStateEnum = "SCALING" + InstancePoolLifecycleStateStarting InstancePoolLifecycleStateEnum = "STARTING" + InstancePoolLifecycleStateStopping InstancePoolLifecycleStateEnum = "STOPPING" + InstancePoolLifecycleStateTerminating InstancePoolLifecycleStateEnum = "TERMINATING" + InstancePoolLifecycleStateStopped InstancePoolLifecycleStateEnum = "STOPPED" + InstancePoolLifecycleStateTerminated InstancePoolLifecycleStateEnum = "TERMINATED" + InstancePoolLifecycleStateRunning InstancePoolLifecycleStateEnum = "RUNNING" +) + +var mappingInstancePoolLifecycleState = map[string]InstancePoolLifecycleStateEnum{ + "PROVISIONING": InstancePoolLifecycleStateProvisioning, + "SCALING": InstancePoolLifecycleStateScaling, + "STARTING": InstancePoolLifecycleStateStarting, + "STOPPING": InstancePoolLifecycleStateStopping, + "TERMINATING": InstancePoolLifecycleStateTerminating, + "STOPPED": InstancePoolLifecycleStateStopped, + "TERMINATED": InstancePoolLifecycleStateTerminated, + "RUNNING": InstancePoolLifecycleStateRunning, +} + +// GetInstancePoolLifecycleStateEnumValues Enumerates the set of values for InstancePoolLifecycleStateEnum +func GetInstancePoolLifecycleStateEnumValues() []InstancePoolLifecycleStateEnum { + values := make([]InstancePoolLifecycleStateEnum, 0) + for _, v := range mappingInstancePoolLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_instance_load_balancer_backend.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_instance_load_balancer_backend.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_instance_load_balancer_backend.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_instance_load_balancer_backend.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolInstanceLoadBalancerBackend Represents the load balancer Backend that is configured for an instance pool instance. +type InstancePoolInstanceLoadBalancerBackend struct { + + // The OCID of the load balancer attached to the instance pool. + LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` + + // The name of the backend set on the load balancer. + BackendSetName *string `mandatory:"true" json:"backendSetName"` + + // The name of the backend in the backend set. + BackendName *string `mandatory:"true" json:"backendName"` + + // The health of the backend as observed by the load balancer. + BackendHealthStatus InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum `mandatory:"true" json:"backendHealthStatus"` +} + +func (m InstancePoolInstanceLoadBalancerBackend) String() string { + return common.PointerString(m) +} + +// InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum Enum with underlying type: string +type InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum string + +// Set of constants representing the allowable values for InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum +const ( + InstancePoolInstanceLoadBalancerBackendBackendHealthStatusOk InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "OK" + InstancePoolInstanceLoadBalancerBackendBackendHealthStatusWarning InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "WARNING" + InstancePoolInstanceLoadBalancerBackendBackendHealthStatusCritical InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "CRITICAL" + InstancePoolInstanceLoadBalancerBackendBackendHealthStatusUnknown InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "UNKNOWN" +) + +var mappingInstancePoolInstanceLoadBalancerBackendBackendHealthStatus = map[string]InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum{ + "OK": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusOk, + "WARNING": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusWarning, + "CRITICAL": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusCritical, + "UNKNOWN": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusUnknown, +} + +// GetInstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnumValues Enumerates the set of values for InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum +func GetInstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnumValues() []InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum { + values := make([]InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum, 0) + for _, v := range mappingInstancePoolInstanceLoadBalancerBackendBackendHealthStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_load_balancer_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_load_balancer_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_load_balancer_attachment.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_load_balancer_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolLoadBalancerAttachment Represents a load balancer that is attached to an instance pool. +type InstancePoolLoadBalancerAttachment struct { + + // The OCID of the load balancer attachment. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the instance pool of the load balancer attachment. + InstancePoolId *string `mandatory:"true" json:"instancePoolId"` + + // The OCID of the load balancer attached to the instance pool. + LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` + + // The name of the backend set on the load balancer. + BackendSetName *string `mandatory:"true" json:"backendSetName"` + + // The port value used for the backends. + Port *int `mandatory:"true" json:"port"` + + // Indicates which VNIC on each instance in the instance pool should be used to associate with the load balancer. Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration that is associated with the instance pool. + VnicSelection *string `mandatory:"true" json:"vnicSelection"` + + // The status of the interaction between the instance pool and the load balancer. + LifecycleState InstancePoolLoadBalancerAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +func (m InstancePoolLoadBalancerAttachment) String() string { + return common.PointerString(m) +} + +// InstancePoolLoadBalancerAttachmentLifecycleStateEnum Enum with underlying type: string +type InstancePoolLoadBalancerAttachmentLifecycleStateEnum string + +// Set of constants representing the allowable values for InstancePoolLoadBalancerAttachmentLifecycleStateEnum +const ( + InstancePoolLoadBalancerAttachmentLifecycleStateAttaching InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "ATTACHING" + InstancePoolLoadBalancerAttachmentLifecycleStateAttached InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "ATTACHED" + InstancePoolLoadBalancerAttachmentLifecycleStateDetaching InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "DETACHING" + InstancePoolLoadBalancerAttachmentLifecycleStateDetached InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "DETACHED" +) + +var mappingInstancePoolLoadBalancerAttachmentLifecycleState = map[string]InstancePoolLoadBalancerAttachmentLifecycleStateEnum{ + "ATTACHING": InstancePoolLoadBalancerAttachmentLifecycleStateAttaching, + "ATTACHED": InstancePoolLoadBalancerAttachmentLifecycleStateAttached, + "DETACHING": InstancePoolLoadBalancerAttachmentLifecycleStateDetaching, + "DETACHED": InstancePoolLoadBalancerAttachmentLifecycleStateDetached, +} + +// GetInstancePoolLoadBalancerAttachmentLifecycleStateEnumValues Enumerates the set of values for InstancePoolLoadBalancerAttachmentLifecycleStateEnum +func GetInstancePoolLoadBalancerAttachmentLifecycleStateEnumValues() []InstancePoolLoadBalancerAttachmentLifecycleStateEnum { + values := make([]InstancePoolLoadBalancerAttachmentLifecycleStateEnum, 0) + for _, v := range mappingInstancePoolLoadBalancerAttachmentLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_configuration.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolPlacementConfiguration The location for where an instance pool will place instances. +type InstancePoolPlacementConfiguration struct { + + // The availability domain to place instances. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the primary subnet to place instances. + PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` + + // The set of secondary VNIC data for instances in the pool. + SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` +} + +func (m InstancePoolPlacementConfiguration) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_secondary_vnic_subnet.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_secondary_vnic_subnet.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_secondary_vnic_subnet.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_secondary_vnic_subnet.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolPlacementSecondaryVnicSubnet The secondary VNIC object for the placement configuration for an instance pool. +type InstancePoolPlacementSecondaryVnicSubnet struct { + + // The subnet OCID for the secondary vnic + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The displayName of the vnic. This is also use to match against the Instance Configuration defined + // secondary vnic. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m InstancePoolPlacementSecondaryVnicSubnet) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstancePoolSummary Condensed InstancePool data when listing instance pools. +type InstancePoolSummary struct { + + // The OCID of the instance pool + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment containing the instance pool + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance configuration associated with the instance pool. + InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` + + // The current state of the instance pool. + LifecycleState InstancePoolSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The availability domains for the instance pool. + AvailabilityDomains []string `mandatory:"true" json:"availabilityDomains"` + + // The number of instances that should be in the instance pool. + Size *int `mandatory:"true" json:"size"` + + // The date and time the instance pool was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The user-friendly name. Does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m InstancePoolSummary) String() string { + return common.PointerString(m) +} + +// InstancePoolSummaryLifecycleStateEnum Enum with underlying type: string +type InstancePoolSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for InstancePoolSummaryLifecycleStateEnum +const ( + InstancePoolSummaryLifecycleStateProvisioning InstancePoolSummaryLifecycleStateEnum = "PROVISIONING" + InstancePoolSummaryLifecycleStateScaling InstancePoolSummaryLifecycleStateEnum = "SCALING" + InstancePoolSummaryLifecycleStateStarting InstancePoolSummaryLifecycleStateEnum = "STARTING" + InstancePoolSummaryLifecycleStateStopping InstancePoolSummaryLifecycleStateEnum = "STOPPING" + InstancePoolSummaryLifecycleStateTerminating InstancePoolSummaryLifecycleStateEnum = "TERMINATING" + InstancePoolSummaryLifecycleStateStopped InstancePoolSummaryLifecycleStateEnum = "STOPPED" + InstancePoolSummaryLifecycleStateTerminated InstancePoolSummaryLifecycleStateEnum = "TERMINATED" + InstancePoolSummaryLifecycleStateRunning InstancePoolSummaryLifecycleStateEnum = "RUNNING" +) + +var mappingInstancePoolSummaryLifecycleState = map[string]InstancePoolSummaryLifecycleStateEnum{ + "PROVISIONING": InstancePoolSummaryLifecycleStateProvisioning, + "SCALING": InstancePoolSummaryLifecycleStateScaling, + "STARTING": InstancePoolSummaryLifecycleStateStarting, + "STOPPING": InstancePoolSummaryLifecycleStateStopping, + "TERMINATING": InstancePoolSummaryLifecycleStateTerminating, + "STOPPED": InstancePoolSummaryLifecycleStateStopped, + "TERMINATED": InstancePoolSummaryLifecycleStateTerminated, + "RUNNING": InstancePoolSummaryLifecycleStateRunning, +} + +// GetInstancePoolSummaryLifecycleStateEnumValues Enumerates the set of values for InstancePoolSummaryLifecycleStateEnum +func GetInstancePoolSummaryLifecycleStateEnumValues() []InstancePoolSummaryLifecycleStateEnum { + values := make([]InstancePoolSummaryLifecycleStateEnum, 0) + for _, v := range mappingInstancePoolSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -40,6 +44,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instancesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.SourceType { case "image": @@ -51,7 +60,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_boot_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_image_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_image_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_image_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_image_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -20,7 +24,10 @@ ImageId *string `mandatory:"true" json:"imageId"` // The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 16384 GB (16TB). - BootVolumeSizeInGBs *int `mandatory:"false" json:"bootVolumeSizeInGBs"` + BootVolumeSizeInGBs *int64 `mandatory:"false" json:"bootVolumeSizeInGBs"` + + // The OCID of the KMS key to be used as the master encryption key for the boot volume. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m InstanceSourceViaImageDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/instance_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// InstanceSummary Condensed instance data when listing instances in an instance pool. +type InstanceSummary struct { + + // The OCID of the instance. + Id *string `mandatory:"true" json:"id"` + + // The availability domain the instance is running in. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the compartment that contains the instance. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the instance confgiuration used to create the instance. + InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` + + // The region that contains the availability domain the instance is running in. + Region *string `mandatory:"true" json:"region"` + + // The current state of the instance pool instance. + State *string `mandatory:"true" json:"state"` + + // The date and time the instance pool instance was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The user-friendly name. Does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The name of the Fault Domain the instance is running in. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // The shape of an instance. The shape determines the number of CPUs, amount of memory, + // and other resources allocated to the instance. + // You can enumerate all available shapes by calling ListShapes. + Shape *string `mandatory:"false" json:"shape"` + + // The load balancer backends that are configured for the instance pool instance. + LoadBalancerBackends []InstancePoolInstanceLoadBalancerBackend `mandatory:"false" json:"loadBalancerBackends"` +} + +func (m InstanceSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/internet_gateway.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/internet_gateway.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/internet_gateway.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/internet_gateway.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,34 +17,47 @@ ) // InternetGateway Represents a router that connects the edge of a VCN with the Internet. For an example scenario -// that uses an Internet Gateway, see -// Typical Networking Service Scenarios (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#scenarios). +// that uses an internet gateway, see +// Typical Networking Service Scenarios (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm#scenarios). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type InternetGateway struct { - // The OCID of the compartment containing the Internet Gateway. + // The OCID of the compartment containing the internet gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The Internet Gateway's Oracle ID (OCID). + // The internet gateway's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` - // The Internet Gateway's current state. + // The internet gateway's current state. LifecycleState InternetGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the VCN the Internet Gateway belongs to. + // The OCID of the VCN the internet gateway belongs to. VcnId *string `mandatory:"true" json:"vcnId"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // Whether the gateway is enabled. When the gateway is disabled, traffic is not // routed to/from the Internet, regardless of route rules. IsEnabled *bool `mandatory:"false" json:"isEnabled"` - // The date and time the Internet Gateway was created, in the format defined by RFC3339. + // The date and time the internet gateway was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } @@ -52,7 +69,7 @@ // InternetGatewayLifecycleStateEnum Enum with underlying type: string type InternetGatewayLifecycleStateEnum string -// Set of constants representing the allowable values for InternetGatewayLifecycleState +// Set of constants representing the allowable values for InternetGatewayLifecycleStateEnum const ( InternetGatewayLifecycleStateProvisioning InternetGatewayLifecycleStateEnum = "PROVISIONING" InternetGatewayLifecycleStateAvailable InternetGatewayLifecycleStateEnum = "AVAILABLE" @@ -67,7 +84,7 @@ "TERMINATED": InternetGatewayLifecycleStateTerminated, } -// GetInternetGatewayLifecycleStateEnumValues Enumerates the set of values for InternetGatewayLifecycleState +// GetInternetGatewayLifecycleStateEnumValues Enumerates the set of values for InternetGatewayLifecycleStateEnum func GetInternetGatewayLifecycleStateEnumValues() []InternetGatewayLifecycleStateEnum { values := make([]InternetGatewayLifecycleStateEnum, 0) for _, v := range mappingInternetGatewayLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_config.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// IpSecConnectionDeviceConfig Information about the IPSecConnection device configuration. +// IpSecConnectionDeviceConfig Deprecated. For tunnel information, instead see: +// * IPSecConnectionTunnel +// * IPSecConnectionTunnelSharedSecret type IpSecConnectionDeviceConfig struct { // The OCID of the compartment containing the IPSec connection. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_status.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_status.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_status.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_status.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,8 @@ "github.com/oracle/oci-go-sdk/common" ) -// IpSecConnectionDeviceStatus Status of the IPSec connection. +// IpSecConnectionDeviceStatus Deprecated. For tunnel information, instead see +// IPSecConnectionTunnel. type IpSecConnectionDeviceStatus struct { // The OCID of the compartment containing the IPSec connection. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -14,17 +18,30 @@ // IpSecConnection A connection between a DRG and CPE. This connection consists of multiple IPSec // tunnels. Creating this connection is one of the steps required when setting up -// an IPSec VPN. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// an IPSec VPN. +// **Important:** Each tunnel in an IPSec connection can use either static routing or BGP dynamic +// routing (see the IPSecConnectionTunnel object's +// `routing` attribute). Originally only static routing was supported and +// every IPSec connection was required to have at least one static route configured. +// To maintain backward compatibility in the API when support for BPG dynamic routing was introduced, +// the API accepts an empty list of static routes if you configure both of the IPSec tunnels to use +// BGP dynamic routing. If you switch a tunnel's routing from `BGP` to `STATIC`, you must first +// ensure that the IPSec connection is configured with at least one valid CIDR block static route. +// Oracle uses the IPSec connection's static routes when routing a tunnel's traffic *only* +// if that tunnel's `routing` attribute = `STATIC`. Otherwise the static routes are ignored. +// For more information about the workflow for setting up an IPSec connection, see +// IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type IpSecConnection struct { // The OCID of the compartment containing the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID of the CPE. + // The OCID of the Cpe object. CpeId *string `mandatory:"true" json:"cpeId"` // The OCID of the DRG. @@ -36,15 +53,44 @@ // The IPSec connection's current state. LifecycleState IpSecConnectionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // Static routes to the CPE. At least one route must be included. The CIDR must not be a + // Static routes to the CPE. The CIDR must not be a // multicast address or class E address. + // Used for routing a given IPSec tunnel's traffic only if the tunnel + // is using static routing. If you configure at least one tunnel to use static routing, then + // you must provide at least one valid static route. If you configure both + // tunnels to use BGP dynamic routing, you can provide an empty list for the static routes. + // // Example: `10.0.1.0/24` StaticRoutes []string `mandatory:"true" json:"staticRoutes"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, + // the fully qualified domain name (FQDN)). The type of identifier here must correspond + // to the value for `cpeLocalIdentifierType`. + // If you don't provide a value when creating the IPSec connection, the `ipAddress` attribute + // for the Cpe object specified by `cpeId` is used as the `cpeLocalIdentifier`. + // Example IP address: `10.0.3.3` + // Example hostname: `cpe.example.com` + CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` + + // The type of identifier for your CPE device. The value here must correspond to the value + // for `cpeLocalIdentifier`. + CpeLocalIdentifierType IpSecConnectionCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` + // The date and time the IPSec connection was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -57,7 +103,7 @@ // IpSecConnectionLifecycleStateEnum Enum with underlying type: string type IpSecConnectionLifecycleStateEnum string -// Set of constants representing the allowable values for IpSecConnectionLifecycleState +// Set of constants representing the allowable values for IpSecConnectionLifecycleStateEnum const ( IpSecConnectionLifecycleStateProvisioning IpSecConnectionLifecycleStateEnum = "PROVISIONING" IpSecConnectionLifecycleStateAvailable IpSecConnectionLifecycleStateEnum = "AVAILABLE" @@ -72,11 +118,34 @@ "TERMINATED": IpSecConnectionLifecycleStateTerminated, } -// GetIpSecConnectionLifecycleStateEnumValues Enumerates the set of values for IpSecConnectionLifecycleState +// GetIpSecConnectionLifecycleStateEnumValues Enumerates the set of values for IpSecConnectionLifecycleStateEnum func GetIpSecConnectionLifecycleStateEnumValues() []IpSecConnectionLifecycleStateEnum { values := make([]IpSecConnectionLifecycleStateEnum, 0) for _, v := range mappingIpSecConnectionLifecycleState { values = append(values, v) } return values +} + +// IpSecConnectionCpeLocalIdentifierTypeEnum Enum with underlying type: string +type IpSecConnectionCpeLocalIdentifierTypeEnum string + +// Set of constants representing the allowable values for IpSecConnectionCpeLocalIdentifierTypeEnum +const ( + IpSecConnectionCpeLocalIdentifierTypeIpAddress IpSecConnectionCpeLocalIdentifierTypeEnum = "IP_ADDRESS" + IpSecConnectionCpeLocalIdentifierTypeHostname IpSecConnectionCpeLocalIdentifierTypeEnum = "HOSTNAME" +) + +var mappingIpSecConnectionCpeLocalIdentifierType = map[string]IpSecConnectionCpeLocalIdentifierTypeEnum{ + "IP_ADDRESS": IpSecConnectionCpeLocalIdentifierTypeIpAddress, + "HOSTNAME": IpSecConnectionCpeLocalIdentifierTypeHostname, +} + +// GetIpSecConnectionCpeLocalIdentifierTypeEnumValues Enumerates the set of values for IpSecConnectionCpeLocalIdentifierTypeEnum +func GetIpSecConnectionCpeLocalIdentifierTypeEnumValues() []IpSecConnectionCpeLocalIdentifierTypeEnum { + values := make([]IpSecConnectionCpeLocalIdentifierTypeEnum, 0) + for _, v := range mappingIpSecConnectionCpeLocalIdentifierType { + values = append(values, v) + } + return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// IpSecConnectionTunnel Information about a single tunnel in an IPSec connection. This object does not include the tunnel's +// shared secret (pre-shared key). That is in the +// IPSecConnectionTunnelSharedSecret object. +type IpSecConnectionTunnel struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the tunnel. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. + Id *string `mandatory:"true" json:"id"` + + // The tunnel's lifecycle state. + LifecycleState IpSecConnectionTunnelLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The IP address of Oracle's VPN headend. + // Example: `192.0.2.5` + VpnIp *string `mandatory:"false" json:"vpnIp"` + + // The IP address of the CPE's VPN headend. + // Example: `192.0.2.157` + CpeIp *string `mandatory:"false" json:"cpeIp"` + + // The status of the tunnel based on IPSec protocol characteristics. + Status IpSecConnectionTunnelStatusEnum `mandatory:"false" json:"status,omitempty"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid + // entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Information for establishing the tunnel's BGP session. + BgpSessionInfo *BgpSessionInfo `mandatory:"false" json:"bgpSessionInfo"` + + // The type of routing used for this tunnel (either BGP dynamic routing or static routing). + Routing IpSecConnectionTunnelRoutingEnum `mandatory:"false" json:"routing,omitempty"` + + // The date and time the IPSec connection tunnel was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // When the status of the tunnel last changed, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeStatusUpdated *common.SDKTime `mandatory:"false" json:"timeStatusUpdated"` +} + +func (m IpSecConnectionTunnel) String() string { + return common.PointerString(m) +} + +// IpSecConnectionTunnelStatusEnum Enum with underlying type: string +type IpSecConnectionTunnelStatusEnum string + +// Set of constants representing the allowable values for IpSecConnectionTunnelStatusEnum +const ( + IpSecConnectionTunnelStatusUp IpSecConnectionTunnelStatusEnum = "UP" + IpSecConnectionTunnelStatusDown IpSecConnectionTunnelStatusEnum = "DOWN" + IpSecConnectionTunnelStatusDownForMaintenance IpSecConnectionTunnelStatusEnum = "DOWN_FOR_MAINTENANCE" +) + +var mappingIpSecConnectionTunnelStatus = map[string]IpSecConnectionTunnelStatusEnum{ + "UP": IpSecConnectionTunnelStatusUp, + "DOWN": IpSecConnectionTunnelStatusDown, + "DOWN_FOR_MAINTENANCE": IpSecConnectionTunnelStatusDownForMaintenance, +} + +// GetIpSecConnectionTunnelStatusEnumValues Enumerates the set of values for IpSecConnectionTunnelStatusEnum +func GetIpSecConnectionTunnelStatusEnumValues() []IpSecConnectionTunnelStatusEnum { + values := make([]IpSecConnectionTunnelStatusEnum, 0) + for _, v := range mappingIpSecConnectionTunnelStatus { + values = append(values, v) + } + return values +} + +// IpSecConnectionTunnelLifecycleStateEnum Enum with underlying type: string +type IpSecConnectionTunnelLifecycleStateEnum string + +// Set of constants representing the allowable values for IpSecConnectionTunnelLifecycleStateEnum +const ( + IpSecConnectionTunnelLifecycleStateProvisioning IpSecConnectionTunnelLifecycleStateEnum = "PROVISIONING" + IpSecConnectionTunnelLifecycleStateAvailable IpSecConnectionTunnelLifecycleStateEnum = "AVAILABLE" + IpSecConnectionTunnelLifecycleStateTerminating IpSecConnectionTunnelLifecycleStateEnum = "TERMINATING" + IpSecConnectionTunnelLifecycleStateTerminated IpSecConnectionTunnelLifecycleStateEnum = "TERMINATED" +) + +var mappingIpSecConnectionTunnelLifecycleState = map[string]IpSecConnectionTunnelLifecycleStateEnum{ + "PROVISIONING": IpSecConnectionTunnelLifecycleStateProvisioning, + "AVAILABLE": IpSecConnectionTunnelLifecycleStateAvailable, + "TERMINATING": IpSecConnectionTunnelLifecycleStateTerminating, + "TERMINATED": IpSecConnectionTunnelLifecycleStateTerminated, +} + +// GetIpSecConnectionTunnelLifecycleStateEnumValues Enumerates the set of values for IpSecConnectionTunnelLifecycleStateEnum +func GetIpSecConnectionTunnelLifecycleStateEnumValues() []IpSecConnectionTunnelLifecycleStateEnum { + values := make([]IpSecConnectionTunnelLifecycleStateEnum, 0) + for _, v := range mappingIpSecConnectionTunnelLifecycleState { + values = append(values, v) + } + return values +} + +// IpSecConnectionTunnelRoutingEnum Enum with underlying type: string +type IpSecConnectionTunnelRoutingEnum string + +// Set of constants representing the allowable values for IpSecConnectionTunnelRoutingEnum +const ( + IpSecConnectionTunnelRoutingBgp IpSecConnectionTunnelRoutingEnum = "BGP" + IpSecConnectionTunnelRoutingStatic IpSecConnectionTunnelRoutingEnum = "STATIC" +) + +var mappingIpSecConnectionTunnelRouting = map[string]IpSecConnectionTunnelRoutingEnum{ + "BGP": IpSecConnectionTunnelRoutingBgp, + "STATIC": IpSecConnectionTunnelRoutingStatic, +} + +// GetIpSecConnectionTunnelRoutingEnumValues Enumerates the set of values for IpSecConnectionTunnelRoutingEnum +func GetIpSecConnectionTunnelRoutingEnumValues() []IpSecConnectionTunnelRoutingEnum { + values := make([]IpSecConnectionTunnelRoutingEnum, 0) + for _, v := range mappingIpSecConnectionTunnelRouting { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel_shared_secret.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel_shared_secret.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel_shared_secret.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel_shared_secret.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// IpSecConnectionTunnelSharedSecret The tunnel's shared secret (pre-shared key). +type IpSecConnectionTunnelSharedSecret struct { + + // The tunnel's shared secret (pre-shared key). + // Example: `EXAMPLEToUis6j1c.p8G.dVQxcmdfMO0yXMLi.lZTbYCMDGu4V8o` + SharedSecret *string `mandatory:"true" json:"sharedSecret"` +} + +func (m IpSecConnectionTunnelSharedSecret) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/i_scsi_volume_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/i_scsi_volume_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/i_scsi_volume_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/i_scsi_volume_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ // IScsiVolumeAttachment An ISCSI volume attachment. type IScsiVolumeAttachment struct { - // The Availability Domain of an instance. + // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -48,6 +52,9 @@ // Example: `3260` Port *int `mandatory:"true" json:"port"` + // The device name. + Device *string `mandatory:"false" json:"device"` + // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` @@ -56,6 +63,9 @@ // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` + // The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. // (Also called the "CHAP password".) // Example: `d6866c0d-298b-48ba-95af-309b4faux45e` @@ -79,6 +89,11 @@ return m.CompartmentId } +//GetDevice returns Device +func (m IScsiVolumeAttachment) GetDevice() *string { + return m.Device +} + //GetDisplayName returns DisplayName func (m IScsiVolumeAttachment) GetDisplayName() *string { return m.DisplayName @@ -114,6 +129,11 @@ return m.VolumeId } +//GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled +func (m IScsiVolumeAttachment) GetIsPvEncryptionInTransitEnabled() *bool { + return m.IsPvEncryptionInTransitEnabled +} + func (m IScsiVolumeAttachment) String() string { return common.PointerString(m) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_agent_config_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_agent_config_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_agent_config_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_agent_config_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// LaunchInstanceAgentConfigDetails Instance agent configuration options to choose for launching the instance +type LaunchInstanceAgentConfigDetails struct { + + // Whether the agent running on the instance can gather performance metrics and monitor the instance. + // Default value is false. + IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` +} + +func (m LaunchInstanceAgentConfigDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// LaunchInstanceConfigurationRequest wrapper for the LaunchInstanceConfiguration operation +type LaunchInstanceConfigurationRequest struct { + + // The OCID of the instance configuration. + InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` + + // Instance configuration Instance Details + InstanceConfiguration InstanceConfigurationInstanceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request LaunchInstanceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request LaunchInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LaunchInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// LaunchInstanceConfigurationResponse wrapper for the LaunchInstanceConfiguration operation +type LaunchInstanceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Instance instance + Instance `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response LaunchInstanceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response LaunchInstanceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,7 +21,7 @@ // Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. type LaunchInstanceDetails struct { - // The Availability Domain of the instance. + // The availability domain of the instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -34,7 +38,7 @@ CreateVnicDetails *CreateVnicDetails `mandatory:"false" json:"createVnicDetails"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -43,14 +47,26 @@ // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` - // Additional metadata key/value pairs that you provide. They serve a similar purpose and functionality from fields in the 'metadata' object. + // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). - // If you don't need nested metadata values, it is strongly advised to avoid using this object and use the Metadata object instead. ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` + // A fault domain is a grouping of hardware and infrastructure within an availability domain. + // Each availability domain contains three fault domains. Fault domains let you distribute your + // instances so that they are not on the same physical hardware within a single availability domain. + // A hardware failure or Compute hardware maintenance that affects one fault domain does not affect + // instances in other fault domains. + // If you do not specify the fault domain, the system selects one for you. To change the fault + // domain for an instance, terminate it and launch a new instance in the preferred fault domain. + // To get a list of fault domains, use the + // ListFaultDomains operation in the + // Identity and Access Management Service API. + // Example: `FAULT-DOMAIN-1` + FaultDomain *string `mandatory:"false" json:"faultDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -80,7 +96,7 @@ // iqn.2015-02.oracle.boot. // For more information about the Bring Your Own Image feature of // Oracle Cloud Infrastructure, see - // Bring Your Own Image (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/bringyourownimage.htm). + // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). // For more information about iPXE, see http://ipxe.org. IpxeScript *string `mandatory:"false" json:"ipxeScript"` @@ -129,6 +145,8 @@ // the metadata information for the specified key name, respectively. Metadata map[string]string `mandatory:"false" json:"metadata"` + AgentConfig *LaunchInstanceAgentConfigDetails `mandatory:"false" json:"agentConfig"` + // Details for creating an instance. // Use this parameter to specify whether a boot volume or an image should be used to launch a new instance. SourceDetails InstanceSourceDetails `mandatory:"false" json:"sourceDetails"` @@ -137,6 +155,9 @@ // CreateVnicDetails. // At least one of them is required; if you provide both, the values must match. SubnetId *string `mandatory:"false" json:"subnetId"` + + // Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` } func (m LaunchInstanceDetails) String() string { @@ -146,20 +167,23 @@ // UnmarshalJSON unmarshals from json func (m *LaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - CreateVnicDetails *CreateVnicDetails `json:"createVnicDetails"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - DisplayName *string `json:"displayName"` - ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` - FreeformTags map[string]string `json:"freeformTags"` - HostnameLabel *string `json:"hostnameLabel"` - ImageId *string `json:"imageId"` - IpxeScript *string `json:"ipxeScript"` - Metadata map[string]string `json:"metadata"` - SourceDetails instancesourcedetails `json:"sourceDetails"` - SubnetId *string `json:"subnetId"` - AvailabilityDomain *string `json:"availabilityDomain"` - CompartmentId *string `json:"compartmentId"` - Shape *string `json:"shape"` + CreateVnicDetails *CreateVnicDetails `json:"createVnicDetails"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` + FaultDomain *string `json:"faultDomain"` + FreeformTags map[string]string `json:"freeformTags"` + HostnameLabel *string `json:"hostnameLabel"` + ImageId *string `json:"imageId"` + IpxeScript *string `json:"ipxeScript"` + Metadata map[string]string `json:"metadata"` + AgentConfig *LaunchInstanceAgentConfigDetails `json:"agentConfig"` + SourceDetails instancesourcedetails `json:"sourceDetails"` + SubnetId *string `json:"subnetId"` + IsPvEncryptionInTransitEnabled *bool `json:"isPvEncryptionInTransitEnabled"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + Shape *string `json:"shape"` }{} e = json.Unmarshal(data, &model) @@ -170,17 +194,24 @@ m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.ExtendedMetadata = model.ExtendedMetadata + m.FaultDomain = model.FaultDomain m.FreeformTags = model.FreeformTags m.HostnameLabel = model.HostnameLabel m.ImageId = model.ImageId m.IpxeScript = model.IpxeScript m.Metadata = model.Metadata + m.AgentConfig = model.AgentConfig nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } - m.SourceDetails = nn.(InstanceSourceDetails) + if nn != nil { + m.SourceDetails = nn.(InstanceSourceDetails) + } else { + m.SourceDetails = nil + } m.SubnetId = model.SubnetId + m.IsPvEncryptionInTransitEnabled = model.IsPvEncryptionInTransitEnabled m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.Shape = model.Shape diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request LaunchInstanceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request LaunchInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LaunchInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // LaunchInstanceResponse wrapper for the LaunchInstance operation type LaunchInstanceResponse struct { @@ -46,3 +64,8 @@ func (response LaunchInstanceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response LaunchInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_options.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/launch_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -22,6 +26,7 @@ // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. + // * `PARAVIRTUALIZED` - Paravirtualized disk. BootVolumeType LaunchOptionsBootVolumeTypeEnum `mandatory:"true" json:"bootVolumeType"` // Firmware used to boot VM. Select the option that matches your operating system. @@ -34,6 +39,7 @@ // Emulation type for NIC. // * `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. // * `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images. + // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. NetworkType LaunchOptionsNetworkTypeEnum `mandatory:"true" json:"networkType"` // Emulation type for volume. @@ -43,7 +49,14 @@ // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. + // * `PARAVIRTUALIZED` - Paravirtualized disk. RemoteDataVolumeType LaunchOptionsRemoteDataVolumeTypeEnum `mandatory:"true" json:"remoteDataVolumeType"` + + // Whether to enable in-transit encryption for the boot volume's paravirtualized attachment. The default value is false. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` + + // Whether to enable consistent volume naming feature. Defaults to false. + IsConsistentVolumeNamingEnabled *bool `mandatory:"false" json:"isConsistentVolumeNamingEnabled"` } func (m LaunchOptions) String() string { @@ -53,22 +66,24 @@ // LaunchOptionsBootVolumeTypeEnum Enum with underlying type: string type LaunchOptionsBootVolumeTypeEnum string -// Set of constants representing the allowable values for LaunchOptionsBootVolumeType +// Set of constants representing the allowable values for LaunchOptionsBootVolumeTypeEnum const ( - LaunchOptionsBootVolumeTypeIscsi LaunchOptionsBootVolumeTypeEnum = "ISCSI" - LaunchOptionsBootVolumeTypeScsi LaunchOptionsBootVolumeTypeEnum = "SCSI" - LaunchOptionsBootVolumeTypeIde LaunchOptionsBootVolumeTypeEnum = "IDE" - LaunchOptionsBootVolumeTypeVfio LaunchOptionsBootVolumeTypeEnum = "VFIO" + LaunchOptionsBootVolumeTypeIscsi LaunchOptionsBootVolumeTypeEnum = "ISCSI" + LaunchOptionsBootVolumeTypeScsi LaunchOptionsBootVolumeTypeEnum = "SCSI" + LaunchOptionsBootVolumeTypeIde LaunchOptionsBootVolumeTypeEnum = "IDE" + LaunchOptionsBootVolumeTypeVfio LaunchOptionsBootVolumeTypeEnum = "VFIO" + LaunchOptionsBootVolumeTypeParavirtualized LaunchOptionsBootVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsBootVolumeType = map[string]LaunchOptionsBootVolumeTypeEnum{ - "ISCSI": LaunchOptionsBootVolumeTypeIscsi, - "SCSI": LaunchOptionsBootVolumeTypeScsi, - "IDE": LaunchOptionsBootVolumeTypeIde, - "VFIO": LaunchOptionsBootVolumeTypeVfio, + "ISCSI": LaunchOptionsBootVolumeTypeIscsi, + "SCSI": LaunchOptionsBootVolumeTypeScsi, + "IDE": LaunchOptionsBootVolumeTypeIde, + "VFIO": LaunchOptionsBootVolumeTypeVfio, + "PARAVIRTUALIZED": LaunchOptionsBootVolumeTypeParavirtualized, } -// GetLaunchOptionsBootVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsBootVolumeType +// GetLaunchOptionsBootVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsBootVolumeTypeEnum func GetLaunchOptionsBootVolumeTypeEnumValues() []LaunchOptionsBootVolumeTypeEnum { values := make([]LaunchOptionsBootVolumeTypeEnum, 0) for _, v := range mappingLaunchOptionsBootVolumeType { @@ -80,7 +95,7 @@ // LaunchOptionsFirmwareEnum Enum with underlying type: string type LaunchOptionsFirmwareEnum string -// Set of constants representing the allowable values for LaunchOptionsFirmware +// Set of constants representing the allowable values for LaunchOptionsFirmwareEnum const ( LaunchOptionsFirmwareBios LaunchOptionsFirmwareEnum = "BIOS" LaunchOptionsFirmwareUefi64 LaunchOptionsFirmwareEnum = "UEFI_64" @@ -91,7 +106,7 @@ "UEFI_64": LaunchOptionsFirmwareUefi64, } -// GetLaunchOptionsFirmwareEnumValues Enumerates the set of values for LaunchOptionsFirmware +// GetLaunchOptionsFirmwareEnumValues Enumerates the set of values for LaunchOptionsFirmwareEnum func GetLaunchOptionsFirmwareEnumValues() []LaunchOptionsFirmwareEnum { values := make([]LaunchOptionsFirmwareEnum, 0) for _, v := range mappingLaunchOptionsFirmware { @@ -103,18 +118,20 @@ // LaunchOptionsNetworkTypeEnum Enum with underlying type: string type LaunchOptionsNetworkTypeEnum string -// Set of constants representing the allowable values for LaunchOptionsNetworkType +// Set of constants representing the allowable values for LaunchOptionsNetworkTypeEnum const ( - LaunchOptionsNetworkTypeE1000 LaunchOptionsNetworkTypeEnum = "E1000" - LaunchOptionsNetworkTypeVfio LaunchOptionsNetworkTypeEnum = "VFIO" + LaunchOptionsNetworkTypeE1000 LaunchOptionsNetworkTypeEnum = "E1000" + LaunchOptionsNetworkTypeVfio LaunchOptionsNetworkTypeEnum = "VFIO" + LaunchOptionsNetworkTypeParavirtualized LaunchOptionsNetworkTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsNetworkType = map[string]LaunchOptionsNetworkTypeEnum{ - "E1000": LaunchOptionsNetworkTypeE1000, - "VFIO": LaunchOptionsNetworkTypeVfio, + "E1000": LaunchOptionsNetworkTypeE1000, + "VFIO": LaunchOptionsNetworkTypeVfio, + "PARAVIRTUALIZED": LaunchOptionsNetworkTypeParavirtualized, } -// GetLaunchOptionsNetworkTypeEnumValues Enumerates the set of values for LaunchOptionsNetworkType +// GetLaunchOptionsNetworkTypeEnumValues Enumerates the set of values for LaunchOptionsNetworkTypeEnum func GetLaunchOptionsNetworkTypeEnumValues() []LaunchOptionsNetworkTypeEnum { values := make([]LaunchOptionsNetworkTypeEnum, 0) for _, v := range mappingLaunchOptionsNetworkType { @@ -126,22 +143,24 @@ // LaunchOptionsRemoteDataVolumeTypeEnum Enum with underlying type: string type LaunchOptionsRemoteDataVolumeTypeEnum string -// Set of constants representing the allowable values for LaunchOptionsRemoteDataVolumeType +// Set of constants representing the allowable values for LaunchOptionsRemoteDataVolumeTypeEnum const ( - LaunchOptionsRemoteDataVolumeTypeIscsi LaunchOptionsRemoteDataVolumeTypeEnum = "ISCSI" - LaunchOptionsRemoteDataVolumeTypeScsi LaunchOptionsRemoteDataVolumeTypeEnum = "SCSI" - LaunchOptionsRemoteDataVolumeTypeIde LaunchOptionsRemoteDataVolumeTypeEnum = "IDE" - LaunchOptionsRemoteDataVolumeTypeVfio LaunchOptionsRemoteDataVolumeTypeEnum = "VFIO" + LaunchOptionsRemoteDataVolumeTypeIscsi LaunchOptionsRemoteDataVolumeTypeEnum = "ISCSI" + LaunchOptionsRemoteDataVolumeTypeScsi LaunchOptionsRemoteDataVolumeTypeEnum = "SCSI" + LaunchOptionsRemoteDataVolumeTypeIde LaunchOptionsRemoteDataVolumeTypeEnum = "IDE" + LaunchOptionsRemoteDataVolumeTypeVfio LaunchOptionsRemoteDataVolumeTypeEnum = "VFIO" + LaunchOptionsRemoteDataVolumeTypeParavirtualized LaunchOptionsRemoteDataVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsRemoteDataVolumeType = map[string]LaunchOptionsRemoteDataVolumeTypeEnum{ - "ISCSI": LaunchOptionsRemoteDataVolumeTypeIscsi, - "SCSI": LaunchOptionsRemoteDataVolumeTypeScsi, - "IDE": LaunchOptionsRemoteDataVolumeTypeIde, - "VFIO": LaunchOptionsRemoteDataVolumeTypeVfio, + "ISCSI": LaunchOptionsRemoteDataVolumeTypeIscsi, + "SCSI": LaunchOptionsRemoteDataVolumeTypeScsi, + "IDE": LaunchOptionsRemoteDataVolumeTypeIde, + "VFIO": LaunchOptionsRemoteDataVolumeTypeVfio, + "PARAVIRTUALIZED": LaunchOptionsRemoteDataVolumeTypeParavirtualized, } -// GetLaunchOptionsRemoteDataVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsRemoteDataVolumeType +// GetLaunchOptionsRemoteDataVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsRemoteDataVolumeTypeEnum func GetLaunchOptionsRemoteDataVolumeTypeEnumValues() []LaunchOptionsRemoteDataVolumeTypeEnum { values := make([]LaunchOptionsRemoteDataVolumeTypeEnum, 0) for _, v := range mappingLaunchOptionsRemoteDataVolumeType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/letter_of_authority.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/letter_of_authority.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/letter_of_authority.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/letter_of_authority.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -46,7 +50,7 @@ // LetterOfAuthorityCircuitTypeEnum Enum with underlying type: string type LetterOfAuthorityCircuitTypeEnum string -// Set of constants representing the allowable values for LetterOfAuthorityCircuitType +// Set of constants representing the allowable values for LetterOfAuthorityCircuitTypeEnum const ( LetterOfAuthorityCircuitTypeLc LetterOfAuthorityCircuitTypeEnum = "Single_mode_LC" LetterOfAuthorityCircuitTypeSc LetterOfAuthorityCircuitTypeEnum = "Single_mode_SC" @@ -57,7 +61,7 @@ "Single_mode_SC": LetterOfAuthorityCircuitTypeSc, } -// GetLetterOfAuthorityCircuitTypeEnumValues Enumerates the set of values for LetterOfAuthorityCircuitType +// GetLetterOfAuthorityCircuitTypeEnumValues Enumerates the set of values for LetterOfAuthorityCircuitTypeEnum func GetLetterOfAuthorityCircuitTypeEnumValues() []LetterOfAuthorityCircuitTypeEnum { values := make([]LetterOfAuthorityCircuitTypeEnum, 0) for _, v := range mappingLetterOfAuthorityCircuitType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_allowed_peer_regions_for_remote_peering_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_allowed_peer_regions_for_remote_peering_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_allowed_peer_regions_for_remote_peering_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_allowed_peer_regions_for_remote_peering_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -10,12 +10,30 @@ // ListAllowedPeerRegionsForRemotePeeringRequest wrapper for the ListAllowedPeerRegionsForRemotePeering operation type ListAllowedPeerRegionsForRemotePeeringRequest struct { + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListAllowedPeerRegionsForRemotePeeringRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListAllowedPeerRegionsForRemotePeeringRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAllowedPeerRegionsForRemotePeeringRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListAllowedPeerRegionsForRemotePeeringResponse wrapper for the ListAllowedPeerRegionsForRemotePeering operation type ListAllowedPeerRegionsForRemotePeeringResponse struct { @@ -33,3 +51,8 @@ func (response ListAllowedPeerRegionsForRemotePeeringResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListAllowedPeerRegionsForRemotePeeringResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listing_resource_versions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listing_resource_versions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listing_resource_versions_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listing_resource_versions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAppCatalogListingResourceVersionsRequest wrapper for the ListAppCatalogListingResourceVersions operation +type ListAppCatalogListingResourceVersionsRequest struct { + + // The OCID of the listing. + ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListAppCatalogListingResourceVersionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAppCatalogListingResourceVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAppCatalogListingResourceVersionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAppCatalogListingResourceVersionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAppCatalogListingResourceVersionsResponse wrapper for the ListAppCatalogListingResourceVersions operation +type ListAppCatalogListingResourceVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AppCatalogListingResourceVersionSummary instances + Items []AppCatalogListingResourceVersionSummary `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAppCatalogListingResourceVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAppCatalogListingResourceVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAppCatalogListingResourceVersionsSortOrderEnum Enum with underlying type: string +type ListAppCatalogListingResourceVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListAppCatalogListingResourceVersionsSortOrderEnum +const ( + ListAppCatalogListingResourceVersionsSortOrderAsc ListAppCatalogListingResourceVersionsSortOrderEnum = "ASC" + ListAppCatalogListingResourceVersionsSortOrderDesc ListAppCatalogListingResourceVersionsSortOrderEnum = "DESC" +) + +var mappingListAppCatalogListingResourceVersionsSortOrder = map[string]ListAppCatalogListingResourceVersionsSortOrderEnum{ + "ASC": ListAppCatalogListingResourceVersionsSortOrderAsc, + "DESC": ListAppCatalogListingResourceVersionsSortOrderDesc, +} + +// GetListAppCatalogListingResourceVersionsSortOrderEnumValues Enumerates the set of values for ListAppCatalogListingResourceVersionsSortOrderEnum +func GetListAppCatalogListingResourceVersionsSortOrderEnumValues() []ListAppCatalogListingResourceVersionsSortOrderEnum { + values := make([]ListAppCatalogListingResourceVersionsSortOrderEnum, 0) + for _, v := range mappingListAppCatalogListingResourceVersionsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listings_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listings_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listings_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_listings_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAppCatalogListingsRequest wrapper for the ListAppCatalogListings operation +type ListAppCatalogListingsRequest struct { + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListAppCatalogListingsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only the publisher that matches the given publisher name exactly. + PublisherName *string `mandatory:"false" contributesTo:"query" name:"publisherName"` + + // A filter to return only publishers that match the given publisher type exactly. Valid types are OCI, ORACLE, TRUSTED, STANDARD. + PublisherType *string `mandatory:"false" contributesTo:"query" name:"publisherType"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAppCatalogListingsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAppCatalogListingsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAppCatalogListingsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAppCatalogListingsResponse wrapper for the ListAppCatalogListings operation +type ListAppCatalogListingsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AppCatalogListingSummary instances + Items []AppCatalogListingSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAppCatalogListingsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAppCatalogListingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAppCatalogListingsSortOrderEnum Enum with underlying type: string +type ListAppCatalogListingsSortOrderEnum string + +// Set of constants representing the allowable values for ListAppCatalogListingsSortOrderEnum +const ( + ListAppCatalogListingsSortOrderAsc ListAppCatalogListingsSortOrderEnum = "ASC" + ListAppCatalogListingsSortOrderDesc ListAppCatalogListingsSortOrderEnum = "DESC" +) + +var mappingListAppCatalogListingsSortOrder = map[string]ListAppCatalogListingsSortOrderEnum{ + "ASC": ListAppCatalogListingsSortOrderAsc, + "DESC": ListAppCatalogListingsSortOrderDesc, +} + +// GetListAppCatalogListingsSortOrderEnumValues Enumerates the set of values for ListAppCatalogListingsSortOrderEnum +func GetListAppCatalogListingsSortOrderEnumValues() []ListAppCatalogListingsSortOrderEnum { + values := make([]ListAppCatalogListingsSortOrderEnum, 0) + for _, v := range mappingListAppCatalogListingsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_subscriptions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_subscriptions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_subscriptions_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_app_catalog_subscriptions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAppCatalogSubscriptionsRequest wrapper for the ListAppCatalogSubscriptions operation +type ListAppCatalogSubscriptionsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListAppCatalogSubscriptionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListAppCatalogSubscriptionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only the listings that matches the given listing id. + ListingId *string `mandatory:"false" contributesTo:"query" name:"listingId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAppCatalogSubscriptionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAppCatalogSubscriptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAppCatalogSubscriptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAppCatalogSubscriptionsResponse wrapper for the ListAppCatalogSubscriptions operation +type ListAppCatalogSubscriptionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AppCatalogSubscriptionSummary instances + Items []AppCatalogSubscriptionSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAppCatalogSubscriptionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAppCatalogSubscriptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAppCatalogSubscriptionsSortByEnum Enum with underlying type: string +type ListAppCatalogSubscriptionsSortByEnum string + +// Set of constants representing the allowable values for ListAppCatalogSubscriptionsSortByEnum +const ( + ListAppCatalogSubscriptionsSortByTimecreated ListAppCatalogSubscriptionsSortByEnum = "TIMECREATED" + ListAppCatalogSubscriptionsSortByDisplayname ListAppCatalogSubscriptionsSortByEnum = "DISPLAYNAME" +) + +var mappingListAppCatalogSubscriptionsSortBy = map[string]ListAppCatalogSubscriptionsSortByEnum{ + "TIMECREATED": ListAppCatalogSubscriptionsSortByTimecreated, + "DISPLAYNAME": ListAppCatalogSubscriptionsSortByDisplayname, +} + +// GetListAppCatalogSubscriptionsSortByEnumValues Enumerates the set of values for ListAppCatalogSubscriptionsSortByEnum +func GetListAppCatalogSubscriptionsSortByEnumValues() []ListAppCatalogSubscriptionsSortByEnum { + values := make([]ListAppCatalogSubscriptionsSortByEnum, 0) + for _, v := range mappingListAppCatalogSubscriptionsSortBy { + values = append(values, v) + } + return values +} + +// ListAppCatalogSubscriptionsSortOrderEnum Enum with underlying type: string +type ListAppCatalogSubscriptionsSortOrderEnum string + +// Set of constants representing the allowable values for ListAppCatalogSubscriptionsSortOrderEnum +const ( + ListAppCatalogSubscriptionsSortOrderAsc ListAppCatalogSubscriptionsSortOrderEnum = "ASC" + ListAppCatalogSubscriptionsSortOrderDesc ListAppCatalogSubscriptionsSortOrderEnum = "DESC" +) + +var mappingListAppCatalogSubscriptionsSortOrder = map[string]ListAppCatalogSubscriptionsSortOrderEnum{ + "ASC": ListAppCatalogSubscriptionsSortOrderAsc, + "DESC": ListAppCatalogSubscriptionsSortOrderDesc, +} + +// GetListAppCatalogSubscriptionsSortOrderEnumValues Enumerates the set of values for ListAppCatalogSubscriptionsSortOrderEnum +func GetListAppCatalogSubscriptionsSortOrderEnumValues() []ListAppCatalogSubscriptionsSortOrderEnum { + values := make([]ListAppCatalogSubscriptionsSortOrderEnum, 0) + for _, v := range mappingListAppCatalogSubscriptionsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_attachments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_attachments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_attachments_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_attachments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,18 +11,22 @@ // ListBootVolumeAttachmentsRequest wrapper for the ListBootVolumeAttachments operation type ListBootVolumeAttachmentsRequest struct { - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. @@ -30,24 +34,42 @@ // The OCID of the boot volume. BootVolumeId *string `mandatory:"false" contributesTo:"query" name:"bootVolumeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBootVolumeAttachmentsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBootVolumeAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBootVolumeAttachmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBootVolumeAttachmentsResponse wrapper for the ListBootVolumeAttachments operation type ListBootVolumeAttachmentsResponse struct { // The underlying http response RawResponse *http.Response - // The []BootVolumeAttachment instance + // A list of []BootVolumeAttachment instances Items []BootVolumeAttachment `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -58,3 +80,8 @@ func (response ListBootVolumeAttachmentsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListBootVolumeAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_backups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volume_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListBootVolumeBackupsRequest wrapper for the ListBootVolumeBackups operation +type ListBootVolumeBackupsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the boot volume. + BootVolumeId *string `mandatory:"false" contributesTo:"query" name:"bootVolumeId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListBootVolumeBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListBootVolumeBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState BootVolumeBackupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListBootVolumeBackupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListBootVolumeBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBootVolumeBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListBootVolumeBackupsResponse wrapper for the ListBootVolumeBackups operation +type ListBootVolumeBackupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []BootVolumeBackup instances + Items []BootVolumeBackup `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListBootVolumeBackupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListBootVolumeBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListBootVolumeBackupsSortByEnum Enum with underlying type: string +type ListBootVolumeBackupsSortByEnum string + +// Set of constants representing the allowable values for ListBootVolumeBackupsSortByEnum +const ( + ListBootVolumeBackupsSortByTimecreated ListBootVolumeBackupsSortByEnum = "TIMECREATED" + ListBootVolumeBackupsSortByDisplayname ListBootVolumeBackupsSortByEnum = "DISPLAYNAME" +) + +var mappingListBootVolumeBackupsSortBy = map[string]ListBootVolumeBackupsSortByEnum{ + "TIMECREATED": ListBootVolumeBackupsSortByTimecreated, + "DISPLAYNAME": ListBootVolumeBackupsSortByDisplayname, +} + +// GetListBootVolumeBackupsSortByEnumValues Enumerates the set of values for ListBootVolumeBackupsSortByEnum +func GetListBootVolumeBackupsSortByEnumValues() []ListBootVolumeBackupsSortByEnum { + values := make([]ListBootVolumeBackupsSortByEnum, 0) + for _, v := range mappingListBootVolumeBackupsSortBy { + values = append(values, v) + } + return values +} + +// ListBootVolumeBackupsSortOrderEnum Enum with underlying type: string +type ListBootVolumeBackupsSortOrderEnum string + +// Set of constants representing the allowable values for ListBootVolumeBackupsSortOrderEnum +const ( + ListBootVolumeBackupsSortOrderAsc ListBootVolumeBackupsSortOrderEnum = "ASC" + ListBootVolumeBackupsSortOrderDesc ListBootVolumeBackupsSortOrderEnum = "DESC" +) + +var mappingListBootVolumeBackupsSortOrder = map[string]ListBootVolumeBackupsSortOrderEnum{ + "ASC": ListBootVolumeBackupsSortOrderAsc, + "DESC": ListBootVolumeBackupsSortOrderDesc, +} + +// GetListBootVolumeBackupsSortOrderEnumValues Enumerates the set of values for ListBootVolumeBackupsSortOrderEnum +func GetListBootVolumeBackupsSortOrderEnumValues() []ListBootVolumeBackupsSortOrderEnum { + values := make([]ListBootVolumeBackupsSortOrderEnum, 0) + for _, v := range mappingListBootVolumeBackupsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volumes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volumes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volumes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volumes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,37 +11,62 @@ // ListBootVolumesRequest wrapper for the ListBootVolumes operation type ListBootVolumesRequest struct { - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The OCID of the volume group. + VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBootVolumesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBootVolumesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBootVolumesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBootVolumesResponse wrapper for the ListBootVolumes operation type ListBootVolumesResponse struct { // The underlying http response RawResponse *http.Response - // The []BootVolume instance + // A list of []BootVolume instances Items []BootVolume `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -52,3 +77,8 @@ func (response ListBootVolumesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListBootVolumesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_console_histories_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_console_histories_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_console_histories_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_console_histories_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,15 +14,19 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. @@ -32,9 +36,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListConsoleHistoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -43,24 +47,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState ConsoleHistoryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListConsoleHistoriesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListConsoleHistoriesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListConsoleHistoriesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListConsoleHistoriesResponse wrapper for the ListConsoleHistories operation type ListConsoleHistoriesResponse struct { // The underlying http response RawResponse *http.Response - // The []ConsoleHistory instance + // A list of []ConsoleHistory instances Items []ConsoleHistory `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -72,10 +94,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListConsoleHistoriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListConsoleHistoriesSortByEnum Enum with underlying type: string type ListConsoleHistoriesSortByEnum string -// Set of constants representing the allowable values for ListConsoleHistoriesSortBy +// Set of constants representing the allowable values for ListConsoleHistoriesSortByEnum const ( ListConsoleHistoriesSortByTimecreated ListConsoleHistoriesSortByEnum = "TIMECREATED" ListConsoleHistoriesSortByDisplayname ListConsoleHistoriesSortByEnum = "DISPLAYNAME" @@ -86,7 +113,7 @@ "DISPLAYNAME": ListConsoleHistoriesSortByDisplayname, } -// GetListConsoleHistoriesSortByEnumValues Enumerates the set of values for ListConsoleHistoriesSortBy +// GetListConsoleHistoriesSortByEnumValues Enumerates the set of values for ListConsoleHistoriesSortByEnum func GetListConsoleHistoriesSortByEnumValues() []ListConsoleHistoriesSortByEnum { values := make([]ListConsoleHistoriesSortByEnum, 0) for _, v := range mappingListConsoleHistoriesSortBy { @@ -98,7 +125,7 @@ // ListConsoleHistoriesSortOrderEnum Enum with underlying type: string type ListConsoleHistoriesSortOrderEnum string -// Set of constants representing the allowable values for ListConsoleHistoriesSortOrder +// Set of constants representing the allowable values for ListConsoleHistoriesSortOrderEnum const ( ListConsoleHistoriesSortOrderAsc ListConsoleHistoriesSortOrderEnum = "ASC" ListConsoleHistoriesSortOrderDesc ListConsoleHistoriesSortOrderEnum = "DESC" @@ -109,7 +136,7 @@ "DESC": ListConsoleHistoriesSortOrderDesc, } -// GetListConsoleHistoriesSortOrderEnumValues Enumerates the set of values for ListConsoleHistoriesSortOrder +// GetListConsoleHistoriesSortOrderEnumValues Enumerates the set of values for ListConsoleHistoriesSortOrderEnum func GetListConsoleHistoriesSortOrderEnumValues() []ListConsoleHistoriesSortOrderEnum { values := make([]ListConsoleHistoriesSortOrderEnum, 0) for _, v := range mappingListConsoleHistoriesSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cpes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cpes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cpes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cpes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCpesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCpesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCpesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCpesResponse wrapper for the ListCpes operation type ListCpesResponse struct { // The underlying http response RawResponse *http.Response - // The []Cpe instance + // A list of []Cpe instances Items []Cpe `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListCpesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCpesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_groups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_groups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_groups_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_groups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,11 +14,15 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -28,9 +32,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListCrossConnectGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -39,24 +43,42 @@ // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState CrossConnectGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCrossConnectGroupsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCrossConnectGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCrossConnectGroupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCrossConnectGroupsResponse wrapper for the ListCrossConnectGroups operation type ListCrossConnectGroupsResponse struct { // The underlying http response RawResponse *http.Response - // The []CrossConnectGroup instance + // A list of []CrossConnectGroup instances Items []CrossConnectGroup `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -68,10 +90,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListCrossConnectGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListCrossConnectGroupsSortByEnum Enum with underlying type: string type ListCrossConnectGroupsSortByEnum string -// Set of constants representing the allowable values for ListCrossConnectGroupsSortBy +// Set of constants representing the allowable values for ListCrossConnectGroupsSortByEnum const ( ListCrossConnectGroupsSortByTimecreated ListCrossConnectGroupsSortByEnum = "TIMECREATED" ListCrossConnectGroupsSortByDisplayname ListCrossConnectGroupsSortByEnum = "DISPLAYNAME" @@ -82,7 +109,7 @@ "DISPLAYNAME": ListCrossConnectGroupsSortByDisplayname, } -// GetListCrossConnectGroupsSortByEnumValues Enumerates the set of values for ListCrossConnectGroupsSortBy +// GetListCrossConnectGroupsSortByEnumValues Enumerates the set of values for ListCrossConnectGroupsSortByEnum func GetListCrossConnectGroupsSortByEnumValues() []ListCrossConnectGroupsSortByEnum { values := make([]ListCrossConnectGroupsSortByEnum, 0) for _, v := range mappingListCrossConnectGroupsSortBy { @@ -94,7 +121,7 @@ // ListCrossConnectGroupsSortOrderEnum Enum with underlying type: string type ListCrossConnectGroupsSortOrderEnum string -// Set of constants representing the allowable values for ListCrossConnectGroupsSortOrder +// Set of constants representing the allowable values for ListCrossConnectGroupsSortOrderEnum const ( ListCrossConnectGroupsSortOrderAsc ListCrossConnectGroupsSortOrderEnum = "ASC" ListCrossConnectGroupsSortOrderDesc ListCrossConnectGroupsSortOrderEnum = "DESC" @@ -105,7 +132,7 @@ "DESC": ListCrossConnectGroupsSortOrderDesc, } -// GetListCrossConnectGroupsSortOrderEnumValues Enumerates the set of values for ListCrossConnectGroupsSortOrder +// GetListCrossConnectGroupsSortOrderEnumValues Enumerates the set of values for ListCrossConnectGroupsSortOrderEnum func GetListCrossConnectGroupsSortOrderEnumValues() []ListCrossConnectGroupsSortOrderEnum { values := make([]ListCrossConnectGroupsSortOrderEnum, 0) for _, v := range mappingListCrossConnectGroupsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_locations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_locations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_locations_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connect_locations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCrossConnectLocationsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCrossConnectLocationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCrossConnectLocationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCrossConnectLocationsResponse wrapper for the ListCrossConnectLocations operation type ListCrossConnectLocationsResponse struct { // The underlying http response RawResponse *http.Response - // The []CrossConnectLocation instance + // A list of []CrossConnectLocation instances Items []CrossConnectLocation `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListCrossConnectLocationsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCrossConnectLocationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_crossconnect_port_speed_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_crossconnect_port_speed_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_crossconnect_port_speed_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_crossconnect_port_speed_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCrossconnectPortSpeedShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCrossconnectPortSpeedShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCrossconnectPortSpeedShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCrossconnectPortSpeedShapesResponse wrapper for the ListCrossconnectPortSpeedShapes operation type ListCrossconnectPortSpeedShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []CrossConnectPortSpeedShape instance + // A list of []CrossConnectPortSpeedShape instances Items []CrossConnectPortSpeedShape `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListCrossconnectPortSpeedShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCrossconnectPortSpeedShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connects_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connects_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connects_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connects_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"false" contributesTo:"query" name:"crossConnectGroupId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListCrossConnectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState CrossConnectLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCrossConnectsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCrossConnectsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCrossConnectsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCrossConnectsResponse wrapper for the ListCrossConnects operation type ListCrossConnectsResponse struct { // The underlying http response RawResponse *http.Response - // The []CrossConnect instance + // A list of []CrossConnect instances Items []CrossConnect `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListCrossConnectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListCrossConnectsSortByEnum Enum with underlying type: string type ListCrossConnectsSortByEnum string -// Set of constants representing the allowable values for ListCrossConnectsSortBy +// Set of constants representing the allowable values for ListCrossConnectsSortByEnum const ( ListCrossConnectsSortByTimecreated ListCrossConnectsSortByEnum = "TIMECREATED" ListCrossConnectsSortByDisplayname ListCrossConnectsSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListCrossConnectsSortByDisplayname, } -// GetListCrossConnectsSortByEnumValues Enumerates the set of values for ListCrossConnectsSortBy +// GetListCrossConnectsSortByEnumValues Enumerates the set of values for ListCrossConnectsSortByEnum func GetListCrossConnectsSortByEnumValues() []ListCrossConnectsSortByEnum { values := make([]ListCrossConnectsSortByEnum, 0) for _, v := range mappingListCrossConnectsSortBy { @@ -97,7 +124,7 @@ // ListCrossConnectsSortOrderEnum Enum with underlying type: string type ListCrossConnectsSortOrderEnum string -// Set of constants representing the allowable values for ListCrossConnectsSortOrder +// Set of constants representing the allowable values for ListCrossConnectsSortOrderEnum const ( ListCrossConnectsSortOrderAsc ListCrossConnectsSortOrderEnum = "ASC" ListCrossConnectsSortOrderDesc ListCrossConnectsSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListCrossConnectsSortOrderDesc, } -// GetListCrossConnectsSortOrderEnumValues Enumerates the set of values for ListCrossConnectsSortOrder +// GetListCrossConnectsSortOrderEnumValues Enumerates the set of values for ListCrossConnectsSortOrderEnum func GetListCrossConnectsSortOrderEnumValues() []ListCrossConnectsSortOrderEnum { values := make([]ListCrossConnectsSortOrderEnum, 0) for _, v := range mappingListCrossConnectsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_dhcp_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_dhcp_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_dhcp_options_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_dhcp_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListDhcpOptionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState DhcpOptionsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDhcpOptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDhcpOptionsResponse wrapper for the ListDhcpOptions operation type ListDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response - // The []DhcpOptions instance + // A list of []DhcpOptions instances Items []DhcpOptions `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListDhcpOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListDhcpOptionsSortByEnum Enum with underlying type: string type ListDhcpOptionsSortByEnum string -// Set of constants representing the allowable values for ListDhcpOptionsSortBy +// Set of constants representing the allowable values for ListDhcpOptionsSortByEnum const ( ListDhcpOptionsSortByTimecreated ListDhcpOptionsSortByEnum = "TIMECREATED" ListDhcpOptionsSortByDisplayname ListDhcpOptionsSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListDhcpOptionsSortByDisplayname, } -// GetListDhcpOptionsSortByEnumValues Enumerates the set of values for ListDhcpOptionsSortBy +// GetListDhcpOptionsSortByEnumValues Enumerates the set of values for ListDhcpOptionsSortByEnum func GetListDhcpOptionsSortByEnumValues() []ListDhcpOptionsSortByEnum { values := make([]ListDhcpOptionsSortByEnum, 0) for _, v := range mappingListDhcpOptionsSortBy { @@ -97,7 +124,7 @@ // ListDhcpOptionsSortOrderEnum Enum with underlying type: string type ListDhcpOptionsSortOrderEnum string -// Set of constants representing the allowable values for ListDhcpOptionsSortOrder +// Set of constants representing the allowable values for ListDhcpOptionsSortOrderEnum const ( ListDhcpOptionsSortOrderAsc ListDhcpOptionsSortOrderEnum = "ASC" ListDhcpOptionsSortOrderDesc ListDhcpOptionsSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListDhcpOptionsSortOrderDesc, } -// GetListDhcpOptionsSortOrderEnumValues Enumerates the set of values for ListDhcpOptionsSortOrder +// GetListDhcpOptionsSortOrderEnumValues Enumerates the set of values for ListDhcpOptionsSortOrderEnum func GetListDhcpOptionsSortOrderEnumValues() []ListDhcpOptionsSortOrderEnum { values := make([]ListDhcpOptionsSortOrderEnum, 0) for _, v := range mappingListDhcpOptionsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drg_attachments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drg_attachments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drg_attachments_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drg_attachments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,30 +20,52 @@ // The OCID of the DRG. DrgId *string `mandatory:"false" contributesTo:"query" name:"drgId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDrgAttachmentsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDrgAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDrgAttachmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDrgAttachmentsResponse wrapper for the ListDrgAttachments operation type ListDrgAttachmentsResponse struct { // The underlying http response RawResponse *http.Response - // The []DrgAttachment instance + // A list of []DrgAttachment instances Items []DrgAttachment `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -54,3 +76,8 @@ func (response ListDrgAttachmentsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDrgAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drgs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drgs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drgs_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_drgs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDrgsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDrgsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDrgsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDrgsResponse wrapper for the ListDrgs operation type ListDrgsResponse struct { // The underlying http response RawResponse *http.Response - // The []Drg instance + // A list of []Drg instances Items []Drg `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListDrgsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDrgsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_services_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_services_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_services_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_services_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListFastConnectProviderServicesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListFastConnectProviderServicesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListFastConnectProviderServicesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListFastConnectProviderServicesResponse wrapper for the ListFastConnectProviderServices operation type ListFastConnectProviderServicesResponse struct { // The underlying http response RawResponse *http.Response - // The []FastConnectProviderService instance + // A list of []FastConnectProviderService instances Items []FastConnectProviderService `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListFastConnectProviderServicesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListFastConnectProviderServicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the provider service. ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListFastConnectProviderVirtualCircuitBandwidthShapesResponse wrapper for the ListFastConnectProviderVirtualCircuitBandwidthShapes operation type ListFastConnectProviderVirtualCircuitBandwidthShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []VirtualCircuitBandwidthShape instance + // A list of []VirtualCircuitBandwidthShape instances Items []VirtualCircuitBandwidthShape `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_images_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_images_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_images_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_images_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -28,20 +28,24 @@ // Shape name. Shape *string `mandatory:"false" contributesTo:"query" name:"shape"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListImagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -50,24 +54,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState ImageLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListImagesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListImagesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListImagesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListImagesResponse wrapper for the ListImages operation type ListImagesResponse struct { // The underlying http response RawResponse *http.Response - // The []Image instance + // A list of []Image instances Items []Image `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -79,10 +101,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListImagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListImagesSortByEnum Enum with underlying type: string type ListImagesSortByEnum string -// Set of constants representing the allowable values for ListImagesSortBy +// Set of constants representing the allowable values for ListImagesSortByEnum const ( ListImagesSortByTimecreated ListImagesSortByEnum = "TIMECREATED" ListImagesSortByDisplayname ListImagesSortByEnum = "DISPLAYNAME" @@ -93,7 +120,7 @@ "DISPLAYNAME": ListImagesSortByDisplayname, } -// GetListImagesSortByEnumValues Enumerates the set of values for ListImagesSortBy +// GetListImagesSortByEnumValues Enumerates the set of values for ListImagesSortByEnum func GetListImagesSortByEnumValues() []ListImagesSortByEnum { values := make([]ListImagesSortByEnum, 0) for _, v := range mappingListImagesSortBy { @@ -105,7 +132,7 @@ // ListImagesSortOrderEnum Enum with underlying type: string type ListImagesSortOrderEnum string -// Set of constants representing the allowable values for ListImagesSortOrder +// Set of constants representing the allowable values for ListImagesSortOrderEnum const ( ListImagesSortOrderAsc ListImagesSortOrderEnum = "ASC" ListImagesSortOrderDesc ListImagesSortOrderEnum = "DESC" @@ -116,7 +143,7 @@ "DESC": ListImagesSortOrderDesc, } -// GetListImagesSortOrderEnumValues Enumerates the set of values for ListImagesSortOrder +// GetListImagesSortOrderEnumValues Enumerates the set of values for ListImagesSortOrderEnum func GetListImagesSortOrderEnumValues() []ListImagesSortOrderEnum { values := make([]ListImagesSortOrderEnum, 0) for _, v := range mappingListImagesSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_configurations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_configurations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_configurations_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_configurations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListInstanceConfigurationsRequest wrapper for the ListInstanceConfigurations operation +type ListInstanceConfigurationsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListInstanceConfigurationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListInstanceConfigurationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListInstanceConfigurationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListInstanceConfigurationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstanceConfigurationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListInstanceConfigurationsResponse wrapper for the ListInstanceConfigurations operation +type ListInstanceConfigurationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []InstanceConfigurationSummary instances + Items []InstanceConfigurationSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListInstanceConfigurationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListInstanceConfigurationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListInstanceConfigurationsSortByEnum Enum with underlying type: string +type ListInstanceConfigurationsSortByEnum string + +// Set of constants representing the allowable values for ListInstanceConfigurationsSortByEnum +const ( + ListInstanceConfigurationsSortByTimecreated ListInstanceConfigurationsSortByEnum = "TIMECREATED" + ListInstanceConfigurationsSortByDisplayname ListInstanceConfigurationsSortByEnum = "DISPLAYNAME" +) + +var mappingListInstanceConfigurationsSortBy = map[string]ListInstanceConfigurationsSortByEnum{ + "TIMECREATED": ListInstanceConfigurationsSortByTimecreated, + "DISPLAYNAME": ListInstanceConfigurationsSortByDisplayname, +} + +// GetListInstanceConfigurationsSortByEnumValues Enumerates the set of values for ListInstanceConfigurationsSortByEnum +func GetListInstanceConfigurationsSortByEnumValues() []ListInstanceConfigurationsSortByEnum { + values := make([]ListInstanceConfigurationsSortByEnum, 0) + for _, v := range mappingListInstanceConfigurationsSortBy { + values = append(values, v) + } + return values +} + +// ListInstanceConfigurationsSortOrderEnum Enum with underlying type: string +type ListInstanceConfigurationsSortOrderEnum string + +// Set of constants representing the allowable values for ListInstanceConfigurationsSortOrderEnum +const ( + ListInstanceConfigurationsSortOrderAsc ListInstanceConfigurationsSortOrderEnum = "ASC" + ListInstanceConfigurationsSortOrderDesc ListInstanceConfigurationsSortOrderEnum = "DESC" +) + +var mappingListInstanceConfigurationsSortOrder = map[string]ListInstanceConfigurationsSortOrderEnum{ + "ASC": ListInstanceConfigurationsSortOrderAsc, + "DESC": ListInstanceConfigurationsSortOrderDesc, +} + +// GetListInstanceConfigurationsSortOrderEnumValues Enumerates the set of values for ListInstanceConfigurationsSortOrderEnum +func GetListInstanceConfigurationsSortOrderEnumValues() []ListInstanceConfigurationsSortOrderEnum { + values := make([]ListInstanceConfigurationsSortOrderEnum, 0) + for _, v := range mappingListInstanceConfigurationsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_console_connections_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_console_connections_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_console_connections_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_console_connections_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,30 +17,52 @@ // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListInstanceConsoleConnectionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListInstanceConsoleConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstanceConsoleConnectionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListInstanceConsoleConnectionsResponse wrapper for the ListInstanceConsoleConnections operation type ListInstanceConsoleConnectionsResponse struct { // The underlying http response RawResponse *http.Response - // The []InstanceConsoleConnection instance + // A list of []InstanceConsoleConnection instances Items []InstanceConsoleConnection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -51,3 +73,8 @@ func (response ListInstanceConsoleConnectionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListInstanceConsoleConnectionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_devices_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_devices_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_devices_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_devices_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListInstanceDevicesRequest wrapper for the ListInstanceDevices operation +type ListInstanceDevicesRequest struct { + + // The OCID of the instance. + InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` + + // A filter to return only available devices or only used devices. + IsAvailable *bool `mandatory:"false" contributesTo:"query" name:"isAvailable"` + + // A filter to return only devices that match the given name exactly. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListInstanceDevicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListInstanceDevicesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListInstanceDevicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListInstanceDevicesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstanceDevicesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListInstanceDevicesResponse wrapper for the ListInstanceDevices operation +type ListInstanceDevicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Device instances + Items []Device `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListInstanceDevicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListInstanceDevicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListInstanceDevicesSortByEnum Enum with underlying type: string +type ListInstanceDevicesSortByEnum string + +// Set of constants representing the allowable values for ListInstanceDevicesSortByEnum +const ( + ListInstanceDevicesSortByTimecreated ListInstanceDevicesSortByEnum = "TIMECREATED" + ListInstanceDevicesSortByDisplayname ListInstanceDevicesSortByEnum = "DISPLAYNAME" +) + +var mappingListInstanceDevicesSortBy = map[string]ListInstanceDevicesSortByEnum{ + "TIMECREATED": ListInstanceDevicesSortByTimecreated, + "DISPLAYNAME": ListInstanceDevicesSortByDisplayname, +} + +// GetListInstanceDevicesSortByEnumValues Enumerates the set of values for ListInstanceDevicesSortByEnum +func GetListInstanceDevicesSortByEnumValues() []ListInstanceDevicesSortByEnum { + values := make([]ListInstanceDevicesSortByEnum, 0) + for _, v := range mappingListInstanceDevicesSortBy { + values = append(values, v) + } + return values +} + +// ListInstanceDevicesSortOrderEnum Enum with underlying type: string +type ListInstanceDevicesSortOrderEnum string + +// Set of constants representing the allowable values for ListInstanceDevicesSortOrderEnum +const ( + ListInstanceDevicesSortOrderAsc ListInstanceDevicesSortOrderEnum = "ASC" + ListInstanceDevicesSortOrderDesc ListInstanceDevicesSortOrderEnum = "DESC" +) + +var mappingListInstanceDevicesSortOrder = map[string]ListInstanceDevicesSortOrderEnum{ + "ASC": ListInstanceDevicesSortOrderAsc, + "DESC": ListInstanceDevicesSortOrderDesc, +} + +// GetListInstanceDevicesSortOrderEnumValues Enumerates the set of values for ListInstanceDevicesSortOrderEnum +func GetListInstanceDevicesSortOrderEnumValues() []ListInstanceDevicesSortOrderEnum { + values := make([]ListInstanceDevicesSortOrderEnum, 0) + for _, v := range mappingListInstanceDevicesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pool_instances_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pool_instances_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pool_instances_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pool_instances_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListInstancePoolInstancesRequest wrapper for the ListInstancePoolInstances operation +type ListInstancePoolInstancesRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListInstancePoolInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListInstancePoolInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListInstancePoolInstancesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListInstancePoolInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstancePoolInstancesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListInstancePoolInstancesResponse wrapper for the ListInstancePoolInstances operation +type ListInstancePoolInstancesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []InstanceSummary instances + Items []InstanceSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListInstancePoolInstancesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListInstancePoolInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListInstancePoolInstancesSortByEnum Enum with underlying type: string +type ListInstancePoolInstancesSortByEnum string + +// Set of constants representing the allowable values for ListInstancePoolInstancesSortByEnum +const ( + ListInstancePoolInstancesSortByTimecreated ListInstancePoolInstancesSortByEnum = "TIMECREATED" + ListInstancePoolInstancesSortByDisplayname ListInstancePoolInstancesSortByEnum = "DISPLAYNAME" +) + +var mappingListInstancePoolInstancesSortBy = map[string]ListInstancePoolInstancesSortByEnum{ + "TIMECREATED": ListInstancePoolInstancesSortByTimecreated, + "DISPLAYNAME": ListInstancePoolInstancesSortByDisplayname, +} + +// GetListInstancePoolInstancesSortByEnumValues Enumerates the set of values for ListInstancePoolInstancesSortByEnum +func GetListInstancePoolInstancesSortByEnumValues() []ListInstancePoolInstancesSortByEnum { + values := make([]ListInstancePoolInstancesSortByEnum, 0) + for _, v := range mappingListInstancePoolInstancesSortBy { + values = append(values, v) + } + return values +} + +// ListInstancePoolInstancesSortOrderEnum Enum with underlying type: string +type ListInstancePoolInstancesSortOrderEnum string + +// Set of constants representing the allowable values for ListInstancePoolInstancesSortOrderEnum +const ( + ListInstancePoolInstancesSortOrderAsc ListInstancePoolInstancesSortOrderEnum = "ASC" + ListInstancePoolInstancesSortOrderDesc ListInstancePoolInstancesSortOrderEnum = "DESC" +) + +var mappingListInstancePoolInstancesSortOrder = map[string]ListInstancePoolInstancesSortOrderEnum{ + "ASC": ListInstancePoolInstancesSortOrderAsc, + "DESC": ListInstancePoolInstancesSortOrderDesc, +} + +// GetListInstancePoolInstancesSortOrderEnumValues Enumerates the set of values for ListInstancePoolInstancesSortOrderEnum +func GetListInstancePoolInstancesSortOrderEnumValues() []ListInstancePoolInstancesSortOrderEnum { + values := make([]ListInstancePoolInstancesSortOrderEnum, 0) + for _, v := range mappingListInstancePoolInstancesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pools_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pools_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pools_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pools_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListInstancePoolsRequest wrapper for the ListInstancePools operation +type ListInstancePoolsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListInstancePoolsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListInstancePoolsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState InstancePoolSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListInstancePoolsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListInstancePoolsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstancePoolsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListInstancePoolsResponse wrapper for the ListInstancePools operation +type ListInstancePoolsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []InstancePoolSummary instances + Items []InstancePoolSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListInstancePoolsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListInstancePoolsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListInstancePoolsSortByEnum Enum with underlying type: string +type ListInstancePoolsSortByEnum string + +// Set of constants representing the allowable values for ListInstancePoolsSortByEnum +const ( + ListInstancePoolsSortByTimecreated ListInstancePoolsSortByEnum = "TIMECREATED" + ListInstancePoolsSortByDisplayname ListInstancePoolsSortByEnum = "DISPLAYNAME" +) + +var mappingListInstancePoolsSortBy = map[string]ListInstancePoolsSortByEnum{ + "TIMECREATED": ListInstancePoolsSortByTimecreated, + "DISPLAYNAME": ListInstancePoolsSortByDisplayname, +} + +// GetListInstancePoolsSortByEnumValues Enumerates the set of values for ListInstancePoolsSortByEnum +func GetListInstancePoolsSortByEnumValues() []ListInstancePoolsSortByEnum { + values := make([]ListInstancePoolsSortByEnum, 0) + for _, v := range mappingListInstancePoolsSortBy { + values = append(values, v) + } + return values +} + +// ListInstancePoolsSortOrderEnum Enum with underlying type: string +type ListInstancePoolsSortOrderEnum string + +// Set of constants representing the allowable values for ListInstancePoolsSortOrderEnum +const ( + ListInstancePoolsSortOrderAsc ListInstancePoolsSortOrderEnum = "ASC" + ListInstancePoolsSortOrderDesc ListInstancePoolsSortOrderEnum = "DESC" +) + +var mappingListInstancePoolsSortOrder = map[string]ListInstancePoolsSortOrderEnum{ + "ASC": ListInstancePoolsSortOrderAsc, + "DESC": ListInstancePoolsSortOrderDesc, +} + +// GetListInstancePoolsSortOrderEnumValues Enumerates the set of values for ListInstancePoolsSortOrderEnum +func GetListInstancePoolsSortOrderEnumValues() []ListInstancePoolsSortOrderEnum { + values := make([]ListInstancePoolsSortOrderEnum, 0) + for _, v := range mappingListInstancePoolsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instances_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instances_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instances_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_instances_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,27 +14,31 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -43,24 +47,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState InstanceLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListInstancesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInstancesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListInstancesResponse wrapper for the ListInstances operation type ListInstancesResponse struct { // The underlying http response RawResponse *http.Response - // The []Instance instance + // A list of []Instance instances Items []Instance `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -72,10 +94,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListInstancesSortByEnum Enum with underlying type: string type ListInstancesSortByEnum string -// Set of constants representing the allowable values for ListInstancesSortBy +// Set of constants representing the allowable values for ListInstancesSortByEnum const ( ListInstancesSortByTimecreated ListInstancesSortByEnum = "TIMECREATED" ListInstancesSortByDisplayname ListInstancesSortByEnum = "DISPLAYNAME" @@ -86,7 +113,7 @@ "DISPLAYNAME": ListInstancesSortByDisplayname, } -// GetListInstancesSortByEnumValues Enumerates the set of values for ListInstancesSortBy +// GetListInstancesSortByEnumValues Enumerates the set of values for ListInstancesSortByEnum func GetListInstancesSortByEnumValues() []ListInstancesSortByEnum { values := make([]ListInstancesSortByEnum, 0) for _, v := range mappingListInstancesSortBy { @@ -98,7 +125,7 @@ // ListInstancesSortOrderEnum Enum with underlying type: string type ListInstancesSortOrderEnum string -// Set of constants representing the allowable values for ListInstancesSortOrder +// Set of constants representing the allowable values for ListInstancesSortOrderEnum const ( ListInstancesSortOrderAsc ListInstancesSortOrderEnum = "ASC" ListInstancesSortOrderDesc ListInstancesSortOrderEnum = "DESC" @@ -109,7 +136,7 @@ "DESC": ListInstancesSortOrderDesc, } -// GetListInstancesSortOrderEnumValues Enumerates the set of values for ListInstancesSortOrder +// GetListInstancesSortOrderEnumValues Enumerates the set of values for ListInstancesSortOrderEnum func GetListInstancesSortOrderEnumValues() []ListInstancesSortOrderEnum { values := make([]ListInstancesSortOrderEnum, 0) for _, v := range mappingListInstancesSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_internet_gateways_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_internet_gateways_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_internet_gateways_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_internet_gateways_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInternetGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState InternetGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListInternetGatewaysRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListInternetGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInternetGatewaysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListInternetGatewaysResponse wrapper for the ListInternetGateways operation type ListInternetGatewaysResponse struct { // The underlying http response RawResponse *http.Response - // The []InternetGateway instance + // A list of []InternetGateway instances Items []InternetGateway `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListInternetGatewaysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListInternetGatewaysSortByEnum Enum with underlying type: string type ListInternetGatewaysSortByEnum string -// Set of constants representing the allowable values for ListInternetGatewaysSortBy +// Set of constants representing the allowable values for ListInternetGatewaysSortByEnum const ( ListInternetGatewaysSortByTimecreated ListInternetGatewaysSortByEnum = "TIMECREATED" ListInternetGatewaysSortByDisplayname ListInternetGatewaysSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListInternetGatewaysSortByDisplayname, } -// GetListInternetGatewaysSortByEnumValues Enumerates the set of values for ListInternetGatewaysSortBy +// GetListInternetGatewaysSortByEnumValues Enumerates the set of values for ListInternetGatewaysSortByEnum func GetListInternetGatewaysSortByEnumValues() []ListInternetGatewaysSortByEnum { values := make([]ListInternetGatewaysSortByEnum, 0) for _, v := range mappingListInternetGatewaysSortBy { @@ -97,7 +124,7 @@ // ListInternetGatewaysSortOrderEnum Enum with underlying type: string type ListInternetGatewaysSortOrderEnum string -// Set of constants representing the allowable values for ListInternetGatewaysSortOrder +// Set of constants representing the allowable values for ListInternetGatewaysSortOrderEnum const ( ListInternetGatewaysSortOrderAsc ListInternetGatewaysSortOrderEnum = "ASC" ListInternetGatewaysSortOrderDesc ListInternetGatewaysSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListInternetGatewaysSortOrderDesc, } -// GetListInternetGatewaysSortOrderEnumValues Enumerates the set of values for ListInternetGatewaysSortOrder +// GetListInternetGatewaysSortOrderEnumValues Enumerates the set of values for ListInternetGatewaysSortOrderEnum func GetListInternetGatewaysSortOrderEnumValues() []ListInternetGatewaysSortOrderEnum { values := make([]ListInternetGatewaysSortOrderEnum, 0) for _, v := range mappingListInternetGatewaysSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connections_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connections_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connections_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connections_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -20,30 +20,52 @@ // The OCID of the CPE. CpeId *string `mandatory:"false" contributesTo:"query" name:"cpeId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListIPSecConnectionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListIPSecConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListIPSecConnectionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListIPSecConnectionsResponse wrapper for the ListIPSecConnections operation type ListIPSecConnectionsResponse struct { // The underlying http response RawResponse *http.Response - // The []IpSecConnection instance + // A list of []IpSecConnection instances Items []IpSecConnection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -54,3 +76,8 @@ func (response ListIPSecConnectionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListIPSecConnectionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connection_tunnels_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connection_tunnels_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connection_tunnels_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_i_p_sec_connection_tunnels_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListIPSecConnectionTunnelsRequest wrapper for the ListIPSecConnectionTunnels operation +type ListIPSecConnectionTunnelsRequest struct { + + // The OCID of the IPSec connection. + IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListIPSecConnectionTunnelsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListIPSecConnectionTunnelsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListIPSecConnectionTunnelsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListIPSecConnectionTunnelsResponse wrapper for the ListIPSecConnectionTunnels operation +type ListIPSecConnectionTunnelsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []IpSecConnectionTunnel instances + Items []IpSecConnectionTunnel `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListIPSecConnectionTunnelsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListIPSecConnectionTunnelsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_local_peering_gateways_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_local_peering_gateways_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_local_peering_gateways_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_local_peering_gateways_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,30 +17,52 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListLocalPeeringGatewaysRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListLocalPeeringGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLocalPeeringGatewaysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListLocalPeeringGatewaysResponse wrapper for the ListLocalPeeringGateways operation type ListLocalPeeringGatewaysResponse struct { // The underlying http response RawResponse *http.Response - // The []LocalPeeringGateway instance + // A list of []LocalPeeringGateway instances Items []LocalPeeringGateway `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -51,3 +73,8 @@ func (response ListLocalPeeringGatewaysResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListLocalPeeringGatewaysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_nat_gateways_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_nat_gateways_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_nat_gateways_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_nat_gateways_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListNatGatewaysRequest wrapper for the ListNatGateways operation +type ListNatGatewaysRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the VCN. + VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListNatGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListNatGatewaysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. + LifecycleState NatGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListNatGatewaysRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNatGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNatGatewaysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListNatGatewaysResponse wrapper for the ListNatGateways operation +type ListNatGatewaysResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NatGateway instances + Items []NatGateway `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListNatGatewaysResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNatGatewaysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNatGatewaysSortByEnum Enum with underlying type: string +type ListNatGatewaysSortByEnum string + +// Set of constants representing the allowable values for ListNatGatewaysSortByEnum +const ( + ListNatGatewaysSortByTimecreated ListNatGatewaysSortByEnum = "TIMECREATED" + ListNatGatewaysSortByDisplayname ListNatGatewaysSortByEnum = "DISPLAYNAME" +) + +var mappingListNatGatewaysSortBy = map[string]ListNatGatewaysSortByEnum{ + "TIMECREATED": ListNatGatewaysSortByTimecreated, + "DISPLAYNAME": ListNatGatewaysSortByDisplayname, +} + +// GetListNatGatewaysSortByEnumValues Enumerates the set of values for ListNatGatewaysSortByEnum +func GetListNatGatewaysSortByEnumValues() []ListNatGatewaysSortByEnum { + values := make([]ListNatGatewaysSortByEnum, 0) + for _, v := range mappingListNatGatewaysSortBy { + values = append(values, v) + } + return values +} + +// ListNatGatewaysSortOrderEnum Enum with underlying type: string +type ListNatGatewaysSortOrderEnum string + +// Set of constants representing the allowable values for ListNatGatewaysSortOrderEnum +const ( + ListNatGatewaysSortOrderAsc ListNatGatewaysSortOrderEnum = "ASC" + ListNatGatewaysSortOrderDesc ListNatGatewaysSortOrderEnum = "DESC" +) + +var mappingListNatGatewaysSortOrder = map[string]ListNatGatewaysSortOrderEnum{ + "ASC": ListNatGatewaysSortOrderAsc, + "DESC": ListNatGatewaysSortOrderDesc, +} + +// GetListNatGatewaysSortOrderEnumValues Enumerates the set of values for ListNatGatewaysSortOrderEnum +func GetListNatGatewaysSortOrderEnumValues() []ListNatGatewaysSortOrderEnum { + values := make([]ListNatGatewaysSortOrderEnum, 0) + for _, v := range mappingListNatGatewaysSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_private_ips_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_private_ips_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_private_ips_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_private_ips_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,11 +11,15 @@ // ListPrivateIpsRequest wrapper for the ListPrivateIps operation type ListPrivateIpsRequest struct { - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // An IP address. @@ -27,24 +31,42 @@ // The OCID of the VNIC. VnicId *string `mandatory:"false" contributesTo:"query" name:"vnicId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPrivateIpsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPrivateIpsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPrivateIpsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPrivateIpsResponse wrapper for the ListPrivateIps operation type ListPrivateIpsResponse struct { // The underlying http response RawResponse *http.Response - // The []PrivateIp instance + // A list of []PrivateIp instances Items []PrivateIp `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -55,3 +77,8 @@ func (response ListPrivateIpsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListPrivateIpsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_public_ips_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_public_ips_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_public_ips_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_public_ips_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,45 +11,72 @@ // ListPublicIpsRequest wrapper for the ListPublicIps operation type ListPublicIpsRequest struct { - // Whether the public IP is regional or specific to a particular Availability Domain. - // * `REGION`: The public IP exists within a region and can be assigned to a private IP - // in any Availability Domain in the region. Reserved public IPs have `scope` = `REGION`. - // * `AVAILABILITY_DOMAIN`: The public IP exists within the Availability Domain of the private IP + // Whether the public IP is regional or specific to a particular availability domain. + // * `REGION`: The public IP exists within a region and is assigned to a regional entity + // (such as a NatGateway), or can be assigned to a private IP + // in any availability domain in the region. Reserved public IPs have `scope` = `REGION`, as do + // ephemeral public IPs assigned to a regional entity. + // * `AVAILABILITY_DOMAIN`: The public IP exists within the availability domain of the entity // it's assigned to, which is specified by the `availabilityDomain` property of the public IP object. - // Ephemeral public IPs have `scope` = `AVAILABILITY_DOMAIN`. + // Ephemeral public IPs that are assigned to private IPs have `scope` = `AVAILABILITY_DOMAIN`. Scope ListPublicIpsScopeEnum `mandatory:"true" contributesTo:"query" name:"scope" omitEmpty:"true"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // A filter to return only public IPs that match given lifetime. + Lifetime ListPublicIpsLifetimeEnum `mandatory:"false" contributesTo:"query" name:"lifetime" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPublicIpsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPublicIpsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPublicIpsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPublicIpsResponse wrapper for the ListPublicIps operation type ListPublicIpsResponse struct { // The underlying http response RawResponse *http.Response - // The []PublicIp instance + // A list of []PublicIp instances Items []PublicIp `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -61,10 +88,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListPublicIpsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListPublicIpsScopeEnum Enum with underlying type: string type ListPublicIpsScopeEnum string -// Set of constants representing the allowable values for ListPublicIpsScope +// Set of constants representing the allowable values for ListPublicIpsScopeEnum const ( ListPublicIpsScopeRegion ListPublicIpsScopeEnum = "REGION" ListPublicIpsScopeAvailabilityDomain ListPublicIpsScopeEnum = "AVAILABILITY_DOMAIN" @@ -75,11 +107,34 @@ "AVAILABILITY_DOMAIN": ListPublicIpsScopeAvailabilityDomain, } -// GetListPublicIpsScopeEnumValues Enumerates the set of values for ListPublicIpsScope +// GetListPublicIpsScopeEnumValues Enumerates the set of values for ListPublicIpsScopeEnum func GetListPublicIpsScopeEnumValues() []ListPublicIpsScopeEnum { values := make([]ListPublicIpsScopeEnum, 0) for _, v := range mappingListPublicIpsScope { values = append(values, v) } return values +} + +// ListPublicIpsLifetimeEnum Enum with underlying type: string +type ListPublicIpsLifetimeEnum string + +// Set of constants representing the allowable values for ListPublicIpsLifetimeEnum +const ( + ListPublicIpsLifetimeEphemeral ListPublicIpsLifetimeEnum = "EPHEMERAL" + ListPublicIpsLifetimeReserved ListPublicIpsLifetimeEnum = "RESERVED" +) + +var mappingListPublicIpsLifetime = map[string]ListPublicIpsLifetimeEnum{ + "EPHEMERAL": ListPublicIpsLifetimeEphemeral, + "RESERVED": ListPublicIpsLifetimeReserved, +} + +// GetListPublicIpsLifetimeEnumValues Enumerates the set of values for ListPublicIpsLifetimeEnum +func GetListPublicIpsLifetimeEnumValues() []ListPublicIpsLifetimeEnum { + values := make([]ListPublicIpsLifetimeEnum, 0) + for _, v := range mappingListPublicIpsLifetime { + values = append(values, v) + } + return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_remote_peering_connections_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_remote_peering_connections_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_remote_peering_connections_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_remote_peering_connections_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,28 +17,52 @@ // The OCID of the DRG. DrgId *string `mandatory:"false" contributesTo:"query" name:"drgId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListRemotePeeringConnectionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListRemotePeeringConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRemotePeeringConnectionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListRemotePeeringConnectionsResponse wrapper for the ListRemotePeeringConnections operation type ListRemotePeeringConnectionsResponse struct { // The underlying http response RawResponse *http.Response - // The []RemotePeeringConnection instance + // A list of []RemotePeeringConnection instances Items []RemotePeeringConnection `presentIn:"body"` - // A pagination token to the start of the next page, if one exist. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -49,3 +73,8 @@ func (response ListRemotePeeringConnectionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListRemotePeeringConnectionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_route_tables_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_route_tables_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_route_tables_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_route_tables_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListRouteTablesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState RouteTableLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListRouteTablesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListRouteTablesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRouteTablesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListRouteTablesResponse wrapper for the ListRouteTables operation type ListRouteTablesResponse struct { // The underlying http response RawResponse *http.Response - // The []RouteTable instance + // A list of []RouteTable instances Items []RouteTable `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListRouteTablesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListRouteTablesSortByEnum Enum with underlying type: string type ListRouteTablesSortByEnum string -// Set of constants representing the allowable values for ListRouteTablesSortBy +// Set of constants representing the allowable values for ListRouteTablesSortByEnum const ( ListRouteTablesSortByTimecreated ListRouteTablesSortByEnum = "TIMECREATED" ListRouteTablesSortByDisplayname ListRouteTablesSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListRouteTablesSortByDisplayname, } -// GetListRouteTablesSortByEnumValues Enumerates the set of values for ListRouteTablesSortBy +// GetListRouteTablesSortByEnumValues Enumerates the set of values for ListRouteTablesSortByEnum func GetListRouteTablesSortByEnumValues() []ListRouteTablesSortByEnum { values := make([]ListRouteTablesSortByEnum, 0) for _, v := range mappingListRouteTablesSortBy { @@ -97,7 +124,7 @@ // ListRouteTablesSortOrderEnum Enum with underlying type: string type ListRouteTablesSortOrderEnum string -// Set of constants representing the allowable values for ListRouteTablesSortOrder +// Set of constants representing the allowable values for ListRouteTablesSortOrderEnum const ( ListRouteTablesSortOrderAsc ListRouteTablesSortOrderEnum = "ASC" ListRouteTablesSortOrderDesc ListRouteTablesSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListRouteTablesSortOrderDesc, } -// GetListRouteTablesSortOrderEnumValues Enumerates the set of values for ListRouteTablesSortOrder +// GetListRouteTablesSortOrderEnumValues Enumerates the set of values for ListRouteTablesSortOrderEnum func GetListRouteTablesSortOrderEnumValues() []ListRouteTablesSortOrderEnum { values := make([]ListRouteTablesSortOrderEnum, 0) for _, v := range mappingListRouteTablesSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_security_lists_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_security_lists_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_security_lists_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_security_lists_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListSecurityListsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState SecurityListLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSecurityListsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSecurityListsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSecurityListsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSecurityListsResponse wrapper for the ListSecurityLists operation type ListSecurityListsResponse struct { // The underlying http response RawResponse *http.Response - // The []SecurityList instance + // A list of []SecurityList instances Items []SecurityList `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListSecurityListsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListSecurityListsSortByEnum Enum with underlying type: string type ListSecurityListsSortByEnum string -// Set of constants representing the allowable values for ListSecurityListsSortBy +// Set of constants representing the allowable values for ListSecurityListsSortByEnum const ( ListSecurityListsSortByTimecreated ListSecurityListsSortByEnum = "TIMECREATED" ListSecurityListsSortByDisplayname ListSecurityListsSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListSecurityListsSortByDisplayname, } -// GetListSecurityListsSortByEnumValues Enumerates the set of values for ListSecurityListsSortBy +// GetListSecurityListsSortByEnumValues Enumerates the set of values for ListSecurityListsSortByEnum func GetListSecurityListsSortByEnumValues() []ListSecurityListsSortByEnum { values := make([]ListSecurityListsSortByEnum, 0) for _, v := range mappingListSecurityListsSortBy { @@ -97,7 +124,7 @@ // ListSecurityListsSortOrderEnum Enum with underlying type: string type ListSecurityListsSortOrderEnum string -// Set of constants representing the allowable values for ListSecurityListsSortOrder +// Set of constants representing the allowable values for ListSecurityListsSortOrderEnum const ( ListSecurityListsSortOrderAsc ListSecurityListsSortOrderEnum = "ASC" ListSecurityListsSortOrderDesc ListSecurityListsSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListSecurityListsSortOrderDesc, } -// GetListSecurityListsSortOrderEnumValues Enumerates the set of values for ListSecurityListsSortOrder +// GetListSecurityListsSortOrderEnumValues Enumerates the set of values for ListSecurityListsSortOrderEnum func GetListSecurityListsSortOrderEnumValues() []ListSecurityListsSortOrderEnum { values := make([]ListSecurityListsSortOrderEnum, 0) for _, v := range mappingListSecurityListsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_service_gateways_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_service_gateways_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_service_gateways_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_service_gateways_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListServiceGatewaysRequest wrapper for the ListServiceGateways operation +type ListServiceGatewaysRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the VCN. + VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListServiceGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListServiceGatewaysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState ServiceGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServiceGatewaysRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServiceGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServiceGatewaysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListServiceGatewaysResponse wrapper for the ListServiceGateways operation +type ListServiceGatewaysResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ServiceGateway instances + Items []ServiceGateway `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListServiceGatewaysResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServiceGatewaysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServiceGatewaysSortByEnum Enum with underlying type: string +type ListServiceGatewaysSortByEnum string + +// Set of constants representing the allowable values for ListServiceGatewaysSortByEnum +const ( + ListServiceGatewaysSortByTimecreated ListServiceGatewaysSortByEnum = "TIMECREATED" + ListServiceGatewaysSortByDisplayname ListServiceGatewaysSortByEnum = "DISPLAYNAME" +) + +var mappingListServiceGatewaysSortBy = map[string]ListServiceGatewaysSortByEnum{ + "TIMECREATED": ListServiceGatewaysSortByTimecreated, + "DISPLAYNAME": ListServiceGatewaysSortByDisplayname, +} + +// GetListServiceGatewaysSortByEnumValues Enumerates the set of values for ListServiceGatewaysSortByEnum +func GetListServiceGatewaysSortByEnumValues() []ListServiceGatewaysSortByEnum { + values := make([]ListServiceGatewaysSortByEnum, 0) + for _, v := range mappingListServiceGatewaysSortBy { + values = append(values, v) + } + return values +} + +// ListServiceGatewaysSortOrderEnum Enum with underlying type: string +type ListServiceGatewaysSortOrderEnum string + +// Set of constants representing the allowable values for ListServiceGatewaysSortOrderEnum +const ( + ListServiceGatewaysSortOrderAsc ListServiceGatewaysSortOrderEnum = "ASC" + ListServiceGatewaysSortOrderDesc ListServiceGatewaysSortOrderEnum = "DESC" +) + +var mappingListServiceGatewaysSortOrder = map[string]ListServiceGatewaysSortOrderEnum{ + "ASC": ListServiceGatewaysSortOrderAsc, + "DESC": ListServiceGatewaysSortOrderDesc, +} + +// GetListServiceGatewaysSortOrderEnumValues Enumerates the set of values for ListServiceGatewaysSortOrderEnum +func GetListServiceGatewaysSortOrderEnumValues() []ListServiceGatewaysSortOrderEnum { + values := make([]ListServiceGatewaysSortOrderEnum, 0) + for _, v := range mappingListServiceGatewaysSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_services_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_services_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_services_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_services_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListServicesRequest wrapper for the ListServices operation +type ListServicesRequest struct { + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServicesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServicesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListServicesResponse wrapper for the ListServices operation +type ListServicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Service instances + Items []Service `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListServicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,37 +14,59 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of an image. ImageId *string `mandatory:"false" contributesTo:"query" name:"imageId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListShapesResponse wrapper for the ListShapes operation type ListShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []Shape instance + // A list of []Shape instances Items []Shape `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -55,3 +77,8 @@ func (response ListShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_subnets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_subnets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_subnets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_subnets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,11 +17,15 @@ // The OCID of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -31,9 +35,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListSubnetsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +46,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState SubnetLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSubnetsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSubnetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSubnetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSubnetsResponse wrapper for the ListSubnets operation type ListSubnetsResponse struct { // The underlying http response RawResponse *http.Response - // The []Subnet instance + // A list of []Subnet instances Items []Subnet `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListSubnetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListSubnetsSortByEnum Enum with underlying type: string type ListSubnetsSortByEnum string -// Set of constants representing the allowable values for ListSubnetsSortBy +// Set of constants representing the allowable values for ListSubnetsSortByEnum const ( ListSubnetsSortByTimecreated ListSubnetsSortByEnum = "TIMECREATED" ListSubnetsSortByDisplayname ListSubnetsSortByEnum = "DISPLAYNAME" @@ -85,7 +112,7 @@ "DISPLAYNAME": ListSubnetsSortByDisplayname, } -// GetListSubnetsSortByEnumValues Enumerates the set of values for ListSubnetsSortBy +// GetListSubnetsSortByEnumValues Enumerates the set of values for ListSubnetsSortByEnum func GetListSubnetsSortByEnumValues() []ListSubnetsSortByEnum { values := make([]ListSubnetsSortByEnum, 0) for _, v := range mappingListSubnetsSortBy { @@ -97,7 +124,7 @@ // ListSubnetsSortOrderEnum Enum with underlying type: string type ListSubnetsSortOrderEnum string -// Set of constants representing the allowable values for ListSubnetsSortOrder +// Set of constants representing the allowable values for ListSubnetsSortOrderEnum const ( ListSubnetsSortOrderAsc ListSubnetsSortOrderEnum = "ASC" ListSubnetsSortOrderDesc ListSubnetsSortOrderEnum = "DESC" @@ -108,7 +135,7 @@ "DESC": ListSubnetsSortOrderDesc, } -// GetListSubnetsSortOrderEnumValues Enumerates the set of values for ListSubnetsSortOrder +// GetListSubnetsSortOrderEnumValues Enumerates the set of values for ListSubnetsSortOrderEnum func GetListSubnetsSortOrderEnumValues() []ListSubnetsSortOrderEnum { values := make([]ListSubnetsSortOrderEnum, 0) for _, v := range mappingListSubnetsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vcns_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vcns_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vcns_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vcns_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,11 +14,15 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -28,9 +32,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVcnsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -39,24 +43,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VcnLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVcnsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVcnsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVcnsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVcnsResponse wrapper for the ListVcns operation type ListVcnsResponse struct { // The underlying http response RawResponse *http.Response - // The []Vcn instance + // A list of []Vcn instances Items []Vcn `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -68,10 +90,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListVcnsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListVcnsSortByEnum Enum with underlying type: string type ListVcnsSortByEnum string -// Set of constants representing the allowable values for ListVcnsSortBy +// Set of constants representing the allowable values for ListVcnsSortByEnum const ( ListVcnsSortByTimecreated ListVcnsSortByEnum = "TIMECREATED" ListVcnsSortByDisplayname ListVcnsSortByEnum = "DISPLAYNAME" @@ -82,7 +109,7 @@ "DISPLAYNAME": ListVcnsSortByDisplayname, } -// GetListVcnsSortByEnumValues Enumerates the set of values for ListVcnsSortBy +// GetListVcnsSortByEnumValues Enumerates the set of values for ListVcnsSortByEnum func GetListVcnsSortByEnumValues() []ListVcnsSortByEnum { values := make([]ListVcnsSortByEnum, 0) for _, v := range mappingListVcnsSortBy { @@ -94,7 +121,7 @@ // ListVcnsSortOrderEnum Enum with underlying type: string type ListVcnsSortOrderEnum string -// Set of constants representing the allowable values for ListVcnsSortOrder +// Set of constants representing the allowable values for ListVcnsSortOrderEnum const ( ListVcnsSortOrderAsc ListVcnsSortOrderEnum = "ASC" ListVcnsSortOrderDesc ListVcnsSortOrderEnum = "DESC" @@ -105,7 +132,7 @@ "DESC": ListVcnsSortOrderDesc, } -// GetListVcnsSortOrderEnumValues Enumerates the set of values for ListVcnsSortOrder +// GetListVcnsSortOrderEnumValues Enumerates the set of values for ListVcnsSortOrderEnum func GetListVcnsSortOrderEnumValues() []ListVcnsSortOrderEnum { values := make([]ListVcnsSortOrderEnum, 0) for _, v := range mappingListVcnsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_bandwidth_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_bandwidth_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_bandwidth_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_bandwidth_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,30 +14,52 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitBandwidthShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVirtualCircuitBandwidthShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVirtualCircuitBandwidthShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVirtualCircuitBandwidthShapesResponse wrapper for the ListVirtualCircuitBandwidthShapes operation type ListVirtualCircuitBandwidthShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []VirtualCircuitBandwidthShape instance + // A list of []VirtualCircuitBandwidthShape instances Items []VirtualCircuitBandwidthShape `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -48,3 +70,8 @@ func (response ListVirtualCircuitBandwidthShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListVirtualCircuitBandwidthShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_public_prefixes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_public_prefixes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_public_prefixes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuit_public_prefixes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,12 +17,30 @@ // A filter to only return resources that match the given verification state. // The state value is case-insensitive. VerificationState VirtualCircuitPublicPrefixVerificationStateEnum `mandatory:"false" contributesTo:"query" name:"verificationState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVirtualCircuitPublicPrefixesResponse wrapper for the ListVirtualCircuitPublicPrefixes operation type ListVirtualCircuitPublicPrefixesResponse struct { @@ -40,3 +58,8 @@ func (response ListVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuits_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuits_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuits_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuits_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,11 +14,15 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -28,9 +32,9 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVirtualCircuitsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -39,24 +43,42 @@ // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState VirtualCircuitLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVirtualCircuitsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVirtualCircuitsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVirtualCircuitsResponse wrapper for the ListVirtualCircuits operation type ListVirtualCircuitsResponse struct { // The underlying http response RawResponse *http.Response - // The []VirtualCircuit instance + // A list of []VirtualCircuit instances Items []VirtualCircuit `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -68,10 +90,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListVirtualCircuitsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListVirtualCircuitsSortByEnum Enum with underlying type: string type ListVirtualCircuitsSortByEnum string -// Set of constants representing the allowable values for ListVirtualCircuitsSortBy +// Set of constants representing the allowable values for ListVirtualCircuitsSortByEnum const ( ListVirtualCircuitsSortByTimecreated ListVirtualCircuitsSortByEnum = "TIMECREATED" ListVirtualCircuitsSortByDisplayname ListVirtualCircuitsSortByEnum = "DISPLAYNAME" @@ -82,7 +109,7 @@ "DISPLAYNAME": ListVirtualCircuitsSortByDisplayname, } -// GetListVirtualCircuitsSortByEnumValues Enumerates the set of values for ListVirtualCircuitsSortBy +// GetListVirtualCircuitsSortByEnumValues Enumerates the set of values for ListVirtualCircuitsSortByEnum func GetListVirtualCircuitsSortByEnumValues() []ListVirtualCircuitsSortByEnum { values := make([]ListVirtualCircuitsSortByEnum, 0) for _, v := range mappingListVirtualCircuitsSortBy { @@ -94,7 +121,7 @@ // ListVirtualCircuitsSortOrderEnum Enum with underlying type: string type ListVirtualCircuitsSortOrderEnum string -// Set of constants representing the allowable values for ListVirtualCircuitsSortOrder +// Set of constants representing the allowable values for ListVirtualCircuitsSortOrderEnum const ( ListVirtualCircuitsSortOrderAsc ListVirtualCircuitsSortOrderEnum = "ASC" ListVirtualCircuitsSortOrderDesc ListVirtualCircuitsSortOrderEnum = "DESC" @@ -105,7 +132,7 @@ "DESC": ListVirtualCircuitsSortOrderDesc, } -// GetListVirtualCircuitsSortOrderEnumValues Enumerates the set of values for ListVirtualCircuitsSortOrder +// GetListVirtualCircuitsSortOrderEnumValues Enumerates the set of values for ListVirtualCircuitsSortOrderEnum func GetListVirtualCircuitsSortOrderEnumValues() []ListVirtualCircuitsSortOrderEnum { values := make([]ListVirtualCircuitsSortOrderEnum, 0) for _, v := range mappingListVirtualCircuitsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vnic_attachments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vnic_attachments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vnic_attachments_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_vnic_attachments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,40 +14,62 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the VNIC. VnicId *string `mandatory:"false" contributesTo:"query" name:"vnicId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVnicAttachmentsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVnicAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVnicAttachmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVnicAttachmentsResponse wrapper for the ListVnicAttachments operation type ListVnicAttachmentsResponse struct { // The underlying http response RawResponse *http.Response - // The []VnicAttachment instance + // A list of []VnicAttachment instances Items []VnicAttachment `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -58,3 +80,8 @@ func (response ListVnicAttachmentsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListVnicAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_attachments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_attachments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_attachments_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_attachments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,15 +14,19 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. @@ -30,24 +34,42 @@ // The OCID of the volume. VolumeId *string `mandatory:"false" contributesTo:"query" name:"volumeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVolumeAttachmentsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVolumeAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumeAttachmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVolumeAttachmentsResponse wrapper for the ListVolumeAttachments operation type ListVolumeAttachmentsResponse struct { // The underlying http response RawResponse *http.Response - // The []VolumeAttachment instance + // A list of []VolumeAttachment instances Items []VolumeAttachment `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -58,3 +80,8 @@ func (response ListVolumeAttachmentsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListVolumeAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backup_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backup_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backup_policies_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backup_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,30 +11,52 @@ // ListVolumeBackupPoliciesRequest wrapper for the ListVolumeBackupPolicies operation type ListVolumeBackupPoliciesRequest struct { - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVolumeBackupPoliciesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVolumeBackupPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumeBackupPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVolumeBackupPoliciesResponse wrapper for the ListVolumeBackupPolicies operation type ListVolumeBackupPoliciesResponse struct { // The underlying http response RawResponse *http.Response - // The []VolumeBackupPolicy instance + // A list of []VolumeBackupPolicy instances Items []VolumeBackupPolicy `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -45,3 +67,8 @@ func (response ListVolumeBackupPoliciesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListVolumeBackupPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backups_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -17,23 +17,30 @@ // The OCID of the volume. VolumeId *string `mandatory:"false" contributesTo:"query" name:"volumeId"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + // A filter to return only resources that originated from the given source volume backup. + SourceVolumeBackupId *string `mandatory:"false" contributesTo:"query" name:"sourceVolumeBackupId"` + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumeBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order @@ -42,24 +49,42 @@ // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VolumeBackupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVolumeBackupsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVolumeBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumeBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVolumeBackupsResponse wrapper for the ListVolumeBackups operation type ListVolumeBackupsResponse struct { // The underlying http response RawResponse *http.Response - // The []VolumeBackup instance + // A list of []VolumeBackup instances Items []VolumeBackup `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +96,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListVolumeBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListVolumeBackupsSortByEnum Enum with underlying type: string type ListVolumeBackupsSortByEnum string -// Set of constants representing the allowable values for ListVolumeBackupsSortBy +// Set of constants representing the allowable values for ListVolumeBackupsSortByEnum const ( ListVolumeBackupsSortByTimecreated ListVolumeBackupsSortByEnum = "TIMECREATED" ListVolumeBackupsSortByDisplayname ListVolumeBackupsSortByEnum = "DISPLAYNAME" @@ -85,7 +115,7 @@ "DISPLAYNAME": ListVolumeBackupsSortByDisplayname, } -// GetListVolumeBackupsSortByEnumValues Enumerates the set of values for ListVolumeBackupsSortBy +// GetListVolumeBackupsSortByEnumValues Enumerates the set of values for ListVolumeBackupsSortByEnum func GetListVolumeBackupsSortByEnumValues() []ListVolumeBackupsSortByEnum { values := make([]ListVolumeBackupsSortByEnum, 0) for _, v := range mappingListVolumeBackupsSortBy { @@ -97,7 +127,7 @@ // ListVolumeBackupsSortOrderEnum Enum with underlying type: string type ListVolumeBackupsSortOrderEnum string -// Set of constants representing the allowable values for ListVolumeBackupsSortOrder +// Set of constants representing the allowable values for ListVolumeBackupsSortOrderEnum const ( ListVolumeBackupsSortOrderAsc ListVolumeBackupsSortOrderEnum = "ASC" ListVolumeBackupsSortOrderDesc ListVolumeBackupsSortOrderEnum = "DESC" @@ -108,7 +138,7 @@ "DESC": ListVolumeBackupsSortOrderDesc, } -// GetListVolumeBackupsSortOrderEnumValues Enumerates the set of values for ListVolumeBackupsSortOrder +// GetListVolumeBackupsSortOrderEnumValues Enumerates the set of values for ListVolumeBackupsSortOrderEnum func GetListVolumeBackupsSortOrderEnumValues() []ListVolumeBackupsSortOrderEnum { values := make([]ListVolumeBackupsSortOrderEnum, 0) for _, v := range mappingListVolumeBackupsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_group_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_group_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_group_backups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_group_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListVolumeGroupBackupsRequest wrapper for the ListVolumeGroupBackups operation +type ListVolumeGroupBackupsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID of the volume group. + VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListVolumeGroupBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListVolumeGroupBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListVolumeGroupBackupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListVolumeGroupBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumeGroupBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListVolumeGroupBackupsResponse wrapper for the ListVolumeGroupBackups operation +type ListVolumeGroupBackupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []VolumeGroupBackup instances + Items []VolumeGroupBackup `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListVolumeGroupBackupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListVolumeGroupBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListVolumeGroupBackupsSortByEnum Enum with underlying type: string +type ListVolumeGroupBackupsSortByEnum string + +// Set of constants representing the allowable values for ListVolumeGroupBackupsSortByEnum +const ( + ListVolumeGroupBackupsSortByTimecreated ListVolumeGroupBackupsSortByEnum = "TIMECREATED" + ListVolumeGroupBackupsSortByDisplayname ListVolumeGroupBackupsSortByEnum = "DISPLAYNAME" +) + +var mappingListVolumeGroupBackupsSortBy = map[string]ListVolumeGroupBackupsSortByEnum{ + "TIMECREATED": ListVolumeGroupBackupsSortByTimecreated, + "DISPLAYNAME": ListVolumeGroupBackupsSortByDisplayname, +} + +// GetListVolumeGroupBackupsSortByEnumValues Enumerates the set of values for ListVolumeGroupBackupsSortByEnum +func GetListVolumeGroupBackupsSortByEnumValues() []ListVolumeGroupBackupsSortByEnum { + values := make([]ListVolumeGroupBackupsSortByEnum, 0) + for _, v := range mappingListVolumeGroupBackupsSortBy { + values = append(values, v) + } + return values +} + +// ListVolumeGroupBackupsSortOrderEnum Enum with underlying type: string +type ListVolumeGroupBackupsSortOrderEnum string + +// Set of constants representing the allowable values for ListVolumeGroupBackupsSortOrderEnum +const ( + ListVolumeGroupBackupsSortOrderAsc ListVolumeGroupBackupsSortOrderEnum = "ASC" + ListVolumeGroupBackupsSortOrderDesc ListVolumeGroupBackupsSortOrderEnum = "DESC" +) + +var mappingListVolumeGroupBackupsSortOrder = map[string]ListVolumeGroupBackupsSortOrderEnum{ + "ASC": ListVolumeGroupBackupsSortOrderAsc, + "DESC": ListVolumeGroupBackupsSortOrderDesc, +} + +// GetListVolumeGroupBackupsSortOrderEnumValues Enumerates the set of values for ListVolumeGroupBackupsSortOrderEnum +func GetListVolumeGroupBackupsSortOrderEnumValues() []ListVolumeGroupBackupsSortOrderEnum { + values := make([]ListVolumeGroupBackupsSortOrderEnum, 0) + for _, v := range mappingListVolumeGroupBackupsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_groups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_groups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_groups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volume_groups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListVolumeGroupsRequest wrapper for the ListVolumeGroups operation +type ListVolumeGroupsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The name of the availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListVolumeGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListVolumeGroupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState VolumeGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListVolumeGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListVolumeGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumeGroupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListVolumeGroupsResponse wrapper for the ListVolumeGroups operation +type ListVolumeGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []VolumeGroup instances + Items []VolumeGroup `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListVolumeGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListVolumeGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListVolumeGroupsSortByEnum Enum with underlying type: string +type ListVolumeGroupsSortByEnum string + +// Set of constants representing the allowable values for ListVolumeGroupsSortByEnum +const ( + ListVolumeGroupsSortByTimecreated ListVolumeGroupsSortByEnum = "TIMECREATED" + ListVolumeGroupsSortByDisplayname ListVolumeGroupsSortByEnum = "DISPLAYNAME" +) + +var mappingListVolumeGroupsSortBy = map[string]ListVolumeGroupsSortByEnum{ + "TIMECREATED": ListVolumeGroupsSortByTimecreated, + "DISPLAYNAME": ListVolumeGroupsSortByDisplayname, +} + +// GetListVolumeGroupsSortByEnumValues Enumerates the set of values for ListVolumeGroupsSortByEnum +func GetListVolumeGroupsSortByEnumValues() []ListVolumeGroupsSortByEnum { + values := make([]ListVolumeGroupsSortByEnum, 0) + for _, v := range mappingListVolumeGroupsSortBy { + values = append(values, v) + } + return values +} + +// ListVolumeGroupsSortOrderEnum Enum with underlying type: string +type ListVolumeGroupsSortOrderEnum string + +// Set of constants representing the allowable values for ListVolumeGroupsSortOrderEnum +const ( + ListVolumeGroupsSortOrderAsc ListVolumeGroupsSortOrderEnum = "ASC" + ListVolumeGroupsSortOrderDesc ListVolumeGroupsSortOrderEnum = "DESC" +) + +var mappingListVolumeGroupsSortOrder = map[string]ListVolumeGroupsSortOrderEnum{ + "ASC": ListVolumeGroupsSortOrderAsc, + "DESC": ListVolumeGroupsSortOrderDesc, +} + +// GetListVolumeGroupsSortOrderEnumValues Enumerates the set of values for ListVolumeGroupsSortOrderEnum +func GetListVolumeGroupsSortOrderEnumValues() []ListVolumeGroupsSortOrderEnum { + values := make([]ListVolumeGroupsSortOrderEnum, 0) + for _, v := range mappingListVolumeGroupsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volumes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volumes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volumes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/list_volumes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -14,15 +14,19 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The name of the Availability Domain. + // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. @@ -32,35 +36,56 @@ // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you - // optionally filter by Availability Domain if the scope of the resource type is within a - // single Availability Domain. If you call one of these "List" operations without specifying - // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVolumesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + // The OCID of the volume group. + VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VolumeLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListVolumesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListVolumesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVolumesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListVolumesResponse wrapper for the ListVolumes operation type ListVolumesResponse struct { // The underlying http response RawResponse *http.Response - // The []Volume instance + // A list of []Volume instances Items []Volume `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of + // results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -72,10 +97,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListVolumesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListVolumesSortByEnum Enum with underlying type: string type ListVolumesSortByEnum string -// Set of constants representing the allowable values for ListVolumesSortBy +// Set of constants representing the allowable values for ListVolumesSortByEnum const ( ListVolumesSortByTimecreated ListVolumesSortByEnum = "TIMECREATED" ListVolumesSortByDisplayname ListVolumesSortByEnum = "DISPLAYNAME" @@ -86,7 +116,7 @@ "DISPLAYNAME": ListVolumesSortByDisplayname, } -// GetListVolumesSortByEnumValues Enumerates the set of values for ListVolumesSortBy +// GetListVolumesSortByEnumValues Enumerates the set of values for ListVolumesSortByEnum func GetListVolumesSortByEnumValues() []ListVolumesSortByEnum { values := make([]ListVolumesSortByEnum, 0) for _, v := range mappingListVolumesSortBy { @@ -98,7 +128,7 @@ // ListVolumesSortOrderEnum Enum with underlying type: string type ListVolumesSortOrderEnum string -// Set of constants representing the allowable values for ListVolumesSortOrder +// Set of constants representing the allowable values for ListVolumesSortOrderEnum const ( ListVolumesSortOrderAsc ListVolumesSortOrderEnum = "ASC" ListVolumesSortOrderDesc ListVolumesSortOrderEnum = "DESC" @@ -109,7 +139,7 @@ "DESC": ListVolumesSortOrderDesc, } -// GetListVolumesSortOrderEnumValues Enumerates the set of values for ListVolumesSortOrder +// GetListVolumesSortOrderEnumValues Enumerates the set of values for ListVolumesSortOrderEnum func GetListVolumesSortOrderEnumValues() []ListVolumesSortOrderEnum { values := make([]ListVolumesSortOrderEnum, 0) for _, v := range mappingListVolumesSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/local_peering_gateway.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/local_peering_gateway.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/local_peering_gateway.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/local_peering_gateway.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,10 +20,12 @@ // with another VCN in the same region. *Peering* means that the two VCNs can // communicate using private IP addresses, but without the traffic traversing the // internet or routing through your on-premises network. For more information, -// see VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type LocalPeeringGateway struct { // The OCID of the compartment containing the LPG. @@ -51,15 +57,37 @@ // The OCID of the VCN the LPG belongs to. VcnId *string `mandatory:"true" json:"vcnId"` - // The range of IP addresses available on the VCN at the other + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN + // at the other end of the peering from this LPG. See `peerAdvertisedCidrDetails` for + // the individual CIDRs. The value is `null` if the LPG is not peered. + // Example: `192.168.0.0/16`, or if aggregated with `172.16.0.0/24` then `128.0.0.0/1` + PeerAdvertisedCidr *string `mandatory:"false" json:"peerAdvertisedCidr"` + + // The specific ranges of IP addresses available on or via the VCN at the other // end of the peering from this LPG. The value is `null` if the LPG is not peered. - // You can use this as the destination CIDR for a route rule to route a subnet's + // You can use these as destination CIDRs for route rules to route a subnet's // traffic to this LPG. - // Example: `192.168.0.0/16` - PeerAdvertisedCidr *string `mandatory:"false" json:"peerAdvertisedCidr"` + // Example: [`192.168.0.0/16`, `172.16.0.0/24`] + PeerAdvertisedCidrDetails []string `mandatory:"false" json:"peerAdvertisedCidrDetails"` // Additional information regarding the peering status, if applicable. PeeringStatusDetails *string `mandatory:"false" json:"peeringStatusDetails"` + + // The OCID of the route table the LPG is using. For information about why you + // would associate a route table with an LPG, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m LocalPeeringGateway) String() string { @@ -69,7 +97,7 @@ // LocalPeeringGatewayLifecycleStateEnum Enum with underlying type: string type LocalPeeringGatewayLifecycleStateEnum string -// Set of constants representing the allowable values for LocalPeeringGatewayLifecycleState +// Set of constants representing the allowable values for LocalPeeringGatewayLifecycleStateEnum const ( LocalPeeringGatewayLifecycleStateProvisioning LocalPeeringGatewayLifecycleStateEnum = "PROVISIONING" LocalPeeringGatewayLifecycleStateAvailable LocalPeeringGatewayLifecycleStateEnum = "AVAILABLE" @@ -84,7 +112,7 @@ "TERMINATED": LocalPeeringGatewayLifecycleStateTerminated, } -// GetLocalPeeringGatewayLifecycleStateEnumValues Enumerates the set of values for LocalPeeringGatewayLifecycleState +// GetLocalPeeringGatewayLifecycleStateEnumValues Enumerates the set of values for LocalPeeringGatewayLifecycleStateEnum func GetLocalPeeringGatewayLifecycleStateEnumValues() []LocalPeeringGatewayLifecycleStateEnum { values := make([]LocalPeeringGatewayLifecycleStateEnum, 0) for _, v := range mappingLocalPeeringGatewayLifecycleState { @@ -96,7 +124,7 @@ // LocalPeeringGatewayPeeringStatusEnum Enum with underlying type: string type LocalPeeringGatewayPeeringStatusEnum string -// Set of constants representing the allowable values for LocalPeeringGatewayPeeringStatus +// Set of constants representing the allowable values for LocalPeeringGatewayPeeringStatusEnum const ( LocalPeeringGatewayPeeringStatusInvalid LocalPeeringGatewayPeeringStatusEnum = "INVALID" LocalPeeringGatewayPeeringStatusNew LocalPeeringGatewayPeeringStatusEnum = "NEW" @@ -113,7 +141,7 @@ "REVOKED": LocalPeeringGatewayPeeringStatusRevoked, } -// GetLocalPeeringGatewayPeeringStatusEnumValues Enumerates the set of values for LocalPeeringGatewayPeeringStatus +// GetLocalPeeringGatewayPeeringStatusEnumValues Enumerates the set of values for LocalPeeringGatewayPeeringStatusEnum func GetLocalPeeringGatewayPeeringStatusEnumValues() []LocalPeeringGatewayPeeringStatusEnum { values := make([]LocalPeeringGatewayPeeringStatusEnum, 0) for _, v := range mappingLocalPeeringGatewayPeeringStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/nat_gateway.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/nat_gateway.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/nat_gateway.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/nat_gateway.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NatGateway A NAT (Network Address Translation) gateway, which represents a router that lets instances +// without public IPs contact the public internet without exposing the instance to inbound +// internet traffic. For more information, see +// NAT Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/NATgateway.htm). +// To use any of the API operations, you must be authorized in an +// IAM policy. If you are not authorized, talk to an +// administrator. If you are an administrator who needs to write +// policies to give users access, see Getting Started with +// Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. +type NatGateway struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains + // the NAT gateway. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the NAT gateway. + Id *string `mandatory:"true" json:"id"` + + // Whether the NAT gateway blocks traffic through it. The default is `false`. + // Example: `true` + BlockTraffic *bool `mandatory:"true" json:"blockTraffic"` + + // The NAT gateway's current state. + LifecycleState NatGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The IP address associated with the NAT gateway. + NatIp *string `mandatory:"true" json:"natIp"` + + // The date and time the NAT gateway was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the NAT gateway + // belongs to. + VcnId *string `mandatory:"true" json:"vcnId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m NatGateway) String() string { + return common.PointerString(m) +} + +// NatGatewayLifecycleStateEnum Enum with underlying type: string +type NatGatewayLifecycleStateEnum string + +// Set of constants representing the allowable values for NatGatewayLifecycleStateEnum +const ( + NatGatewayLifecycleStateProvisioning NatGatewayLifecycleStateEnum = "PROVISIONING" + NatGatewayLifecycleStateAvailable NatGatewayLifecycleStateEnum = "AVAILABLE" + NatGatewayLifecycleStateTerminating NatGatewayLifecycleStateEnum = "TERMINATING" + NatGatewayLifecycleStateTerminated NatGatewayLifecycleStateEnum = "TERMINATED" +) + +var mappingNatGatewayLifecycleState = map[string]NatGatewayLifecycleStateEnum{ + "PROVISIONING": NatGatewayLifecycleStateProvisioning, + "AVAILABLE": NatGatewayLifecycleStateAvailable, + "TERMINATING": NatGatewayLifecycleStateTerminating, + "TERMINATED": NatGatewayLifecycleStateTerminated, +} + +// GetNatGatewayLifecycleStateEnumValues Enumerates the set of values for NatGatewayLifecycleStateEnum +func GetNatGatewayLifecycleStateEnumValues() []NatGatewayLifecycleStateEnum { + values := make([]NatGatewayLifecycleStateEnum, 0) + for _, v := range mappingNatGatewayLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/paravirtualized_volume_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/paravirtualized_volume_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/paravirtualized_volume_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/paravirtualized_volume_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ // ParavirtualizedVolumeAttachment A paravirtualized volume attachment. type ParavirtualizedVolumeAttachment struct { - // The Availability Domain of an instance. + // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -36,6 +40,9 @@ // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` + // The device name. + Device *string `mandatory:"false" json:"device"` + // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` @@ -44,6 +51,9 @@ // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` + // The current state of the volume attachment. LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } @@ -58,6 +68,11 @@ return m.CompartmentId } +//GetDevice returns Device +func (m ParavirtualizedVolumeAttachment) GetDevice() *string { + return m.Device +} + //GetDisplayName returns DisplayName func (m ParavirtualizedVolumeAttachment) GetDisplayName() *string { return m.DisplayName @@ -93,6 +108,11 @@ return m.VolumeId } +//GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled +func (m ParavirtualizedVolumeAttachment) GetIsPvEncryptionInTransitEnabled() *bool { + return m.IsPvEncryptionInTransitEnabled +} + func (m ParavirtualizedVolumeAttachment) String() string { return common.PointerString(m) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/peer_region_for_remote_peering.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/peer_region_for_remote_peering.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/peer_region_for_remote_peering.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/peer_region_for_remote_peering.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,7 @@ "github.com/oracle/oci-go-sdk/common" ) -// PeerRegionForRemotePeering Details about a region that supports remote VCN peering. For more information, see VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// PeerRegionForRemotePeering Details about a region that supports remote VCN peering. For more information, see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). type PeerRegionForRemotePeering struct { // The region's name. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/port_range.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/port_range.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/port_range.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/port_range.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/private_ip.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/private_ip.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/private_ip.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/private_ip.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,8 +16,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// PrivateIp A *private IP* is a conceptual term that refers to a private IP address and related properties. +// PrivateIp A *private IP* is a conceptual term that refers to an IPv4 private IP address and related properties. // The `privateIp` object is the API representation of a private IP. +// // Each instance has a *primary private IP* that is automatically created and // assigned to the primary VNIC during instance launch. If you add a secondary // VNIC to the instance, it also automatically gets a primary private IP. You @@ -21,7 +26,7 @@ // automatically deleted when the VNIC is terminated. // You can add *secondary private IPs* to a VNIC after it's created. For more // information, see the `privateIp` operations and also -// IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPaddresses.htm). +// IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // **Note:** Only // ListPrivateIps and // GetPrivateIp work with @@ -34,10 +39,13 @@ // for a primary private IP, you use UpdateVnic. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type PrivateIp struct { - // The private IP's Availability Domain. + // The private IP's availability domain. This attribute will be null if this is a *secondary* + // private IP assigned to a VNIC that is in a *regional* subnet. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` @@ -45,7 +53,7 @@ CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -55,7 +63,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -66,7 +74,7 @@ // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/public_ip.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/public_ip.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/public_ip.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/public_ip.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,24 +22,46 @@ // 1. Ephemeral // 2. Reserved // For more information and comparison of the two types, -// see Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). +// see Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type PublicIp struct { - // The public IP's Availability Domain. This property is set only for ephemeral public IPs - // (that is, when the `scope` of the public IP is set to AVAILABILITY_DOMAIN). The value - // is the Availability Domain of the assigned private IP. + // The OCID of the entity the public IP is assigned to, or in the process of + // being assigned to. + AssignedEntityId *string `mandatory:"false" json:"assignedEntityId"` + + // The type of entity the public IP is assigned to, or in the process of being + // assigned to. + AssignedEntityType PublicIpAssignedEntityTypeEnum `mandatory:"false" json:"assignedEntityType,omitempty"` + + // The public IP's availability domain. This property is set only for ephemeral public IPs + // that are assigned to a private IP (that is, when the `scope` of the public IP is set to + // AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // The OCID of the compartment containing the public IP. For an ephemeral public IP, this is - // the same compartment as the private IP's. For a reserved public IP that is currently assigned, - // this can be a different compartment than the assigned private IP's. + // the compartment of its assigned entity (which can be a private IP or a regional entity such + // as a NAT gateway). For a reserved public IP that is currently assigned, + // its compartment can be different from the assigned private IP's. CompartmentId *string `mandatory:"false" json:"compartmentId"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The public IP's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` @@ -47,26 +73,33 @@ LifecycleState PublicIpLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // Defines when the public IP is deleted and released back to Oracle's public IP pool. - // * `EPHEMERAL`: The lifetime is tied to the lifetime of its assigned private IP. The - // ephemeral public IP is automatically deleted when its private IP is deleted, when - // the VNIC is terminated, or when the instance is terminated. An ephemeral - // public IP must always be assigned to a private IP. + // * `EPHEMERAL`: The lifetime is tied to the lifetime of its assigned entity. An ephemeral + // public IP must always be assigned to an entity. If the assigned entity is a private IP, + // the ephemeral public IP is automatically deleted when the private IP is deleted, when + // the VNIC is terminated, or when the instance is terminated. If the assigned entity is a + // NatGateway, the ephemeral public IP is automatically + // deleted when the NAT gateway is terminated. // * `RESERVED`: You control the public IP's lifetime. You can delete a reserved public IP // whenever you like. It does not need to be assigned to a private IP at all times. // For more information and comparison of the two types, - // see Public IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm). + // see Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). Lifetime PublicIpLifetimeEnum `mandatory:"false" json:"lifetime,omitempty"` + // Deprecated. Use `assignedEntityId` instead. // The OCID of the private IP that the public IP is currently assigned to, or in the // process of being assigned to. + // **Note:** This is `null` if the public IP is not assigned to a private IP, or is + // in the process of being assigned to one. PrivateIpId *string `mandatory:"false" json:"privateIpId"` - // Whether the public IP is regional or specific to a particular Availability Domain. - // * `REGION`: The public IP exists within a region and can be assigned to a private IP - // in any Availability Domain in the region. Reserved public IPs have `scope` = `REGION`. - // * `AVAILABILITY_DOMAIN`: The public IP exists within the Availability Domain of the private IP + // Whether the public IP is regional or specific to a particular availability domain. + // * `REGION`: The public IP exists within a region and is assigned to a regional entity + // (such as a NatGateway), or can be assigned to a private + // IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs + // assigned to a regional entity have `scope` = `REGION`. + // * `AVAILABILITY_DOMAIN`: The public IP exists within the availability domain of the entity // it's assigned to, which is specified by the `availabilityDomain` property of the public IP object. - // Ephemeral public IPs have `scope` = `AVAILABILITY_DOMAIN`. + // Ephemeral public IPs that are assigned to private IPs have `scope` = `AVAILABILITY_DOMAIN`. Scope PublicIpScopeEnum `mandatory:"false" json:"scope,omitempty"` // The date and time the public IP was created, in the format defined by RFC3339. @@ -78,10 +111,33 @@ return common.PointerString(m) } +// PublicIpAssignedEntityTypeEnum Enum with underlying type: string +type PublicIpAssignedEntityTypeEnum string + +// Set of constants representing the allowable values for PublicIpAssignedEntityTypeEnum +const ( + PublicIpAssignedEntityTypePrivateIp PublicIpAssignedEntityTypeEnum = "PRIVATE_IP" + PublicIpAssignedEntityTypeNatGateway PublicIpAssignedEntityTypeEnum = "NAT_GATEWAY" +) + +var mappingPublicIpAssignedEntityType = map[string]PublicIpAssignedEntityTypeEnum{ + "PRIVATE_IP": PublicIpAssignedEntityTypePrivateIp, + "NAT_GATEWAY": PublicIpAssignedEntityTypeNatGateway, +} + +// GetPublicIpAssignedEntityTypeEnumValues Enumerates the set of values for PublicIpAssignedEntityTypeEnum +func GetPublicIpAssignedEntityTypeEnumValues() []PublicIpAssignedEntityTypeEnum { + values := make([]PublicIpAssignedEntityTypeEnum, 0) + for _, v := range mappingPublicIpAssignedEntityType { + values = append(values, v) + } + return values +} + // PublicIpLifecycleStateEnum Enum with underlying type: string type PublicIpLifecycleStateEnum string -// Set of constants representing the allowable values for PublicIpLifecycleState +// Set of constants representing the allowable values for PublicIpLifecycleStateEnum const ( PublicIpLifecycleStateProvisioning PublicIpLifecycleStateEnum = "PROVISIONING" PublicIpLifecycleStateAvailable PublicIpLifecycleStateEnum = "AVAILABLE" @@ -104,7 +160,7 @@ "TERMINATED": PublicIpLifecycleStateTerminated, } -// GetPublicIpLifecycleStateEnumValues Enumerates the set of values for PublicIpLifecycleState +// GetPublicIpLifecycleStateEnumValues Enumerates the set of values for PublicIpLifecycleStateEnum func GetPublicIpLifecycleStateEnumValues() []PublicIpLifecycleStateEnum { values := make([]PublicIpLifecycleStateEnum, 0) for _, v := range mappingPublicIpLifecycleState { @@ -116,7 +172,7 @@ // PublicIpLifetimeEnum Enum with underlying type: string type PublicIpLifetimeEnum string -// Set of constants representing the allowable values for PublicIpLifetime +// Set of constants representing the allowable values for PublicIpLifetimeEnum const ( PublicIpLifetimeEphemeral PublicIpLifetimeEnum = "EPHEMERAL" PublicIpLifetimeReserved PublicIpLifetimeEnum = "RESERVED" @@ -127,7 +183,7 @@ "RESERVED": PublicIpLifetimeReserved, } -// GetPublicIpLifetimeEnumValues Enumerates the set of values for PublicIpLifetime +// GetPublicIpLifetimeEnumValues Enumerates the set of values for PublicIpLifetimeEnum func GetPublicIpLifetimeEnumValues() []PublicIpLifetimeEnum { values := make([]PublicIpLifetimeEnum, 0) for _, v := range mappingPublicIpLifetime { @@ -139,7 +195,7 @@ // PublicIpScopeEnum Enum with underlying type: string type PublicIpScopeEnum string -// Set of constants representing the allowable values for PublicIpScope +// Set of constants representing the allowable values for PublicIpScopeEnum const ( PublicIpScopeRegion PublicIpScopeEnum = "REGION" PublicIpScopeAvailabilityDomain PublicIpScopeEnum = "AVAILABILITY_DOMAIN" @@ -150,7 +206,7 @@ "AVAILABILITY_DOMAIN": PublicIpScopeAvailabilityDomain, } -// GetPublicIpScopeEnumValues Enumerates the set of values for PublicIpScope +// GetPublicIpScopeEnumValues Enumerates the set of values for PublicIpScopeEnum func GetPublicIpScopeEnumValues() []PublicIpScopeEnum { values := make([]PublicIpScopeEnum, 0) for _, v := range mappingPublicIpScope { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/remote_peering_connection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/remote_peering_connection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/remote_peering_connection.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/remote_peering_connection.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,10 +20,12 @@ // to the DRG peer with a VCN in a different region. *Peering* means that the two VCNs can // communicate using private IP addresses, but without the traffic traversing the internet or // routing through your on-premises network. For more information, see -// VCN Peering (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/VCNpeering.htm). +// VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type RemotePeeringConnection struct { // The OCID of the compartment that contains the RPC. @@ -69,7 +75,7 @@ // RemotePeeringConnectionLifecycleStateEnum Enum with underlying type: string type RemotePeeringConnectionLifecycleStateEnum string -// Set of constants representing the allowable values for RemotePeeringConnectionLifecycleState +// Set of constants representing the allowable values for RemotePeeringConnectionLifecycleStateEnum const ( RemotePeeringConnectionLifecycleStateAvailable RemotePeeringConnectionLifecycleStateEnum = "AVAILABLE" RemotePeeringConnectionLifecycleStateProvisioning RemotePeeringConnectionLifecycleStateEnum = "PROVISIONING" @@ -84,7 +90,7 @@ "TERMINATED": RemotePeeringConnectionLifecycleStateTerminated, } -// GetRemotePeeringConnectionLifecycleStateEnumValues Enumerates the set of values for RemotePeeringConnectionLifecycleState +// GetRemotePeeringConnectionLifecycleStateEnumValues Enumerates the set of values for RemotePeeringConnectionLifecycleStateEnum func GetRemotePeeringConnectionLifecycleStateEnumValues() []RemotePeeringConnectionLifecycleStateEnum { values := make([]RemotePeeringConnectionLifecycleStateEnum, 0) for _, v := range mappingRemotePeeringConnectionLifecycleState { @@ -96,7 +102,7 @@ // RemotePeeringConnectionPeeringStatusEnum Enum with underlying type: string type RemotePeeringConnectionPeeringStatusEnum string -// Set of constants representing the allowable values for RemotePeeringConnectionPeeringStatus +// Set of constants representing the allowable values for RemotePeeringConnectionPeeringStatusEnum const ( RemotePeeringConnectionPeeringStatusInvalid RemotePeeringConnectionPeeringStatusEnum = "INVALID" RemotePeeringConnectionPeeringStatusNew RemotePeeringConnectionPeeringStatusEnum = "NEW" @@ -113,7 +119,7 @@ "REVOKED": RemotePeeringConnectionPeeringStatusRevoked, } -// GetRemotePeeringConnectionPeeringStatusEnumValues Enumerates the set of values for RemotePeeringConnectionPeeringStatus +// GetRemotePeeringConnectionPeeringStatusEnumValues Enumerates the set of values for RemotePeeringConnectionPeeringStatusEnum func GetRemotePeeringConnectionPeeringStatusEnumValues() []RemotePeeringConnectionPeeringStatusEnum { values := make([]RemotePeeringConnectionPeeringStatusEnum, 0) for _, v := range mappingRemotePeeringConnectionPeeringStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/reset_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/reset_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/reset_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/reset_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ResetInstancePoolRequest wrapper for the ResetInstancePool operation +type ResetInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ResetInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ResetInstancePoolResponse wrapper for the ResetInstancePool operation +type ResetInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ResetInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResetInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_rule.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,17 +20,59 @@ // packets to (a target). type RouteRule struct { + // The OCID for the route rule's target. For information about the type of + // targets you can specify, see + // Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). + NetworkEntityId *string `mandatory:"true" json:"networkEntityId"` + + // Deprecated. Instead use `destination` and `destinationType`. Requests that include both + // `cidrBlock` and `destination` will be rejected. // A destination IP address range in CIDR notation. Matching packets will // be routed to the indicated network entity (the target). + // // Example: `0.0.0.0/0` - CidrBlock *string `mandatory:"true" json:"cidrBlock"` + CidrBlock *string `mandatory:"false" json:"cidrBlock"` - // The OCID for the route rule's target. For information about the type of - // targets you can specify, see - // Route Tables (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). - NetworkEntityId *string `mandatory:"true" json:"networkEntityId"` + // Conceptually, this is the range of IP addresses used for matching when routing + // traffic. Required if you provide a `destinationType`. + // Allowed values: + // * IP address range in CIDR notation. For example: `192.168.1.0/24` + // * The `cidrBlock` value for a Service, if you're + // setting up a route rule for traffic destined for a particular `Service` through + // a service gateway. For example: `oci-phx-objectstorage`. + Destination *string `mandatory:"false" json:"destination"` + + // Type of destination for the rule. Required if you provide a `destination`. + // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. + // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a + // Service (the rule is for traffic destined for a + // particular `Service` through a service gateway). + DestinationType RouteRuleDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` } func (m RouteRule) String() string { return common.PointerString(m) } + +// RouteRuleDestinationTypeEnum Enum with underlying type: string +type RouteRuleDestinationTypeEnum string + +// Set of constants representing the allowable values for RouteRuleDestinationTypeEnum +const ( + RouteRuleDestinationTypeCidrBlock RouteRuleDestinationTypeEnum = "CIDR_BLOCK" + RouteRuleDestinationTypeServiceCidrBlock RouteRuleDestinationTypeEnum = "SERVICE_CIDR_BLOCK" +) + +var mappingRouteRuleDestinationType = map[string]RouteRuleDestinationTypeEnum{ + "CIDR_BLOCK": RouteRuleDestinationTypeCidrBlock, + "SERVICE_CIDR_BLOCK": RouteRuleDestinationTypeServiceCidrBlock, +} + +// GetRouteRuleDestinationTypeEnumValues Enumerates the set of values for RouteRuleDestinationTypeEnum +func GetRouteRuleDestinationTypeEnumValues() []RouteRuleDestinationTypeEnum { + values := make([]RouteRuleDestinationTypeEnum, 0) + for _, v := range mappingRouteRuleDestinationType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_table.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_table.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_table.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/route_table.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -14,10 +18,12 @@ // RouteTable A collection of `RouteRule` objects, which are used to route packets // based on destination IP to a particular network entity. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type RouteTable struct { // The OCID of the compartment containing the route table. @@ -36,7 +42,7 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -46,7 +52,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -62,7 +68,7 @@ // RouteTableLifecycleStateEnum Enum with underlying type: string type RouteTableLifecycleStateEnum string -// Set of constants representing the allowable values for RouteTableLifecycleState +// Set of constants representing the allowable values for RouteTableLifecycleStateEnum const ( RouteTableLifecycleStateProvisioning RouteTableLifecycleStateEnum = "PROVISIONING" RouteTableLifecycleStateAvailable RouteTableLifecycleStateEnum = "AVAILABLE" @@ -77,7 +83,7 @@ "TERMINATED": RouteTableLifecycleStateTerminated, } -// GetRouteTableLifecycleStateEnumValues Enumerates the set of values for RouteTableLifecycleState +// GetRouteTableLifecycleStateEnumValues Enumerates the set of values for RouteTableLifecycleStateEnum func GetRouteTableLifecycleStateEnumValues() []RouteTableLifecycleStateEnum { values := make([]RouteTableLifecycleStateEnum, 0) for _, v := range mappingRouteTableLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/security_list.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/security_list.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/security_list.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/security_list.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,14 +19,16 @@ // SecurityList A set of virtual firewall rules for your VCN. Security lists are configured at the subnet // level, but the rules are applied to the ingress and egress traffic for the individual instances // in the subnet. The rules can be stateful or stateless. For more information, see -// Security Lists (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). +// Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // **Important:** Oracle Cloud Infrastructure Compute service images automatically include firewall rules (for example, // Linux iptables, Windows firewall). If there are issues with some type of access to an instance, // make sure both the security lists associated with the instance's subnet and the instance's // firewall rules are set correctly. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type SecurityList struct { // The OCID of the compartment containing the security list. @@ -52,13 +58,13 @@ VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -70,7 +76,7 @@ // SecurityListLifecycleStateEnum Enum with underlying type: string type SecurityListLifecycleStateEnum string -// Set of constants representing the allowable values for SecurityListLifecycleState +// Set of constants representing the allowable values for SecurityListLifecycleStateEnum const ( SecurityListLifecycleStateProvisioning SecurityListLifecycleStateEnum = "PROVISIONING" SecurityListLifecycleStateAvailable SecurityListLifecycleStateEnum = "AVAILABLE" @@ -85,7 +91,7 @@ "TERMINATED": SecurityListLifecycleStateTerminated, } -// GetSecurityListLifecycleStateEnumValues Enumerates the set of values for SecurityListLifecycleState +// GetSecurityListLifecycleStateEnumValues Enumerates the set of values for SecurityListLifecycleStateEnum func GetSecurityListLifecycleStateEnumValues() []SecurityListLifecycleStateEnum { values := make([]SecurityListLifecycleStateEnum, 0) for _, v := range mappingSecurityListLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_gateway.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_gateway.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_gateway.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_gateway.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ServiceGateway Represents a router that lets your VCN privately access specific Oracle services such as Object +// Storage without exposing the VCN to the public internet. Traffic leaving the VCN and destined +// for a supported Oracle service (see ListServices) is +// routed through the service gateway and does not traverse the internet. The instances in the VCN +// do not need to have public IP addresses nor be in a public subnet. The VCN does not need an internet gateway +// for this traffic. For more information, see +// Access to Oracle Services: Service Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/servicegateway.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. +type ServiceGateway struct { + + // Whether the service gateway blocks all traffic through it. The default is `false`. When + // this is `true`, traffic is not routed to any services, regardless of route rules. + // Example: `true` + BlockTraffic *bool `mandatory:"true" json:"blockTraffic"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the + // service gateway. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the service gateway. + Id *string `mandatory:"true" json:"id"` + + // The service gateway's current state. + LifecycleState ServiceGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // List of the Service objects enabled for this service gateway. + // The list can be empty. You can enable a particular `Service` by using + // AttachServiceId or + // UpdateServiceGateway. + Services []ServiceIdResponseDetails `mandatory:"true" json:"services"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the service gateway + // belongs to. + VcnId *string `mandatory:"true" json:"vcnId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The date and time the service gateway was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m ServiceGateway) String() string { + return common.PointerString(m) +} + +// ServiceGatewayLifecycleStateEnum Enum with underlying type: string +type ServiceGatewayLifecycleStateEnum string + +// Set of constants representing the allowable values for ServiceGatewayLifecycleStateEnum +const ( + ServiceGatewayLifecycleStateProvisioning ServiceGatewayLifecycleStateEnum = "PROVISIONING" + ServiceGatewayLifecycleStateAvailable ServiceGatewayLifecycleStateEnum = "AVAILABLE" + ServiceGatewayLifecycleStateTerminating ServiceGatewayLifecycleStateEnum = "TERMINATING" + ServiceGatewayLifecycleStateTerminated ServiceGatewayLifecycleStateEnum = "TERMINATED" +) + +var mappingServiceGatewayLifecycleState = map[string]ServiceGatewayLifecycleStateEnum{ + "PROVISIONING": ServiceGatewayLifecycleStateProvisioning, + "AVAILABLE": ServiceGatewayLifecycleStateAvailable, + "TERMINATING": ServiceGatewayLifecycleStateTerminating, + "TERMINATED": ServiceGatewayLifecycleStateTerminated, +} + +// GetServiceGatewayLifecycleStateEnumValues Enumerates the set of values for ServiceGatewayLifecycleStateEnum +func GetServiceGatewayLifecycleStateEnumValues() []ServiceGatewayLifecycleStateEnum { + values := make([]ServiceGatewayLifecycleStateEnum, 0) + for _, v := range mappingServiceGatewayLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Service An object that represents one or multiple Oracle services that you can enable for a +// ServiceGateway. In the User Guide topic +// Access to Oracle Services: Service Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/servicegateway.htm), the +// term *service CIDR label* is used to refer to the string that represents the regional public +// IP address ranges of the Oracle service or services covered by a given `Service` object. That +// unique string is the value of the `Service` object's `cidrBlock` attribute. +type Service struct { + + // A string that represents the regional public IP address ranges for the Oracle service or + // services covered by this `Service` object. Also known as the `Service` object's *service + // CIDR label*. + // When you set up a route rule to route traffic to the service gateway, use this value as the + // rule's destination. See RouteTable. Also, when you set up + // a security list rule to cover traffic with the service gateway, use the `cidrBlock` value + // as the rule's destination (for an egress rule) or the source (for an ingress rule). + // See SecurityList. + // Example: `oci-phx-objectstorage` + CidrBlock *string `mandatory:"true" json:"cidrBlock"` + + // Description of the Oracle service or services covered by this `Service` object. + // Example: `OCI PHX Object Storage` + Description *string `mandatory:"true" json:"description"` + + // The `Service` object's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + Id *string `mandatory:"true" json:"id"` + + // Name of the `Service` object. This name can change and is not guaranteed to be unique. + // Example: `OCI PHX Object Storage` + Name *string `mandatory:"true" json:"name"` +} + +func (m Service) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_request_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_request_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_request_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_request_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ServiceIdRequestDetails The representation of ServiceIdRequestDetails +type ServiceIdRequestDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Service. + ServiceId *string `mandatory:"true" json:"serviceId"` +} + +func (m ServiceIdRequestDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_response_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_response_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_response_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/service_id_response_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ServiceIdResponseDetails The representation of ServiceIdResponseDetails +type ServiceIdResponseDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the service. + ServiceId *string `mandatory:"true" json:"serviceId"` + + // The name of the service. + ServiceName *string `mandatory:"true" json:"serviceName"` +} + +func (m ServiceIdResponseDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/shape.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/shape.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/shape.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/shape.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,7 +17,7 @@ ) // Shape A compute instance shape that can be used in LaunchInstance. -// For more information, see Overview of the Compute Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm). +// For more information, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). type Shape struct { // The name of the shape. You can enumerate all available shapes by calling diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/softreset_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/softreset_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/softreset_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/softreset_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// SoftresetInstancePoolRequest wrapper for the SoftresetInstancePool operation +type SoftresetInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SoftresetInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SoftresetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SoftresetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// SoftresetInstancePoolResponse wrapper for the SoftresetInstancePool operation +type SoftresetInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response SoftresetInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SoftresetInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/start_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/start_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/start_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/start_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StartInstancePoolRequest wrapper for the StartInstancePool operation +type StartInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StartInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StartInstancePoolResponse wrapper for the StartInstancePool operation +type StartInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StartInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/stop_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/stop_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/stop_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/stop_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StopInstancePoolRequest wrapper for the StopInstancePool operation +type StopInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StopInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StopInstancePoolResponse wrapper for the StopInstancePool operation +type StopInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StopInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/subnet.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/subnet.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/subnet.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/subnet.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,20 +16,18 @@ "github.com/oracle/oci-go-sdk/common" ) -// Subnet A logical subdivision of a VCN. Each subnet exists in a single Availability Domain and +// Subnet A logical subdivision of a VCN. Each subnet exists in a single availability domain and // consists of a contiguous range of IP addresses that do not overlap with // other subnets in the VCN. Example: 172.16.1.0/24. For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm) and -// VCNs and Subnets (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVCNs.htm). +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm) and +// VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Subnet struct { - // The subnet's Availability Domain. - // Example: `Uocm:PHX-AD-1` - AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - // The subnet's CIDR block. // Example: `172.16.1.0/24` CidrBlock *string `mandatory:"true" json:"cidrBlock"` @@ -39,7 +41,7 @@ // The subnet's current state. LifecycleState SubnetLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the route table the subnet is using. + // The OCID of the route table that the subnet uses. RouteTableId *string `mandatory:"true" json:"routeTableId"` // The OCID of the VCN the subnet is in. @@ -53,12 +55,17 @@ // Example: `00:00:17:B6:4D:DD` VirtualRouterMac *string `mandatory:"true" json:"virtualRouterMac"` + // The subnet's availability domain. This attribute will be null if this is a regional subnet + // instead of an AD-specific subnet. Oracle recommends creating regional subnets. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` - // The OCID of the set of DHCP options associated with the subnet. + // The OCID of the set of DHCP options that the subnet uses. DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` // A user-friendly name. Does not have to be unique, and it's changeable. @@ -73,13 +80,13 @@ // The absence of this parameter means the Internet and VCN Resolver // will not resolve hostnames of instances in this subnet. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -95,13 +102,15 @@ // Example: `true` ProhibitPublicIpOnVnic *bool `mandatory:"false" json:"prohibitPublicIpOnVnic"` - // OCIDs for the security lists to use for VNICs in this subnet. + // The OCIDs of the security list or lists that the subnet uses. Remember + // that security lists are associated *with the subnet*, but the + // rules are applied to the individual VNICs in the subnet. SecurityListIds []string `mandatory:"false" json:"securityListIds"` // The subnet's domain name, which consists of the subnet's DNS label, // the VCN's DNS label, and the `oraclevcn.com` domain. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123.vcn1.oraclevcn.com` SubnetDomainName *string `mandatory:"false" json:"subnetDomainName"` @@ -117,7 +126,7 @@ // SubnetLifecycleStateEnum Enum with underlying type: string type SubnetLifecycleStateEnum string -// Set of constants representing the allowable values for SubnetLifecycleState +// Set of constants representing the allowable values for SubnetLifecycleStateEnum const ( SubnetLifecycleStateProvisioning SubnetLifecycleStateEnum = "PROVISIONING" SubnetLifecycleStateAvailable SubnetLifecycleStateEnum = "AVAILABLE" @@ -132,7 +141,7 @@ "TERMINATED": SubnetLifecycleStateTerminated, } -// GetSubnetLifecycleStateEnumValues Enumerates the set of values for SubnetLifecycleState +// GetSubnetLifecycleStateEnumValues Enumerates the set of values for SubnetLifecycleStateEnum func GetSubnetLifecycleStateEnumValues() []SubnetLifecycleStateEnum { values := make([]SubnetLifecycleStateEnum, 0) for _, v := range mappingSubnetLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tcp_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tcp_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tcp_options.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tcp_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// TerminateInstancePoolRequest wrapper for the TerminateInstancePool operation +type TerminateInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request TerminateInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request TerminateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request TerminateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// TerminateInstancePoolResponse wrapper for the TerminateInstancePool operation +type TerminateInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response TerminateInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response TerminateInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -22,12 +22,30 @@ // Specifies whether to delete or preserve the boot volume when terminating an instance. // The default value is false. PreserveBootVolume *bool `mandatory:"false" contributesTo:"query" name:"preserveBootVolume"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request TerminateInstanceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request TerminateInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request TerminateInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // TerminateInstanceResponse wrapper for the TerminateInstance operation type TerminateInstanceResponse struct { @@ -42,3 +60,8 @@ func (response TerminateInstanceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response TerminateInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_config.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// TunnelConfig Specific connection details for an IPSec tunnel. +// TunnelConfig Deprecated. For tunnel information, instead see: +// * IPSecConnectionTunnel +// * IPSecConnectionTunnelSharedSecret type TunnelConfig struct { // The IP address of Oracle's VPN headend. @@ -20,7 +26,7 @@ IpAddress *string `mandatory:"true" json:"ipAddress"` // The shared secret of the IPSec tunnel. - // Example: `vFG2IF6TWq4UToUiLSRDoJEUs6j1c.p8G.dVQxiMfMO0yXMLi.lZTbYIWhGu4V8o` + // Example: `EXAMPLEToUis6j1c.p8G.dVQxcmdfMO0yXMLi.lZTbYCMDGu4V8o` SharedSecret *string `mandatory:"true" json:"sharedSecret"` // The date and time the IPSec connection was created, in the format defined by RFC3339. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_status.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_status.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_status.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/tunnel_status.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,7 @@ "github.com/oracle/oci-go-sdk/common" ) -// TunnelStatus Specific connection details for an IPSec tunnel. +// TunnelStatus Deprecated. For tunnel information, instead see IPSecConnectionTunnel. type TunnelStatus struct { // The IP address of Oracle's VPN headend. @@ -38,7 +42,7 @@ // TunnelStatusLifecycleStateEnum Enum with underlying type: string type TunnelStatusLifecycleStateEnum string -// Set of constants representing the allowable values for TunnelStatusLifecycleState +// Set of constants representing the allowable values for TunnelStatusLifecycleStateEnum const ( TunnelStatusLifecycleStateUp TunnelStatusLifecycleStateEnum = "UP" TunnelStatusLifecycleStateDown TunnelStatusLifecycleStateEnum = "DOWN" @@ -51,7 +55,7 @@ "DOWN_FOR_MAINTENANCE": TunnelStatusLifecycleStateDownForMaintenance, } -// GetTunnelStatusLifecycleStateEnumValues Enumerates the set of values for TunnelStatusLifecycleState +// GetTunnelStatusLifecycleStateEnumValues Enumerates the set of values for TunnelStatusLifecycleStateEnum func GetTunnelStatusLifecycleStateEnumValues() []TunnelStatusLifecycleStateEnum { values := make([]TunnelStatusLifecycleStateEnum, 0) for _, v := range mappingTunnelStatusLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/udp_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/udp_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/udp_options.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/udp_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateBootVolumeBackupDetails The representation of UpdateBootVolumeBackupDetails +type UpdateBootVolumeBackupDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A friendly user-specified name for the boot volume backup. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateBootVolumeBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateBootVolumeBackupRequest wrapper for the UpdateBootVolumeBackup operation +type UpdateBootVolumeBackupRequest struct { + + // The OCID of the boot volume backup. + BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` + + // Update boot volume backup fields + UpdateBootVolumeBackupDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateBootVolumeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateBootVolumeBackupResponse wrapper for the UpdateBootVolumeBackup operation +type UpdateBootVolumeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolumeBackup instance + BootVolumeBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateBootVolumeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBootVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,23 @@ // UpdateBootVolumeDetails The representation of UpdateBootVolumeDetails type UpdateBootVolumeDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The size to resize the volume to in GBs. Has to be larger than the current size. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` } func (m UpdateBootVolumeDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateBootVolumeKmsKeyDetails The representation of UpdateBootVolumeKmsKeyDetails +type UpdateBootVolumeKmsKeyDetails struct { + + // The OCID of the new KMS key which will be used to protect the specified volume. + // This key has to be a valid KMS key OCID, and the user must have key delegation policy to allow them to access this key. + // Even if the new KMS key is the same as the previous KMS key ID, the Block Volume service will use it to regenerate a new volume encryption key. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` +} + +func (m UpdateBootVolumeKmsKeyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateBootVolumeKmsKeyRequest wrapper for the UpdateBootVolumeKmsKey operation +type UpdateBootVolumeKmsKeyRequest struct { + + // The OCID of the boot volume. + BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` + + // Updates the KMS key ID for the specified boot volume. + UpdateBootVolumeKmsKeyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateBootVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateBootVolumeKmsKeyResponse wrapper for the UpdateBootVolumeKmsKey operation +type UpdateBootVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The BootVolumeKmsKey instance + BootVolumeKmsKey `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateBootVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateBootVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBootVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateBootVolumeResponse wrapper for the UpdateBootVolume operation type UpdateBootVolumeResponse struct { @@ -47,3 +65,8 @@ func (response UpdateBootVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBootVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateConsoleHistoryDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -25,7 +29,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateConsoleHistoryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateConsoleHistoryResponse wrapper for the UpdateConsoleHistory operation type UpdateConsoleHistoryResponse struct { @@ -47,3 +65,8 @@ func (response UpdateConsoleHistoryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,20 @@ // UpdateCpeDetails The representation of UpdateCpeDetails type UpdateCpeDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateCpeDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateCpeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateCpeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCpeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateCpeResponse wrapper for the UpdateCpe operation type UpdateCpeResponse struct { @@ -47,3 +65,8 @@ func (response UpdateCpeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCpeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -24,6 +28,10 @@ // of the interface is up. Activation indicates to Oracle that the physical connection is ready. // Example: `true` IsActive *bool `mandatory:"false" json:"isActive"` + + // A reference name or identifier for the physical fiber connection that this cross-connect + // uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m UpdateCrossConnectDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,6 +22,10 @@ // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // A reference name or identifier for the physical fiber connection that this cross-connect + // group uses. + CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m UpdateCrossConnectGroupDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateCrossConnectGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateCrossConnectGroupResponse wrapper for the UpdateCrossConnectGroup operation type UpdateCrossConnectGroupResponse struct { @@ -47,3 +65,8 @@ func (response UpdateCrossConnectGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCrossConnectGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateCrossConnectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCrossConnectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateCrossConnectResponse wrapper for the UpdateCrossConnect operation type UpdateCrossConnectResponse struct { @@ -47,3 +65,8 @@ func (response UpdateCrossConnectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCrossConnectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,7 +21,7 @@ type UpdateDhcpDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -27,7 +31,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -60,7 +64,11 @@ if err != nil { return err } - m.Options[i] = nn + if nn != nil { + m.Options[i] = nn.(DhcpOption) + } else { + m.Options[i] = nil + } } return } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_options_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_options_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_options_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_options_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDhcpOptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDhcpOptionsResponse wrapper for the UpdateDhcpOptions operation type UpdateDhcpOptionsResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDhcpOptionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDhcpOptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,6 +22,11 @@ // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID of the route table the DRG attachment will use. For information about why you + // would associate a route table with a DRG attachment, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m UpdateDrgAttachmentDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDrgAttachmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDrgAttachmentResponse wrapper for the UpdateDrgAttachment operation type UpdateDrgAttachmentResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDrgAttachmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDrgAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,20 @@ // UpdateDrgDetails The representation of UpdateDrgDetails type UpdateDrgDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateDrgDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_drg_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDrgRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDrgRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDrgRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDrgResponse wrapper for the UpdateDrg operation type UpdateDrgResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDrgResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDrgResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateImageDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -27,7 +31,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_image_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -28,12 +28,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateImageRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateImageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateImageResponse wrapper for the UpdateImage operation type UpdateImageResponse struct { @@ -54,3 +72,8 @@ func (response UpdateImageResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_agent_config_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_agent_config_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_agent_config_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_agent_config_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateInstanceAgentConfigDetails Instance agent configuration options to choose for updating the instance +type UpdateInstanceAgentConfigDetails struct { + + // Whether the agent running on the instance can gather performance metrics and monitor the instance. + IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` +} + +func (m UpdateInstanceAgentConfigDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateInstanceConfigurationDetails The representation of UpdateInstanceConfigurationDetails +type UpdateInstanceConfigurationDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // Example: `My instance configuration` + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateInstanceConfigurationDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateInstanceConfigurationRequest wrapper for the UpdateInstanceConfiguration operation +type UpdateInstanceConfigurationRequest struct { + + // The OCID of the instance configuration. + InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` + + // Updates the freeFormTags, definedTags, and display name of an instance configuration. + UpdateInstanceConfigurationDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateInstanceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateInstanceConfigurationResponse wrapper for the UpdateInstanceConfiguration operation +type UpdateInstanceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstanceConfiguration instance + InstanceConfiguration `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateInstanceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateInstanceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateInstanceDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -27,9 +31,31 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Instance agent configuration options to choose for updating the instance + AgentConfig *UpdateInstanceAgentConfigDetails `mandatory:"false" json:"agentConfig"` + + // Custom metadata key/value string pairs that you provide. Any set of key/value pairs + // provided here will completely replace the current set of key/value pairs in the 'metadata' + // field on the instance. + // Both the 'user_data' and 'ssh_authorized_keys' fields cannot be changed after an instance + // has launched. Any request which updates, removes, or adds either of these fields will be + // rejected. You must provide the same values for 'user_data' and 'ssh_authorized_keys' that + // already exist on the instance. + Metadata map[string]string `mandatory:"false" json:"metadata"` + + // Additional metadata key/value pairs that you provide. They serve the same purpose and + // functionality as fields in the 'metadata' object. + // They are distinguished from 'metadata' fields in that these can be nested JSON objects + // (whereas 'metadata' fields are string/string maps only). + // Both the 'user_data' and 'ssh_authorized_keys' fields cannot be changed after an instance + // has launched. Any request which updates, removes, or adds either of these fields will be + // rejected. You must provide the same values for 'user_data' and 'ssh_authorized_keys' that + // already exist on the instance. + ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` } func (m UpdateInstanceDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateInstancePoolDetails The data to update an instance pool. +type UpdateInstancePoolDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The user-friendly name. Does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The OCID of the instance configuration associated with the instance pool. + InstanceConfigurationId *string `mandatory:"false" json:"instanceConfigurationId"` + + // The placement configurations for the instance pool. Provide one placement configuration for + // each availability domain. + // To use the instance pool with a regional subnet, provide a placement configuration for + // each availability domain, and include the regional subnet in each placement + // configuration. + PlacementConfigurations []UpdateInstancePoolPlacementConfigurationDetails `mandatory:"false" json:"placementConfigurations"` + + // The number of instances that should be in the instance pool. + Size *int `mandatory:"false" json:"size"` +} + +func (m UpdateInstancePoolDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_placement_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_placement_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_placement_configuration_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_placement_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateInstancePoolPlacementConfigurationDetails The location for where an instance pool will place instances. +type UpdateInstancePoolPlacementConfigurationDetails struct { + + // The availability domain to place instances. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the primary subnet to place instances. + PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` + + // The set of subnet OCIDs for secondary VNICs for instances in the pool. + SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` +} + +func (m UpdateInstancePoolPlacementConfigurationDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateInstancePoolRequest wrapper for the UpdateInstancePool operation +type UpdateInstancePoolRequest struct { + + // The OCID of the instance pool. + InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` + + // Update instance pool configuration + UpdateInstancePoolDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateInstancePoolRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateInstancePoolResponse wrapper for the UpdateInstancePool operation +type UpdateInstancePoolResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The InstancePool instance + InstancePool `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateInstancePoolResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateInstancePoolResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_instance_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -28,12 +28,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateInstanceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateInstanceResponse wrapper for the UpdateInstance operation type UpdateInstanceResponse struct { @@ -54,3 +72,8 @@ func (response UpdateInstanceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,10 +19,21 @@ // UpdateInternetGatewayDetails The representation of UpdateInternetGatewayDetails type UpdateInternetGatewayDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // Whether the gateway is enabled. IsEnabled *bool `mandatory:"false" json:"isEnabled"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -11,22 +11,40 @@ // UpdateInternetGatewayRequest wrapper for the UpdateInternetGateway operation type UpdateInternetGatewayRequest struct { - // The OCID of the Internet Gateway. + // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` - // Details for updating the Internet Gateway. + // Details for updating the internet gateway. UpdateInternetGatewayDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateInternetGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateInternetGatewayResponse wrapper for the UpdateInternetGateway operation type UpdateInternetGatewayResponse struct { @@ -47,3 +65,8 @@ func (response UpdateInternetGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateInternetGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,11 +19,61 @@ // UpdateIpSecConnectionDetails The representation of UpdateIpSecConnectionDetails type UpdateIpSecConnectionDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, the + // fully qualified domain name (FQDN)). The type of identifier you provide here must correspond + // to the value for `cpeLocalIdentifierType`. + // Example IP address: `10.0.3.3` + // Example hostname: `cpe.example.com` + CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` + + // The type of identifier for your CPE device. The value you provide here must correspond to the value + // for `cpeLocalIdentifier`. + CpeLocalIdentifierType UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` + + // Static routes to the CPE. If you provide this attribute, it replaces the entire current set of + // static routes. A static route's CIDR must not be a multicast address or class E address. + // Example: `10.0.1.0/24` + StaticRoutes []string `mandatory:"false" json:"staticRoutes"` } func (m UpdateIpSecConnectionDetails) String() string { return common.PointerString(m) } + +// UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum Enum with underlying type: string +type UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum string + +// Set of constants representing the allowable values for UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum +const ( + UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "IP_ADDRESS" + UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "HOSTNAME" +) + +var mappingUpdateIpSecConnectionDetailsCpeLocalIdentifierType = map[string]UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum{ + "IP_ADDRESS": UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress, + "HOSTNAME": UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname, +} + +// GetUpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues Enumerates the set of values for UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum +func GetUpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues() []UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum { + values := make([]UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum, 0) + for _, v := range mappingUpdateIpSecConnectionDetailsCpeLocalIdentifierType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateIPSecConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateIPSecConnectionResponse wrapper for the UpdateIPSecConnection operation type UpdateIPSecConnectionResponse struct { @@ -47,3 +65,8 @@ func (response UpdateIPSecConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateIPSecConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateIpSecConnectionTunnelDetails The representation of UpdateIpSecConnectionTunnelDetails +type UpdateIpSecConnectionTunnelDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid + // entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The type of routing to use for this tunnel (either BGP dynamic routing or static routing). + Routing UpdateIpSecConnectionTunnelDetailsRoutingEnum `mandatory:"false" json:"routing,omitempty"` + + // Information for establishing a BGP session for the IPSec tunnel. + BgpSessionConfig *UpdateIpSecTunnelBgpSessionDetails `mandatory:"false" json:"bgpSessionConfig"` +} + +func (m UpdateIpSecConnectionTunnelDetails) String() string { + return common.PointerString(m) +} + +// UpdateIpSecConnectionTunnelDetailsRoutingEnum Enum with underlying type: string +type UpdateIpSecConnectionTunnelDetailsRoutingEnum string + +// Set of constants representing the allowable values for UpdateIpSecConnectionTunnelDetailsRoutingEnum +const ( + UpdateIpSecConnectionTunnelDetailsRoutingBgp UpdateIpSecConnectionTunnelDetailsRoutingEnum = "BGP" + UpdateIpSecConnectionTunnelDetailsRoutingStatic UpdateIpSecConnectionTunnelDetailsRoutingEnum = "STATIC" +) + +var mappingUpdateIpSecConnectionTunnelDetailsRouting = map[string]UpdateIpSecConnectionTunnelDetailsRoutingEnum{ + "BGP": UpdateIpSecConnectionTunnelDetailsRoutingBgp, + "STATIC": UpdateIpSecConnectionTunnelDetailsRoutingStatic, +} + +// GetUpdateIpSecConnectionTunnelDetailsRoutingEnumValues Enumerates the set of values for UpdateIpSecConnectionTunnelDetailsRoutingEnum +func GetUpdateIpSecConnectionTunnelDetailsRoutingEnumValues() []UpdateIpSecConnectionTunnelDetailsRoutingEnum { + values := make([]UpdateIpSecConnectionTunnelDetailsRoutingEnum, 0) + for _, v := range mappingUpdateIpSecConnectionTunnelDetailsRouting { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateIPSecConnectionTunnelRequest wrapper for the UpdateIPSecConnectionTunnel operation +type UpdateIPSecConnectionTunnelRequest struct { + + // The OCID of the IPSec connection. + IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. + TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` + + // Details object for updating a IPSecConnection tunnel's details. + UpdateIpSecConnectionTunnelDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateIPSecConnectionTunnelRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateIPSecConnectionTunnelRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateIPSecConnectionTunnelRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateIPSecConnectionTunnelResponse wrapper for the UpdateIPSecConnectionTunnel operation +type UpdateIPSecConnectionTunnelResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The IpSecConnectionTunnel instance + IpSecConnectionTunnel `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateIPSecConnectionTunnelResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateIPSecConnectionTunnelResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_shared_secret_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_shared_secret_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_shared_secret_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_shared_secret_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateIpSecConnectionTunnelSharedSecretDetails The representation of UpdateIpSecConnectionTunnelSharedSecretDetails +type UpdateIpSecConnectionTunnelSharedSecretDetails struct { + + // The shared secret (pre-shared key) to use for the tunnel. + // Example: `EXAMPLEToUis6j1c.p8G.dVQxcmdfMO0yXMLi.lZTbYCMDGu4V8o` + SharedSecret *string `mandatory:"false" json:"sharedSecret"` +} + +func (m UpdateIpSecConnectionTunnelSharedSecretDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_shared_secret_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_shared_secret_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_shared_secret_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_i_p_sec_connection_tunnel_shared_secret_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateIPSecConnectionTunnelSharedSecretRequest wrapper for the UpdateIPSecConnectionTunnelSharedSecret operation +type UpdateIPSecConnectionTunnelSharedSecretRequest struct { + + // The OCID of the IPSec connection. + IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. + TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` + + // Details object for updating a IPSec connection tunnel's sharedSecret. + UpdateIpSecConnectionTunnelSharedSecretDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateIPSecConnectionTunnelSharedSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateIPSecConnectionTunnelSharedSecretRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateIPSecConnectionTunnelSharedSecretRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateIPSecConnectionTunnelSharedSecretResponse wrapper for the UpdateIPSecConnectionTunnelSharedSecret operation +type UpdateIPSecConnectionTunnelSharedSecretResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The IpSecConnectionTunnelSharedSecret instance + IpSecConnectionTunnelSharedSecret `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateIPSecConnectionTunnelSharedSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateIPSecConnectionTunnelSharedSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_tunnel_bgp_session_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_tunnel_bgp_session_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_tunnel_bgp_session_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_tunnel_bgp_session_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateIpSecTunnelBgpSessionDetails The representation of UpdateIpSecTunnelBgpSessionDetails +type UpdateIpSecTunnelBgpSessionDetails struct { + + // The IP address for the Oracle end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see UpdateIPSecConnectionTunnelDetails), this IP address + // is used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, you can set this IP address to troubleshoot or + // monitor the tunnel. + // The value must be a /30 or /31. + // If you are switching the tunnel from using BGP dynamic routing to static routing and want + // to remove the value for `oracleInterfaceIp`, you can set the value to an empty string. + // Example: `10.0.0.4/31` + OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` + + // The IP address for the CPE end of the inside tunnel interface. + // If the tunnel's `routing` attribute is set to `BGP` + // (see UpdateIPSecConnectionTunnelDetails), this IP address + // is used for the tunnel's BGP session. + // If `routing` is instead set to `STATIC`, you can set this IP address to troubleshoot or + // monitor the tunnel. + // The value must be a /30 or /31. + // If you are switching the tunnel from using BGP dynamic routing to static routing and want + // to remove the value for `customerInterfaceIp`, you can set the value to an empty string. + // Example: `10.0.0.5/31` + CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` + + // The BGP ASN of the network on the CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. + // Uses "asplain" format. + // If you are switching the tunnel from using BGP dynamic routing to static routing, the + // `customerBgpAsn` must be null. + // Example: `12345` (2-byte) or `1587232876` (4-byte) + CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` +} + +func (m UpdateIpSecTunnelBgpSessionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,25 @@ // UpdateLocalPeeringGatewayDetails The representation of UpdateLocalPeeringGatewayDetails type UpdateLocalPeeringGatewayDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The OCID of the route table the LPG will use. For information about why you + // would associate a route table with an LPG, see + // Advanced Scenario: Transit Routing (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). + RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m UpdateLocalPeeringGatewayDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateLocalPeeringGatewayResponse wrapper for the UpdateLocalPeeringGateway operation type UpdateLocalPeeringGatewayResponse struct { @@ -47,3 +65,8 @@ func (response UpdateLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateLocalPeeringGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateNatGatewayDetails The representation of UpdateNatGatewayDetails +type UpdateNatGatewayDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Whether the NAT gateway blocks traffic through it. The default is `false`. + // Example: `true` + BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` +} + +func (m UpdateNatGatewayDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateNatGatewayRequest wrapper for the UpdateNatGateway operation +type UpdateNatGatewayRequest struct { + + // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` + + // Details object for updating a NAT gateway. + UpdateNatGatewayDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateNatGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNatGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateNatGatewayResponse wrapper for the UpdateNatGateway operation +type UpdateNatGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NatGateway instance + NatGateway `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateNatGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNatGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdatePrivateIpDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -26,7 +30,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -37,7 +41,7 @@ // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdatePrivateIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdatePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePrivateIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdatePrivateIpResponse wrapper for the UpdatePrivateIp operation type UpdatePrivateIpResponse struct { @@ -47,3 +65,8 @@ func (response UpdatePrivateIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePrivateIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,10 +19,21 @@ // UpdatePublicIpDetails The representation of UpdatePublicIpDetails type UpdatePublicIpDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The OCID of the private IP to assign the public IP to. // * If the public IP is already assigned to a different private IP, it will be unassigned // and then reassigned to the specified private IP. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdatePublicIpRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdatePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePublicIpRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdatePublicIpResponse wrapper for the UpdatePublicIp operation type UpdatePublicIpResponse struct { @@ -47,3 +65,8 @@ func (response UpdatePublicIpResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePublicIpResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_remote_peering_connection_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateRemotePeeringConnectionResponse wrapper for the UpdateRemotePeeringConnection operation type UpdateRemotePeeringConnectionResponse struct { @@ -47,3 +65,8 @@ func (response UpdateRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateRemotePeeringConnectionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateRouteTableDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -26,7 +30,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateRouteTableRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateRouteTableRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateRouteTableResponse wrapper for the UpdateRouteTable operation type UpdateRouteTableResponse struct { @@ -47,3 +65,8 @@ func (response UpdateRouteTableResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateRouteTableResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateSecurityListDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -29,7 +33,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateSecurityListRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSecurityListRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateSecurityListResponse wrapper for the UpdateSecurityList operation type UpdateSecurityListResponse struct { @@ -47,3 +65,8 @@ func (response UpdateSecurityListResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSecurityListResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateServiceGatewayDetails The representation of UpdateServiceGatewayDetails +type UpdateServiceGatewayDetails struct { + + // Whether the service gateway blocks all traffic through it. The default is `false`. When + // this is `true`, traffic is not routed to any services, regardless of route rules. + // Example: `true` + BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // List of all the `Service` objects you want enabled on this service gateway. Sending an empty list + // means you want to disable all services. Omitting this parameter entirely keeps the + // existing list of services intact. + // You can also enable or disable a particular `Service` by using + // AttachServiceId or + // DetachServiceId. + // For each enabled `Service`, make sure there's a route rule with the `Service` object's `cidrBlock` + // as the rule's destination and the service gateway as the rule's target. See + // RouteTable. + Services []ServiceIdRequestDetails `mandatory:"false" json:"services"` +} + +func (m UpdateServiceGatewayDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateServiceGatewayRequest wrapper for the UpdateServiceGateway operation +type UpdateServiceGatewayRequest struct { + + // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` + + // Details object for updating a service gateway. + UpdateServiceGatewayDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateServiceGatewayRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateServiceGatewayResponse wrapper for the UpdateServiceGateway operation +type UpdateServiceGatewayResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceGateway instance + ServiceGateway `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateServiceGatewayResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateServiceGatewayResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,19 +20,31 @@ type UpdateSubnetDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // The OCID of the set of DHCP options the subnet will use. + DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` + // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The OCID of the route table the subnet will use. + RouteTableId *string `mandatory:"false" json:"routeTableId"` + + // The OCIDs of the security list or lists the subnet will use. This + // replaces the entire current set of security lists. Remember that + // security lists are associated *with the subnet*, but the rules are + // applied to the individual VNICs in the subnet. + SecurityListIds []string `mandatory:"false" json:"securityListIds"` } func (m UpdateSubnetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateSubnetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSubnetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateSubnetResponse wrapper for the UpdateSubnet operation type UpdateSubnetResponse struct { @@ -47,3 +65,8 @@ func (response UpdateSubnetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSubnetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateVcnDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -26,7 +30,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateVcnRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateVcnRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVcnRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateVcnResponse wrapper for the UpdateVcn operation type UpdateVcnResponse struct { @@ -47,3 +65,8 @@ func (response UpdateVcnResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVcnResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -56,6 +60,9 @@ // To be updated only by the provider. ProviderState UpdateVirtualCircuitDetailsProviderStateEnum `mandatory:"false" json:"providerState,omitempty"` + // The service key name offered by the provider (if the customer is connecting via a provider). + ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` + // Provider-supplied reference information about this virtual circuit. // Relevant only if the customer is using FastConnect via a provider. // To be updated only by the provider. @@ -69,7 +76,7 @@ // UpdateVirtualCircuitDetailsProviderStateEnum Enum with underlying type: string type UpdateVirtualCircuitDetailsProviderStateEnum string -// Set of constants representing the allowable values for UpdateVirtualCircuitDetailsProviderState +// Set of constants representing the allowable values for UpdateVirtualCircuitDetailsProviderStateEnum const ( UpdateVirtualCircuitDetailsProviderStateActive UpdateVirtualCircuitDetailsProviderStateEnum = "ACTIVE" UpdateVirtualCircuitDetailsProviderStateInactive UpdateVirtualCircuitDetailsProviderStateEnum = "INACTIVE" @@ -80,7 +87,7 @@ "INACTIVE": UpdateVirtualCircuitDetailsProviderStateInactive, } -// GetUpdateVirtualCircuitDetailsProviderStateEnumValues Enumerates the set of values for UpdateVirtualCircuitDetailsProviderState +// GetUpdateVirtualCircuitDetailsProviderStateEnumValues Enumerates the set of values for UpdateVirtualCircuitDetailsProviderStateEnum func GetUpdateVirtualCircuitDetailsProviderStateEnumValues() []UpdateVirtualCircuitDetailsProviderStateEnum { values := make([]UpdateVirtualCircuitDetailsProviderStateEnum, 0) for _, v := range mappingUpdateVirtualCircuitDetailsProviderState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateVirtualCircuitRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateVirtualCircuitResponse wrapper for the UpdateVirtualCircuit operation type UpdateVirtualCircuitResponse struct { @@ -47,3 +65,8 @@ func (response UpdateVirtualCircuitResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVirtualCircuitResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,9 +19,20 @@ // UpdateVnicDetails The representation of UpdateVnicDetails type UpdateVnicDetails struct { + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique, and it's changeable. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). @@ -29,13 +44,13 @@ // ListPrivateIps and // GetPrivateIp. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. For information // about why you would skip the source/destination check, see - // Using a Private IP as a Route Target (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip). + // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateVnicRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateVnicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVnicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateVnicResponse wrapper for the UpdateVnic operation type UpdateVnicResponse struct { @@ -47,3 +65,8 @@ func (response UpdateVnicResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVnicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateVolumeBackupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -26,7 +30,7 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateVolumeBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateVolumeBackupResponse wrapper for the UpdateVolumeBackup operation type UpdateVolumeBackupResponse struct { @@ -43,3 +61,8 @@ func (response UpdateVolumeBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVolumeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -16,7 +20,7 @@ type UpdateVolumeDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -26,9 +30,12 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The size to resize the volume to in GBs. Has to be larger than the current size. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` } func (m UpdateVolumeDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateVolumeGroupBackupDetails The representation of UpdateVolumeGroupBackupDetails +type UpdateVolumeGroupBackupDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A friendly user-specified name for the volume group backup. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateVolumeGroupBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateVolumeGroupBackupRequest wrapper for the UpdateVolumeGroupBackup operation +type UpdateVolumeGroupBackupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. + VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` + + // Update volume group backup fields + UpdateVolumeGroupBackupDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateVolumeGroupBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateVolumeGroupBackupResponse wrapper for the UpdateVolumeGroupBackup operation +type UpdateVolumeGroupBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroupBackup instance + VolumeGroupBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateVolumeGroupBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVolumeGroupBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateVolumeGroupDetails The representation of UpdateVolumeGroupDetails +type UpdateVolumeGroupDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the volume group. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // OCIDs for the volumes in this volume group. + VolumeIds []string `mandatory:"false" json:"volumeIds"` +} + +func (m UpdateVolumeGroupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateVolumeGroupRequest wrapper for the UpdateVolumeGroup operation +type UpdateVolumeGroupRequest struct { + + // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. + VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` + + // Update volume group's set of volumes and/or display name + UpdateVolumeGroupDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateVolumeGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateVolumeGroupResponse wrapper for the UpdateVolumeGroup operation +type UpdateVolumeGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeGroup instance + VolumeGroup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateVolumeGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVolumeGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateVolumeKmsKeyDetails The representation of UpdateVolumeKmsKeyDetails +type UpdateVolumeKmsKeyDetails struct { + + // The OCID of the new KMS key which will be used to protect the specified volume. + // This key has to be a valid KMS key OCID, and the user must have key delegation policy to allow them to access this key. + // Even if the new KMS key is the same as the previous KMS key ID, the Block Volume service will use it to regenerate a new volume encryption key. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` +} + +func (m UpdateVolumeKmsKeyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateVolumeKmsKeyRequest wrapper for the UpdateVolumeKmsKey operation +type UpdateVolumeKmsKeyRequest struct { + + // The OCID of the volume. + VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` + + // Update the KMS key ID for the specified volume. + UpdateVolumeKmsKeyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateVolumeKmsKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateVolumeKmsKeyResponse wrapper for the UpdateVolumeKmsKey operation +type UpdateVolumeKmsKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The VolumeKmsKey instance + VolumeKmsKey `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateVolumeKmsKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVolumeKmsKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/update_volume_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package core @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateVolumeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVolumeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateVolumeResponse wrapper for the UpdateVolume operation type UpdateVolumeResponse struct { @@ -47,3 +65,8 @@ func (response UpdateVolumeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVolumeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vcn.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vcn.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vcn.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vcn.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,11 +16,13 @@ "github.com/oracle/oci-go-sdk/common" ) -// Vcn A Virtual Cloud Network (VCN). For more information, see -// Overview of the Networking Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). +// Vcn A virtual cloud network (VCN). For more information, see +// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Vcn struct { // The CIDR IP address block of the VCN. @@ -42,7 +48,7 @@ DefaultSecurityListId *string `mandatory:"false" json:"defaultSecurityListId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -58,13 +64,13 @@ // The absence of this parameter means the Internet and VCN Resolver will // not work for this VCN. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -75,7 +81,7 @@ // The VCN's domain name, which consists of the VCN's DNS label, and the // `oraclevcn.com` domain. // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1.oraclevcn.com` VcnDomainName *string `mandatory:"false" json:"vcnDomainName"` } @@ -87,7 +93,7 @@ // VcnLifecycleStateEnum Enum with underlying type: string type VcnLifecycleStateEnum string -// Set of constants representing the allowable values for VcnLifecycleState +// Set of constants representing the allowable values for VcnLifecycleStateEnum const ( VcnLifecycleStateProvisioning VcnLifecycleStateEnum = "PROVISIONING" VcnLifecycleStateAvailable VcnLifecycleStateEnum = "AVAILABLE" @@ -102,7 +108,7 @@ "TERMINATED": VcnLifecycleStateTerminated, } -// GetVcnLifecycleStateEnumValues Enumerates the set of values for VcnLifecycleState +// GetVcnLifecycleStateEnumValues Enumerates the set of values for VcnLifecycleStateEnum func GetVcnLifecycleStateEnumValues() []VcnLifecycleStateEnum { values := make([]VcnLifecycleStateEnum, 0) for _, v := range mappingVcnLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_bandwidth_shape.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_bandwidth_shape.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_bandwidth_shape.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_bandwidth_shape.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,7 +21,7 @@ // network connections to provide a single, logical connection between the edge router // on the customer's existing network and Oracle Cloud Infrastructure. *Private* // virtual circuits support private peering, and *public* virtual circuits support -// public peering. For more information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// public peering. For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // Each virtual circuit is made up of information shared between a customer, Oracle, // and a provider (if the customer is using FastConnect via a provider). Who fills in // a given property of a virtual circuit depends on whether the BGP session related to @@ -27,13 +31,19 @@ // provider and Oracle each do their part to provision the virtual circuit. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type VirtualCircuit struct { - // The provisioned data rate of the connection. + // The provisioned data rate of the connection. To get a list of the + // available bandwidth levels (that is, shapes), see + // ListFastConnectProviderVirtualCircuitBandwidthShapes. + // Example: `10 Gbps` BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` - // BGP management option. + // Deprecated. Instead use the information in + // FastConnectProviderService. BgpManagement VirtualCircuitBgpManagementEnum `mandatory:"false" json:"bgpManagement,omitempty"` // The state of the BGP session associated with the virtual circuit. @@ -67,7 +77,7 @@ // The virtual circuit's current state. For information about // the different states, see - // FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). LifecycleState VirtualCircuitLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The Oracle BGP ASN. @@ -79,6 +89,9 @@ // The OCID of the service offered by the provider (if the customer is connecting via a provider). ProviderServiceId *string `mandatory:"false" json:"providerServiceId"` + // The service key name offered by the provider (if the customer is connecting via a provider). + ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` + // Deprecated. Instead use `providerServiceId`. ProviderServiceName *string `mandatory:"false" json:"providerServiceName"` @@ -90,7 +103,7 @@ ProviderState VirtualCircuitProviderStateEnum `mandatory:"false" json:"providerState,omitempty"` // For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to - // advertise across the connection. Each prefix must be /24 or less specific. + // advertise across the connection. Each prefix must be /31 or less specific. PublicPrefixes []string `mandatory:"false" json:"publicPrefixes"` // Provider-supplied reference information about this virtual circuit @@ -110,7 +123,7 @@ TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Whether the virtual circuit supports private or public peering. For more information, - // see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + // see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). Type VirtualCircuitTypeEnum `mandatory:"false" json:"type,omitempty"` } @@ -121,7 +134,7 @@ // VirtualCircuitBgpManagementEnum Enum with underlying type: string type VirtualCircuitBgpManagementEnum string -// Set of constants representing the allowable values for VirtualCircuitBgpManagement +// Set of constants representing the allowable values for VirtualCircuitBgpManagementEnum const ( VirtualCircuitBgpManagementCustomerManaged VirtualCircuitBgpManagementEnum = "CUSTOMER_MANAGED" VirtualCircuitBgpManagementProviderManaged VirtualCircuitBgpManagementEnum = "PROVIDER_MANAGED" @@ -134,7 +147,7 @@ "ORACLE_MANAGED": VirtualCircuitBgpManagementOracleManaged, } -// GetVirtualCircuitBgpManagementEnumValues Enumerates the set of values for VirtualCircuitBgpManagement +// GetVirtualCircuitBgpManagementEnumValues Enumerates the set of values for VirtualCircuitBgpManagementEnum func GetVirtualCircuitBgpManagementEnumValues() []VirtualCircuitBgpManagementEnum { values := make([]VirtualCircuitBgpManagementEnum, 0) for _, v := range mappingVirtualCircuitBgpManagement { @@ -146,7 +159,7 @@ // VirtualCircuitBgpSessionStateEnum Enum with underlying type: string type VirtualCircuitBgpSessionStateEnum string -// Set of constants representing the allowable values for VirtualCircuitBgpSessionState +// Set of constants representing the allowable values for VirtualCircuitBgpSessionStateEnum const ( VirtualCircuitBgpSessionStateUp VirtualCircuitBgpSessionStateEnum = "UP" VirtualCircuitBgpSessionStateDown VirtualCircuitBgpSessionStateEnum = "DOWN" @@ -157,7 +170,7 @@ "DOWN": VirtualCircuitBgpSessionStateDown, } -// GetVirtualCircuitBgpSessionStateEnumValues Enumerates the set of values for VirtualCircuitBgpSessionState +// GetVirtualCircuitBgpSessionStateEnumValues Enumerates the set of values for VirtualCircuitBgpSessionStateEnum func GetVirtualCircuitBgpSessionStateEnumValues() []VirtualCircuitBgpSessionStateEnum { values := make([]VirtualCircuitBgpSessionStateEnum, 0) for _, v := range mappingVirtualCircuitBgpSessionState { @@ -169,7 +182,7 @@ // VirtualCircuitLifecycleStateEnum Enum with underlying type: string type VirtualCircuitLifecycleStateEnum string -// Set of constants representing the allowable values for VirtualCircuitLifecycleState +// Set of constants representing the allowable values for VirtualCircuitLifecycleStateEnum const ( VirtualCircuitLifecycleStatePendingProvider VirtualCircuitLifecycleStateEnum = "PENDING_PROVIDER" VirtualCircuitLifecycleStateVerifying VirtualCircuitLifecycleStateEnum = "VERIFYING" @@ -192,7 +205,7 @@ "TERMINATED": VirtualCircuitLifecycleStateTerminated, } -// GetVirtualCircuitLifecycleStateEnumValues Enumerates the set of values for VirtualCircuitLifecycleState +// GetVirtualCircuitLifecycleStateEnumValues Enumerates the set of values for VirtualCircuitLifecycleStateEnum func GetVirtualCircuitLifecycleStateEnumValues() []VirtualCircuitLifecycleStateEnum { values := make([]VirtualCircuitLifecycleStateEnum, 0) for _, v := range mappingVirtualCircuitLifecycleState { @@ -204,7 +217,7 @@ // VirtualCircuitProviderStateEnum Enum with underlying type: string type VirtualCircuitProviderStateEnum string -// Set of constants representing the allowable values for VirtualCircuitProviderState +// Set of constants representing the allowable values for VirtualCircuitProviderStateEnum const ( VirtualCircuitProviderStateActive VirtualCircuitProviderStateEnum = "ACTIVE" VirtualCircuitProviderStateInactive VirtualCircuitProviderStateEnum = "INACTIVE" @@ -215,7 +228,7 @@ "INACTIVE": VirtualCircuitProviderStateInactive, } -// GetVirtualCircuitProviderStateEnumValues Enumerates the set of values for VirtualCircuitProviderState +// GetVirtualCircuitProviderStateEnumValues Enumerates the set of values for VirtualCircuitProviderStateEnum func GetVirtualCircuitProviderStateEnumValues() []VirtualCircuitProviderStateEnum { values := make([]VirtualCircuitProviderStateEnum, 0) for _, v := range mappingVirtualCircuitProviderState { @@ -227,7 +240,7 @@ // VirtualCircuitServiceTypeEnum Enum with underlying type: string type VirtualCircuitServiceTypeEnum string -// Set of constants representing the allowable values for VirtualCircuitServiceType +// Set of constants representing the allowable values for VirtualCircuitServiceTypeEnum const ( VirtualCircuitServiceTypeColocated VirtualCircuitServiceTypeEnum = "COLOCATED" VirtualCircuitServiceTypeLayer2 VirtualCircuitServiceTypeEnum = "LAYER2" @@ -240,7 +253,7 @@ "LAYER3": VirtualCircuitServiceTypeLayer3, } -// GetVirtualCircuitServiceTypeEnumValues Enumerates the set of values for VirtualCircuitServiceType +// GetVirtualCircuitServiceTypeEnumValues Enumerates the set of values for VirtualCircuitServiceTypeEnum func GetVirtualCircuitServiceTypeEnumValues() []VirtualCircuitServiceTypeEnum { values := make([]VirtualCircuitServiceTypeEnum, 0) for _, v := range mappingVirtualCircuitServiceType { @@ -252,7 +265,7 @@ // VirtualCircuitTypeEnum Enum with underlying type: string type VirtualCircuitTypeEnum string -// Set of constants representing the allowable values for VirtualCircuitType +// Set of constants representing the allowable values for VirtualCircuitTypeEnum const ( VirtualCircuitTypePublic VirtualCircuitTypeEnum = "PUBLIC" VirtualCircuitTypePrivate VirtualCircuitTypeEnum = "PRIVATE" @@ -263,7 +276,7 @@ "PRIVATE": VirtualCircuitTypePrivate, } -// GetVirtualCircuitTypeEnumValues Enumerates the set of values for VirtualCircuitType +// GetVirtualCircuitTypeEnumValues Enumerates the set of values for VirtualCircuitTypeEnum func GetVirtualCircuitTypeEnumValues() []VirtualCircuitTypeEnum { values := make([]VirtualCircuitTypeEnum, 0) for _, v := range mappingVirtualCircuitType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_public_prefix.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_public_prefix.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_public_prefix.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_public_prefix.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -14,7 +18,7 @@ // VirtualCircuitPublicPrefix A public IP prefix and its details. With a public virtual circuit, the customer // specifies the customer-owned public IP prefixes to advertise across the connection. -// For more information, see FastConnect Overview (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). +// For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). type VirtualCircuitPublicPrefix struct { // Publix IP prefix (CIDR) that the customer specified. @@ -35,7 +39,7 @@ // VirtualCircuitPublicPrefixVerificationStateEnum Enum with underlying type: string type VirtualCircuitPublicPrefixVerificationStateEnum string -// Set of constants representing the allowable values for VirtualCircuitPublicPrefixVerificationState +// Set of constants representing the allowable values for VirtualCircuitPublicPrefixVerificationStateEnum const ( VirtualCircuitPublicPrefixVerificationStateInProgress VirtualCircuitPublicPrefixVerificationStateEnum = "IN_PROGRESS" VirtualCircuitPublicPrefixVerificationStateCompleted VirtualCircuitPublicPrefixVerificationStateEnum = "COMPLETED" @@ -48,7 +52,7 @@ "FAILED": VirtualCircuitPublicPrefixVerificationStateFailed, } -// GetVirtualCircuitPublicPrefixVerificationStateEnumValues Enumerates the set of values for VirtualCircuitPublicPrefixVerificationState +// GetVirtualCircuitPublicPrefixVerificationStateEnumValues Enumerates the set of values for VirtualCircuitPublicPrefixVerificationStateEnum func GetVirtualCircuitPublicPrefixVerificationStateEnumValues() []VirtualCircuitPublicPrefixVerificationStateEnum { values := make([]VirtualCircuitPublicPrefixVerificationStateEnum, 0) for _, v := range mappingVirtualCircuitPublicPrefixVerificationState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -13,10 +17,12 @@ ) // VnicAttachment Represents an attachment between a VNIC and an instance. For more information, see -// Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). +// Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type VnicAttachment struct { - // The Availability Domain of the instance. + // The availability domain of the instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -48,7 +54,7 @@ // Certain bare metal instance shapes have two active physical NICs (0 and 1). If // you add a secondary VNIC to one of these instances, you can specify which NIC // the VNIC will use. For more information, see - // Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). + // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). NicIndex *int `mandatory:"false" json:"nicIndex"` // The Oracle-assigned VLAN tag of the attached VNIC. Available after the @@ -67,7 +73,7 @@ // VnicAttachmentLifecycleStateEnum Enum with underlying type: string type VnicAttachmentLifecycleStateEnum string -// Set of constants representing the allowable values for VnicAttachmentLifecycleState +// Set of constants representing the allowable values for VnicAttachmentLifecycleStateEnum const ( VnicAttachmentLifecycleStateAttaching VnicAttachmentLifecycleStateEnum = "ATTACHING" VnicAttachmentLifecycleStateAttached VnicAttachmentLifecycleStateEnum = "ATTACHED" @@ -82,7 +88,7 @@ "DETACHED": VnicAttachmentLifecycleStateDetached, } -// GetVnicAttachmentLifecycleStateEnumValues Enumerates the set of values for VnicAttachmentLifecycleState +// GetVnicAttachmentLifecycleStateEnumValues Enumerates the set of values for VnicAttachmentLifecycleStateEnum func GetVnicAttachmentLifecycleStateEnumValues() []VnicAttachmentLifecycleStateEnum { values := make([]VnicAttachmentLifecycleStateEnum, 0) for _, v := range mappingVnicAttachmentLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/vnic.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,17 +21,19 @@ // through that subnet. Each instance has a *primary VNIC* that is automatically // created and attached during launch. You can add *secondary VNICs* to an // instance after it's launched. For more information, see -// Virtual Network Interface Cards (VNICs) (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm). +// Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). // Each VNIC has a *primary private IP* that is automatically assigned during launch. // You can add *secondary private IPs* to a VNIC after it's created. For more // information, see CreatePrivateIp and -// IP Addresses (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPaddresses.htm). +// IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Vnic struct { - // The VNIC's Availability Domain. + // The VNIC's availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -40,11 +46,6 @@ // The current state of the VNIC. LifecycleState VnicLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The private IP address of the primary `privateIp` object on the VNIC. - // The address is within the CIDR of the VNIC's subnet. - // Example: `10.0.3.3` - PrivateIp *string `mandatory:"true" json:"privateIp"` - // The OCID of the subnet the VNIC is in. SubnetId *string `mandatory:"true" json:"subnetId"` @@ -52,10 +53,21 @@ // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // A user-friendly name. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). @@ -63,7 +75,7 @@ // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` @@ -75,13 +87,18 @@ // Example: `00:00:17:B6:4D:DD` MacAddress *string `mandatory:"false" json:"macAddress"` + // The private IP address of the primary `privateIp` object on the VNIC. + // The address is within the CIDR of the VNIC's subnet. + // Example: `10.0.3.3` + PrivateIp *string `mandatory:"false" json:"privateIp"` + // The public IP address of the VNIC, if one is assigned. PublicIp *string `mandatory:"false" json:"publicIp"` // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. For information // about why you would skip the source/destination check, see - // Using a Private IP as a Route Target (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm#privateip). + // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } @@ -93,7 +110,7 @@ // VnicLifecycleStateEnum Enum with underlying type: string type VnicLifecycleStateEnum string -// Set of constants representing the allowable values for VnicLifecycleState +// Set of constants representing the allowable values for VnicLifecycleStateEnum const ( VnicLifecycleStateProvisioning VnicLifecycleStateEnum = "PROVISIONING" VnicLifecycleStateAvailable VnicLifecycleStateEnum = "AVAILABLE" @@ -108,7 +125,7 @@ "TERMINATED": VnicLifecycleStateTerminated, } -// GetVnicLifecycleStateEnumValues Enumerates the set of values for VnicLifecycleState +// GetVnicLifecycleStateEnumValues Enumerates the set of values for VnicLifecycleStateEnum func GetVnicLifecycleStateEnumValues() []VnicLifecycleStateEnum { values := make([]VnicLifecycleStateEnum, 0) for _, v := range mappingVnicLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_attachment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -17,10 +21,12 @@ // For specific details about iSCSI attachments, see // IScsiVolumeAttachment. // For general information about volume attachments, see -// Overview of Block Volume Storage (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm). +// Overview of Block Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type VolumeAttachment interface { - // The Availability Domain of an instance. + // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` GetAvailabilityDomain() *string @@ -43,6 +49,9 @@ // The OCID of the volume. GetVolumeId() *string + // The device name. + GetDevice() *string + // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` @@ -50,20 +59,25 @@ // Whether the attachment was created in read-only mode. GetIsReadOnly() *bool + + // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. + GetIsPvEncryptionInTransitEnabled() *bool } type volumeattachment struct { - JsonData []byte - AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - CompartmentId *string `mandatory:"true" json:"compartmentId"` - Id *string `mandatory:"true" json:"id"` - InstanceId *string `mandatory:"true" json:"instanceId"` - LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - VolumeId *string `mandatory:"true" json:"volumeId"` - DisplayName *string `mandatory:"false" json:"displayName"` - IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` - AttachmentType string `json:"attachmentType"` + JsonData []byte + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + Id *string `mandatory:"true" json:"id"` + InstanceId *string `mandatory:"true" json:"instanceId"` + LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + VolumeId *string `mandatory:"true" json:"volumeId"` + Device *string `mandatory:"false" json:"device"` + DisplayName *string `mandatory:"false" json:"displayName"` + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` + AttachmentType string `json:"attachmentType"` } // UnmarshalJSON unmarshals json @@ -84,8 +98,10 @@ m.LifecycleState = s.Model.LifecycleState m.TimeCreated = s.Model.TimeCreated m.VolumeId = s.Model.VolumeId + m.Device = s.Model.Device m.DisplayName = s.Model.DisplayName m.IsReadOnly = s.Model.IsReadOnly + m.IsPvEncryptionInTransitEnabled = s.Model.IsPvEncryptionInTransitEnabled m.AttachmentType = s.Model.AttachmentType return err @@ -93,6 +109,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *volumeattachment) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.AttachmentType { case "iscsi": @@ -104,7 +125,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -143,6 +164,11 @@ return m.VolumeId } +//GetDevice returns Device +func (m volumeattachment) GetDevice() *string { + return m.Device +} + //GetDisplayName returns DisplayName func (m volumeattachment) GetDisplayName() *string { return m.DisplayName @@ -153,6 +179,11 @@ return m.IsReadOnly } +//GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled +func (m volumeattachment) GetIsPvEncryptionInTransitEnabled() *bool { + return m.IsPvEncryptionInTransitEnabled +} + func (m volumeattachment) String() string { return common.PointerString(m) } @@ -160,7 +191,7 @@ // VolumeAttachmentLifecycleStateEnum Enum with underlying type: string type VolumeAttachmentLifecycleStateEnum string -// Set of constants representing the allowable values for VolumeAttachmentLifecycleState +// Set of constants representing the allowable values for VolumeAttachmentLifecycleStateEnum const ( VolumeAttachmentLifecycleStateAttaching VolumeAttachmentLifecycleStateEnum = "ATTACHING" VolumeAttachmentLifecycleStateAttached VolumeAttachmentLifecycleStateEnum = "ATTACHED" @@ -175,7 +206,7 @@ "DETACHED": VolumeAttachmentLifecycleStateDetached, } -// GetVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for VolumeAttachmentLifecycleState +// GetVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for VolumeAttachmentLifecycleStateEnum func GetVolumeAttachmentLifecycleStateEnumValues() []VolumeAttachmentLifecycleStateEnum { values := make([]VolumeAttachmentLifecycleStateEnum, 0) for _, v := range mappingVolumeAttachmentLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -14,10 +18,12 @@ // VolumeBackup A point-in-time copy of a volume that can then be used to create a new block volume // or recover a block volume. For more information, see -// Overview of Cloud Volume Storage (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm). +// Overview of Cloud Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type VolumeBackup struct { // The OCID of the compartment that contains the volume backup. @@ -41,7 +47,7 @@ Type VolumeBackupTypeEnum `mandatory:"true" json:"type"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -54,31 +60,34 @@ // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The size of the volume, in GBs. - SizeInGBs *int `mandatory:"false" json:"sizeInGBs"` + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Please use sizeInGBs. - SizeInMBs *int `mandatory:"false" json:"sizeInMBs"` + SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` // Specifies whether the backup was created manually, or via scheduled backup policy. SourceType VolumeBackupSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + // The OCID of the source volume backup. + SourceVolumeBackupId *string `mandatory:"false" json:"sourceVolumeBackupId"` + // The date and time the request to create the volume backup was received. Format defined by RFC3339. TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` // The size used by the backup, in GBs. It is typically smaller than sizeInGBs, depending on the space // consumed on the volume and whether the backup is full or incremental. - UniqueSizeInGBs *int `mandatory:"false" json:"uniqueSizeInGBs"` + UniqueSizeInGBs *int64 `mandatory:"false" json:"uniqueSizeInGBs"` // The size used by the backup, in MBs. It is typically smaller than sizeInMBs, depending on the space // consumed on the volume and whether the backup is full or incremental. // This field is deprecated. Please use uniqueSizeInGBs. - UniqueSizeInMbs *int `mandatory:"false" json:"uniqueSizeInMbs"` + UniqueSizeInMbs *int64 `mandatory:"false" json:"uniqueSizeInMbs"` // The OCID of the volume. VolumeId *string `mandatory:"false" json:"volumeId"` @@ -91,7 +100,7 @@ // VolumeBackupLifecycleStateEnum Enum with underlying type: string type VolumeBackupLifecycleStateEnum string -// Set of constants representing the allowable values for VolumeBackupLifecycleState +// Set of constants representing the allowable values for VolumeBackupLifecycleStateEnum const ( VolumeBackupLifecycleStateCreating VolumeBackupLifecycleStateEnum = "CREATING" VolumeBackupLifecycleStateAvailable VolumeBackupLifecycleStateEnum = "AVAILABLE" @@ -110,7 +119,7 @@ "REQUEST_RECEIVED": VolumeBackupLifecycleStateRequestReceived, } -// GetVolumeBackupLifecycleStateEnumValues Enumerates the set of values for VolumeBackupLifecycleState +// GetVolumeBackupLifecycleStateEnumValues Enumerates the set of values for VolumeBackupLifecycleStateEnum func GetVolumeBackupLifecycleStateEnumValues() []VolumeBackupLifecycleStateEnum { values := make([]VolumeBackupLifecycleStateEnum, 0) for _, v := range mappingVolumeBackupLifecycleState { @@ -122,7 +131,7 @@ // VolumeBackupSourceTypeEnum Enum with underlying type: string type VolumeBackupSourceTypeEnum string -// Set of constants representing the allowable values for VolumeBackupSourceType +// Set of constants representing the allowable values for VolumeBackupSourceTypeEnum const ( VolumeBackupSourceTypeManual VolumeBackupSourceTypeEnum = "MANUAL" VolumeBackupSourceTypeScheduled VolumeBackupSourceTypeEnum = "SCHEDULED" @@ -133,7 +142,7 @@ "SCHEDULED": VolumeBackupSourceTypeScheduled, } -// GetVolumeBackupSourceTypeEnumValues Enumerates the set of values for VolumeBackupSourceType +// GetVolumeBackupSourceTypeEnumValues Enumerates the set of values for VolumeBackupSourceTypeEnum func GetVolumeBackupSourceTypeEnumValues() []VolumeBackupSourceTypeEnum { values := make([]VolumeBackupSourceTypeEnum, 0) for _, v := range mappingVolumeBackupSourceType { @@ -145,7 +154,7 @@ // VolumeBackupTypeEnum Enum with underlying type: string type VolumeBackupTypeEnum string -// Set of constants representing the allowable values for VolumeBackupType +// Set of constants representing the allowable values for VolumeBackupTypeEnum const ( VolumeBackupTypeFull VolumeBackupTypeEnum = "FULL" VolumeBackupTypeIncremental VolumeBackupTypeEnum = "INCREMENTAL" @@ -156,7 +165,7 @@ "INCREMENTAL": VolumeBackupTypeIncremental, } -// GetVolumeBackupTypeEnumValues Enumerates the set of values for VolumeBackupType +// GetVolumeBackupTypeEnumValues Enumerates the set of values for VolumeBackupTypeEnum func GetVolumeBackupTypeEnumValues() []VolumeBackupTypeEnum { values := make([]VolumeBackupTypeEnum, 0) for _, v := range mappingVolumeBackupType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy_assignment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy_assignment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy_assignment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy_assignment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -12,7 +16,11 @@ "github.com/oracle/oci-go-sdk/common" ) -// VolumeBackupPolicy A policy for automatically creating volume backups according to a recurring schedule. Has a set of one or more schedules that control when and how backups are created. +// VolumeBackupPolicy A policy for automatically creating volume backups according to a +// recurring schedule. Has a set of one or more schedules that control when and +// how backups are created. +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type VolumeBackupPolicy struct { // A user-friendly name for the volume backup policy. Does not have to be unique and it's changeable. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_schedule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_schedule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_schedule.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_schedule.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -18,7 +22,7 @@ // The type of backup to create. BackupType VolumeBackupScheduleBackupTypeEnum `mandatory:"true" json:"backupType"` - // The number of seconds (positive or negative) that the backup time should be shifted from the default interval boundaries specified by the period. + // The number of seconds that the backup time should be shifted from the default interval boundaries specified by the period. Backup time = Frequency start time + Offset. OffsetSeconds *int `mandatory:"true" json:"offsetSeconds"` // How often the backup should occur. @@ -35,7 +39,7 @@ // VolumeBackupScheduleBackupTypeEnum Enum with underlying type: string type VolumeBackupScheduleBackupTypeEnum string -// Set of constants representing the allowable values for VolumeBackupScheduleBackupType +// Set of constants representing the allowable values for VolumeBackupScheduleBackupTypeEnum const ( VolumeBackupScheduleBackupTypeFull VolumeBackupScheduleBackupTypeEnum = "FULL" VolumeBackupScheduleBackupTypeIncremental VolumeBackupScheduleBackupTypeEnum = "INCREMENTAL" @@ -46,7 +50,7 @@ "INCREMENTAL": VolumeBackupScheduleBackupTypeIncremental, } -// GetVolumeBackupScheduleBackupTypeEnumValues Enumerates the set of values for VolumeBackupScheduleBackupType +// GetVolumeBackupScheduleBackupTypeEnumValues Enumerates the set of values for VolumeBackupScheduleBackupTypeEnum func GetVolumeBackupScheduleBackupTypeEnumValues() []VolumeBackupScheduleBackupTypeEnum { values := make([]VolumeBackupScheduleBackupTypeEnum, 0) for _, v := range mappingVolumeBackupScheduleBackupType { @@ -58,7 +62,7 @@ // VolumeBackupSchedulePeriodEnum Enum with underlying type: string type VolumeBackupSchedulePeriodEnum string -// Set of constants representing the allowable values for VolumeBackupSchedulePeriod +// Set of constants representing the allowable values for VolumeBackupSchedulePeriodEnum const ( VolumeBackupSchedulePeriodHour VolumeBackupSchedulePeriodEnum = "ONE_HOUR" VolumeBackupSchedulePeriodDay VolumeBackupSchedulePeriodEnum = "ONE_DAY" @@ -75,7 +79,7 @@ "ONE_YEAR": VolumeBackupSchedulePeriodYear, } -// GetVolumeBackupSchedulePeriodEnumValues Enumerates the set of values for VolumeBackupSchedulePeriod +// GetVolumeBackupSchedulePeriodEnumValues Enumerates the set of values for VolumeBackupSchedulePeriodEnum func GetVolumeBackupSchedulePeriodEnumValues() []VolumeBackupSchedulePeriodEnum { values := make([]VolumeBackupSchedulePeriodEnum, 0) for _, v := range mappingVolumeBackupSchedulePeriod { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -15,13 +19,15 @@ // Volume A detachable block volume device that allows you to dynamically expand // the storage capacity of an instance. For more information, see -// Overview of Cloud Volume Storage (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm). +// Overview of Cloud Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. type Volume struct { - // The Availability Domain of the volume. + // The availability domain of the volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` @@ -39,31 +45,37 @@ LifecycleState VolumeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The size of the volume in MBs. This field is deprecated. Use sizeInGBs instead. - SizeInMBs *int `mandatory:"true" json:"sizeInMBs"` + SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` // The date and time the volume was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see - // Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Specifies whether the cloned volume's data has finished copying from the source volume or backup. IsHydrated *bool `mandatory:"false" json:"isHydrated"` + // The OCID of the KMS key which is the master encryption key for the volume. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` + // The size of the volume in GBs. - SizeInGBs *int `mandatory:"false" json:"sizeInGBs"` + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` - // The volume source, either an existing volume in the same Availability Domain or a volume backup. + // The volume source, either an existing volume in the same availability domain or a volume backup. // If null, an empty volume is created. SourceDetails VolumeSourceDetails `mandatory:"false" json:"sourceDetails"` + + // The OCID of the source volume group. + VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` } func (m Volume) String() string { @@ -76,14 +88,16 @@ DefinedTags map[string]map[string]interface{} `json:"definedTags"` FreeformTags map[string]string `json:"freeformTags"` IsHydrated *bool `json:"isHydrated"` - SizeInGBs *int `json:"sizeInGBs"` + KmsKeyId *string `json:"kmsKeyId"` + SizeInGBs *int64 `json:"sizeInGBs"` SourceDetails volumesourcedetails `json:"sourceDetails"` + VolumeGroupId *string `json:"volumeGroupId"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` DisplayName *string `json:"displayName"` Id *string `json:"id"` LifecycleState VolumeLifecycleStateEnum `json:"lifecycleState"` - SizeInMBs *int `json:"sizeInMBs"` + SizeInMBs *int64 `json:"sizeInMBs"` TimeCreated *common.SDKTime `json:"timeCreated"` }{} @@ -94,12 +108,18 @@ m.DefinedTags = model.DefinedTags m.FreeformTags = model.FreeformTags m.IsHydrated = model.IsHydrated + m.KmsKeyId = model.KmsKeyId m.SizeInGBs = model.SizeInGBs nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } - m.SourceDetails = nn.(VolumeSourceDetails) + if nn != nil { + m.SourceDetails = nn.(VolumeSourceDetails) + } else { + m.SourceDetails = nil + } + m.VolumeGroupId = model.VolumeGroupId m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.DisplayName = model.DisplayName @@ -113,7 +133,7 @@ // VolumeLifecycleStateEnum Enum with underlying type: string type VolumeLifecycleStateEnum string -// Set of constants representing the allowable values for VolumeLifecycleState +// Set of constants representing the allowable values for VolumeLifecycleStateEnum const ( VolumeLifecycleStateProvisioning VolumeLifecycleStateEnum = "PROVISIONING" VolumeLifecycleStateRestoring VolumeLifecycleStateEnum = "RESTORING" @@ -132,7 +152,7 @@ "FAULTY": VolumeLifecycleStateFaulty, } -// GetVolumeLifecycleStateEnumValues Enumerates the set of values for VolumeLifecycleState +// GetVolumeLifecycleStateEnumValues Enumerates the set of values for VolumeLifecycleStateEnum func GetVolumeLifecycleStateEnumValues() []VolumeLifecycleStateEnum { values := make([]VolumeLifecycleStateEnum, 0) for _, v := range mappingVolumeLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_backup.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroupBackup A point-in-time copy of a volume group that can then be used to create a new volume group +// or restore a volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. +type VolumeGroupBackup struct { + + // The OCID of the compartment that contains the volume group backup. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the volume group backup. Does not have to be unique and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the volume group backup. + Id *string `mandatory:"true" json:"id"` + + // The current state of a volume group backup. + LifecycleState VolumeGroupBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the volume group backup was created. This is the time the actual point-in-time image + // of the volume group data was taken. Format defined by RFC3339. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The type of backup. + Type VolumeGroupBackupTypeEnum `mandatory:"true" json:"type"` + + // OCIDs for the volume backups in this volume group backup. + VolumeBackupIds []string `mandatory:"true" json:"volumeBackupIds"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The aggregate size of the volume group backup, in MBs. + SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` + + // The aggregate size of the volume group backup, in GBs. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` + + // The date and time the request to create the volume group backup was received. Format defined by RFC3339. + TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` + + // The aggregate size used by the volume group backup, in MBs. + // It is typically smaller than sizeInMBs, depending on the space + // consumed on the volume group and whether the volume backup is full or incremental. + UniqueSizeInMbs *int64 `mandatory:"false" json:"uniqueSizeInMbs"` + + // The aggregate size used by the volume group backup, in GBs. + // It is typically smaller than sizeInGBs, depending on the space + // consumed on the volume group and whether the volume backup is full or incremental. + UniqueSizeInGbs *int64 `mandatory:"false" json:"uniqueSizeInGbs"` + + // The OCID of the source volume group. + VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` +} + +func (m VolumeGroupBackup) String() string { + return common.PointerString(m) +} + +// VolumeGroupBackupLifecycleStateEnum Enum with underlying type: string +type VolumeGroupBackupLifecycleStateEnum string + +// Set of constants representing the allowable values for VolumeGroupBackupLifecycleStateEnum +const ( + VolumeGroupBackupLifecycleStateCreating VolumeGroupBackupLifecycleStateEnum = "CREATING" + VolumeGroupBackupLifecycleStateCommitted VolumeGroupBackupLifecycleStateEnum = "COMMITTED" + VolumeGroupBackupLifecycleStateAvailable VolumeGroupBackupLifecycleStateEnum = "AVAILABLE" + VolumeGroupBackupLifecycleStateTerminating VolumeGroupBackupLifecycleStateEnum = "TERMINATING" + VolumeGroupBackupLifecycleStateTerminated VolumeGroupBackupLifecycleStateEnum = "TERMINATED" + VolumeGroupBackupLifecycleStateFaulty VolumeGroupBackupLifecycleStateEnum = "FAULTY" + VolumeGroupBackupLifecycleStateRequestReceived VolumeGroupBackupLifecycleStateEnum = "REQUEST_RECEIVED" +) + +var mappingVolumeGroupBackupLifecycleState = map[string]VolumeGroupBackupLifecycleStateEnum{ + "CREATING": VolumeGroupBackupLifecycleStateCreating, + "COMMITTED": VolumeGroupBackupLifecycleStateCommitted, + "AVAILABLE": VolumeGroupBackupLifecycleStateAvailable, + "TERMINATING": VolumeGroupBackupLifecycleStateTerminating, + "TERMINATED": VolumeGroupBackupLifecycleStateTerminated, + "FAULTY": VolumeGroupBackupLifecycleStateFaulty, + "REQUEST_RECEIVED": VolumeGroupBackupLifecycleStateRequestReceived, +} + +// GetVolumeGroupBackupLifecycleStateEnumValues Enumerates the set of values for VolumeGroupBackupLifecycleStateEnum +func GetVolumeGroupBackupLifecycleStateEnumValues() []VolumeGroupBackupLifecycleStateEnum { + values := make([]VolumeGroupBackupLifecycleStateEnum, 0) + for _, v := range mappingVolumeGroupBackupLifecycleState { + values = append(values, v) + } + return values +} + +// VolumeGroupBackupTypeEnum Enum with underlying type: string +type VolumeGroupBackupTypeEnum string + +// Set of constants representing the allowable values for VolumeGroupBackupTypeEnum +const ( + VolumeGroupBackupTypeFull VolumeGroupBackupTypeEnum = "FULL" + VolumeGroupBackupTypeIncremental VolumeGroupBackupTypeEnum = "INCREMENTAL" +) + +var mappingVolumeGroupBackupType = map[string]VolumeGroupBackupTypeEnum{ + "FULL": VolumeGroupBackupTypeFull, + "INCREMENTAL": VolumeGroupBackupTypeIncremental, +} + +// GetVolumeGroupBackupTypeEnumValues Enumerates the set of values for VolumeGroupBackupTypeEnum +func GetVolumeGroupBackupTypeEnumValues() []VolumeGroupBackupTypeEnum { + values := make([]VolumeGroupBackupTypeEnum, 0) + for _, v := range mappingVolumeGroupBackupType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroup Specifies a volume group which is a collection of +// volumes. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you +// supply string values using the API. +type VolumeGroup struct { + + // The availability domain of the volume group. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID of the compartment that contains the volume group. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the volume group. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID for the volume group. + Id *string `mandatory:"true" json:"id"` + + // The aggregate size of the volume group in MBs. + SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` + + // The date and time the volume group was created. Format defined by RFC3339. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // OCIDs for the volumes in this volume group. + VolumeIds []string `mandatory:"true" json:"volumeIds"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see + // Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The current state of a volume group. + LifecycleState VolumeGroupLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The aggregate size of the volume group in GBs. + SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` + + // The volume group source. The source is either another a list of + // volume IDs in the same availability domain, another volume group, or a volume group backup. + SourceDetails VolumeGroupSourceDetails `mandatory:"false" json:"sourceDetails"` + + // Specifies whether the newly created cloned volume group's data has finished copying from the source volume group or backup. + IsHydrated *bool `mandatory:"false" json:"isHydrated"` +} + +func (m VolumeGroup) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *VolumeGroup) UnmarshalJSON(data []byte) (e error) { + model := struct { + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + FreeformTags map[string]string `json:"freeformTags"` + LifecycleState VolumeGroupLifecycleStateEnum `json:"lifecycleState"` + SizeInGBs *int64 `json:"sizeInGBs"` + SourceDetails volumegroupsourcedetails `json:"sourceDetails"` + IsHydrated *bool `json:"isHydrated"` + AvailabilityDomain *string `json:"availabilityDomain"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Id *string `json:"id"` + SizeInMBs *int64 `json:"sizeInMBs"` + TimeCreated *common.SDKTime `json:"timeCreated"` + VolumeIds []string `json:"volumeIds"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DefinedTags = model.DefinedTags + m.FreeformTags = model.FreeformTags + m.LifecycleState = model.LifecycleState + m.SizeInGBs = model.SizeInGBs + nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceDetails = nn.(VolumeGroupSourceDetails) + } else { + m.SourceDetails = nil + } + m.IsHydrated = model.IsHydrated + m.AvailabilityDomain = model.AvailabilityDomain + m.CompartmentId = model.CompartmentId + m.DisplayName = model.DisplayName + m.Id = model.Id + m.SizeInMBs = model.SizeInMBs + m.TimeCreated = model.TimeCreated + m.VolumeIds = make([]string, len(model.VolumeIds)) + for i, n := range model.VolumeIds { + m.VolumeIds[i] = n + } + return +} + +// VolumeGroupLifecycleStateEnum Enum with underlying type: string +type VolumeGroupLifecycleStateEnum string + +// Set of constants representing the allowable values for VolumeGroupLifecycleStateEnum +const ( + VolumeGroupLifecycleStateProvisioning VolumeGroupLifecycleStateEnum = "PROVISIONING" + VolumeGroupLifecycleStateAvailable VolumeGroupLifecycleStateEnum = "AVAILABLE" + VolumeGroupLifecycleStateTerminating VolumeGroupLifecycleStateEnum = "TERMINATING" + VolumeGroupLifecycleStateTerminated VolumeGroupLifecycleStateEnum = "TERMINATED" + VolumeGroupLifecycleStateFaulty VolumeGroupLifecycleStateEnum = "FAULTY" +) + +var mappingVolumeGroupLifecycleState = map[string]VolumeGroupLifecycleStateEnum{ + "PROVISIONING": VolumeGroupLifecycleStateProvisioning, + "AVAILABLE": VolumeGroupLifecycleStateAvailable, + "TERMINATING": VolumeGroupLifecycleStateTerminating, + "TERMINATED": VolumeGroupLifecycleStateTerminated, + "FAULTY": VolumeGroupLifecycleStateFaulty, +} + +// GetVolumeGroupLifecycleStateEnumValues Enumerates the set of values for VolumeGroupLifecycleStateEnum +func GetVolumeGroupLifecycleStateEnumValues() []VolumeGroupLifecycleStateEnum { + values := make([]VolumeGroupLifecycleStateEnum, 0) + for _, v := range mappingVolumeGroupLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroupSourceDetails Specifies the source for a volume group. +type VolumeGroupSourceDetails interface { +} + +type volumegroupsourcedetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *volumegroupsourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalervolumegroupsourcedetails volumegroupsourcedetails + s := struct { + Model Unmarshalervolumegroupsourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *volumegroupsourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "volumeGroupId": + mm := VolumeGroupSourceFromVolumeGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "volumeIds": + mm := VolumeGroupSourceFromVolumesDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "volumeGroupBackupId": + mm := VolumeGroupSourceFromVolumeGroupBackupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m volumegroupsourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroupSourceFromVolumeGroupBackupDetails Specifies the volume group backup to restore from. +type VolumeGroupSourceFromVolumeGroupBackupDetails struct { + + // The OCID of the volume group backup to restore from. + VolumeGroupBackupId *string `mandatory:"true" json:"volumeGroupBackupId"` +} + +func (m VolumeGroupSourceFromVolumeGroupBackupDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m VolumeGroupSourceFromVolumeGroupBackupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails VolumeGroupSourceFromVolumeGroupBackupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails + }{ + "volumeGroupBackupId", + (MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volume_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroupSourceFromVolumeGroupDetails Specifies the volume group to clone from. +type VolumeGroupSourceFromVolumeGroupDetails struct { + + // The OCID of the volume group to clone from. + VolumeGroupId *string `mandatory:"true" json:"volumeGroupId"` +} + +func (m VolumeGroupSourceFromVolumeGroupDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m VolumeGroupSourceFromVolumeGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVolumeGroupSourceFromVolumeGroupDetails VolumeGroupSourceFromVolumeGroupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeVolumeGroupSourceFromVolumeGroupDetails + }{ + "volumeGroupId", + (MarshalTypeVolumeGroupSourceFromVolumeGroupDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volumes_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volumes_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volumes_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_from_volumes_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeGroupSourceFromVolumesDetails Specifies the volumes in a volume group. +type VolumeGroupSourceFromVolumesDetails struct { + + // OCIDs for the volumes in this volume group. + VolumeIds []string `mandatory:"true" json:"volumeIds"` +} + +func (m VolumeGroupSourceFromVolumesDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m VolumeGroupSourceFromVolumesDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVolumeGroupSourceFromVolumesDetails VolumeGroupSourceFromVolumesDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeVolumeGroupSourceFromVolumesDetails + }{ + "volumeIds", + (MarshalTypeVolumeGroupSourceFromVolumesDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_kms_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_kms_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_kms_key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_kms_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Core Services API +// +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. +// + +package core + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// VolumeKmsKey The KMS key OCID associated with this volume. +type VolumeKmsKey struct { + + // The KMS key OCID associated with this volume. If the volume is not using KMS, then the `kmsKeyId` will be a null string. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` +} + +func (m VolumeKmsKey) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core @@ -40,6 +44,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *volumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Type { case "volume": @@ -51,7 +60,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,13 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Core Services API // -// APIs for Networking Service, Compute Service, and Block Volume Service. +// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API +// to manage resources such as virtual cloud networks (VCNs), compute instances, and +// block storage volumes. // package core diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDatabaseBackup An Autonomous Database backup. +type AutonomousDatabaseBackup struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + AutonomousDatabaseId *string `mandatory:"true" json:"autonomousDatabaseId"` + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of backup. + Type AutonomousDatabaseBackupTypeEnum `mandatory:"true" json:"type"` + + // Indicates whether the backup is user-initiated or automatic. + IsAutomatic *bool `mandatory:"true" json:"isAutomatic"` + + // The current state of the backup. + LifecycleState AutonomousDatabaseBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m AutonomousDatabaseBackup) String() string { + return common.PointerString(m) +} + +// AutonomousDatabaseBackupTypeEnum Enum with underlying type: string +type AutonomousDatabaseBackupTypeEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseBackupTypeEnum +const ( + AutonomousDatabaseBackupTypeIncremental AutonomousDatabaseBackupTypeEnum = "INCREMENTAL" + AutonomousDatabaseBackupTypeFull AutonomousDatabaseBackupTypeEnum = "FULL" +) + +var mappingAutonomousDatabaseBackupType = map[string]AutonomousDatabaseBackupTypeEnum{ + "INCREMENTAL": AutonomousDatabaseBackupTypeIncremental, + "FULL": AutonomousDatabaseBackupTypeFull, +} + +// GetAutonomousDatabaseBackupTypeEnumValues Enumerates the set of values for AutonomousDatabaseBackupTypeEnum +func GetAutonomousDatabaseBackupTypeEnumValues() []AutonomousDatabaseBackupTypeEnum { + values := make([]AutonomousDatabaseBackupTypeEnum, 0) + for _, v := range mappingAutonomousDatabaseBackupType { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseBackupLifecycleStateEnum Enum with underlying type: string +type AutonomousDatabaseBackupLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseBackupLifecycleStateEnum +const ( + AutonomousDatabaseBackupLifecycleStateCreating AutonomousDatabaseBackupLifecycleStateEnum = "CREATING" + AutonomousDatabaseBackupLifecycleStateActive AutonomousDatabaseBackupLifecycleStateEnum = "ACTIVE" + AutonomousDatabaseBackupLifecycleStateDeleting AutonomousDatabaseBackupLifecycleStateEnum = "DELETING" + AutonomousDatabaseBackupLifecycleStateDeleted AutonomousDatabaseBackupLifecycleStateEnum = "DELETED" + AutonomousDatabaseBackupLifecycleStateFailed AutonomousDatabaseBackupLifecycleStateEnum = "FAILED" +) + +var mappingAutonomousDatabaseBackupLifecycleState = map[string]AutonomousDatabaseBackupLifecycleStateEnum{ + "CREATING": AutonomousDatabaseBackupLifecycleStateCreating, + "ACTIVE": AutonomousDatabaseBackupLifecycleStateActive, + "DELETING": AutonomousDatabaseBackupLifecycleStateDeleting, + "DELETED": AutonomousDatabaseBackupLifecycleStateDeleted, + "FAILED": AutonomousDatabaseBackupLifecycleStateFailed, +} + +// GetAutonomousDatabaseBackupLifecycleStateEnumValues Enumerates the set of values for AutonomousDatabaseBackupLifecycleStateEnum +func GetAutonomousDatabaseBackupLifecycleStateEnumValues() []AutonomousDatabaseBackupLifecycleStateEnum { + values := make([]AutonomousDatabaseBackupLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDatabaseBackupLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_backup_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDatabaseBackupSummary An Autonomous Database backup. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type AutonomousDatabaseBackupSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + AutonomousDatabaseId *string `mandatory:"true" json:"autonomousDatabaseId"` + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of backup. + Type AutonomousDatabaseBackupSummaryTypeEnum `mandatory:"true" json:"type"` + + // Indicates whether the backup is user-initiated or automatic. + IsAutomatic *bool `mandatory:"true" json:"isAutomatic"` + + // The current state of the backup. + LifecycleState AutonomousDatabaseBackupSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m AutonomousDatabaseBackupSummary) String() string { + return common.PointerString(m) +} + +// AutonomousDatabaseBackupSummaryTypeEnum Enum with underlying type: string +type AutonomousDatabaseBackupSummaryTypeEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseBackupSummaryTypeEnum +const ( + AutonomousDatabaseBackupSummaryTypeIncremental AutonomousDatabaseBackupSummaryTypeEnum = "INCREMENTAL" + AutonomousDatabaseBackupSummaryTypeFull AutonomousDatabaseBackupSummaryTypeEnum = "FULL" +) + +var mappingAutonomousDatabaseBackupSummaryType = map[string]AutonomousDatabaseBackupSummaryTypeEnum{ + "INCREMENTAL": AutonomousDatabaseBackupSummaryTypeIncremental, + "FULL": AutonomousDatabaseBackupSummaryTypeFull, +} + +// GetAutonomousDatabaseBackupSummaryTypeEnumValues Enumerates the set of values for AutonomousDatabaseBackupSummaryTypeEnum +func GetAutonomousDatabaseBackupSummaryTypeEnumValues() []AutonomousDatabaseBackupSummaryTypeEnum { + values := make([]AutonomousDatabaseBackupSummaryTypeEnum, 0) + for _, v := range mappingAutonomousDatabaseBackupSummaryType { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseBackupSummaryLifecycleStateEnum Enum with underlying type: string +type AutonomousDatabaseBackupSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseBackupSummaryLifecycleStateEnum +const ( + AutonomousDatabaseBackupSummaryLifecycleStateCreating AutonomousDatabaseBackupSummaryLifecycleStateEnum = "CREATING" + AutonomousDatabaseBackupSummaryLifecycleStateActive AutonomousDatabaseBackupSummaryLifecycleStateEnum = "ACTIVE" + AutonomousDatabaseBackupSummaryLifecycleStateDeleting AutonomousDatabaseBackupSummaryLifecycleStateEnum = "DELETING" + AutonomousDatabaseBackupSummaryLifecycleStateDeleted AutonomousDatabaseBackupSummaryLifecycleStateEnum = "DELETED" + AutonomousDatabaseBackupSummaryLifecycleStateFailed AutonomousDatabaseBackupSummaryLifecycleStateEnum = "FAILED" +) + +var mappingAutonomousDatabaseBackupSummaryLifecycleState = map[string]AutonomousDatabaseBackupSummaryLifecycleStateEnum{ + "CREATING": AutonomousDatabaseBackupSummaryLifecycleStateCreating, + "ACTIVE": AutonomousDatabaseBackupSummaryLifecycleStateActive, + "DELETING": AutonomousDatabaseBackupSummaryLifecycleStateDeleting, + "DELETED": AutonomousDatabaseBackupSummaryLifecycleStateDeleted, + "FAILED": AutonomousDatabaseBackupSummaryLifecycleStateFailed, +} + +// GetAutonomousDatabaseBackupSummaryLifecycleStateEnumValues Enumerates the set of values for AutonomousDatabaseBackupSummaryLifecycleStateEnum +func GetAutonomousDatabaseBackupSummaryLifecycleStateEnumValues() []AutonomousDatabaseBackupSummaryLifecycleStateEnum { + values := make([]AutonomousDatabaseBackupSummaryLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDatabaseBackupSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_connection_strings.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_connection_strings.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_connection_strings.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_connection_strings.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDatabaseConnectionStrings Connection strings to connect to an Oracle Autonomous Database. +type AutonomousDatabaseConnectionStrings struct { + + // The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + High *string `mandatory:"false" json:"high"` + + // The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + Medium *string `mandatory:"false" json:"medium"` + + // The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + Low *string `mandatory:"false" json:"low"` + + // Returns all connection strings that can be used to connect to the Autonomous Database. + // For more information, please see Predefined Database Service Names for Autonomous Transaction Processing (https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) + AllConnectionStrings map[string]string `mandatory:"false" json:"allConnectionStrings"` +} + +func (m AutonomousDatabaseConnectionStrings) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDatabase An Oracle Autonomous Database. +type AutonomousDatabase struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the database. + LifecycleState AutonomousDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The database name. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // Information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the database was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The URL of the Service Console for the Autonomous Database. + ServiceConsoleUrl *string `mandatory:"false" json:"serviceConsoleUrl"` + + // The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. + ConnectionStrings *AutonomousDatabaseConnectionStrings `mandatory:"false" json:"connectionStrings"` + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel AutonomousDatabaseLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // The amount of storage that has been used, in terabytes. + UsedDataStorageSizeInTBs *int `mandatory:"false" json:"usedDataStorageSizeInTBs"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A valid Oracle Database version for Autonomous Database. + DbVersion *string `mandatory:"false" json:"dbVersion"` + + // The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database. + DbWorkload AutonomousDatabaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + + // The client IP access control list (ACL). Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. This is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet. + WhitelistedIps []string `mandatory:"false" json:"whitelistedIps"` +} + +func (m AutonomousDatabase) String() string { + return common.PointerString(m) +} + +// AutonomousDatabaseLifecycleStateEnum Enum with underlying type: string +type AutonomousDatabaseLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseLifecycleStateEnum +const ( + AutonomousDatabaseLifecycleStateProvisioning AutonomousDatabaseLifecycleStateEnum = "PROVISIONING" + AutonomousDatabaseLifecycleStateAvailable AutonomousDatabaseLifecycleStateEnum = "AVAILABLE" + AutonomousDatabaseLifecycleStateStopping AutonomousDatabaseLifecycleStateEnum = "STOPPING" + AutonomousDatabaseLifecycleStateStopped AutonomousDatabaseLifecycleStateEnum = "STOPPED" + AutonomousDatabaseLifecycleStateStarting AutonomousDatabaseLifecycleStateEnum = "STARTING" + AutonomousDatabaseLifecycleStateTerminating AutonomousDatabaseLifecycleStateEnum = "TERMINATING" + AutonomousDatabaseLifecycleStateTerminated AutonomousDatabaseLifecycleStateEnum = "TERMINATED" + AutonomousDatabaseLifecycleStateUnavailable AutonomousDatabaseLifecycleStateEnum = "UNAVAILABLE" + AutonomousDatabaseLifecycleStateRestoreInProgress AutonomousDatabaseLifecycleStateEnum = "RESTORE_IN_PROGRESS" + AutonomousDatabaseLifecycleStateRestoreFailed AutonomousDatabaseLifecycleStateEnum = "RESTORE_FAILED" + AutonomousDatabaseLifecycleStateBackupInProgress AutonomousDatabaseLifecycleStateEnum = "BACKUP_IN_PROGRESS" + AutonomousDatabaseLifecycleStateScaleInProgress AutonomousDatabaseLifecycleStateEnum = "SCALE_IN_PROGRESS" + AutonomousDatabaseLifecycleStateAvailableNeedsAttention AutonomousDatabaseLifecycleStateEnum = "AVAILABLE_NEEDS_ATTENTION" + AutonomousDatabaseLifecycleStateUpdating AutonomousDatabaseLifecycleStateEnum = "UPDATING" +) + +var mappingAutonomousDatabaseLifecycleState = map[string]AutonomousDatabaseLifecycleStateEnum{ + "PROVISIONING": AutonomousDatabaseLifecycleStateProvisioning, + "AVAILABLE": AutonomousDatabaseLifecycleStateAvailable, + "STOPPING": AutonomousDatabaseLifecycleStateStopping, + "STOPPED": AutonomousDatabaseLifecycleStateStopped, + "STARTING": AutonomousDatabaseLifecycleStateStarting, + "TERMINATING": AutonomousDatabaseLifecycleStateTerminating, + "TERMINATED": AutonomousDatabaseLifecycleStateTerminated, + "UNAVAILABLE": AutonomousDatabaseLifecycleStateUnavailable, + "RESTORE_IN_PROGRESS": AutonomousDatabaseLifecycleStateRestoreInProgress, + "RESTORE_FAILED": AutonomousDatabaseLifecycleStateRestoreFailed, + "BACKUP_IN_PROGRESS": AutonomousDatabaseLifecycleStateBackupInProgress, + "SCALE_IN_PROGRESS": AutonomousDatabaseLifecycleStateScaleInProgress, + "AVAILABLE_NEEDS_ATTENTION": AutonomousDatabaseLifecycleStateAvailableNeedsAttention, + "UPDATING": AutonomousDatabaseLifecycleStateUpdating, +} + +// GetAutonomousDatabaseLifecycleStateEnumValues Enumerates the set of values for AutonomousDatabaseLifecycleStateEnum +func GetAutonomousDatabaseLifecycleStateEnumValues() []AutonomousDatabaseLifecycleStateEnum { + values := make([]AutonomousDatabaseLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDatabaseLifecycleState { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseLicenseModelEnum Enum with underlying type: string +type AutonomousDatabaseLicenseModelEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseLicenseModelEnum +const ( + AutonomousDatabaseLicenseModelLicenseIncluded AutonomousDatabaseLicenseModelEnum = "LICENSE_INCLUDED" + AutonomousDatabaseLicenseModelBringYourOwnLicense AutonomousDatabaseLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingAutonomousDatabaseLicenseModel = map[string]AutonomousDatabaseLicenseModelEnum{ + "LICENSE_INCLUDED": AutonomousDatabaseLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": AutonomousDatabaseLicenseModelBringYourOwnLicense, +} + +// GetAutonomousDatabaseLicenseModelEnumValues Enumerates the set of values for AutonomousDatabaseLicenseModelEnum +func GetAutonomousDatabaseLicenseModelEnumValues() []AutonomousDatabaseLicenseModelEnum { + values := make([]AutonomousDatabaseLicenseModelEnum, 0) + for _, v := range mappingAutonomousDatabaseLicenseModel { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseDbWorkloadEnum Enum with underlying type: string +type AutonomousDatabaseDbWorkloadEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseDbWorkloadEnum +const ( + AutonomousDatabaseDbWorkloadOltp AutonomousDatabaseDbWorkloadEnum = "OLTP" + AutonomousDatabaseDbWorkloadDw AutonomousDatabaseDbWorkloadEnum = "DW" +) + +var mappingAutonomousDatabaseDbWorkload = map[string]AutonomousDatabaseDbWorkloadEnum{ + "OLTP": AutonomousDatabaseDbWorkloadOltp, + "DW": AutonomousDatabaseDbWorkloadDw, +} + +// GetAutonomousDatabaseDbWorkloadEnumValues Enumerates the set of values for AutonomousDatabaseDbWorkloadEnum +func GetAutonomousDatabaseDbWorkloadEnumValues() []AutonomousDatabaseDbWorkloadEnum { + values := make([]AutonomousDatabaseDbWorkloadEnum, 0) + for _, v := range mappingAutonomousDatabaseDbWorkload { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_database_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,173 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDatabaseSummary An Oracle Autonomous Database. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type AutonomousDatabaseSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the database. + LifecycleState AutonomousDatabaseSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The database name. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // Information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the database was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The URL of the Service Console for the Autonomous Database. + ServiceConsoleUrl *string `mandatory:"false" json:"serviceConsoleUrl"` + + // The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. + ConnectionStrings *AutonomousDatabaseConnectionStrings `mandatory:"false" json:"connectionStrings"` + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel AutonomousDatabaseSummaryLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // The amount of storage that has been used, in terabytes. + UsedDataStorageSizeInTBs *int `mandatory:"false" json:"usedDataStorageSizeInTBs"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A valid Oracle Database version for Autonomous Database. + DbVersion *string `mandatory:"false" json:"dbVersion"` + + // The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database. + DbWorkload AutonomousDatabaseSummaryDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + + // The client IP access control list (ACL). Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. This is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet. + WhitelistedIps []string `mandatory:"false" json:"whitelistedIps"` +} + +func (m AutonomousDatabaseSummary) String() string { + return common.PointerString(m) +} + +// AutonomousDatabaseSummaryLifecycleStateEnum Enum with underlying type: string +type AutonomousDatabaseSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseSummaryLifecycleStateEnum +const ( + AutonomousDatabaseSummaryLifecycleStateProvisioning AutonomousDatabaseSummaryLifecycleStateEnum = "PROVISIONING" + AutonomousDatabaseSummaryLifecycleStateAvailable AutonomousDatabaseSummaryLifecycleStateEnum = "AVAILABLE" + AutonomousDatabaseSummaryLifecycleStateStopping AutonomousDatabaseSummaryLifecycleStateEnum = "STOPPING" + AutonomousDatabaseSummaryLifecycleStateStopped AutonomousDatabaseSummaryLifecycleStateEnum = "STOPPED" + AutonomousDatabaseSummaryLifecycleStateStarting AutonomousDatabaseSummaryLifecycleStateEnum = "STARTING" + AutonomousDatabaseSummaryLifecycleStateTerminating AutonomousDatabaseSummaryLifecycleStateEnum = "TERMINATING" + AutonomousDatabaseSummaryLifecycleStateTerminated AutonomousDatabaseSummaryLifecycleStateEnum = "TERMINATED" + AutonomousDatabaseSummaryLifecycleStateUnavailable AutonomousDatabaseSummaryLifecycleStateEnum = "UNAVAILABLE" + AutonomousDatabaseSummaryLifecycleStateRestoreInProgress AutonomousDatabaseSummaryLifecycleStateEnum = "RESTORE_IN_PROGRESS" + AutonomousDatabaseSummaryLifecycleStateRestoreFailed AutonomousDatabaseSummaryLifecycleStateEnum = "RESTORE_FAILED" + AutonomousDatabaseSummaryLifecycleStateBackupInProgress AutonomousDatabaseSummaryLifecycleStateEnum = "BACKUP_IN_PROGRESS" + AutonomousDatabaseSummaryLifecycleStateScaleInProgress AutonomousDatabaseSummaryLifecycleStateEnum = "SCALE_IN_PROGRESS" + AutonomousDatabaseSummaryLifecycleStateAvailableNeedsAttention AutonomousDatabaseSummaryLifecycleStateEnum = "AVAILABLE_NEEDS_ATTENTION" + AutonomousDatabaseSummaryLifecycleStateUpdating AutonomousDatabaseSummaryLifecycleStateEnum = "UPDATING" +) + +var mappingAutonomousDatabaseSummaryLifecycleState = map[string]AutonomousDatabaseSummaryLifecycleStateEnum{ + "PROVISIONING": AutonomousDatabaseSummaryLifecycleStateProvisioning, + "AVAILABLE": AutonomousDatabaseSummaryLifecycleStateAvailable, + "STOPPING": AutonomousDatabaseSummaryLifecycleStateStopping, + "STOPPED": AutonomousDatabaseSummaryLifecycleStateStopped, + "STARTING": AutonomousDatabaseSummaryLifecycleStateStarting, + "TERMINATING": AutonomousDatabaseSummaryLifecycleStateTerminating, + "TERMINATED": AutonomousDatabaseSummaryLifecycleStateTerminated, + "UNAVAILABLE": AutonomousDatabaseSummaryLifecycleStateUnavailable, + "RESTORE_IN_PROGRESS": AutonomousDatabaseSummaryLifecycleStateRestoreInProgress, + "RESTORE_FAILED": AutonomousDatabaseSummaryLifecycleStateRestoreFailed, + "BACKUP_IN_PROGRESS": AutonomousDatabaseSummaryLifecycleStateBackupInProgress, + "SCALE_IN_PROGRESS": AutonomousDatabaseSummaryLifecycleStateScaleInProgress, + "AVAILABLE_NEEDS_ATTENTION": AutonomousDatabaseSummaryLifecycleStateAvailableNeedsAttention, + "UPDATING": AutonomousDatabaseSummaryLifecycleStateUpdating, +} + +// GetAutonomousDatabaseSummaryLifecycleStateEnumValues Enumerates the set of values for AutonomousDatabaseSummaryLifecycleStateEnum +func GetAutonomousDatabaseSummaryLifecycleStateEnumValues() []AutonomousDatabaseSummaryLifecycleStateEnum { + values := make([]AutonomousDatabaseSummaryLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDatabaseSummaryLifecycleState { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseSummaryLicenseModelEnum Enum with underlying type: string +type AutonomousDatabaseSummaryLicenseModelEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseSummaryLicenseModelEnum +const ( + AutonomousDatabaseSummaryLicenseModelLicenseIncluded AutonomousDatabaseSummaryLicenseModelEnum = "LICENSE_INCLUDED" + AutonomousDatabaseSummaryLicenseModelBringYourOwnLicense AutonomousDatabaseSummaryLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingAutonomousDatabaseSummaryLicenseModel = map[string]AutonomousDatabaseSummaryLicenseModelEnum{ + "LICENSE_INCLUDED": AutonomousDatabaseSummaryLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": AutonomousDatabaseSummaryLicenseModelBringYourOwnLicense, +} + +// GetAutonomousDatabaseSummaryLicenseModelEnumValues Enumerates the set of values for AutonomousDatabaseSummaryLicenseModelEnum +func GetAutonomousDatabaseSummaryLicenseModelEnumValues() []AutonomousDatabaseSummaryLicenseModelEnum { + values := make([]AutonomousDatabaseSummaryLicenseModelEnum, 0) + for _, v := range mappingAutonomousDatabaseSummaryLicenseModel { + values = append(values, v) + } + return values +} + +// AutonomousDatabaseSummaryDbWorkloadEnum Enum with underlying type: string +type AutonomousDatabaseSummaryDbWorkloadEnum string + +// Set of constants representing the allowable values for AutonomousDatabaseSummaryDbWorkloadEnum +const ( + AutonomousDatabaseSummaryDbWorkloadOltp AutonomousDatabaseSummaryDbWorkloadEnum = "OLTP" + AutonomousDatabaseSummaryDbWorkloadDw AutonomousDatabaseSummaryDbWorkloadEnum = "DW" +) + +var mappingAutonomousDatabaseSummaryDbWorkload = map[string]AutonomousDatabaseSummaryDbWorkloadEnum{ + "OLTP": AutonomousDatabaseSummaryDbWorkloadOltp, + "DW": AutonomousDatabaseSummaryDbWorkloadDw, +} + +// GetAutonomousDatabaseSummaryDbWorkloadEnumValues Enumerates the set of values for AutonomousDatabaseSummaryDbWorkloadEnum +func GetAutonomousDatabaseSummaryDbWorkloadEnumValues() []AutonomousDatabaseSummaryDbWorkloadEnum { + values := make([]AutonomousDatabaseSummaryDbWorkloadEnum, 0) + for _, v := range mappingAutonomousDatabaseSummaryDbWorkload { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDataWarehouseBackup **Deprecated.** See AutonomousDatabaseBackup for reference information about Autonomous Data Warehouse backups. +type AutonomousDataWarehouseBackup struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse backup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse. + AutonomousDataWarehouseId *string `mandatory:"true" json:"autonomousDataWarehouseId"` + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of backup. + Type AutonomousDataWarehouseBackupTypeEnum `mandatory:"true" json:"type"` + + // Indicates whether the backup is user-initiated or automatic. + IsAutomatic *bool `mandatory:"true" json:"isAutomatic"` + + // The current state of the backup. + LifecycleState AutonomousDataWarehouseBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m AutonomousDataWarehouseBackup) String() string { + return common.PointerString(m) +} + +// AutonomousDataWarehouseBackupTypeEnum Enum with underlying type: string +type AutonomousDataWarehouseBackupTypeEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseBackupTypeEnum +const ( + AutonomousDataWarehouseBackupTypeIncremental AutonomousDataWarehouseBackupTypeEnum = "INCREMENTAL" + AutonomousDataWarehouseBackupTypeFull AutonomousDataWarehouseBackupTypeEnum = "FULL" +) + +var mappingAutonomousDataWarehouseBackupType = map[string]AutonomousDataWarehouseBackupTypeEnum{ + "INCREMENTAL": AutonomousDataWarehouseBackupTypeIncremental, + "FULL": AutonomousDataWarehouseBackupTypeFull, +} + +// GetAutonomousDataWarehouseBackupTypeEnumValues Enumerates the set of values for AutonomousDataWarehouseBackupTypeEnum +func GetAutonomousDataWarehouseBackupTypeEnumValues() []AutonomousDataWarehouseBackupTypeEnum { + values := make([]AutonomousDataWarehouseBackupTypeEnum, 0) + for _, v := range mappingAutonomousDataWarehouseBackupType { + values = append(values, v) + } + return values +} + +// AutonomousDataWarehouseBackupLifecycleStateEnum Enum with underlying type: string +type AutonomousDataWarehouseBackupLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseBackupLifecycleStateEnum +const ( + AutonomousDataWarehouseBackupLifecycleStateCreating AutonomousDataWarehouseBackupLifecycleStateEnum = "CREATING" + AutonomousDataWarehouseBackupLifecycleStateActive AutonomousDataWarehouseBackupLifecycleStateEnum = "ACTIVE" + AutonomousDataWarehouseBackupLifecycleStateDeleting AutonomousDataWarehouseBackupLifecycleStateEnum = "DELETING" + AutonomousDataWarehouseBackupLifecycleStateDeleted AutonomousDataWarehouseBackupLifecycleStateEnum = "DELETED" + AutonomousDataWarehouseBackupLifecycleStateFailed AutonomousDataWarehouseBackupLifecycleStateEnum = "FAILED" +) + +var mappingAutonomousDataWarehouseBackupLifecycleState = map[string]AutonomousDataWarehouseBackupLifecycleStateEnum{ + "CREATING": AutonomousDataWarehouseBackupLifecycleStateCreating, + "ACTIVE": AutonomousDataWarehouseBackupLifecycleStateActive, + "DELETING": AutonomousDataWarehouseBackupLifecycleStateDeleting, + "DELETED": AutonomousDataWarehouseBackupLifecycleStateDeleted, + "FAILED": AutonomousDataWarehouseBackupLifecycleStateFailed, +} + +// GetAutonomousDataWarehouseBackupLifecycleStateEnumValues Enumerates the set of values for AutonomousDataWarehouseBackupLifecycleStateEnum +func GetAutonomousDataWarehouseBackupLifecycleStateEnumValues() []AutonomousDataWarehouseBackupLifecycleStateEnum { + values := make([]AutonomousDataWarehouseBackupLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDataWarehouseBackupLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_backup_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDataWarehouseBackupSummary **Deprecated.** See AutonomousDataWarehouseBackupSummary for reference information about Autonomous Data Warehouse backups. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type AutonomousDataWarehouseBackupSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse backup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse. + AutonomousDataWarehouseId *string `mandatory:"true" json:"autonomousDataWarehouseId"` + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of backup. + Type AutonomousDataWarehouseBackupSummaryTypeEnum `mandatory:"true" json:"type"` + + // Indicates whether the backup is user-initiated or automatic. + IsAutomatic *bool `mandatory:"true" json:"isAutomatic"` + + // The current state of the backup. + LifecycleState AutonomousDataWarehouseBackupSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m AutonomousDataWarehouseBackupSummary) String() string { + return common.PointerString(m) +} + +// AutonomousDataWarehouseBackupSummaryTypeEnum Enum with underlying type: string +type AutonomousDataWarehouseBackupSummaryTypeEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseBackupSummaryTypeEnum +const ( + AutonomousDataWarehouseBackupSummaryTypeIncremental AutonomousDataWarehouseBackupSummaryTypeEnum = "INCREMENTAL" + AutonomousDataWarehouseBackupSummaryTypeFull AutonomousDataWarehouseBackupSummaryTypeEnum = "FULL" +) + +var mappingAutonomousDataWarehouseBackupSummaryType = map[string]AutonomousDataWarehouseBackupSummaryTypeEnum{ + "INCREMENTAL": AutonomousDataWarehouseBackupSummaryTypeIncremental, + "FULL": AutonomousDataWarehouseBackupSummaryTypeFull, +} + +// GetAutonomousDataWarehouseBackupSummaryTypeEnumValues Enumerates the set of values for AutonomousDataWarehouseBackupSummaryTypeEnum +func GetAutonomousDataWarehouseBackupSummaryTypeEnumValues() []AutonomousDataWarehouseBackupSummaryTypeEnum { + values := make([]AutonomousDataWarehouseBackupSummaryTypeEnum, 0) + for _, v := range mappingAutonomousDataWarehouseBackupSummaryType { + values = append(values, v) + } + return values +} + +// AutonomousDataWarehouseBackupSummaryLifecycleStateEnum Enum with underlying type: string +type AutonomousDataWarehouseBackupSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseBackupSummaryLifecycleStateEnum +const ( + AutonomousDataWarehouseBackupSummaryLifecycleStateCreating AutonomousDataWarehouseBackupSummaryLifecycleStateEnum = "CREATING" + AutonomousDataWarehouseBackupSummaryLifecycleStateActive AutonomousDataWarehouseBackupSummaryLifecycleStateEnum = "ACTIVE" + AutonomousDataWarehouseBackupSummaryLifecycleStateDeleting AutonomousDataWarehouseBackupSummaryLifecycleStateEnum = "DELETING" + AutonomousDataWarehouseBackupSummaryLifecycleStateDeleted AutonomousDataWarehouseBackupSummaryLifecycleStateEnum = "DELETED" + AutonomousDataWarehouseBackupSummaryLifecycleStateFailed AutonomousDataWarehouseBackupSummaryLifecycleStateEnum = "FAILED" +) + +var mappingAutonomousDataWarehouseBackupSummaryLifecycleState = map[string]AutonomousDataWarehouseBackupSummaryLifecycleStateEnum{ + "CREATING": AutonomousDataWarehouseBackupSummaryLifecycleStateCreating, + "ACTIVE": AutonomousDataWarehouseBackupSummaryLifecycleStateActive, + "DELETING": AutonomousDataWarehouseBackupSummaryLifecycleStateDeleting, + "DELETED": AutonomousDataWarehouseBackupSummaryLifecycleStateDeleted, + "FAILED": AutonomousDataWarehouseBackupSummaryLifecycleStateFailed, +} + +// GetAutonomousDataWarehouseBackupSummaryLifecycleStateEnumValues Enumerates the set of values for AutonomousDataWarehouseBackupSummaryLifecycleStateEnum +func GetAutonomousDataWarehouseBackupSummaryLifecycleStateEnumValues() []AutonomousDataWarehouseBackupSummaryLifecycleStateEnum { + values := make([]AutonomousDataWarehouseBackupSummaryLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDataWarehouseBackupSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_connection_strings.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_connection_strings.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_connection_strings.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_connection_strings.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDataWarehouseConnectionStrings **Deprecated.** For information about connection strings to connect to an Oracle Autonomous Data Warehouse, see AutonomousDatabaseConnectionStrings. +type AutonomousDataWarehouseConnectionStrings struct { + + // The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + High *string `mandatory:"false" json:"high"` + + // The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + Medium *string `mandatory:"false" json:"medium"` + + // The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + Low *string `mandatory:"false" json:"low"` + + // Returns all connection strings that can be used to connect to the Autonomous Data Warehouse. + // For more information, please see Predefined Database Service Names for Autonomous Transaction Processing (https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) + AllConnectionStrings map[string]string `mandatory:"false" json:"allConnectionStrings"` +} + +func (m AutonomousDataWarehouseConnectionStrings) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDataWarehouse **Deprecated.** See AutonomousDatabase for reference information about Autonomous Databases with the warehouse workload type. +type AutonomousDataWarehouse struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the database. + LifecycleState AutonomousDataWarehouseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The database name. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // Information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the database was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The URL of the Service Console for the Data Warehouse. + ServiceConsoleUrl *string `mandatory:"false" json:"serviceConsoleUrl"` + + // The connection string used to connect to the Data Warehouse. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Data Warehouse for the password value. + ConnectionStrings *AutonomousDataWarehouseConnectionStrings `mandatory:"false" json:"connectionStrings"` + + // The Oracle license model that applies to the Oracle Autonomous Data Warehouse. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel AutonomousDataWarehouseLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A valid Oracle Database version for Autonomous Data Warehouse. + DbVersion *string `mandatory:"false" json:"dbVersion"` +} + +func (m AutonomousDataWarehouse) String() string { + return common.PointerString(m) +} + +// AutonomousDataWarehouseLifecycleStateEnum Enum with underlying type: string +type AutonomousDataWarehouseLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseLifecycleStateEnum +const ( + AutonomousDataWarehouseLifecycleStateProvisioning AutonomousDataWarehouseLifecycleStateEnum = "PROVISIONING" + AutonomousDataWarehouseLifecycleStateAvailable AutonomousDataWarehouseLifecycleStateEnum = "AVAILABLE" + AutonomousDataWarehouseLifecycleStateStopping AutonomousDataWarehouseLifecycleStateEnum = "STOPPING" + AutonomousDataWarehouseLifecycleStateStopped AutonomousDataWarehouseLifecycleStateEnum = "STOPPED" + AutonomousDataWarehouseLifecycleStateStarting AutonomousDataWarehouseLifecycleStateEnum = "STARTING" + AutonomousDataWarehouseLifecycleStateTerminating AutonomousDataWarehouseLifecycleStateEnum = "TERMINATING" + AutonomousDataWarehouseLifecycleStateTerminated AutonomousDataWarehouseLifecycleStateEnum = "TERMINATED" + AutonomousDataWarehouseLifecycleStateUnavailable AutonomousDataWarehouseLifecycleStateEnum = "UNAVAILABLE" + AutonomousDataWarehouseLifecycleStateRestoreInProgress AutonomousDataWarehouseLifecycleStateEnum = "RESTORE_IN_PROGRESS" + AutonomousDataWarehouseLifecycleStateBackupInProgress AutonomousDataWarehouseLifecycleStateEnum = "BACKUP_IN_PROGRESS" + AutonomousDataWarehouseLifecycleStateScaleInProgress AutonomousDataWarehouseLifecycleStateEnum = "SCALE_IN_PROGRESS" + AutonomousDataWarehouseLifecycleStateAvailableNeedsAttention AutonomousDataWarehouseLifecycleStateEnum = "AVAILABLE_NEEDS_ATTENTION" +) + +var mappingAutonomousDataWarehouseLifecycleState = map[string]AutonomousDataWarehouseLifecycleStateEnum{ + "PROVISIONING": AutonomousDataWarehouseLifecycleStateProvisioning, + "AVAILABLE": AutonomousDataWarehouseLifecycleStateAvailable, + "STOPPING": AutonomousDataWarehouseLifecycleStateStopping, + "STOPPED": AutonomousDataWarehouseLifecycleStateStopped, + "STARTING": AutonomousDataWarehouseLifecycleStateStarting, + "TERMINATING": AutonomousDataWarehouseLifecycleStateTerminating, + "TERMINATED": AutonomousDataWarehouseLifecycleStateTerminated, + "UNAVAILABLE": AutonomousDataWarehouseLifecycleStateUnavailable, + "RESTORE_IN_PROGRESS": AutonomousDataWarehouseLifecycleStateRestoreInProgress, + "BACKUP_IN_PROGRESS": AutonomousDataWarehouseLifecycleStateBackupInProgress, + "SCALE_IN_PROGRESS": AutonomousDataWarehouseLifecycleStateScaleInProgress, + "AVAILABLE_NEEDS_ATTENTION": AutonomousDataWarehouseLifecycleStateAvailableNeedsAttention, +} + +// GetAutonomousDataWarehouseLifecycleStateEnumValues Enumerates the set of values for AutonomousDataWarehouseLifecycleStateEnum +func GetAutonomousDataWarehouseLifecycleStateEnumValues() []AutonomousDataWarehouseLifecycleStateEnum { + values := make([]AutonomousDataWarehouseLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDataWarehouseLifecycleState { + values = append(values, v) + } + return values +} + +// AutonomousDataWarehouseLicenseModelEnum Enum with underlying type: string +type AutonomousDataWarehouseLicenseModelEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseLicenseModelEnum +const ( + AutonomousDataWarehouseLicenseModelLicenseIncluded AutonomousDataWarehouseLicenseModelEnum = "LICENSE_INCLUDED" + AutonomousDataWarehouseLicenseModelBringYourOwnLicense AutonomousDataWarehouseLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingAutonomousDataWarehouseLicenseModel = map[string]AutonomousDataWarehouseLicenseModelEnum{ + "LICENSE_INCLUDED": AutonomousDataWarehouseLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": AutonomousDataWarehouseLicenseModelBringYourOwnLicense, +} + +// GetAutonomousDataWarehouseLicenseModelEnumValues Enumerates the set of values for AutonomousDataWarehouseLicenseModelEnum +func GetAutonomousDataWarehouseLicenseModelEnumValues() []AutonomousDataWarehouseLicenseModelEnum { + values := make([]AutonomousDataWarehouseLicenseModelEnum, 0) + for _, v := range mappingAutonomousDataWarehouseLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/autonomous_data_warehouse_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,137 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AutonomousDataWarehouseSummary **Deprecated.** See AutonomousDatabase for reference information about Autonomous Databases with the warehouse workload type. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type AutonomousDataWarehouseSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the database. + LifecycleState AutonomousDataWarehouseSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The database name. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // Information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the database was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The URL of the Service Console for the Data Warehouse. + ServiceConsoleUrl *string `mandatory:"false" json:"serviceConsoleUrl"` + + // The connection string used to connect to the Data Warehouse. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Data Warehouse for the password value. + ConnectionStrings *AutonomousDataWarehouseConnectionStrings `mandatory:"false" json:"connectionStrings"` + + // The Oracle license model that applies to the Oracle Autonomous Data Warehouse. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel AutonomousDataWarehouseSummaryLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A valid Oracle Database version for Autonomous Data Warehouse. + DbVersion *string `mandatory:"false" json:"dbVersion"` +} + +func (m AutonomousDataWarehouseSummary) String() string { + return common.PointerString(m) +} + +// AutonomousDataWarehouseSummaryLifecycleStateEnum Enum with underlying type: string +type AutonomousDataWarehouseSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseSummaryLifecycleStateEnum +const ( + AutonomousDataWarehouseSummaryLifecycleStateProvisioning AutonomousDataWarehouseSummaryLifecycleStateEnum = "PROVISIONING" + AutonomousDataWarehouseSummaryLifecycleStateAvailable AutonomousDataWarehouseSummaryLifecycleStateEnum = "AVAILABLE" + AutonomousDataWarehouseSummaryLifecycleStateStopping AutonomousDataWarehouseSummaryLifecycleStateEnum = "STOPPING" + AutonomousDataWarehouseSummaryLifecycleStateStopped AutonomousDataWarehouseSummaryLifecycleStateEnum = "STOPPED" + AutonomousDataWarehouseSummaryLifecycleStateStarting AutonomousDataWarehouseSummaryLifecycleStateEnum = "STARTING" + AutonomousDataWarehouseSummaryLifecycleStateTerminating AutonomousDataWarehouseSummaryLifecycleStateEnum = "TERMINATING" + AutonomousDataWarehouseSummaryLifecycleStateTerminated AutonomousDataWarehouseSummaryLifecycleStateEnum = "TERMINATED" + AutonomousDataWarehouseSummaryLifecycleStateUnavailable AutonomousDataWarehouseSummaryLifecycleStateEnum = "UNAVAILABLE" + AutonomousDataWarehouseSummaryLifecycleStateRestoreInProgress AutonomousDataWarehouseSummaryLifecycleStateEnum = "RESTORE_IN_PROGRESS" + AutonomousDataWarehouseSummaryLifecycleStateBackupInProgress AutonomousDataWarehouseSummaryLifecycleStateEnum = "BACKUP_IN_PROGRESS" + AutonomousDataWarehouseSummaryLifecycleStateScaleInProgress AutonomousDataWarehouseSummaryLifecycleStateEnum = "SCALE_IN_PROGRESS" + AutonomousDataWarehouseSummaryLifecycleStateAvailableNeedsAttention AutonomousDataWarehouseSummaryLifecycleStateEnum = "AVAILABLE_NEEDS_ATTENTION" +) + +var mappingAutonomousDataWarehouseSummaryLifecycleState = map[string]AutonomousDataWarehouseSummaryLifecycleStateEnum{ + "PROVISIONING": AutonomousDataWarehouseSummaryLifecycleStateProvisioning, + "AVAILABLE": AutonomousDataWarehouseSummaryLifecycleStateAvailable, + "STOPPING": AutonomousDataWarehouseSummaryLifecycleStateStopping, + "STOPPED": AutonomousDataWarehouseSummaryLifecycleStateStopped, + "STARTING": AutonomousDataWarehouseSummaryLifecycleStateStarting, + "TERMINATING": AutonomousDataWarehouseSummaryLifecycleStateTerminating, + "TERMINATED": AutonomousDataWarehouseSummaryLifecycleStateTerminated, + "UNAVAILABLE": AutonomousDataWarehouseSummaryLifecycleStateUnavailable, + "RESTORE_IN_PROGRESS": AutonomousDataWarehouseSummaryLifecycleStateRestoreInProgress, + "BACKUP_IN_PROGRESS": AutonomousDataWarehouseSummaryLifecycleStateBackupInProgress, + "SCALE_IN_PROGRESS": AutonomousDataWarehouseSummaryLifecycleStateScaleInProgress, + "AVAILABLE_NEEDS_ATTENTION": AutonomousDataWarehouseSummaryLifecycleStateAvailableNeedsAttention, +} + +// GetAutonomousDataWarehouseSummaryLifecycleStateEnumValues Enumerates the set of values for AutonomousDataWarehouseSummaryLifecycleStateEnum +func GetAutonomousDataWarehouseSummaryLifecycleStateEnumValues() []AutonomousDataWarehouseSummaryLifecycleStateEnum { + values := make([]AutonomousDataWarehouseSummaryLifecycleStateEnum, 0) + for _, v := range mappingAutonomousDataWarehouseSummaryLifecycleState { + values = append(values, v) + } + return values +} + +// AutonomousDataWarehouseSummaryLicenseModelEnum Enum with underlying type: string +type AutonomousDataWarehouseSummaryLicenseModelEnum string + +// Set of constants representing the allowable values for AutonomousDataWarehouseSummaryLicenseModelEnum +const ( + AutonomousDataWarehouseSummaryLicenseModelLicenseIncluded AutonomousDataWarehouseSummaryLicenseModelEnum = "LICENSE_INCLUDED" + AutonomousDataWarehouseSummaryLicenseModelBringYourOwnLicense AutonomousDataWarehouseSummaryLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingAutonomousDataWarehouseSummaryLicenseModel = map[string]AutonomousDataWarehouseSummaryLicenseModelEnum{ + "LICENSE_INCLUDED": AutonomousDataWarehouseSummaryLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": AutonomousDataWarehouseSummaryLicenseModelBringYourOwnLicense, +} + +// GetAutonomousDataWarehouseSummaryLicenseModelEnumValues Enumerates the set of values for AutonomousDataWarehouseSummaryLicenseModelEnum +func GetAutonomousDataWarehouseSummaryLicenseModelEnumValues() []AutonomousDataWarehouseSummaryLicenseModelEnum { + values := make([]AutonomousDataWarehouseSummaryLicenseModelEnum, 0) + for _, v := range mappingAutonomousDataWarehouseSummaryLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,49 +12,77 @@ "github.com/oracle/oci-go-sdk/common" ) -// Backup A database backup -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Backup The representation of Backup type Backup struct { - // The name of the Availability Domain that the backup is located in. - AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup. + Id *string `mandatory:"false" json:"id"` - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // The OCID of the database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. DatabaseId *string `mandatory:"false" json:"databaseId"` - // The user-friendly name for the backup. It does not have to be unique. + // The user-friendly name for the backup. The name does not have to be unique. DisplayName *string `mandatory:"false" json:"displayName"` - // The OCID of the backup. - Id *string `mandatory:"false" json:"id"` + // The type of backup. + Type BackupTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup was completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // The name of the availability domain where the database backup is stored. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The current state of the backup. LifecycleState BackupLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` - // The date and time the backup was completed. - TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` - - // The date and time the backup starts. - TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + // The Oracle Database edition of the DB system from which the database backup was taken. + DatabaseEdition BackupDatabaseEditionEnum `mandatory:"false" json:"databaseEdition,omitempty"` - // The type of backup. - Type BackupTypeEnum `mandatory:"false" json:"type,omitempty"` + // The size of the database in gigabytes at the time the backup was taken. + DatabaseSizeInGBs *float64 `mandatory:"false" json:"databaseSizeInGBs"` } func (m Backup) String() string { return common.PointerString(m) } +// BackupTypeEnum Enum with underlying type: string +type BackupTypeEnum string + +// Set of constants representing the allowable values for BackupTypeEnum +const ( + BackupTypeIncremental BackupTypeEnum = "INCREMENTAL" + BackupTypeFull BackupTypeEnum = "FULL" +) + +var mappingBackupType = map[string]BackupTypeEnum{ + "INCREMENTAL": BackupTypeIncremental, + "FULL": BackupTypeFull, +} + +// GetBackupTypeEnumValues Enumerates the set of values for BackupTypeEnum +func GetBackupTypeEnumValues() []BackupTypeEnum { + values := make([]BackupTypeEnum, 0) + for _, v := range mappingBackupType { + values = append(values, v) + } + return values +} + // BackupLifecycleStateEnum Enum with underlying type: string type BackupLifecycleStateEnum string -// Set of constants representing the allowable values for BackupLifecycleState +// Set of constants representing the allowable values for BackupLifecycleStateEnum const ( BackupLifecycleStateCreating BackupLifecycleStateEnum = "CREATING" BackupLifecycleStateActive BackupLifecycleStateEnum = "ACTIVE" @@ -73,7 +101,7 @@ "RESTORING": BackupLifecycleStateRestoring, } -// GetBackupLifecycleStateEnumValues Enumerates the set of values for BackupLifecycleState +// GetBackupLifecycleStateEnumValues Enumerates the set of values for BackupLifecycleStateEnum func GetBackupLifecycleStateEnumValues() []BackupLifecycleStateEnum { values := make([]BackupLifecycleStateEnum, 0) for _, v := range mappingBackupLifecycleState { @@ -82,24 +110,28 @@ return values } -// BackupTypeEnum Enum with underlying type: string -type BackupTypeEnum string +// BackupDatabaseEditionEnum Enum with underlying type: string +type BackupDatabaseEditionEnum string -// Set of constants representing the allowable values for BackupType +// Set of constants representing the allowable values for BackupDatabaseEditionEnum const ( - BackupTypeIncremental BackupTypeEnum = "INCREMENTAL" - BackupTypeFull BackupTypeEnum = "FULL" + BackupDatabaseEditionStandardEdition BackupDatabaseEditionEnum = "STANDARD_EDITION" + BackupDatabaseEditionEnterpriseEdition BackupDatabaseEditionEnum = "ENTERPRISE_EDITION" + BackupDatabaseEditionEnterpriseEditionHighPerformance BackupDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + BackupDatabaseEditionEnterpriseEditionExtremePerformance BackupDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" ) -var mappingBackupType = map[string]BackupTypeEnum{ - "INCREMENTAL": BackupTypeIncremental, - "FULL": BackupTypeFull, +var mappingBackupDatabaseEdition = map[string]BackupDatabaseEditionEnum{ + "STANDARD_EDITION": BackupDatabaseEditionStandardEdition, + "ENTERPRISE_EDITION": BackupDatabaseEditionEnterpriseEdition, + "ENTERPRISE_EDITION_HIGH_PERFORMANCE": BackupDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": BackupDatabaseEditionEnterpriseEditionExtremePerformance, } -// GetBackupTypeEnumValues Enumerates the set of values for BackupType -func GetBackupTypeEnumValues() []BackupTypeEnum { - values := make([]BackupTypeEnum, 0) - for _, v := range mappingBackupType { +// GetBackupDatabaseEditionEnumValues Enumerates the set of values for BackupDatabaseEditionEnum +func GetBackupDatabaseEditionEnumValues() []BackupDatabaseEditionEnum { + values := make([]BackupDatabaseEditionEnum, 0) + for _, v := range mappingBackupDatabaseEdition { values = append(values, v) } return values diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/backup_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,49 +12,79 @@ "github.com/oracle/oci-go-sdk/common" ) -// BackupSummary A database backup -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// BackupSummary A database backup. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type BackupSummary struct { - // The name of the Availability Domain that the backup is located in. - AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup. + Id *string `mandatory:"false" json:"id"` - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // The OCID of the database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. DatabaseId *string `mandatory:"false" json:"databaseId"` - // The user-friendly name for the backup. It does not have to be unique. + // The user-friendly name for the backup. The name does not have to be unique. DisplayName *string `mandatory:"false" json:"displayName"` - // The OCID of the backup. - Id *string `mandatory:"false" json:"id"` + // The type of backup. + Type BackupSummaryTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The date and time the backup started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the backup was completed. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // The name of the availability domain where the database backup is stored. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The current state of the backup. LifecycleState BackupSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` - // The date and time the backup was completed. - TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` - - // The date and time the backup starts. - TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + // The Oracle Database edition of the DB system from which the database backup was taken. + DatabaseEdition BackupSummaryDatabaseEditionEnum `mandatory:"false" json:"databaseEdition,omitempty"` - // The type of backup. - Type BackupSummaryTypeEnum `mandatory:"false" json:"type,omitempty"` + // The size of the database in gigabytes at the time the backup was taken. + DatabaseSizeInGBs *float64 `mandatory:"false" json:"databaseSizeInGBs"` } func (m BackupSummary) String() string { return common.PointerString(m) } +// BackupSummaryTypeEnum Enum with underlying type: string +type BackupSummaryTypeEnum string + +// Set of constants representing the allowable values for BackupSummaryTypeEnum +const ( + BackupSummaryTypeIncremental BackupSummaryTypeEnum = "INCREMENTAL" + BackupSummaryTypeFull BackupSummaryTypeEnum = "FULL" +) + +var mappingBackupSummaryType = map[string]BackupSummaryTypeEnum{ + "INCREMENTAL": BackupSummaryTypeIncremental, + "FULL": BackupSummaryTypeFull, +} + +// GetBackupSummaryTypeEnumValues Enumerates the set of values for BackupSummaryTypeEnum +func GetBackupSummaryTypeEnumValues() []BackupSummaryTypeEnum { + values := make([]BackupSummaryTypeEnum, 0) + for _, v := range mappingBackupSummaryType { + values = append(values, v) + } + return values +} + // BackupSummaryLifecycleStateEnum Enum with underlying type: string type BackupSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for BackupSummaryLifecycleState +// Set of constants representing the allowable values for BackupSummaryLifecycleStateEnum const ( BackupSummaryLifecycleStateCreating BackupSummaryLifecycleStateEnum = "CREATING" BackupSummaryLifecycleStateActive BackupSummaryLifecycleStateEnum = "ACTIVE" @@ -73,7 +103,7 @@ "RESTORING": BackupSummaryLifecycleStateRestoring, } -// GetBackupSummaryLifecycleStateEnumValues Enumerates the set of values for BackupSummaryLifecycleState +// GetBackupSummaryLifecycleStateEnumValues Enumerates the set of values for BackupSummaryLifecycleStateEnum func GetBackupSummaryLifecycleStateEnumValues() []BackupSummaryLifecycleStateEnum { values := make([]BackupSummaryLifecycleStateEnum, 0) for _, v := range mappingBackupSummaryLifecycleState { @@ -82,24 +112,28 @@ return values } -// BackupSummaryTypeEnum Enum with underlying type: string -type BackupSummaryTypeEnum string +// BackupSummaryDatabaseEditionEnum Enum with underlying type: string +type BackupSummaryDatabaseEditionEnum string -// Set of constants representing the allowable values for BackupSummaryType +// Set of constants representing the allowable values for BackupSummaryDatabaseEditionEnum const ( - BackupSummaryTypeIncremental BackupSummaryTypeEnum = "INCREMENTAL" - BackupSummaryTypeFull BackupSummaryTypeEnum = "FULL" + BackupSummaryDatabaseEditionStandardEdition BackupSummaryDatabaseEditionEnum = "STANDARD_EDITION" + BackupSummaryDatabaseEditionEnterpriseEdition BackupSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION" + BackupSummaryDatabaseEditionEnterpriseEditionHighPerformance BackupSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + BackupSummaryDatabaseEditionEnterpriseEditionExtremePerformance BackupSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" ) -var mappingBackupSummaryType = map[string]BackupSummaryTypeEnum{ - "INCREMENTAL": BackupSummaryTypeIncremental, - "FULL": BackupSummaryTypeFull, +var mappingBackupSummaryDatabaseEdition = map[string]BackupSummaryDatabaseEditionEnum{ + "STANDARD_EDITION": BackupSummaryDatabaseEditionStandardEdition, + "ENTERPRISE_EDITION": BackupSummaryDatabaseEditionEnterpriseEdition, + "ENTERPRISE_EDITION_HIGH_PERFORMANCE": BackupSummaryDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": BackupSummaryDatabaseEditionEnterpriseEditionExtremePerformance, } -// GetBackupSummaryTypeEnumValues Enumerates the set of values for BackupSummaryType -func GetBackupSummaryTypeEnumValues() []BackupSummaryTypeEnum { - values := make([]BackupSummaryTypeEnum, 0) - for _, v := range mappingBackupSummaryType { +// GetBackupSummaryDatabaseEditionEnumValues Enumerates the set of values for BackupSummaryDatabaseEditionEnum +func GetBackupSummaryDatabaseEditionEnumValues() []BackupSummaryDatabaseEditionEnum { + values := make([]BackupSummaryDatabaseEditionEnum, 0) + for _, v := range mappingBackupSummaryDatabaseEdition { values = append(values, v) } return values diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CompleteExternalBackupJobDetails The representation of CompleteExternalBackupJobDetails +type CompleteExternalBackupJobDetails struct { + + // If the database being backed up is TDE enabled, this will be the path to the associated TDE wallet in Object Storage. + TdeWalletPath *string `mandatory:"false" json:"tdeWalletPath"` + + // The handle of the control file backup. + CfBackupHandle *string `mandatory:"false" json:"cfBackupHandle"` + + // The handle of the spfile backup. + SpfBackupHandle *string `mandatory:"false" json:"spfBackupHandle"` + + // The list of SQL patches that need to be applied to the backup during the restore. + SqlPatches []string `mandatory:"false" json:"sqlPatches"` + + // The size of the data in the database, in megabytes. + DataSize *int64 `mandatory:"false" json:"dataSize"` + + // The size of the redo in the database, in megabytes. + RedoSize *int64 `mandatory:"false" json:"redoSize"` +} + +func (m CompleteExternalBackupJobDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/complete_external_backup_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CompleteExternalBackupJobRequest wrapper for the CompleteExternalBackupJob operation +type CompleteExternalBackupJobRequest struct { + + // The backup OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + BackupId *string `mandatory:"true" contributesTo:"path" name:"backupId"` + + // Updates the status of the backup resource. + CompleteExternalBackupJobDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CompleteExternalBackupJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CompleteExternalBackupJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CompleteExternalBackupJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CompleteExternalBackupJobResponse wrapper for the CompleteExternalBackupJob operation +type CompleteExternalBackupJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExternalBackupJob instance + ExternalBackupJob `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CompleteExternalBackupJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CompleteExternalBackupJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDatabaseBackupDetails Details to create an Oracle Autonomous Database backup. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateAutonomousDatabaseBackupDetails struct { + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. + AutonomousDatabaseId *string `mandatory:"true" json:"autonomousDatabaseId"` +} + +func (m CreateAutonomousDatabaseBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutonomousDatabaseBackupRequest wrapper for the CreateAutonomousDatabaseBackup operation +type CreateAutonomousDatabaseBackupRequest struct { + + // Request to create a new Autonomous Database backup. + CreateAutonomousDatabaseBackupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutonomousDatabaseBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutonomousDatabaseBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutonomousDatabaseBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutonomousDatabaseBackupResponse wrapper for the CreateAutonomousDatabaseBackup operation +type CreateAutonomousDatabaseBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabaseBackup instance + AutonomousDatabaseBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutonomousDatabaseBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutonomousDatabaseBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_base.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_base.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_base.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_base.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,216 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDatabaseBase Details to create an Oracle Autonomous Database. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateAutonomousDatabaseBase interface { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the autonomous database. + GetCompartmentId() *string + + // The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + GetDbName() *string + + // The number of CPU Cores to be made available to the database. + GetCpuCoreCount() *int + + // The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + GetDataStorageSizeInTBs() *int + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + GetAdminPassword() *string + + // The autonomous database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse. The default is OLTP. + GetDbWorkload() CreateAutonomousDatabaseBaseDbWorkloadEnum + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + GetDisplayName() *string + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + GetLicenseModel() CreateAutonomousDatabaseBaseLicenseModelEnum + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createautonomousdatabasebase struct { + JsonData []byte + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DbName *string `mandatory:"true" json:"dbName"` + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + AdminPassword *string `mandatory:"true" json:"adminPassword"` + DbWorkload CreateAutonomousDatabaseBaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + DisplayName *string `mandatory:"false" json:"displayName"` + LicenseModel CreateAutonomousDatabaseBaseLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + Source string `json:"source"` +} + +// UnmarshalJSON unmarshals json +func (m *createautonomousdatabasebase) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateautonomousdatabasebase createautonomousdatabasebase + s := struct { + Model Unmarshalercreateautonomousdatabasebase + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DbName = s.Model.DbName + m.CpuCoreCount = s.Model.CpuCoreCount + m.DataStorageSizeInTBs = s.Model.DataStorageSizeInTBs + m.AdminPassword = s.Model.AdminPassword + m.DbWorkload = s.Model.DbWorkload + m.DisplayName = s.Model.DisplayName + m.LicenseModel = s.Model.LicenseModel + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.Source = s.Model.Source + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createautonomousdatabasebase) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Source { + case "DATABASE": + mm := CreateAutonomousDatabaseCloneDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NONE": + mm := CreateAutonomousDatabaseDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetCompartmentId returns CompartmentId +func (m createautonomousdatabasebase) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDbName returns DbName +func (m createautonomousdatabasebase) GetDbName() *string { + return m.DbName +} + +//GetCpuCoreCount returns CpuCoreCount +func (m createautonomousdatabasebase) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetDataStorageSizeInTBs returns DataStorageSizeInTBs +func (m createautonomousdatabasebase) GetDataStorageSizeInTBs() *int { + return m.DataStorageSizeInTBs +} + +//GetAdminPassword returns AdminPassword +func (m createautonomousdatabasebase) GetAdminPassword() *string { + return m.AdminPassword +} + +//GetDbWorkload returns DbWorkload +func (m createautonomousdatabasebase) GetDbWorkload() CreateAutonomousDatabaseBaseDbWorkloadEnum { + return m.DbWorkload +} + +//GetDisplayName returns DisplayName +func (m createautonomousdatabasebase) GetDisplayName() *string { + return m.DisplayName +} + +//GetLicenseModel returns LicenseModel +func (m createautonomousdatabasebase) GetLicenseModel() CreateAutonomousDatabaseBaseLicenseModelEnum { + return m.LicenseModel +} + +//GetFreeformTags returns FreeformTags +func (m createautonomousdatabasebase) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m createautonomousdatabasebase) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m createautonomousdatabasebase) String() string { + return common.PointerString(m) +} + +// CreateAutonomousDatabaseBaseDbWorkloadEnum Enum with underlying type: string +type CreateAutonomousDatabaseBaseDbWorkloadEnum string + +// Set of constants representing the allowable values for CreateAutonomousDatabaseBaseDbWorkloadEnum +const ( + CreateAutonomousDatabaseBaseDbWorkloadOltp CreateAutonomousDatabaseBaseDbWorkloadEnum = "OLTP" + CreateAutonomousDatabaseBaseDbWorkloadDw CreateAutonomousDatabaseBaseDbWorkloadEnum = "DW" +) + +var mappingCreateAutonomousDatabaseBaseDbWorkload = map[string]CreateAutonomousDatabaseBaseDbWorkloadEnum{ + "OLTP": CreateAutonomousDatabaseBaseDbWorkloadOltp, + "DW": CreateAutonomousDatabaseBaseDbWorkloadDw, +} + +// GetCreateAutonomousDatabaseBaseDbWorkloadEnumValues Enumerates the set of values for CreateAutonomousDatabaseBaseDbWorkloadEnum +func GetCreateAutonomousDatabaseBaseDbWorkloadEnumValues() []CreateAutonomousDatabaseBaseDbWorkloadEnum { + values := make([]CreateAutonomousDatabaseBaseDbWorkloadEnum, 0) + for _, v := range mappingCreateAutonomousDatabaseBaseDbWorkload { + values = append(values, v) + } + return values +} + +// CreateAutonomousDatabaseBaseLicenseModelEnum Enum with underlying type: string +type CreateAutonomousDatabaseBaseLicenseModelEnum string + +// Set of constants representing the allowable values for CreateAutonomousDatabaseBaseLicenseModelEnum +const ( + CreateAutonomousDatabaseBaseLicenseModelLicenseIncluded CreateAutonomousDatabaseBaseLicenseModelEnum = "LICENSE_INCLUDED" + CreateAutonomousDatabaseBaseLicenseModelBringYourOwnLicense CreateAutonomousDatabaseBaseLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingCreateAutonomousDatabaseBaseLicenseModel = map[string]CreateAutonomousDatabaseBaseLicenseModelEnum{ + "LICENSE_INCLUDED": CreateAutonomousDatabaseBaseLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": CreateAutonomousDatabaseBaseLicenseModelBringYourOwnLicense, +} + +// GetCreateAutonomousDatabaseBaseLicenseModelEnumValues Enumerates the set of values for CreateAutonomousDatabaseBaseLicenseModelEnum +func GetCreateAutonomousDatabaseBaseLicenseModelEnumValues() []CreateAutonomousDatabaseBaseLicenseModelEnum { + values := make([]CreateAutonomousDatabaseBaseLicenseModelEnum, 0) + for _, v := range mappingCreateAutonomousDatabaseBaseLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_clone_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_clone_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_clone_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_clone_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,149 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDatabaseCloneDetails Details to create an Oracle Autonomous Database by cloning an existing Autonomous Database. +type CreateAutonomousDatabaseCloneDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the autonomous database. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU Cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the source Autonomous Database that you will clone to create a new Autonomous Database. + SourceId *string `mandatory:"true" json:"sourceId"` + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The clone type. + CloneType CreateAutonomousDatabaseCloneDetailsCloneTypeEnum `mandatory:"true" json:"cloneType"` + + // The autonomous database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse. The default is OLTP. + DbWorkload CreateAutonomousDatabaseBaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel CreateAutonomousDatabaseBaseLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateAutonomousDatabaseCloneDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDbName returns DbName +func (m CreateAutonomousDatabaseCloneDetails) GetDbName() *string { + return m.DbName +} + +//GetCpuCoreCount returns CpuCoreCount +func (m CreateAutonomousDatabaseCloneDetails) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetDbWorkload returns DbWorkload +func (m CreateAutonomousDatabaseCloneDetails) GetDbWorkload() CreateAutonomousDatabaseBaseDbWorkloadEnum { + return m.DbWorkload +} + +//GetDataStorageSizeInTBs returns DataStorageSizeInTBs +func (m CreateAutonomousDatabaseCloneDetails) GetDataStorageSizeInTBs() *int { + return m.DataStorageSizeInTBs +} + +//GetAdminPassword returns AdminPassword +func (m CreateAutonomousDatabaseCloneDetails) GetAdminPassword() *string { + return m.AdminPassword +} + +//GetDisplayName returns DisplayName +func (m CreateAutonomousDatabaseCloneDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetLicenseModel returns LicenseModel +func (m CreateAutonomousDatabaseCloneDetails) GetLicenseModel() CreateAutonomousDatabaseBaseLicenseModelEnum { + return m.LicenseModel +} + +//GetFreeformTags returns FreeformTags +func (m CreateAutonomousDatabaseCloneDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateAutonomousDatabaseCloneDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateAutonomousDatabaseCloneDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m CreateAutonomousDatabaseCloneDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateAutonomousDatabaseCloneDetails CreateAutonomousDatabaseCloneDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeCreateAutonomousDatabaseCloneDetails + }{ + "DATABASE", + (MarshalTypeCreateAutonomousDatabaseCloneDetails)(m), + } + + return json.Marshal(&s) +} + +// CreateAutonomousDatabaseCloneDetailsCloneTypeEnum Enum with underlying type: string +type CreateAutonomousDatabaseCloneDetailsCloneTypeEnum string + +// Set of constants representing the allowable values for CreateAutonomousDatabaseCloneDetailsCloneTypeEnum +const ( + CreateAutonomousDatabaseCloneDetailsCloneTypeFull CreateAutonomousDatabaseCloneDetailsCloneTypeEnum = "FULL" + CreateAutonomousDatabaseCloneDetailsCloneTypeMetadata CreateAutonomousDatabaseCloneDetailsCloneTypeEnum = "METADATA" +) + +var mappingCreateAutonomousDatabaseCloneDetailsCloneType = map[string]CreateAutonomousDatabaseCloneDetailsCloneTypeEnum{ + "FULL": CreateAutonomousDatabaseCloneDetailsCloneTypeFull, + "METADATA": CreateAutonomousDatabaseCloneDetailsCloneTypeMetadata, +} + +// GetCreateAutonomousDatabaseCloneDetailsCloneTypeEnumValues Enumerates the set of values for CreateAutonomousDatabaseCloneDetailsCloneTypeEnum +func GetCreateAutonomousDatabaseCloneDetailsCloneTypeEnumValues() []CreateAutonomousDatabaseCloneDetailsCloneTypeEnum { + values := make([]CreateAutonomousDatabaseCloneDetailsCloneTypeEnum, 0) + for _, v := range mappingCreateAutonomousDatabaseCloneDetailsCloneType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDatabaseDetails Details to create an Oracle Autonomous Database. +type CreateAutonomousDatabaseDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the autonomous database. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU Cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The autonomous database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse. The default is OLTP. + DbWorkload CreateAutonomousDatabaseBaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel CreateAutonomousDatabaseBaseLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateAutonomousDatabaseDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDbName returns DbName +func (m CreateAutonomousDatabaseDetails) GetDbName() *string { + return m.DbName +} + +//GetCpuCoreCount returns CpuCoreCount +func (m CreateAutonomousDatabaseDetails) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetDbWorkload returns DbWorkload +func (m CreateAutonomousDatabaseDetails) GetDbWorkload() CreateAutonomousDatabaseBaseDbWorkloadEnum { + return m.DbWorkload +} + +//GetDataStorageSizeInTBs returns DataStorageSizeInTBs +func (m CreateAutonomousDatabaseDetails) GetDataStorageSizeInTBs() *int { + return m.DataStorageSizeInTBs +} + +//GetAdminPassword returns AdminPassword +func (m CreateAutonomousDatabaseDetails) GetAdminPassword() *string { + return m.AdminPassword +} + +//GetDisplayName returns DisplayName +func (m CreateAutonomousDatabaseDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetLicenseModel returns LicenseModel +func (m CreateAutonomousDatabaseDetails) GetLicenseModel() CreateAutonomousDatabaseBaseLicenseModelEnum { + return m.LicenseModel +} + +//GetFreeformTags returns FreeformTags +func (m CreateAutonomousDatabaseDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateAutonomousDatabaseDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateAutonomousDatabaseDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m CreateAutonomousDatabaseDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateAutonomousDatabaseDetails CreateAutonomousDatabaseDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeCreateAutonomousDatabaseDetails + }{ + "NONE", + (MarshalTypeCreateAutonomousDatabaseDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutonomousDatabaseRequest wrapper for the CreateAutonomousDatabase operation +type CreateAutonomousDatabaseRequest struct { + + // Request to create a new Autonomous Database. + CreateAutonomousDatabaseDetails CreateAutonomousDatabaseBase `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutonomousDatabaseResponse wrapper for the CreateAutonomousDatabase operation +type CreateAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDataWarehouseBackupDetails **Deprecated.** See CreateAutonomousDatabaseBackupDetails for reference information about creating Autonomous Data Warehouse backups. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateAutonomousDataWarehouseBackupDetails struct { + + // The user-friendly name for the backup. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse backup. + AutonomousDataWarehouseId *string `mandatory:"true" json:"autonomousDataWarehouseId"` +} + +func (m CreateAutonomousDataWarehouseBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutonomousDataWarehouseBackupRequest wrapper for the CreateAutonomousDataWarehouseBackup operation +type CreateAutonomousDataWarehouseBackupRequest struct { + + // Request to create a new Autonomous Data Warehouse backup. + CreateAutonomousDataWarehouseBackupDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutonomousDataWarehouseBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutonomousDataWarehouseBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutonomousDataWarehouseBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutonomousDataWarehouseBackupResponse wrapper for the CreateAutonomousDataWarehouseBackup operation +type CreateAutonomousDataWarehouseBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouseBackup instance + AutonomousDataWarehouseBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutonomousDataWarehouseBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutonomousDataWarehouseBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAutonomousDataWarehouseDetails **Deprecated.** See CreateAutonomousDatabaseDetails for reference information about creating an Oracle Autonomous Data Warehouse. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateAutonomousDataWarehouseDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the Autonomous Data Warehouse. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + DbName *string `mandatory:"true" json:"dbName"` + + // The number of CPU Cores to be made available to the database. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + // Size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + DataStorageSizeInTBs *int `mandatory:"true" json:"dataStorageSizeInTBs"` + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The Oracle license model that applies to the Oracle Autonomous Data Warehouse. The default is BRING_YOUR_OWN_LICENSE. + LicenseModel CreateAutonomousDataWarehouseDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateAutonomousDataWarehouseDetails) String() string { + return common.PointerString(m) +} + +// CreateAutonomousDataWarehouseDetailsLicenseModelEnum Enum with underlying type: string +type CreateAutonomousDataWarehouseDetailsLicenseModelEnum string + +// Set of constants representing the allowable values for CreateAutonomousDataWarehouseDetailsLicenseModelEnum +const ( + CreateAutonomousDataWarehouseDetailsLicenseModelLicenseIncluded CreateAutonomousDataWarehouseDetailsLicenseModelEnum = "LICENSE_INCLUDED" + CreateAutonomousDataWarehouseDetailsLicenseModelBringYourOwnLicense CreateAutonomousDataWarehouseDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingCreateAutonomousDataWarehouseDetailsLicenseModel = map[string]CreateAutonomousDataWarehouseDetailsLicenseModelEnum{ + "LICENSE_INCLUDED": CreateAutonomousDataWarehouseDetailsLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": CreateAutonomousDataWarehouseDetailsLicenseModelBringYourOwnLicense, +} + +// GetCreateAutonomousDataWarehouseDetailsLicenseModelEnumValues Enumerates the set of values for CreateAutonomousDataWarehouseDetailsLicenseModelEnum +func GetCreateAutonomousDataWarehouseDetailsLicenseModelEnumValues() []CreateAutonomousDataWarehouseDetailsLicenseModelEnum { + values := make([]CreateAutonomousDataWarehouseDetailsLicenseModelEnum, 0) + for _, v := range mappingCreateAutonomousDataWarehouseDetailsLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAutonomousDataWarehouseRequest wrapper for the CreateAutonomousDataWarehouse operation +type CreateAutonomousDataWarehouseRequest struct { + + // Request to create a new Autonomous Data Warehouse. + CreateAutonomousDataWarehouseDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAutonomousDataWarehouseResponse wrapper for the CreateAutonomousDataWarehouse operation +type CreateAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,13 +12,14 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateBackupDetails The representation of CreateBackupDetails +// CreateBackupDetails Details for creating a database backup. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateBackupDetails struct { - // The OCID of the database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. DatabaseId *string `mandatory:"true" json:"databaseId"` - // The user-friendly name for the backup. It does not have to be unique. + // The user-friendly name for the backup. The name does not have to be unique. DisplayName *string `mandatory:"true" json:"displayName"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateBackupResponse wrapper for the CreateBackup operation type CreateBackupResponse struct { @@ -46,3 +64,8 @@ func (response CreateBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,30 +12,41 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateDatabaseDetails The representation of CreateDatabaseDetails +// CreateDatabaseDetails Details for creating a database backup. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateDatabaseDetails struct { + // The database name. The name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. + DbName *string `mandatory:"true" json:"dbName"` + // A strong password for SYS, SYSTEM, and PDB Admin. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numbers, and two special characters. The special characters must be _, \#, or -. AdminPassword *string `mandatory:"true" json:"adminPassword"` - // The database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. - DbName *string `mandatory:"true" json:"dbName"` + // The name of the pluggable database. The name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. + PdbName *string `mandatory:"false" json:"pdbName"` // The character set for the database. The default is AL32UTF8. Allowed values are: - // AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS + // AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS CharacterSet *string `mandatory:"false" json:"characterSet"` - DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + // The national character set for the database. The default is AL16UTF16. Allowed values are: + // AL16UTF16 or UTF8. + NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` - // Database workload type. + // The database workload type. DbWorkload CreateDatabaseDetailsDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` - // National character set for the database. The default is AL16UTF16. Allowed values are: - // AL16UTF16 or UTF8. - NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` + DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` - // Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. - PdbName *string `mandatory:"false" json:"pdbName"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateDatabaseDetails) String() string { @@ -45,7 +56,7 @@ // CreateDatabaseDetailsDbWorkloadEnum Enum with underlying type: string type CreateDatabaseDetailsDbWorkloadEnum string -// Set of constants representing the allowable values for CreateDatabaseDetailsDbWorkload +// Set of constants representing the allowable values for CreateDatabaseDetailsDbWorkloadEnum const ( CreateDatabaseDetailsDbWorkloadOltp CreateDatabaseDetailsDbWorkloadEnum = "OLTP" CreateDatabaseDetailsDbWorkloadDss CreateDatabaseDetailsDbWorkloadEnum = "DSS" @@ -56,7 +67,7 @@ "DSS": CreateDatabaseDetailsDbWorkloadDss, } -// GetCreateDatabaseDetailsDbWorkloadEnumValues Enumerates the set of values for CreateDatabaseDetailsDbWorkload +// GetCreateDatabaseDetailsDbWorkloadEnumValues Enumerates the set of values for CreateDatabaseDetailsDbWorkloadEnum func GetCreateDatabaseDetailsDbWorkloadEnumValues() []CreateDatabaseDetailsDbWorkloadEnum { values := make([]CreateDatabaseDetailsDbWorkloadEnum, 0) for _, v := range mappingCreateDatabaseDetailsDbWorkload { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_from_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_from_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_from_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_database_from_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,14 +15,17 @@ // CreateDatabaseFromBackupDetails The representation of CreateDatabaseFromBackupDetails type CreateDatabaseFromBackupDetails struct { - // A strong password for SYS, SYSTEM, PDB Admin and TDE Wallet. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numbers, and two special characters. The special characters must be _, \#, or -. - AdminPassword *string `mandatory:"true" json:"adminPassword"` - - // The backup OCID. + // The backup OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). BackupId *string `mandatory:"true" json:"backupId"` // The password to open the TDE wallet. BackupTDEPassword *string `mandatory:"true" json:"backupTDEPassword"` + + // A strong password for SYS, SYSTEM, PDB Admin and TDE Wallet. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numbers, and two special characters. The special characters must be _, \#, or -. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The display name of the database to be created from the backup. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. + DbName *string `mandatory:"false" json:"dbName"` } func (m CreateDatabaseFromBackupDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -14,12 +14,7 @@ ) // CreateDataGuardAssociationDetails The configuration details for creating a Data Guard association between databases. -// **NOTE:** -// "ExistingDbSystem" is the only supported `creationType` value. Therefore, all -// CreateDataGuardAssociation -// requests must include the `peerDbSystemId` parameter found in the -// CreateDataGuardAssociationToExistingDbSystemDetails -// object. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateDataGuardAssociationDetails interface { // A strong password for the `SYS`, `SYSTEM`, and `PDB Admin` users to apply during standby creation. @@ -34,7 +29,7 @@ // The protection mode to set up between the primary and standby databases. For more information, see // Oracle Data Guard Protection Modes (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) // in the Oracle Data Guard documentation. - // **IMPORTANT** - The only protection mode currently supported by the Database Service is MAXIMUM_PERFORMANCE. + // **IMPORTANT** - The only protection mode currently supported by the Database service is MAXIMUM_PERFORMANCE. GetProtectionMode() CreateDataGuardAssociationDetailsProtectionModeEnum // The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`: @@ -44,7 +39,7 @@ // For more information, see // Redo Transport Services (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) // in the Oracle Data Guard documentation. - // **IMPORTANT** - The only transport type currently supported by the Database Service is ASYNC. + // **IMPORTANT** - The only transport type currently supported by the Database service is ASYNC. GetTransportType() CreateDataGuardAssociationDetailsTransportTypeEnum } @@ -77,14 +72,23 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *createdataguardassociationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.CreationType { + case "NewDbSystem": + mm := CreateDataGuardAssociationWithNewDbSystemDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "ExistingDbSystem": mm := CreateDataGuardAssociationToExistingDbSystemDetails{} err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -110,7 +114,7 @@ // CreateDataGuardAssociationDetailsProtectionModeEnum Enum with underlying type: string type CreateDataGuardAssociationDetailsProtectionModeEnum string -// Set of constants representing the allowable values for CreateDataGuardAssociationDetailsProtectionMode +// Set of constants representing the allowable values for CreateDataGuardAssociationDetailsProtectionModeEnum const ( CreateDataGuardAssociationDetailsProtectionModeAvailability CreateDataGuardAssociationDetailsProtectionModeEnum = "MAXIMUM_AVAILABILITY" CreateDataGuardAssociationDetailsProtectionModePerformance CreateDataGuardAssociationDetailsProtectionModeEnum = "MAXIMUM_PERFORMANCE" @@ -123,7 +127,7 @@ "MAXIMUM_PROTECTION": CreateDataGuardAssociationDetailsProtectionModeProtection, } -// GetCreateDataGuardAssociationDetailsProtectionModeEnumValues Enumerates the set of values for CreateDataGuardAssociationDetailsProtectionMode +// GetCreateDataGuardAssociationDetailsProtectionModeEnumValues Enumerates the set of values for CreateDataGuardAssociationDetailsProtectionModeEnum func GetCreateDataGuardAssociationDetailsProtectionModeEnumValues() []CreateDataGuardAssociationDetailsProtectionModeEnum { values := make([]CreateDataGuardAssociationDetailsProtectionModeEnum, 0) for _, v := range mappingCreateDataGuardAssociationDetailsProtectionMode { @@ -135,7 +139,7 @@ // CreateDataGuardAssociationDetailsTransportTypeEnum Enum with underlying type: string type CreateDataGuardAssociationDetailsTransportTypeEnum string -// Set of constants representing the allowable values for CreateDataGuardAssociationDetailsTransportType +// Set of constants representing the allowable values for CreateDataGuardAssociationDetailsTransportTypeEnum const ( CreateDataGuardAssociationDetailsTransportTypeSync CreateDataGuardAssociationDetailsTransportTypeEnum = "SYNC" CreateDataGuardAssociationDetailsTransportTypeAsync CreateDataGuardAssociationDetailsTransportTypeEnum = "ASYNC" @@ -148,7 +152,7 @@ "FASTSYNC": CreateDataGuardAssociationDetailsTransportTypeFastsync, } -// GetCreateDataGuardAssociationDetailsTransportTypeEnumValues Enumerates the set of values for CreateDataGuardAssociationDetailsTransportType +// GetCreateDataGuardAssociationDetailsTransportTypeEnumValues Enumerates the set of values for CreateDataGuardAssociationDetailsTransportTypeEnum func GetCreateDataGuardAssociationDetailsTransportTypeEnumValues() []CreateDataGuardAssociationDetailsTransportTypeEnum { values := make([]CreateDataGuardAssociationDetailsTransportTypeEnum, 0) for _, v := range mappingCreateDataGuardAssociationDetailsTransportType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // CreateDataGuardAssociationRequest wrapper for the CreateDataGuardAssociation operation type CreateDataGuardAssociationRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` // A request to create a Data Guard association. @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDataGuardAssociationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDataGuardAssociationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDataGuardAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDataGuardAssociationResponse wrapper for the CreateDataGuardAssociation operation type CreateDataGuardAssociationResponse struct { @@ -49,3 +67,8 @@ func (response CreateDataGuardAssociationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDataGuardAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_to_existing_db_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_to_existing_db_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_to_existing_db_system_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_to_existing_db_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -13,7 +13,8 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateDataGuardAssociationToExistingDbSystemDetails The configuration details for creating a Data Guard association to an existing database. +// CreateDataGuardAssociationToExistingDbSystemDetails The configuration details for creating a Data Guard association for a bare metal DB system database. A standby database will be created in the DB system you specify. +// To create a Data Guard association for a database in a virtual machine DB system, use the CreateDataGuardAssociationWithNewDbSystemDetails subtype. type CreateDataGuardAssociationToExistingDbSystemDetails struct { // A strong password for the `SYS`, `SYSTEM`, and `PDB Admin` users to apply during standby creation. @@ -25,13 +26,14 @@ // **The password MUST be the same as the primary admin password.** DatabaseAdminPassword *string `mandatory:"true" json:"databaseAdminPassword"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System to create the standby database on. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system in which to create the standby database. + // You must supply this value if creationType is `ExistingDbSystem`. PeerDbSystemId *string `mandatory:"false" json:"peerDbSystemId"` // The protection mode to set up between the primary and standby databases. For more information, see // Oracle Data Guard Protection Modes (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) // in the Oracle Data Guard documentation. - // **IMPORTANT** - The only protection mode currently supported by the Database Service is MAXIMUM_PERFORMANCE. + // **IMPORTANT** - The only protection mode currently supported by the Database service is MAXIMUM_PERFORMANCE. ProtectionMode CreateDataGuardAssociationDetailsProtectionModeEnum `mandatory:"true" json:"protectionMode"` // The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`: @@ -41,7 +43,7 @@ // For more information, see // Redo Transport Services (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) // in the Oracle Data Guard documentation. - // **IMPORTANT** - The only transport type currently supported by the Database Service is ASYNC. + // **IMPORTANT** - The only transport type currently supported by the Database service is ASYNC. TransportType CreateDataGuardAssociationDetailsTransportTypeEnum `mandatory:"true" json:"transportType"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_with_new_db_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_with_new_db_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_with_new_db_system_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_data_guard_association_with_new_db_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateDataGuardAssociationWithNewDbSystemDetails The configuration details for creating a Data Guard association for a bare metal DB system or virtual machine DB system database. A new DB system will be launched to create the standby database. +// **NOTE** - You must use this subtype to create a Data Guard association for a database in a virtual machine DB system. +type CreateDataGuardAssociationWithNewDbSystemDetails struct { + + // A strong password for the `SYS`, `SYSTEM`, and `PDB Admin` users to apply during standby creation. + // The password must contain no fewer than nine characters and include: + // * At least two uppercase characters. + // * At least two lowercase characters. + // * At least two numeric characters. + // * At least two special characters. Valid special characters include "_", "#", and "-" only. + // **The password MUST be the same as the primary admin password.** + DatabaseAdminPassword *string `mandatory:"true" json:"databaseAdminPassword"` + + // The user-friendly name of the DB system that will contain the the standby database. The display name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The name of the availability domain that the standby database DB system will be located in. For example- "Uocm:PHX-AD-1". + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The OCID of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For 1- and 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.16.16/28 + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and backup subnet. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // The hostname for the DB node. + Hostname *string `mandatory:"false" json:"hostname"` + + // The protection mode to set up between the primary and standby databases. For more information, see + // Oracle Data Guard Protection Modes (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) + // in the Oracle Data Guard documentation. + // **IMPORTANT** - The only protection mode currently supported by the Database service is MAXIMUM_PERFORMANCE. + ProtectionMode CreateDataGuardAssociationDetailsProtectionModeEnum `mandatory:"true" json:"protectionMode"` + + // The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`: + // * MAXIMUM_AVAILABILITY - SYNC or FASTSYNC + // * MAXIMUM_PERFORMANCE - ASYNC + // * MAXIMUM_PROTECTION - SYNC + // For more information, see + // Redo Transport Services (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) + // in the Oracle Data Guard documentation. + // **IMPORTANT** - The only transport type currently supported by the Database service is ASYNC. + TransportType CreateDataGuardAssociationDetailsTransportTypeEnum `mandatory:"true" json:"transportType"` +} + +//GetDatabaseAdminPassword returns DatabaseAdminPassword +func (m CreateDataGuardAssociationWithNewDbSystemDetails) GetDatabaseAdminPassword() *string { + return m.DatabaseAdminPassword +} + +//GetProtectionMode returns ProtectionMode +func (m CreateDataGuardAssociationWithNewDbSystemDetails) GetProtectionMode() CreateDataGuardAssociationDetailsProtectionModeEnum { + return m.ProtectionMode +} + +//GetTransportType returns TransportType +func (m CreateDataGuardAssociationWithNewDbSystemDetails) GetTransportType() CreateDataGuardAssociationDetailsTransportTypeEnum { + return m.TransportType +} + +func (m CreateDataGuardAssociationWithNewDbSystemDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m CreateDataGuardAssociationWithNewDbSystemDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateDataGuardAssociationWithNewDbSystemDetails CreateDataGuardAssociationWithNewDbSystemDetails + s := struct { + DiscriminatorParam string `json:"creationType"` + MarshalTypeCreateDataGuardAssociationWithNewDbSystemDetails + }{ + "NewDbSystem", + (MarshalTypeCreateDataGuardAssociationWithNewDbSystemDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,13 +12,15 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateDbHomeDetails The representation of CreateDbHomeDetails +// CreateDbHomeDetails Details for creating a database home. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateDbHomeDetails struct { - Database *CreateDatabaseDetails `mandatory:"true" json:"database"` - // A valid Oracle database version. To get a list of supported versions, use the ListDbVersions operation. + // A valid Oracle Database version. To get a list of supported versions, use the ListDbVersions operation. DbVersion *string `mandatory:"true" json:"dbVersion"` + Database *CreateDatabaseDetails `mandatory:"true" json:"database"` + // The user-provided name of the database home. DisplayName *string `mandatory:"false" json:"displayName"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_from_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_from_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_from_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_from_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateDbHomeFromBackupDetails Details for creating a database home if you are creating a database by restoring from a database backup. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateDbHomeFromBackupDetails struct { + Database *CreateDatabaseFromBackupDetails `mandatory:"true" json:"database"` + + // The user-provided name of the database home. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CreateDbHomeFromBackupDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // CreateDbHomeRequest wrapper for the CreateDbHome operation type CreateDbHomeRequest struct { - // Request to create a new DB Home. + // Request to create a new database home. CreateDbHomeWithDbSystemIdBase `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDbHomeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDbHomeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDbHomeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDbHomeResponse wrapper for the CreateDbHome operation type CreateDbHomeResponse struct { @@ -46,3 +64,8 @@ func (response CreateDbHomeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDbHomeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_base.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_base.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_base.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_base.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -13,10 +13,11 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateDbHomeWithDbSystemIdBase The representation of CreateDbHomeWithDbSystemIdBase +// CreateDbHomeWithDbSystemIdBase Details for creating a database home. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateDbHomeWithDbSystemIdBase interface { - // The OCID of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. GetDbSystemId() *string // The user-provided name of the database home. @@ -50,6 +51,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *createdbhomewithdbsystemidbase) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Source { case "DB_BACKUP": @@ -61,7 +67,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -16,14 +16,14 @@ // CreateDbHomeWithDbSystemIdDetails The representation of CreateDbHomeWithDbSystemIdDetails type CreateDbHomeWithDbSystemIdDetails struct { - // The OCID of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" json:"dbSystemId"` - Database *CreateDatabaseDetails `mandatory:"true" json:"database"` - - // A valid Oracle database version. To get a list of supported versions, use the ListDbVersions operation. + // A valid Oracle Database version. To get a list of supported versions, use the ListDbVersions operation. DbVersion *string `mandatory:"true" json:"dbVersion"` + Database *CreateDatabaseDetails `mandatory:"true" json:"database"` + // The user-provided name of the database home. DisplayName *string `mandatory:"false" json:"displayName"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_from_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_from_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_from_backup_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_db_home_with_db_system_id_from_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -16,7 +16,7 @@ // CreateDbHomeWithDbSystemIdFromBackupDetails The representation of CreateDbHomeWithDbSystemIdFromBackupDetails type CreateDbHomeWithDbSystemIdFromBackupDetails struct { - // The OCID of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" json:"dbSystemId"` Database *CreateDatabaseFromBackupDetails `mandatory:"true" json:"database"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateExternalBackupJobDetails The representation of CreateExternalBackupJobDetails +type CreateExternalBackupJobDetails struct { + + // The targeted availability domain for the backup. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment where this backup should be created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the backup. This name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // A valid Oracle Database version. + DbVersion *string `mandatory:"true" json:"dbVersion"` + + // The name of the database from which the backup is being taken. + DbName *string `mandatory:"true" json:"dbName"` + + // The `DBID` of the Oracle Database being backed up. + ExternalDatabaseIdentifier *int64 `mandatory:"true" json:"externalDatabaseIdentifier"` + + // The character set for the database. + CharacterSet *string `mandatory:"true" json:"characterSet"` + + // The national character set for the database. + NcharacterSet *string `mandatory:"true" json:"ncharacterSet"` + + // The mode (single instance or RAC) of the database being backed up. + DatabaseMode CreateExternalBackupJobDetailsDatabaseModeEnum `mandatory:"true" json:"databaseMode"` + + // The Oracle Database edition to use for creating a database from this standalone backup. + // Note that 2-node RAC DB systems require Enterprise Edition - Extreme Performance. + DatabaseEdition CreateExternalBackupJobDetailsDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` + + // The `DB_UNIQUE_NAME` of the Oracle Database being backed up. + DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` + + // The pluggable database name. + PdbName *string `mandatory:"false" json:"pdbName"` +} + +func (m CreateExternalBackupJobDetails) String() string { + return common.PointerString(m) +} + +// CreateExternalBackupJobDetailsDatabaseModeEnum Enum with underlying type: string +type CreateExternalBackupJobDetailsDatabaseModeEnum string + +// Set of constants representing the allowable values for CreateExternalBackupJobDetailsDatabaseModeEnum +const ( + CreateExternalBackupJobDetailsDatabaseModeSi CreateExternalBackupJobDetailsDatabaseModeEnum = "SI" + CreateExternalBackupJobDetailsDatabaseModeRac CreateExternalBackupJobDetailsDatabaseModeEnum = "RAC" +) + +var mappingCreateExternalBackupJobDetailsDatabaseMode = map[string]CreateExternalBackupJobDetailsDatabaseModeEnum{ + "SI": CreateExternalBackupJobDetailsDatabaseModeSi, + "RAC": CreateExternalBackupJobDetailsDatabaseModeRac, +} + +// GetCreateExternalBackupJobDetailsDatabaseModeEnumValues Enumerates the set of values for CreateExternalBackupJobDetailsDatabaseModeEnum +func GetCreateExternalBackupJobDetailsDatabaseModeEnumValues() []CreateExternalBackupJobDetailsDatabaseModeEnum { + values := make([]CreateExternalBackupJobDetailsDatabaseModeEnum, 0) + for _, v := range mappingCreateExternalBackupJobDetailsDatabaseMode { + values = append(values, v) + } + return values +} + +// CreateExternalBackupJobDetailsDatabaseEditionEnum Enum with underlying type: string +type CreateExternalBackupJobDetailsDatabaseEditionEnum string + +// Set of constants representing the allowable values for CreateExternalBackupJobDetailsDatabaseEditionEnum +const ( + CreateExternalBackupJobDetailsDatabaseEditionStandardEdition CreateExternalBackupJobDetailsDatabaseEditionEnum = "STANDARD_EDITION" + CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEdition CreateExternalBackupJobDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION" + CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEditionHighPerformance CreateExternalBackupJobDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEditionExtremePerformance CreateExternalBackupJobDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" +) + +var mappingCreateExternalBackupJobDetailsDatabaseEdition = map[string]CreateExternalBackupJobDetailsDatabaseEditionEnum{ + "STANDARD_EDITION": CreateExternalBackupJobDetailsDatabaseEditionStandardEdition, + "ENTERPRISE_EDITION": CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEdition, + "ENTERPRISE_EDITION_HIGH_PERFORMANCE": CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": CreateExternalBackupJobDetailsDatabaseEditionEnterpriseEditionExtremePerformance, +} + +// GetCreateExternalBackupJobDetailsDatabaseEditionEnumValues Enumerates the set of values for CreateExternalBackupJobDetailsDatabaseEditionEnum +func GetCreateExternalBackupJobDetailsDatabaseEditionEnumValues() []CreateExternalBackupJobDetailsDatabaseEditionEnum { + values := make([]CreateExternalBackupJobDetailsDatabaseEditionEnum, 0) + for _, v := range mappingCreateExternalBackupJobDetailsDatabaseEdition { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/create_external_backup_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateExternalBackupJobRequest wrapper for the CreateExternalBackupJob operation +type CreateExternalBackupJobRequest struct { + + // Request to create a cloud backup resource for a database running outside the cloud. + CreateExternalBackupJobDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateExternalBackupJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateExternalBackupJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateExternalBackupJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateExternalBackupJobResponse wrapper for the CreateExternalBackupJob operation +type CreateExternalBackupJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExternalBackupJob instance + ExternalBackupJob `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateExternalBackupJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateExternalBackupJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -37,7 +37,7 @@ // SetRegion overrides the region of this client. func (client *DatabaseClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "database", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("database", "https://database.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +48,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -58,696 +58,2868 @@ return client.config } -// CreateBackup Creates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. -func (client DatabaseClient) CreateBackup(ctx context.Context, request CreateBackupRequest) (response CreateBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/backups", request) +// CompleteExternalBackupJob Changes the status of the standalone backup resource to `ACTIVE` after the backup is created from the on-premises database and placed in Oracle Cloud Infrastructure Object Storage. +// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +func (client DatabaseClient) CompleteExternalBackupJob(ctx context.Context, request CompleteExternalBackupJobRequest) (response CompleteExternalBackupJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.completeExternalBackupJob, policy) + if err != nil { + if ociResponse != nil { + response = CompleteExternalBackupJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CompleteExternalBackupJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CompleteExternalBackupJobResponse") + } + return +} + +// completeExternalBackupJob implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) completeExternalBackupJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalBackupJobs/{backupId}/actions/complete") + if err != nil { + return nil, err + } + + var response CompleteExternalBackupJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAutonomousDataWarehouse **Deprecated.** To create a new Autonomous Data Warehouse, use the CreateAutonomousDatabase operation and specify `DW` as the workload type. +func (client DatabaseClient) CreateAutonomousDataWarehouse(ctx context.Context, request CreateAutonomousDataWarehouseRequest) (response CreateAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutonomousDataWarehouse, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutonomousDataWarehouseResponse") + } + return +} + +// createAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouses") + if err != nil { + return nil, err + } + + var response CreateAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAutonomousDataWarehouseBackup **Deprecated.** To create a new Autonomous Data Warehouse backup for a specified database, use the CreateAutonomousDatabaseBackup operation. +func (client DatabaseClient) CreateAutonomousDataWarehouseBackup(ctx context.Context, request CreateAutonomousDataWarehouseBackupRequest) (response CreateAutonomousDataWarehouseBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutonomousDataWarehouseBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutonomousDataWarehouseBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAutonomousDataWarehouseBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutonomousDataWarehouseBackupResponse") + } + return +} + +// createAutonomousDataWarehouseBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createAutonomousDataWarehouseBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouseBackups") + if err != nil { + return nil, err + } + + var response CreateAutonomousDataWarehouseBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAutonomousDatabase Creates a new Autonomous Database. +func (client DatabaseClient) CreateAutonomousDatabase(ctx context.Context, request CreateAutonomousDatabaseRequest) (response CreateAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutonomousDatabase, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutonomousDatabaseResponse") + } + return +} + +// createAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAutonomousDatabaseBackup Creates a new Autonomous Database backup for the specified database based on the provided request parameters. +func (client DatabaseClient) CreateAutonomousDatabaseBackup(ctx context.Context, request CreateAutonomousDatabaseBackupRequest) (response CreateAutonomousDatabaseBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAutonomousDatabaseBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateAutonomousDatabaseBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateAutonomousDatabaseBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAutonomousDatabaseBackupResponse") + } + return +} + +// createAutonomousDatabaseBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createAutonomousDatabaseBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabaseBackups") + if err != nil { + return nil, err + } + + var response CreateAutonomousDatabaseBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateBackup Creates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. +func (client DatabaseClient) CreateBackup(ctx context.Context, request CreateBackupRequest) (response CreateBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBackup, policy) + if err != nil { + if ociResponse != nil { + response = CreateBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBackupResponse") + } return } +// createBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/backups") + if err != nil { + return nil, err + } + + var response CreateBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateDataGuardAssociation Creates a new Data Guard association. A Data Guard association represents the replication relationship between the -// specified database and a peer database. For more information, see Using Oracle Data Guard (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/usingdataguard.htm). +// specified database and a peer database. For more information, see Using Oracle Data Guard (https://docs.cloud.oracle.com/Content/Database/Tasks/usingdataguard.htm). // All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID // called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. // You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the // resource in the Console. For more information, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). func (client DatabaseClient) CreateDataGuardAssociation(ctx context.Context, request CreateDataGuardAssociationRequest) (response CreateDataGuardAssociationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDataGuardAssociation, policy) if err != nil { + if ociResponse != nil { + response = CreateDataGuardAssociationResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDataGuardAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDataGuardAssociationResponse") + } + return +} + +// createDataGuardAssociation implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createDataGuardAssociation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDataGuardAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateDbHome Creates a new DB Home in the specified DB System based on the request parameters you provide. +// CreateDbHome Creates a new database home in the specified DB system based on the request parameters you provide. func (client DatabaseClient) CreateDbHome(ctx context.Context, request CreateDbHomeRequest) (response CreateDbHomeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/dbHomes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDbHome, policy) if err != nil { + if ociResponse != nil { + response = CreateDbHomeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDbHomeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDbHomeResponse") + } + return +} + +// createDbHome implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createDbHome(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbHomes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDbHomeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateExternalBackupJob Creates a new backup resource and returns the information the caller needs to back up an on-premises Oracle Database to Oracle Cloud Infrastructure. +// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +func (client DatabaseClient) CreateExternalBackupJob(ctx context.Context, request CreateExternalBackupJobRequest) (response CreateExternalBackupJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createExternalBackupJob, policy) + if err != nil { + if ociResponse != nil { + response = CreateExternalBackupJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateExternalBackupJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateExternalBackupJobResponse") + } return } -// DbNodeAction Performs an action, such as one of the power actions (start, stop, softreset, or reset), on the specified DB Node. -// **start** - power on -// **stop** - power off -// **softreset** - ACPI shutdown and power on -// **reset** - power off and power on -// Note that the **stop** state has no effect on the resources you consume. -// Billing continues for DB Nodes that you stop, and related resources continue -// to apply against any relevant quotas. You must terminate the DB System +// createExternalBackupJob implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExternalBackupJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalBackupJobs") + if err != nil { + return nil, err + } + + var response CreateExternalBackupJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DbNodeAction Performs one of the following power actions on the specified DB node: +// - start - power on +// - stop - power off +// - softreset - ACPI shutdown and power on +// - reset - power off and power on +// **Note:** Stopping a node affects billing differently, depending on the type of DB system: +// *Bare metal and Exadata DB systems* - The _stop_ state has no effect on the resources you consume. +// Billing continues for DB nodes that you stop, and related resources continue +// to apply against any relevant quotas. You must terminate the DB system // (TerminateDbSystem) // to remove its resources from billing and quotas. +// *Virtual machine DB systems* - Stopping a node stops billing for all OCPUs associated with that node, and billing resumes when you restart the node. func (client DatabaseClient) DbNodeAction(ctx context.Context, request DbNodeActionRequest) (response DbNodeActionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/dbNodes/{dbNodeId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.dbNodeAction, policy) + if err != nil { + if ociResponse != nil { + response = DbNodeActionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DbNodeActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DbNodeActionResponse") + } + return +} + +// dbNodeAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) dbNodeAction(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbNodes/{dbNodeId}") + if err != nil { + return nil, err + } + + var response DbNodeActionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAutonomousDataWarehouse **Deprecated.** To delete an Autonomous Data Warehouse, use the DeleteAutonomousDatabase operation. +func (client DatabaseClient) DeleteAutonomousDataWarehouse(ctx context.Context, request DeleteAutonomousDataWarehouseRequest) (response DeleteAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAutonomousDataWarehouse, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDataWarehouseResponse") + } + return +} + +// deleteAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autonomousDataWarehouses/{autonomousDataWarehouseId}") + if err != nil { + return nil, err + } + + var response DeleteAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAutonomousDatabase Deletes the specified Autonomous Database. +func (client DatabaseClient) DeleteAutonomousDatabase(ctx context.Context, request DeleteAutonomousDatabaseRequest) (response DeleteAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAutonomousDatabase, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDatabaseResponse") + } + return +} + +// deleteAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autonomousDatabases/{autonomousDatabaseId}") + if err != nil { + return nil, err + } + + var response DeleteAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteBackup Deletes a full backup. You cannot delete automatic backups using this API. +func (client DatabaseClient) DeleteBackup(ctx context.Context, request DeleteBackupRequest) (response DeleteBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBackup, policy) if err != nil { + if ociResponse != nil { + response = DeleteBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBackupResponse") + } + return +} + +// deleteBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/backups/{backupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDbHome Deletes a DB Home. The DB Home and its database data are local to the DB system and will be lost when it is deleted. Oracle recommends that you back up any data in the DB system prior to deleting it. +func (client DatabaseClient) DeleteDbHome(ctx context.Context, request DeleteDbHomeRequest) (response DeleteDbHomeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteDbHome, policy) + if err != nil { + if ociResponse != nil { + response = DeleteDbHomeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteDbHomeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDbHomeResponse") + } + return +} + +// deleteDbHome implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteDbHome(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dbHomes/{dbHomeId}") + if err != nil { + return nil, err + } + + var response DeleteDbHomeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// FailoverDataGuardAssociation Performs a failover to transition the standby database identified by the `databaseId` parameter into the +// specified Data Guard association's primary role after the existing primary database fails or becomes unreachable. +// A failover might result in data loss depending on the protection mode in effect at the time of the primary +// database failure. +func (client DatabaseClient) FailoverDataGuardAssociation(ctx context.Context, request FailoverDataGuardAssociationRequest) (response FailoverDataGuardAssociationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.failoverDataGuardAssociation, policy) + if err != nil { + if ociResponse != nil { + response = FailoverDataGuardAssociationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(FailoverDataGuardAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into FailoverDataGuardAssociationResponse") + } + return +} + +// failoverDataGuardAssociation implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) failoverDataGuardAssociation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/failover") + if err != nil { + return nil, err + } + + var response FailoverDataGuardAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GenerateAutonomousDataWarehouseWallet **Deprecated.** To create and download a wallet for an Autonomous Data Warehouse, use the GenerateAutonomousDatabaseWallet operation. +func (client DatabaseClient) GenerateAutonomousDataWarehouseWallet(ctx context.Context, request GenerateAutonomousDataWarehouseWalletRequest) (response GenerateAutonomousDataWarehouseWalletResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.generateAutonomousDataWarehouseWallet, policy) + if err != nil { + if ociResponse != nil { + response = GenerateAutonomousDataWarehouseWalletResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GenerateAutonomousDataWarehouseWalletResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateAutonomousDataWarehouseWalletResponse") + } + return +} + +// generateAutonomousDataWarehouseWallet implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) generateAutonomousDataWarehouseWallet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouses/{autonomousDataWarehouseId}/actions/generateWallet") + if err != nil { + return nil, err + } + + var response GenerateAutonomousDataWarehouseWalletResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GenerateAutonomousDatabaseWallet Creates and downloads a wallet for the specified Autonomous Database. +func (client DatabaseClient) GenerateAutonomousDatabaseWallet(ctx context.Context, request GenerateAutonomousDatabaseWalletRequest) (response GenerateAutonomousDatabaseWalletResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.generateAutonomousDatabaseWallet, policy) + if err != nil { + if ociResponse != nil { + response = GenerateAutonomousDatabaseWalletResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GenerateAutonomousDatabaseWalletResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateAutonomousDatabaseWalletResponse") + } + return +} + +// generateAutonomousDatabaseWallet implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) generateAutonomousDatabaseWallet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/generateWallet") + if err != nil { + return nil, err + } + + var response GenerateAutonomousDatabaseWalletResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutonomousDataWarehouse **Deprecated.** To get the details of an Autonomous Data Warehouse, use the GetAutonomousDatabase operation. +func (client DatabaseClient) GetAutonomousDataWarehouse(ctx context.Context, request GetAutonomousDataWarehouseRequest) (response GetAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutonomousDataWarehouse, policy) + if err != nil { + if ociResponse != nil { + response = GetAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutonomousDataWarehouseResponse") + } + return +} + +// getAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDataWarehouses/{autonomousDataWarehouseId}") + if err != nil { + return nil, err + } + + var response GetAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutonomousDataWarehouseBackup **Deprecated.** To get information about a specified Autonomous Data Warehouse backup, use the GetAutonomousDatabaseBackup operation. +func (client DatabaseClient) GetAutonomousDataWarehouseBackup(ctx context.Context, request GetAutonomousDataWarehouseBackupRequest) (response GetAutonomousDataWarehouseBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutonomousDataWarehouseBackup, policy) + if err != nil { + if ociResponse != nil { + response = GetAutonomousDataWarehouseBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutonomousDataWarehouseBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutonomousDataWarehouseBackupResponse") + } + return +} + +// getAutonomousDataWarehouseBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getAutonomousDataWarehouseBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDataWarehouseBackups/{autonomousDataWarehouseBackupId}") + if err != nil { + return nil, err + } + + var response GetAutonomousDataWarehouseBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutonomousDatabase Gets the details of the specified Autonomous Database. +func (client DatabaseClient) GetAutonomousDatabase(ctx context.Context, request GetAutonomousDatabaseRequest) (response GetAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutonomousDatabase, policy) + if err != nil { + if ociResponse != nil { + response = GetAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutonomousDatabaseResponse") + } + return +} + +// getAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDatabases/{autonomousDatabaseId}") + if err != nil { + return nil, err + } + + var response GetAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAutonomousDatabaseBackup Gets information about the specified Autonomous Database backup. +func (client DatabaseClient) GetAutonomousDatabaseBackup(ctx context.Context, request GetAutonomousDatabaseBackupRequest) (response GetAutonomousDatabaseBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAutonomousDatabaseBackup, policy) + if err != nil { + if ociResponse != nil { + response = GetAutonomousDatabaseBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAutonomousDatabaseBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAutonomousDatabaseBackupResponse") + } + return +} + +// getAutonomousDatabaseBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getAutonomousDatabaseBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDatabaseBackups/{autonomousDatabaseBackupId}") + if err != nil { + return nil, err + } + + var response GetAutonomousDatabaseBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBackup Gets information about the specified backup. +func (client DatabaseClient) GetBackup(ctx context.Context, request GetBackupRequest) (response GetBackupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBackup, policy) + if err != nil { + if ociResponse != nil { + response = GetBackupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBackupResponse") + } + return +} + +// getBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/backups/{backupId}") + if err != nil { + return nil, err + } + + var response GetBackupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDataGuardAssociation Gets the specified Data Guard association's configuration information. +func (client DatabaseClient) GetDataGuardAssociation(ctx context.Context, request GetDataGuardAssociationRequest) (response GetDataGuardAssociationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDataGuardAssociation, policy) + if err != nil { + if ociResponse != nil { + response = GetDataGuardAssociationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDataGuardAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDataGuardAssociationResponse") + } + return +} + +// getDataGuardAssociation implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDataGuardAssociation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}") + if err != nil { + return nil, err + } + + var response GetDataGuardAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDatabase Gets information about a specific database. +func (client DatabaseClient) GetDatabase(ctx context.Context, request GetDatabaseRequest) (response GetDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDatabase, policy) + if err != nil { + if ociResponse != nil { + response = GetDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDatabaseResponse") + } + return +} + +// getDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases/{databaseId}") + if err != nil { + return nil, err + } + + var response GetDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbHome Gets information about the specified database home. +func (client DatabaseClient) GetDbHome(ctx context.Context, request GetDbHomeRequest) (response GetDbHomeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbHome, policy) + if err != nil { + if ociResponse != nil { + response = GetDbHomeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbHomeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbHomeResponse") + } + return +} + +// getDbHome implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbHome(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes/{dbHomeId}") + if err != nil { + return nil, err + } + + var response GetDbHomeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbHomePatch Gets information about a specified patch package. +func (client DatabaseClient) GetDbHomePatch(ctx context.Context, request GetDbHomePatchRequest) (response GetDbHomePatchResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbHomePatch, policy) + if err != nil { + if ociResponse != nil { + response = GetDbHomePatchResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbHomePatchResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbHomePatchResponse") + } + return +} + +// getDbHomePatch implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbHomePatch(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes/{dbHomeId}/patches/{patchId}") + if err != nil { + return nil, err + } + + var response GetDbHomePatchResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbHomePatchHistoryEntry Gets the patch history details for the specified patchHistoryEntryId +func (client DatabaseClient) GetDbHomePatchHistoryEntry(ctx context.Context, request GetDbHomePatchHistoryEntryRequest) (response GetDbHomePatchHistoryEntryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbHomePatchHistoryEntry, policy) + if err != nil { + if ociResponse != nil { + response = GetDbHomePatchHistoryEntryResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbHomePatchHistoryEntryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbHomePatchHistoryEntryResponse") + } + return +} + +// getDbHomePatchHistoryEntry implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbHomePatchHistoryEntry(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes/{dbHomeId}/patchHistoryEntries/{patchHistoryEntryId}") + if err != nil { + return nil, err + } + + var response GetDbHomePatchHistoryEntryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbNode Gets information about the specified database node. +func (client DatabaseClient) GetDbNode(ctx context.Context, request GetDbNodeRequest) (response GetDbNodeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbNode, policy) + if err != nil { + if ociResponse != nil { + response = GetDbNodeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbNodeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbNodeResponse") + } + return +} + +// getDbNode implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbNode(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbNodes/{dbNodeId}") + if err != nil { + return nil, err + } + + var response GetDbNodeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbSystem Gets information about the specified DB system. +func (client DatabaseClient) GetDbSystem(ctx context.Context, request GetDbSystemRequest) (response GetDbSystemResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbSystem, policy) + if err != nil { + if ociResponse != nil { + response = GetDbSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbSystemResponse") + } + return +} + +// getDbSystem implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}") + if err != nil { + return nil, err + } + + var response GetDbSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbSystemPatch Gets information about a specified patch package. +func (client DatabaseClient) GetDbSystemPatch(ctx context.Context, request GetDbSystemPatchRequest) (response GetDbSystemPatchResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbSystemPatch, policy) + if err != nil { + if ociResponse != nil { + response = GetDbSystemPatchResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbSystemPatchResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbSystemPatchResponse") + } + return +} + +// getDbSystemPatch implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbSystemPatch(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}/patches/{patchId}") + if err != nil { + return nil, err + } + + var response GetDbSystemPatchResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDbSystemPatchHistoryEntry Gets the patch history details for the specified patchHistoryEntryId. +func (client DatabaseClient) GetDbSystemPatchHistoryEntry(ctx context.Context, request GetDbSystemPatchHistoryEntryRequest) (response GetDbSystemPatchHistoryEntryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDbSystemPatchHistoryEntry, policy) + if err != nil { + if ociResponse != nil { + response = GetDbSystemPatchHistoryEntryResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDbSystemPatchHistoryEntryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDbSystemPatchHistoryEntryResponse") + } + return +} + +// getDbSystemPatchHistoryEntry implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getDbSystemPatchHistoryEntry(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}/patchHistoryEntries/{patchHistoryEntryId}") + if err != nil { + return nil, err + } + + var response GetDbSystemPatchHistoryEntryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetExadataIormConfig Gets `IORM` Setting for the requested Exadata DB System. +// The default IORM Settings is pre-created in all the Exadata DB System. +func (client DatabaseClient) GetExadataIormConfig(ctx context.Context, request GetExadataIormConfigRequest) (response GetExadataIormConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getExadataIormConfig, policy) + if err != nil { + if ociResponse != nil { + response = GetExadataIormConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetExadataIormConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExadataIormConfigResponse") + } + return +} + +// getExadataIormConfig implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExadataIormConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}/ExadataIormConfig") + if err != nil { + return nil, err + } + + var response GetExadataIormConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetExternalBackupJob Gets information about the specified external backup job. +// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +func (client DatabaseClient) GetExternalBackupJob(ctx context.Context, request GetExternalBackupJobRequest) (response GetExternalBackupJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getExternalBackupJob, policy) + if err != nil { + if ociResponse != nil { + response = GetExternalBackupJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetExternalBackupJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExternalBackupJobResponse") + } + return +} + +// getExternalBackupJob implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExternalBackupJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalBackupJobs/{backupId}") + if err != nil { + return nil, err + } + + var response GetExternalBackupJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LaunchDbSystem Launches a new DB system in the specified compartment and availability domain. The Oracle +// Database edition that you specify applies to all the databases on that DB system. The selected edition cannot be changed. +// An initial database is created on the DB system based on the request parameters you provide and some default +// options. For more information, +// see Default Options for the Initial Database (https://docs.cloud.oracle.com/Content/Database/Tasks/launchingDB.htm#DefaultOptionsfortheInitialDatabase). +func (client DatabaseClient) LaunchDbSystem(ctx context.Context, request LaunchDbSystemRequest) (response LaunchDbSystemResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.launchDbSystem, policy) + if err != nil { + if ociResponse != nil { + response = LaunchDbSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(LaunchDbSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LaunchDbSystemResponse") + } + return +} + +// launchDbSystem implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) launchDbSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbSystems") + if err != nil { + return nil, err + } + + var response LaunchDbSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAutonomousDataWarehouseBackups **Deprecated.** To get a list of Autonomous Data Warehouse backups, use the ListAutonomousDatabaseBackups operation. +func (client DatabaseClient) ListAutonomousDataWarehouseBackups(ctx context.Context, request ListAutonomousDataWarehouseBackupsRequest) (response ListAutonomousDataWarehouseBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutonomousDataWarehouseBackups, policy) + if err != nil { + if ociResponse != nil { + response = ListAutonomousDataWarehouseBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutonomousDataWarehouseBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutonomousDataWarehouseBackupsResponse") + } + return +} + +// listAutonomousDataWarehouseBackups implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listAutonomousDataWarehouseBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDataWarehouseBackups") + if err != nil { + return nil, err + } + + var response ListAutonomousDataWarehouseBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAutonomousDataWarehouses **Deprecated.** To get a list of Autonomous Data Warehouses, use the ListAutonomousDatabases operation and specify `DW` as the workload type. +func (client DatabaseClient) ListAutonomousDataWarehouses(ctx context.Context, request ListAutonomousDataWarehousesRequest) (response ListAutonomousDataWarehousesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutonomousDataWarehouses, policy) + if err != nil { + if ociResponse != nil { + response = ListAutonomousDataWarehousesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutonomousDataWarehousesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutonomousDataWarehousesResponse") + } + return +} + +// listAutonomousDataWarehouses implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listAutonomousDataWarehouses(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDataWarehouses") + if err != nil { + return nil, err + } + + var response ListAutonomousDataWarehousesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAutonomousDatabaseBackups Gets a list of Autonomous Database backups based on either the `autonomousDatabaseId` or `compartmentId` specified as a query parameter. +func (client DatabaseClient) ListAutonomousDatabaseBackups(ctx context.Context, request ListAutonomousDatabaseBackupsRequest) (response ListAutonomousDatabaseBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutonomousDatabaseBackups, policy) + if err != nil { + if ociResponse != nil { + response = ListAutonomousDatabaseBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutonomousDatabaseBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutonomousDatabaseBackupsResponse") + } + return +} + +// listAutonomousDatabaseBackups implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listAutonomousDatabaseBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDatabaseBackups") + if err != nil { + return nil, err + } + + var response ListAutonomousDatabaseBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAutonomousDatabases Gets a list of Autonomous Databases. +func (client DatabaseClient) ListAutonomousDatabases(ctx context.Context, request ListAutonomousDatabasesRequest) (response ListAutonomousDatabasesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAutonomousDatabases, policy) + if err != nil { + if ociResponse != nil { + response = ListAutonomousDatabasesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAutonomousDatabasesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutonomousDatabasesResponse") + } + return +} + +// listAutonomousDatabases implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listAutonomousDatabases(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/autonomousDatabases") + if err != nil { + return nil, err + } + + var response ListAutonomousDatabasesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBackups Gets a list of backups based on the databaseId or compartmentId specified. Either one of the query parameters must be provided. +func (client DatabaseClient) ListBackups(ctx context.Context, request ListBackupsRequest) (response ListBackupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBackups, policy) + if err != nil { + if ociResponse != nil { + response = ListBackupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListBackupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBackupsResponse") + } + return +} + +// listBackups implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/backups") + if err != nil { + return nil, err + } + + var response ListBackupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDataGuardAssociations Lists all Data Guard associations for the specified database. +func (client DatabaseClient) ListDataGuardAssociations(ctx context.Context, request ListDataGuardAssociationsRequest) (response ListDataGuardAssociationsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDataGuardAssociations, policy) + if err != nil { + if ociResponse != nil { + response = ListDataGuardAssociationsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDataGuardAssociationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDataGuardAssociationsResponse") + } + return +} + +// listDataGuardAssociations implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDataGuardAssociations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases/{databaseId}/dataGuardAssociations") + if err != nil { + return nil, err + } + + var response ListDataGuardAssociationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDatabases Gets a list of the databases in the specified database home. +func (client DatabaseClient) ListDatabases(ctx context.Context, request ListDatabasesRequest) (response ListDatabasesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDatabases, policy) + if err != nil { + if ociResponse != nil { + response = ListDatabasesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDatabasesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDatabasesResponse") + } + return +} + +// listDatabases implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDatabases(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases") + if err != nil { + return nil, err + } + + var response ListDatabasesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbHomePatchHistoryEntries Gets history of the actions taken for patches for the specified database home. +func (client DatabaseClient) ListDbHomePatchHistoryEntries(ctx context.Context, request ListDbHomePatchHistoryEntriesRequest) (response ListDbHomePatchHistoryEntriesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbHomePatchHistoryEntries, policy) + if err != nil { + if ociResponse != nil { + response = ListDbHomePatchHistoryEntriesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbHomePatchHistoryEntriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbHomePatchHistoryEntriesResponse") + } + return +} + +// listDbHomePatchHistoryEntries implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbHomePatchHistoryEntries(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes/{dbHomeId}/patchHistoryEntries") + if err != nil { + return nil, err + } + + var response ListDbHomePatchHistoryEntriesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbHomePatches Lists patches applicable to the requested database home. +func (client DatabaseClient) ListDbHomePatches(ctx context.Context, request ListDbHomePatchesRequest) (response ListDbHomePatchesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbHomePatches, policy) + if err != nil { + if ociResponse != nil { + response = ListDbHomePatchesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbHomePatchesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbHomePatchesResponse") + } + return +} + +// listDbHomePatches implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbHomePatches(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes/{dbHomeId}/patches") + if err != nil { + return nil, err + } + + var response ListDbHomePatchesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbHomes Gets a list of database homes in the specified DB system and compartment. A database home is a directory where Oracle Database software is installed. +func (client DatabaseClient) ListDbHomes(ctx context.Context, request ListDbHomesRequest) (response ListDbHomesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbHomes, policy) + if err != nil { + if ociResponse != nil { + response = ListDbHomesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbHomesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbHomesResponse") + } + return +} + +// listDbHomes implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbHomes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbHomes") + if err != nil { + return nil, err + } + + var response ListDbHomesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbNodes Gets a list of database nodes in the specified DB system and compartment. A database node is a server running database software. +func (client DatabaseClient) ListDbNodes(ctx context.Context, request ListDbNodesRequest) (response ListDbNodesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbNodes, policy) + if err != nil { + if ociResponse != nil { + response = ListDbNodesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbNodesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbNodesResponse") + } + return +} + +// listDbNodes implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbNodes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbNodes") + if err != nil { + return nil, err + } + + var response ListDbNodesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbSystemPatchHistoryEntries Gets the history of the patch actions performed on the specified DB system. +func (client DatabaseClient) ListDbSystemPatchHistoryEntries(ctx context.Context, request ListDbSystemPatchHistoryEntriesRequest) (response ListDbSystemPatchHistoryEntriesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbSystemPatchHistoryEntries, policy) + if err != nil { + if ociResponse != nil { + response = ListDbSystemPatchHistoryEntriesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbSystemPatchHistoryEntriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbSystemPatchHistoryEntriesResponse") + } + return +} + +// listDbSystemPatchHistoryEntries implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbSystemPatchHistoryEntries(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}/patchHistoryEntries") + if err != nil { + return nil, err + } + + var response ListDbSystemPatchHistoryEntriesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbSystemPatches Lists the patches applicable to the requested DB system. +func (client DatabaseClient) ListDbSystemPatches(ctx context.Context, request ListDbSystemPatchesRequest) (response ListDbSystemPatchesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbSystemPatches, policy) + if err != nil { + if ociResponse != nil { + response = ListDbSystemPatchesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbSystemPatchesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbSystemPatchesResponse") + } + return +} + +// listDbSystemPatches implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbSystemPatches(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems/{dbSystemId}/patches") + if err != nil { + return nil, err + } + + var response ListDbSystemPatchesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbSystemShapes Gets a list of the shapes that can be used to launch a new DB system. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. +func (client DatabaseClient) ListDbSystemShapes(ctx context.Context, request ListDbSystemShapesRequest) (response ListDbSystemShapesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbSystemShapes, policy) + if err != nil { + if ociResponse != nil { + response = ListDbSystemShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbSystemShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbSystemShapesResponse") + } + return +} + +// listDbSystemShapes implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbSystemShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystemShapes") + if err != nil { + return nil, err + } + + var response ListDbSystemShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbSystems Gets a list of the DB systems in the specified compartment. You can specify a backupId to list only the DB systems that support creating a database using this backup in this compartment. +// +func (client DatabaseClient) ListDbSystems(ctx context.Context, request ListDbSystemsRequest) (response ListDbSystemsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbSystems, policy) + if err != nil { + if ociResponse != nil { + response = ListDbSystemsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbSystemsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbSystemsResponse") + } + return +} + +// listDbSystems implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbSystems(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbSystems") + if err != nil { + return nil, err + } + + var response ListDbSystemsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDbVersions Gets a list of supported Oracle Database versions. +func (client DatabaseClient) ListDbVersions(ctx context.Context, request ListDbVersionsRequest) (response ListDbVersionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDbVersions, policy) + if err != nil { + if ociResponse != nil { + response = ListDbVersionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDbVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDbVersionsResponse") + } return } -// DeleteBackup Deletes a full backup. You cannot delete automatic backups using this API. -func (client DatabaseClient) DeleteBackup(ctx context.Context, request DeleteBackupRequest) (response DeleteBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/backups/{backupId}", request) +// listDbVersions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listDbVersions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbVersions") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListDbVersionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteDbHome Deletes a DB Home. The DB Home and its database data are local to the DB System and will be lost when it is deleted. Oracle recommends that you back up any data in the DB System prior to deleting it. -func (client DatabaseClient) DeleteDbHome(ctx context.Context, request DeleteDbHomeRequest) (response DeleteDbHomeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/dbHomes/{dbHomeId}", request) - if err != nil { - return +// ReinstateDataGuardAssociation Reinstates the database identified by the `databaseId` parameter into the standby role in a Data Guard association. +func (client DatabaseClient) ReinstateDataGuardAssociation(ctx context.Context, request ReinstateDataGuardAssociationRequest) (response ReinstateDataGuardAssociationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.reinstateDataGuardAssociation, policy) if err != nil { + if ociResponse != nil { + response = ReinstateDataGuardAssociationResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(ReinstateDataGuardAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ReinstateDataGuardAssociationResponse") + } return } -// FailoverDataGuardAssociation Performs a failover to transition the standby database identified by the `databaseId` parameter into the -// specified Data Guard association's primary role after the existing primary database fails or becomes unreachable. -// A failover might result in data loss depending on the protection mode in effect at the time of the primary -// database failure. -func (client DatabaseClient) FailoverDataGuardAssociation(ctx context.Context, request FailoverDataGuardAssociationRequest) (response FailoverDataGuardAssociationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/failover", request) +// reinstateDataGuardAssociation implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) reinstateDataGuardAssociation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/reinstate") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ReinstateDataGuardAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetBackup Gets information about the specified backup. -func (client DatabaseClient) GetBackup(ctx context.Context, request GetBackupRequest) (response GetBackupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/backups/{backupId}", request) - if err != nil { - return +// RestoreAutonomousDataWarehouse **Deprecated.** To restore an Autonomous Data Warehouse, use the RestoreAutonomousDatabase operation. +func (client DatabaseClient) RestoreAutonomousDataWarehouse(ctx context.Context, request RestoreAutonomousDataWarehouseRequest) (response RestoreAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.restoreAutonomousDataWarehouse, policy) if err != nil { + if ociResponse != nil { + response = RestoreAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(RestoreAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RestoreAutonomousDataWarehouseResponse") + } return } -// GetDataGuardAssociation Gets the specified Data Guard association's configuration information. -func (client DatabaseClient) GetDataGuardAssociation(ctx context.Context, request GetDataGuardAssociationRequest) (response GetDataGuardAssociationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}", request) +// restoreAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) restoreAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouses/{autonomousDataWarehouseId}/actions/restore") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response RestoreAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetDatabase Gets information about a specific database. -func (client DatabaseClient) GetDatabase(ctx context.Context, request GetDatabaseRequest) (response GetDatabaseResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/databases/{databaseId}", request) - if err != nil { - return +// RestoreAutonomousDatabase Restores an Autonomous Database based on the provided request parameters. +func (client DatabaseClient) RestoreAutonomousDatabase(ctx context.Context, request RestoreAutonomousDatabaseRequest) (response RestoreAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.restoreAutonomousDatabase, policy) if err != nil { + if ociResponse != nil { + response = RestoreAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(RestoreAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RestoreAutonomousDatabaseResponse") + } return } -// GetDbHome Gets information about the specified database home. -func (client DatabaseClient) GetDbHome(ctx context.Context, request GetDbHomeRequest) (response GetDbHomeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes/{dbHomeId}", request) +// restoreAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) restoreAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/restore") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response RestoreAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetDbHomePatch Gets information about a specified patch package. -func (client DatabaseClient) GetDbHomePatch(ctx context.Context, request GetDbHomePatchRequest) (response GetDbHomePatchResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes/{dbHomeId}/patches/{patchId}", request) - if err != nil { - return +// RestoreDatabase Restore a Database based on the request parameters you provide. +func (client DatabaseClient) RestoreDatabase(ctx context.Context, request RestoreDatabaseRequest) (response RestoreDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.restoreDatabase, policy) if err != nil { + if ociResponse != nil { + response = RestoreDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(RestoreDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RestoreDatabaseResponse") + } return } -// GetDbHomePatchHistoryEntry Gets the patch history details for the specified patchHistoryEntryId -func (client DatabaseClient) GetDbHomePatchHistoryEntry(ctx context.Context, request GetDbHomePatchHistoryEntryRequest) (response GetDbHomePatchHistoryEntryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes/{dbHomeId}/patchHistoryEntries/{patchHistoryEntryId}", request) +// restoreDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) restoreDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/actions/restore") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response RestoreDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetDbNode Gets information about the specified database node. -func (client DatabaseClient) GetDbNode(ctx context.Context, request GetDbNodeRequest) (response GetDbNodeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbNodes/{dbNodeId}", request) - if err != nil { - return +// StartAutonomousDataWarehouse **Deprecated.** To start an Autonomous Data Warehouse, use the StartAutonomousDatabase operation. +func (client DatabaseClient) StartAutonomousDataWarehouse(ctx context.Context, request StartAutonomousDataWarehouseRequest) (response StartAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.startAutonomousDataWarehouse, policy) if err != nil { + if ociResponse != nil { + response = StartAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(StartAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartAutonomousDataWarehouseResponse") + } return } -// GetDbSystem Gets information about the specified DB System. -func (client DatabaseClient) GetDbSystem(ctx context.Context, request GetDbSystemRequest) (response GetDbSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems/{dbSystemId}", request) +// startAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) startAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouses/{autonomousDataWarehouseId}/actions/start") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response StartAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetDbSystemPatch Gets information about a specified patch package. -func (client DatabaseClient) GetDbSystemPatch(ctx context.Context, request GetDbSystemPatchRequest) (response GetDbSystemPatchResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems/{dbSystemId}/patches/{patchId}", request) - if err != nil { - return +// StartAutonomousDatabase Starts the specified Autonomous Database. +func (client DatabaseClient) StartAutonomousDatabase(ctx context.Context, request StartAutonomousDatabaseRequest) (response StartAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.startAutonomousDatabase, policy) if err != nil { + if ociResponse != nil { + response = StartAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(StartAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartAutonomousDatabaseResponse") + } return } -// GetDbSystemPatchHistoryEntry Gets the patch history details for the specified patchHistoryEntryId. -func (client DatabaseClient) GetDbSystemPatchHistoryEntry(ctx context.Context, request GetDbSystemPatchHistoryEntryRequest) (response GetDbSystemPatchHistoryEntryResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems/{dbSystemId}/patchHistoryEntries/{patchHistoryEntryId}", request) +// startAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) startAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/start") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response StartAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// LaunchDbSystem Launches a new DB System in the specified compartment and Availability Domain. You'll specify a single Oracle -// Database Edition that applies to all the databases on that DB System. The selected edition cannot be changed. -// An initial database is created on the DB System based on the request parameters you provide and some default -// options. For more information, -// see Default Options for the Initial Database (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/launchingDB.htm#Default_Options_for_the_Initial_Database). -// The DB System will include a command line interface (CLI) that you can use to create additional databases and -// manage existing databases. For more information, see the -// Oracle Database CLI Reference (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/References/odacli.htm#Oracle_Database_CLI_Reference). -func (client DatabaseClient) LaunchDbSystem(ctx context.Context, request LaunchDbSystemRequest) (response LaunchDbSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/dbSystems", request) - if err != nil { - return +// StopAutonomousDataWarehouse **Deprecated.** To stop an Autonomous Data Warehouse, use the StopAutonomousDatabase operation. +func (client DatabaseClient) StopAutonomousDataWarehouse(ctx context.Context, request StopAutonomousDataWarehouseRequest) (response StopAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.stopAutonomousDataWarehouse, policy) if err != nil { + if ociResponse != nil { + response = StopAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(StopAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopAutonomousDataWarehouseResponse") + } return } -// ListBackups Gets a list of backups based on the databaseId or compartmentId specified. Either one of the query parameters must be provided. -func (client DatabaseClient) ListBackups(ctx context.Context, request ListBackupsRequest) (response ListBackupsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/backups", request) +// stopAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) stopAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDataWarehouses/{autonomousDataWarehouseId}/actions/stop") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response StopAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDataGuardAssociations Lists all Data Guard associations for the specified database. -func (client DatabaseClient) ListDataGuardAssociations(ctx context.Context, request ListDataGuardAssociationsRequest) (response ListDataGuardAssociationsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/databases/{databaseId}/dataGuardAssociations", request) - if err != nil { - return +// StopAutonomousDatabase Stops the specified Autonomous Database. +func (client DatabaseClient) StopAutonomousDatabase(ctx context.Context, request StopAutonomousDatabaseRequest) (response StopAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.stopAutonomousDatabase, policy) if err != nil { + if ociResponse != nil { + response = StopAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(StopAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopAutonomousDatabaseResponse") + } return } -// ListDatabases Gets a list of the databases in the specified database home. -func (client DatabaseClient) ListDatabases(ctx context.Context, request ListDatabasesRequest) (response ListDatabasesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/databases", request) +// stopAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) stopAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/stop") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response StopAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDbHomePatchHistoryEntries Gets history of the actions taken for patches for the specified database home. -func (client DatabaseClient) ListDbHomePatchHistoryEntries(ctx context.Context, request ListDbHomePatchHistoryEntriesRequest) (response ListDbHomePatchHistoryEntriesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes/{dbHomeId}/patchHistoryEntries", request) - if err != nil { - return +// SwitchoverDataGuardAssociation Performs a switchover to transition the primary database of a Data Guard association into a standby role. The +// standby database associated with the `dataGuardAssociationId` assumes the primary database role. +// A switchover guarantees no data loss. +func (client DatabaseClient) SwitchoverDataGuardAssociation(ctx context.Context, request SwitchoverDataGuardAssociationRequest) (response SwitchoverDataGuardAssociationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.switchoverDataGuardAssociation, policy) if err != nil { + if ociResponse != nil { + response = SwitchoverDataGuardAssociationResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(SwitchoverDataGuardAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SwitchoverDataGuardAssociationResponse") + } return } -// ListDbHomePatches Lists patches applicable to the requested database home. -func (client DatabaseClient) ListDbHomePatches(ctx context.Context, request ListDbHomePatchesRequest) (response ListDbHomePatchesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes/{dbHomeId}/patches", request) +// switchoverDataGuardAssociation implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) switchoverDataGuardAssociation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/switchover") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response SwitchoverDataGuardAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDbHomes Gets a list of database homes in the specified DB System and compartment. A database home is a directory where Oracle database software is installed. -func (client DatabaseClient) ListDbHomes(ctx context.Context, request ListDbHomesRequest) (response ListDbHomesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbHomes", request) - if err != nil { - return +// TerminateDbSystem Terminates a DB system and permanently deletes it and any databases running on it, and any storage volumes attached to it. The database data is local to the DB system and will be lost when the system is terminated. Oracle recommends that you back up any data in the DB system prior to terminating it. +func (client DatabaseClient) TerminateDbSystem(ctx context.Context, request TerminateDbSystemRequest) (response TerminateDbSystemResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.terminateDbSystem, policy) if err != nil { + if ociResponse != nil { + response = TerminateDbSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(TerminateDbSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into TerminateDbSystemResponse") + } return } -// ListDbNodes Gets a list of database nodes in the specified DB System and compartment. A database node is a server running database software. -func (client DatabaseClient) ListDbNodes(ctx context.Context, request ListDbNodesRequest) (response ListDbNodesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbNodes", request) +// terminateDbSystem implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) terminateDbSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dbSystems/{dbSystemId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response TerminateDbSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDbSystemPatchHistoryEntries Gets the history of the patch actions performed on the specified DB System. -func (client DatabaseClient) ListDbSystemPatchHistoryEntries(ctx context.Context, request ListDbSystemPatchHistoryEntriesRequest) (response ListDbSystemPatchHistoryEntriesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems/{dbSystemId}/patchHistoryEntries", request) - if err != nil { - return +// UpdateAutonomousDataWarehouse **Deprecated.** To update the CPU core count and storage size of an Autonomous Data Warehouse, use the UpdateAutonomousDatabase operation. +func (client DatabaseClient) UpdateAutonomousDataWarehouse(ctx context.Context, request UpdateAutonomousDataWarehouseRequest) (response UpdateAutonomousDataWarehouseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateAutonomousDataWarehouse, policy) if err != nil { + if ociResponse != nil { + response = UpdateAutonomousDataWarehouseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateAutonomousDataWarehouseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAutonomousDataWarehouseResponse") + } return } -// ListDbSystemPatches Lists the patches applicable to the requested DB System. -func (client DatabaseClient) ListDbSystemPatches(ctx context.Context, request ListDbSystemPatchesRequest) (response ListDbSystemPatchesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems/{dbSystemId}/patches", request) +// updateAutonomousDataWarehouse implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateAutonomousDataWarehouse(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/autonomousDataWarehouses/{autonomousDataWarehouseId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateAutonomousDataWarehouseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDbSystemShapes Gets a list of the shapes that can be used to launch a new DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. -func (client DatabaseClient) ListDbSystemShapes(ctx context.Context, request ListDbSystemShapesRequest) (response ListDbSystemShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystemShapes", request) - if err != nil { - return +// UpdateAutonomousDatabase Updates the specified Autonomous Database with a new CPU core count and size. +func (client DatabaseClient) UpdateAutonomousDatabase(ctx context.Context, request UpdateAutonomousDatabaseRequest) (response UpdateAutonomousDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateAutonomousDatabase, policy) if err != nil { + if ociResponse != nil { + response = UpdateAutonomousDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAutonomousDatabaseResponse") + } return } -// ListDbSystems Gets a list of the DB Systems in the specified compartment. You can specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment. -// -func (client DatabaseClient) ListDbSystems(ctx context.Context, request ListDbSystemsRequest) (response ListDbSystemsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbSystems", request) +// updateAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateAutonomousDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/autonomousDatabases/{autonomousDatabaseId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateAutonomousDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDbVersions Gets a list of supported Oracle database versions. -func (client DatabaseClient) ListDbVersions(ctx context.Context, request ListDbVersionsRequest) (response ListDbVersionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dbVersions", request) - if err != nil { - return +// UpdateDatabase Update a Database based on the request parameters you provide. +func (client DatabaseClient) UpdateDatabase(ctx context.Context, request UpdateDatabaseRequest) (response UpdateDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateDatabase, policy) if err != nil { + if ociResponse != nil { + response = UpdateDatabaseResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDatabaseResponse") + } return } -// ReinstateDataGuardAssociation Reinstates the database identified by the `databaseId` parameter into the standby role in a Data Guard association. -func (client DatabaseClient) ReinstateDataGuardAssociation(ctx context.Context, request ReinstateDataGuardAssociationRequest) (response ReinstateDataGuardAssociationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/reinstate", request) +// updateDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateDatabase(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/databases/{databaseId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDatabaseResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// RestoreDatabase Restore a Database based on the request parameters you provide. -func (client DatabaseClient) RestoreDatabase(ctx context.Context, request RestoreDatabaseRequest) (response RestoreDatabaseResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/databases/{databaseId}/actions/restore", request) - if err != nil { - return +// UpdateDbHome Patches the specified dbHome. +func (client DatabaseClient) UpdateDbHome(ctx context.Context, request UpdateDbHomeRequest) (response UpdateDbHomeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateDbHome, policy) if err != nil { + if ociResponse != nil { + response = UpdateDbHomeResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateDbHomeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDbHomeResponse") + } return } -// SwitchoverDataGuardAssociation Performs a switchover to transition the primary database of a Data Guard association into a standby role. The -// standby database associated with the `dataGuardAssociationId` assumes the primary database role. -// A switchover guarantees no data loss. -func (client DatabaseClient) SwitchoverDataGuardAssociation(ctx context.Context, request SwitchoverDataGuardAssociationRequest) (response SwitchoverDataGuardAssociationResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/switchover", request) +// updateDbHome implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateDbHome(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dbHomes/{dbHomeId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDbHomeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// TerminateDbSystem Terminates a DB System and permanently deletes it and any databases running on it, and any storage volumes attached to it. The database data is local to the DB System and will be lost when the system is terminated. Oracle recommends that you back up any data in the DB System prior to terminating it. -func (client DatabaseClient) TerminateDbSystem(ctx context.Context, request TerminateDbSystemRequest) (response TerminateDbSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/dbSystems/{dbSystemId}", request) - if err != nil { - return +// UpdateDbSystem Updates the properties of a DB system, such as the CPU core count. +func (client DatabaseClient) UpdateDbSystem(ctx context.Context, request UpdateDbSystemRequest) (response UpdateDbSystemResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateDbSystem, policy) if err != nil { + if ociResponse != nil { + response = UpdateDbSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateDbSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDbSystemResponse") + } return } -// UpdateDatabase Update a Database based on the request parameters you provide. -func (client DatabaseClient) UpdateDatabase(ctx context.Context, request UpdateDatabaseRequest) (response UpdateDatabaseResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/databases/{databaseId}", request) +// updateDbSystem implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateDbSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dbSystems/{dbSystemId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDbSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateDbHome Patches the specified dbHome. -func (client DatabaseClient) UpdateDbHome(ctx context.Context, request UpdateDbHomeRequest) (response UpdateDbHomeResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/dbHomes/{dbHomeId}", request) - if err != nil { - return +// UpdateExadataIormConfig Update `IORM` Settings for the requested Exadata DB System. +func (client DatabaseClient) UpdateExadataIormConfig(ctx context.Context, request UpdateExadataIormConfigRequest) (response UpdateExadataIormConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateExadataIormConfig, policy) if err != nil { + if ociResponse != nil { + response = UpdateExadataIormConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateExadataIormConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateExadataIormConfigResponse") + } return } -// UpdateDbSystem Updates the properties of a DB System, such as the CPU core count. -func (client DatabaseClient) UpdateDbSystem(ctx context.Context, request UpdateDbSystemRequest) (response UpdateDbSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/dbSystems/{dbSystemId}", request) +// updateExadataIormConfig implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateExadataIormConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dbSystems/{dbSystemId}/ExadataIormConfig") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateExadataIormConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_connection_strings.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_connection_strings.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_connection_strings.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_connection_strings.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DatabaseConnectionStrings Connection strings to connect to an Oracle Database. +type DatabaseConnectionStrings struct { + + // Host name based CDB Connection String. + CdbDefault *string `mandatory:"false" json:"cdbDefault"` + + // IP based CDB Connection String. + CdbIpDefault *string `mandatory:"false" json:"cdbIpDefault"` + + // All connection strings to use to connect to the Database. + AllConnectionStrings map[string]string `mandatory:"false" json:"allConnectionStrings"` +} + +func (m DatabaseConnectionStrings) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,11 +12,13 @@ "github.com/oracle/oci-go-sdk/common" ) -// Database An Oracle database on a DB System. For more information, see Managing Oracle Databases (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Database The representation of Database type Database struct { - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The database name. @@ -25,34 +27,44 @@ // A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed. DbUniqueName *string `mandatory:"true" json:"dbUniqueName"` - // The OCID of the database. - Id *string `mandatory:"true" json:"id"` - // The current state of the database. LifecycleState DatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The character set for the database. CharacterSet *string `mandatory:"false" json:"characterSet"` - DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + // The national character set for the database. + NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` - // The OCID of the database home. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home. DbHomeId *string `mandatory:"false" json:"dbHomeId"` - // Database workload type. + // The name of the pluggable database. The name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. + PdbName *string `mandatory:"false" json:"pdbName"` + + // The database workload type. DbWorkload *string `mandatory:"false" json:"dbWorkload"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - // The national character set for the database. - NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` - - // Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. - PdbName *string `mandatory:"false" json:"pdbName"` - // The date and time the database was created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Connection strings used to connect to the Oracle Database. + ConnectionStrings *DatabaseConnectionStrings `mandatory:"false" json:"connectionStrings"` } func (m Database) String() string { @@ -62,7 +74,7 @@ // DatabaseLifecycleStateEnum Enum with underlying type: string type DatabaseLifecycleStateEnum string -// Set of constants representing the allowable values for DatabaseLifecycleState +// Set of constants representing the allowable values for DatabaseLifecycleStateEnum const ( DatabaseLifecycleStateProvisioning DatabaseLifecycleStateEnum = "PROVISIONING" DatabaseLifecycleStateAvailable DatabaseLifecycleStateEnum = "AVAILABLE" @@ -85,7 +97,7 @@ "FAILED": DatabaseLifecycleStateFailed, } -// GetDatabaseLifecycleStateEnumValues Enumerates the set of values for DatabaseLifecycleState +// GetDatabaseLifecycleStateEnumValues Enumerates the set of values for DatabaseLifecycleStateEnum func GetDatabaseLifecycleStateEnumValues() []DatabaseLifecycleStateEnum { values := make([]DatabaseLifecycleStateEnum, 0) for _, v := range mappingDatabaseLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/database_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,11 +12,15 @@ "github.com/oracle/oci-go-sdk/common" ) -// DatabaseSummary An Oracle database on a DB System. For more information, see Managing Oracle Databases (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DatabaseSummary An Oracle Database on a bare metal or virtual machine DB system. For more information, see Bare Metal and Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type DatabaseSummary struct { - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The database name. @@ -25,34 +29,44 @@ // A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed. DbUniqueName *string `mandatory:"true" json:"dbUniqueName"` - // The OCID of the database. - Id *string `mandatory:"true" json:"id"` - // The current state of the database. LifecycleState DatabaseSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The character set for the database. CharacterSet *string `mandatory:"false" json:"characterSet"` - DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + // The national character set for the database. + NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` - // The OCID of the database home. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home. DbHomeId *string `mandatory:"false" json:"dbHomeId"` - // Database workload type. + // The name of the pluggable database. The name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. + PdbName *string `mandatory:"false" json:"pdbName"` + + // The database workload type. DbWorkload *string `mandatory:"false" json:"dbWorkload"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - // The national character set for the database. - NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` - - // Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. - PdbName *string `mandatory:"false" json:"pdbName"` - // The date and time the database was created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Connection strings used to connect to the Oracle Database. + ConnectionStrings *DatabaseConnectionStrings `mandatory:"false" json:"connectionStrings"` } func (m DatabaseSummary) String() string { @@ -62,7 +76,7 @@ // DatabaseSummaryLifecycleStateEnum Enum with underlying type: string type DatabaseSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for DatabaseSummaryLifecycleState +// Set of constants representing the allowable values for DatabaseSummaryLifecycleStateEnum const ( DatabaseSummaryLifecycleStateProvisioning DatabaseSummaryLifecycleStateEnum = "PROVISIONING" DatabaseSummaryLifecycleStateAvailable DatabaseSummaryLifecycleStateEnum = "AVAILABLE" @@ -85,7 +99,7 @@ "FAILED": DatabaseSummaryLifecycleStateFailed, } -// GetDatabaseSummaryLifecycleStateEnumValues Enumerates the set of values for DatabaseSummaryLifecycleState +// GetDatabaseSummaryLifecycleStateEnumValues Enumerates the set of values for DatabaseSummaryLifecycleStateEnum func GetDatabaseSummaryLifecycleStateEnumValues() []DatabaseSummaryLifecycleStateEnum { values := make([]DatabaseSummaryLifecycleStateEnum, 0) for _, v := range mappingDatabaseSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,25 +12,22 @@ "github.com/oracle/oci-go-sdk/common" ) -// DataGuardAssociation The properties that define a Data Guard association. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an -// administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). -// For information about endpoints and signing API requests, see -// About the API (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see -// SDKS and Other Tools (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm). +// DataGuardAssociation The representation of DataGuardAssociation type DataGuardAssociation struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the reporting database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Data Guard association. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the reporting database. DatabaseId *string `mandatory:"true" json:"databaseId"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Data Guard association. - Id *string `mandatory:"true" json:"id"` + // The role of the reporting database in this Data Guard association. + Role DataGuardAssociationRoleEnum `mandatory:"true" json:"role"` // The current state of the Data Guard association. LifecycleState DataGuardAssociationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System containing the associated + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system containing the associated // peer database. PeerDbSystemId *string `mandatory:"true" json:"peerDbSystemId"` @@ -42,8 +39,17 @@ // in the Oracle Data Guard documentation. ProtectionMode DataGuardAssociationProtectionModeEnum `mandatory:"true" json:"protectionMode"` - // The role of the reporting database in this Data Guard association. - Role DataGuardAssociationRoleEnum `mandatory:"true" json:"role"` + // Additional information about the current lifecycleState, if available. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home containing the associated peer database. + PeerDbHomeId *string `mandatory:"false" json:"peerDbHomeId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated peer database. + PeerDatabaseId *string `mandatory:"false" json:"peerDatabaseId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. + PeerDataGuardAssociationId *string `mandatory:"false" json:"peerDataGuardAssociationId"` // The lag time between updates to the primary database and application of the redo data on the standby database, // as computed by the reporting database. @@ -54,35 +60,48 @@ // Example: `180 Mb per second` ApplyRate *string `mandatory:"false" json:"applyRate"` - // Additional information about the current lifecycleState, if available. - LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. - PeerDataGuardAssociationId *string `mandatory:"false" json:"peerDataGuardAssociationId"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the associated peer database. - PeerDatabaseId *string `mandatory:"false" json:"peerDatabaseId"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the database home containing the associated peer database. - PeerDbHomeId *string `mandatory:"false" json:"peerDbHomeId"` - - // The date and time the Data Guard Association was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The redo transport type used by this Data Guard association. For more information, see // Redo Transport Services (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) // in the Oracle Data Guard documentation. TransportType DataGuardAssociationTransportTypeEnum `mandatory:"false" json:"transportType,omitempty"` + + // The date and time the Data Guard association was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m DataGuardAssociation) String() string { return common.PointerString(m) } +// DataGuardAssociationRoleEnum Enum with underlying type: string +type DataGuardAssociationRoleEnum string + +// Set of constants representing the allowable values for DataGuardAssociationRoleEnum +const ( + DataGuardAssociationRolePrimary DataGuardAssociationRoleEnum = "PRIMARY" + DataGuardAssociationRoleStandby DataGuardAssociationRoleEnum = "STANDBY" + DataGuardAssociationRoleDisabledStandby DataGuardAssociationRoleEnum = "DISABLED_STANDBY" +) + +var mappingDataGuardAssociationRole = map[string]DataGuardAssociationRoleEnum{ + "PRIMARY": DataGuardAssociationRolePrimary, + "STANDBY": DataGuardAssociationRoleStandby, + "DISABLED_STANDBY": DataGuardAssociationRoleDisabledStandby, +} + +// GetDataGuardAssociationRoleEnumValues Enumerates the set of values for DataGuardAssociationRoleEnum +func GetDataGuardAssociationRoleEnumValues() []DataGuardAssociationRoleEnum { + values := make([]DataGuardAssociationRoleEnum, 0) + for _, v := range mappingDataGuardAssociationRole { + values = append(values, v) + } + return values +} + // DataGuardAssociationLifecycleStateEnum Enum with underlying type: string type DataGuardAssociationLifecycleStateEnum string -// Set of constants representing the allowable values for DataGuardAssociationLifecycleState +// Set of constants representing the allowable values for DataGuardAssociationLifecycleStateEnum const ( DataGuardAssociationLifecycleStateProvisioning DataGuardAssociationLifecycleStateEnum = "PROVISIONING" DataGuardAssociationLifecycleStateAvailable DataGuardAssociationLifecycleStateEnum = "AVAILABLE" @@ -101,7 +120,7 @@ "FAILED": DataGuardAssociationLifecycleStateFailed, } -// GetDataGuardAssociationLifecycleStateEnumValues Enumerates the set of values for DataGuardAssociationLifecycleState +// GetDataGuardAssociationLifecycleStateEnumValues Enumerates the set of values for DataGuardAssociationLifecycleStateEnum func GetDataGuardAssociationLifecycleStateEnumValues() []DataGuardAssociationLifecycleStateEnum { values := make([]DataGuardAssociationLifecycleStateEnum, 0) for _, v := range mappingDataGuardAssociationLifecycleState { @@ -113,7 +132,7 @@ // DataGuardAssociationPeerRoleEnum Enum with underlying type: string type DataGuardAssociationPeerRoleEnum string -// Set of constants representing the allowable values for DataGuardAssociationPeerRole +// Set of constants representing the allowable values for DataGuardAssociationPeerRoleEnum const ( DataGuardAssociationPeerRolePrimary DataGuardAssociationPeerRoleEnum = "PRIMARY" DataGuardAssociationPeerRoleStandby DataGuardAssociationPeerRoleEnum = "STANDBY" @@ -126,7 +145,7 @@ "DISABLED_STANDBY": DataGuardAssociationPeerRoleDisabledStandby, } -// GetDataGuardAssociationPeerRoleEnumValues Enumerates the set of values for DataGuardAssociationPeerRole +// GetDataGuardAssociationPeerRoleEnumValues Enumerates the set of values for DataGuardAssociationPeerRoleEnum func GetDataGuardAssociationPeerRoleEnumValues() []DataGuardAssociationPeerRoleEnum { values := make([]DataGuardAssociationPeerRoleEnum, 0) for _, v := range mappingDataGuardAssociationPeerRole { @@ -138,7 +157,7 @@ // DataGuardAssociationProtectionModeEnum Enum with underlying type: string type DataGuardAssociationProtectionModeEnum string -// Set of constants representing the allowable values for DataGuardAssociationProtectionMode +// Set of constants representing the allowable values for DataGuardAssociationProtectionModeEnum const ( DataGuardAssociationProtectionModeAvailability DataGuardAssociationProtectionModeEnum = "MAXIMUM_AVAILABILITY" DataGuardAssociationProtectionModePerformance DataGuardAssociationProtectionModeEnum = "MAXIMUM_PERFORMANCE" @@ -151,7 +170,7 @@ "MAXIMUM_PROTECTION": DataGuardAssociationProtectionModeProtection, } -// GetDataGuardAssociationProtectionModeEnumValues Enumerates the set of values for DataGuardAssociationProtectionMode +// GetDataGuardAssociationProtectionModeEnumValues Enumerates the set of values for DataGuardAssociationProtectionModeEnum func GetDataGuardAssociationProtectionModeEnumValues() []DataGuardAssociationProtectionModeEnum { values := make([]DataGuardAssociationProtectionModeEnum, 0) for _, v := range mappingDataGuardAssociationProtectionMode { @@ -160,35 +179,10 @@ return values } -// DataGuardAssociationRoleEnum Enum with underlying type: string -type DataGuardAssociationRoleEnum string - -// Set of constants representing the allowable values for DataGuardAssociationRole -const ( - DataGuardAssociationRolePrimary DataGuardAssociationRoleEnum = "PRIMARY" - DataGuardAssociationRoleStandby DataGuardAssociationRoleEnum = "STANDBY" - DataGuardAssociationRoleDisabledStandby DataGuardAssociationRoleEnum = "DISABLED_STANDBY" -) - -var mappingDataGuardAssociationRole = map[string]DataGuardAssociationRoleEnum{ - "PRIMARY": DataGuardAssociationRolePrimary, - "STANDBY": DataGuardAssociationRoleStandby, - "DISABLED_STANDBY": DataGuardAssociationRoleDisabledStandby, -} - -// GetDataGuardAssociationRoleEnumValues Enumerates the set of values for DataGuardAssociationRole -func GetDataGuardAssociationRoleEnumValues() []DataGuardAssociationRoleEnum { - values := make([]DataGuardAssociationRoleEnum, 0) - for _, v := range mappingDataGuardAssociationRole { - values = append(values, v) - } - return values -} - // DataGuardAssociationTransportTypeEnum Enum with underlying type: string type DataGuardAssociationTransportTypeEnum string -// Set of constants representing the allowable values for DataGuardAssociationTransportType +// Set of constants representing the allowable values for DataGuardAssociationTransportTypeEnum const ( DataGuardAssociationTransportTypeSync DataGuardAssociationTransportTypeEnum = "SYNC" DataGuardAssociationTransportTypeAsync DataGuardAssociationTransportTypeEnum = "ASYNC" @@ -201,7 +195,7 @@ "FASTSYNC": DataGuardAssociationTransportTypeFastsync, } -// GetDataGuardAssociationTransportTypeEnumValues Enumerates the set of values for DataGuardAssociationTransportType +// GetDataGuardAssociationTransportTypeEnumValues Enumerates the set of values for DataGuardAssociationTransportTypeEnum func GetDataGuardAssociationTransportTypeEnumValues() []DataGuardAssociationTransportTypeEnum { values := make([]DataGuardAssociationTransportTypeEnum, 0) for _, v := range mappingDataGuardAssociationTransportType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/data_guard_association_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,22 +15,25 @@ // DataGuardAssociationSummary The properties that define a Data Guard association. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an // administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // For information about endpoints and signing API requests, see -// About the API (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see -// SDKS and Other Tools (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm). +// About the API (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see +// SDKS and Other Tools (https://docs.cloud.oracle.com/Content/API/Concepts/sdks.htm). type DataGuardAssociationSummary struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the reporting database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Data Guard association. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the reporting database. DatabaseId *string `mandatory:"true" json:"databaseId"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Data Guard association. - Id *string `mandatory:"true" json:"id"` + // The role of the reporting database in this Data Guard association. + Role DataGuardAssociationSummaryRoleEnum `mandatory:"true" json:"role"` // The current state of the Data Guard association. LifecycleState DataGuardAssociationSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System containing the associated + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system containing the associated // peer database. PeerDbSystemId *string `mandatory:"true" json:"peerDbSystemId"` @@ -42,8 +45,17 @@ // in the Oracle Data Guard documentation. ProtectionMode DataGuardAssociationSummaryProtectionModeEnum `mandatory:"true" json:"protectionMode"` - // The role of the reporting database in this Data Guard association. - Role DataGuardAssociationSummaryRoleEnum `mandatory:"true" json:"role"` + // Additional information about the current lifecycleState, if available. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home containing the associated peer database. + PeerDbHomeId *string `mandatory:"false" json:"peerDbHomeId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated peer database. + PeerDatabaseId *string `mandatory:"false" json:"peerDatabaseId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. + PeerDataGuardAssociationId *string `mandatory:"false" json:"peerDataGuardAssociationId"` // The lag time between updates to the primary database and application of the redo data on the standby database, // as computed by the reporting database. @@ -54,35 +66,48 @@ // Example: `180 Mb per second` ApplyRate *string `mandatory:"false" json:"applyRate"` - // Additional information about the current lifecycleState, if available. - LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. - PeerDataGuardAssociationId *string `mandatory:"false" json:"peerDataGuardAssociationId"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the associated peer database. - PeerDatabaseId *string `mandatory:"false" json:"peerDatabaseId"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the database home containing the associated peer database. - PeerDbHomeId *string `mandatory:"false" json:"peerDbHomeId"` - - // The date and time the Data Guard Association was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - // The redo transport type used by this Data Guard association. For more information, see // Redo Transport Services (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) // in the Oracle Data Guard documentation. TransportType DataGuardAssociationSummaryTransportTypeEnum `mandatory:"false" json:"transportType,omitempty"` + + // The date and time the Data Guard association was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m DataGuardAssociationSummary) String() string { return common.PointerString(m) } +// DataGuardAssociationSummaryRoleEnum Enum with underlying type: string +type DataGuardAssociationSummaryRoleEnum string + +// Set of constants representing the allowable values for DataGuardAssociationSummaryRoleEnum +const ( + DataGuardAssociationSummaryRolePrimary DataGuardAssociationSummaryRoleEnum = "PRIMARY" + DataGuardAssociationSummaryRoleStandby DataGuardAssociationSummaryRoleEnum = "STANDBY" + DataGuardAssociationSummaryRoleDisabledStandby DataGuardAssociationSummaryRoleEnum = "DISABLED_STANDBY" +) + +var mappingDataGuardAssociationSummaryRole = map[string]DataGuardAssociationSummaryRoleEnum{ + "PRIMARY": DataGuardAssociationSummaryRolePrimary, + "STANDBY": DataGuardAssociationSummaryRoleStandby, + "DISABLED_STANDBY": DataGuardAssociationSummaryRoleDisabledStandby, +} + +// GetDataGuardAssociationSummaryRoleEnumValues Enumerates the set of values for DataGuardAssociationSummaryRoleEnum +func GetDataGuardAssociationSummaryRoleEnumValues() []DataGuardAssociationSummaryRoleEnum { + values := make([]DataGuardAssociationSummaryRoleEnum, 0) + for _, v := range mappingDataGuardAssociationSummaryRole { + values = append(values, v) + } + return values +} + // DataGuardAssociationSummaryLifecycleStateEnum Enum with underlying type: string type DataGuardAssociationSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for DataGuardAssociationSummaryLifecycleState +// Set of constants representing the allowable values for DataGuardAssociationSummaryLifecycleStateEnum const ( DataGuardAssociationSummaryLifecycleStateProvisioning DataGuardAssociationSummaryLifecycleStateEnum = "PROVISIONING" DataGuardAssociationSummaryLifecycleStateAvailable DataGuardAssociationSummaryLifecycleStateEnum = "AVAILABLE" @@ -101,7 +126,7 @@ "FAILED": DataGuardAssociationSummaryLifecycleStateFailed, } -// GetDataGuardAssociationSummaryLifecycleStateEnumValues Enumerates the set of values for DataGuardAssociationSummaryLifecycleState +// GetDataGuardAssociationSummaryLifecycleStateEnumValues Enumerates the set of values for DataGuardAssociationSummaryLifecycleStateEnum func GetDataGuardAssociationSummaryLifecycleStateEnumValues() []DataGuardAssociationSummaryLifecycleStateEnum { values := make([]DataGuardAssociationSummaryLifecycleStateEnum, 0) for _, v := range mappingDataGuardAssociationSummaryLifecycleState { @@ -113,7 +138,7 @@ // DataGuardAssociationSummaryPeerRoleEnum Enum with underlying type: string type DataGuardAssociationSummaryPeerRoleEnum string -// Set of constants representing the allowable values for DataGuardAssociationSummaryPeerRole +// Set of constants representing the allowable values for DataGuardAssociationSummaryPeerRoleEnum const ( DataGuardAssociationSummaryPeerRolePrimary DataGuardAssociationSummaryPeerRoleEnum = "PRIMARY" DataGuardAssociationSummaryPeerRoleStandby DataGuardAssociationSummaryPeerRoleEnum = "STANDBY" @@ -126,7 +151,7 @@ "DISABLED_STANDBY": DataGuardAssociationSummaryPeerRoleDisabledStandby, } -// GetDataGuardAssociationSummaryPeerRoleEnumValues Enumerates the set of values for DataGuardAssociationSummaryPeerRole +// GetDataGuardAssociationSummaryPeerRoleEnumValues Enumerates the set of values for DataGuardAssociationSummaryPeerRoleEnum func GetDataGuardAssociationSummaryPeerRoleEnumValues() []DataGuardAssociationSummaryPeerRoleEnum { values := make([]DataGuardAssociationSummaryPeerRoleEnum, 0) for _, v := range mappingDataGuardAssociationSummaryPeerRole { @@ -138,7 +163,7 @@ // DataGuardAssociationSummaryProtectionModeEnum Enum with underlying type: string type DataGuardAssociationSummaryProtectionModeEnum string -// Set of constants representing the allowable values for DataGuardAssociationSummaryProtectionMode +// Set of constants representing the allowable values for DataGuardAssociationSummaryProtectionModeEnum const ( DataGuardAssociationSummaryProtectionModeAvailability DataGuardAssociationSummaryProtectionModeEnum = "MAXIMUM_AVAILABILITY" DataGuardAssociationSummaryProtectionModePerformance DataGuardAssociationSummaryProtectionModeEnum = "MAXIMUM_PERFORMANCE" @@ -151,7 +176,7 @@ "MAXIMUM_PROTECTION": DataGuardAssociationSummaryProtectionModeProtection, } -// GetDataGuardAssociationSummaryProtectionModeEnumValues Enumerates the set of values for DataGuardAssociationSummaryProtectionMode +// GetDataGuardAssociationSummaryProtectionModeEnumValues Enumerates the set of values for DataGuardAssociationSummaryProtectionModeEnum func GetDataGuardAssociationSummaryProtectionModeEnumValues() []DataGuardAssociationSummaryProtectionModeEnum { values := make([]DataGuardAssociationSummaryProtectionModeEnum, 0) for _, v := range mappingDataGuardAssociationSummaryProtectionMode { @@ -160,35 +185,10 @@ return values } -// DataGuardAssociationSummaryRoleEnum Enum with underlying type: string -type DataGuardAssociationSummaryRoleEnum string - -// Set of constants representing the allowable values for DataGuardAssociationSummaryRole -const ( - DataGuardAssociationSummaryRolePrimary DataGuardAssociationSummaryRoleEnum = "PRIMARY" - DataGuardAssociationSummaryRoleStandby DataGuardAssociationSummaryRoleEnum = "STANDBY" - DataGuardAssociationSummaryRoleDisabledStandby DataGuardAssociationSummaryRoleEnum = "DISABLED_STANDBY" -) - -var mappingDataGuardAssociationSummaryRole = map[string]DataGuardAssociationSummaryRoleEnum{ - "PRIMARY": DataGuardAssociationSummaryRolePrimary, - "STANDBY": DataGuardAssociationSummaryRoleStandby, - "DISABLED_STANDBY": DataGuardAssociationSummaryRoleDisabledStandby, -} - -// GetDataGuardAssociationSummaryRoleEnumValues Enumerates the set of values for DataGuardAssociationSummaryRole -func GetDataGuardAssociationSummaryRoleEnumValues() []DataGuardAssociationSummaryRoleEnum { - values := make([]DataGuardAssociationSummaryRoleEnum, 0) - for _, v := range mappingDataGuardAssociationSummaryRole { - values = append(values, v) - } - return values -} - // DataGuardAssociationSummaryTransportTypeEnum Enum with underlying type: string type DataGuardAssociationSummaryTransportTypeEnum string -// Set of constants representing the allowable values for DataGuardAssociationSummaryTransportType +// Set of constants representing the allowable values for DataGuardAssociationSummaryTransportTypeEnum const ( DataGuardAssociationSummaryTransportTypeSync DataGuardAssociationSummaryTransportTypeEnum = "SYNC" DataGuardAssociationSummaryTransportTypeAsync DataGuardAssociationSummaryTransportTypeEnum = "ASYNC" @@ -201,7 +201,7 @@ "FASTSYNC": DataGuardAssociationSummaryTransportTypeFastsync, } -// GetDataGuardAssociationSummaryTransportTypeEnumValues Enumerates the set of values for DataGuardAssociationSummaryTransportType +// GetDataGuardAssociationSummaryTransportTypeEnumValues Enumerates the set of values for DataGuardAssociationSummaryTransportTypeEnum func GetDataGuardAssociationSummaryTransportTypeEnumValues() []DataGuardAssociationSummaryTransportTypeEnum { values := make([]DataGuardAssociationSummaryTransportTypeEnum, 0) for _, v := range mappingDataGuardAssociationSummaryTransportType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_backup_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_backup_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_backup_config.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_backup_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -13,11 +13,16 @@ ) // DbBackupConfig Backup Options -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type DbBackupConfig struct { // If set to true, configures automatic backups. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. AutoBackupEnabled *bool `mandatory:"false" json:"autoBackupEnabled"` + + // Number of days between the current and the earliest point of recoverability covered by automatic backups. + // This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. + // When the value is updated, it is applied to all existing automatic backups. + RecoveryWindowInDays *int `mandatory:"false" json:"recoveryWindowInDays"` } func (m DbBackupConfig) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,36 +12,30 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbHome A directory where Oracle database software is installed. Each DB System can have multiple database homes, -// and each database home can have multiple databases within it. All the databases within a single database home -// must be the same database version, but different database homes can run different versions. For more information, -// see Managing Oracle Databases (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an -// administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DbHome The representation of DbHome type DbHome struct { - // The OCID of the compartment. - CompartmentId *string `mandatory:"true" json:"compartmentId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home. + Id *string `mandatory:"true" json:"id"` - // The Oracle database version. - DbVersion *string `mandatory:"true" json:"dbVersion"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The user-provided name for the database home. It does not need to be unique. + // The user-provided name for the database home. The name does not need to be unique. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID of the database home. - Id *string `mandatory:"true" json:"id"` - // The current state of the database home. LifecycleState DbHomeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the DB System. - DbSystemId *string `mandatory:"false" json:"dbSystemId"` + // The Oracle Database version. + DbVersion *string `mandatory:"true" json:"dbVersion"` - // The OCID of the last patch history. This is updated as soon as a patch operation is started. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the last patch history. This value is updated as soon as a patch operation is started. LastPatchHistoryEntryId *string `mandatory:"false" json:"lastPatchHistoryEntryId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. + DbSystemId *string `mandatory:"false" json:"dbSystemId"` + // The date and time the database home was created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } @@ -53,7 +47,7 @@ // DbHomeLifecycleStateEnum Enum with underlying type: string type DbHomeLifecycleStateEnum string -// Set of constants representing the allowable values for DbHomeLifecycleState +// Set of constants representing the allowable values for DbHomeLifecycleStateEnum const ( DbHomeLifecycleStateProvisioning DbHomeLifecycleStateEnum = "PROVISIONING" DbHomeLifecycleStateAvailable DbHomeLifecycleStateEnum = "AVAILABLE" @@ -72,7 +66,7 @@ "FAILED": DbHomeLifecycleStateFailed, } -// GetDbHomeLifecycleStateEnumValues Enumerates the set of values for DbHomeLifecycleState +// GetDbHomeLifecycleStateEnumValues Enumerates the set of values for DbHomeLifecycleStateEnum func GetDbHomeLifecycleStateEnumValues() []DbHomeLifecycleStateEnum { values := make([]DbHomeLifecycleStateEnum, 0) for _, v := range mappingDbHomeLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_home_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,36 +12,36 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbHomeSummary A directory where Oracle database software is installed. Each DB System can have multiple database homes, -// and each database home can have multiple databases within it. All the databases within a single database home -// must be the same database version, but different database homes can run different versions. For more information, -// see Managing Oracle Databases (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm). +// DbHomeSummary A directory where Oracle Database software is installed. A bare metal DB system can have multiple database homes +// and each database home can run a different supported version of Oracle Database. A virtual machine DB system can have only one database home. +// For more information, see Bare Metal and Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an // administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type DbHomeSummary struct { - // The OCID of the compartment. - CompartmentId *string `mandatory:"true" json:"compartmentId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database home. + Id *string `mandatory:"true" json:"id"` - // The Oracle database version. - DbVersion *string `mandatory:"true" json:"dbVersion"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The user-provided name for the database home. It does not need to be unique. + // The user-provided name for the database home. The name does not need to be unique. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID of the database home. - Id *string `mandatory:"true" json:"id"` - // The current state of the database home. LifecycleState DbHomeSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the DB System. - DbSystemId *string `mandatory:"false" json:"dbSystemId"` + // The Oracle Database version. + DbVersion *string `mandatory:"true" json:"dbVersion"` - // The OCID of the last patch history. This is updated as soon as a patch operation is started. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the last patch history. This value is updated as soon as a patch operation is started. LastPatchHistoryEntryId *string `mandatory:"false" json:"lastPatchHistoryEntryId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. + DbSystemId *string `mandatory:"false" json:"dbSystemId"` + // The date and time the database home was created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } @@ -53,7 +53,7 @@ // DbHomeSummaryLifecycleStateEnum Enum with underlying type: string type DbHomeSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for DbHomeSummaryLifecycleState +// Set of constants representing the allowable values for DbHomeSummaryLifecycleStateEnum const ( DbHomeSummaryLifecycleStateProvisioning DbHomeSummaryLifecycleStateEnum = "PROVISIONING" DbHomeSummaryLifecycleStateAvailable DbHomeSummaryLifecycleStateEnum = "AVAILABLE" @@ -72,7 +72,7 @@ "FAILED": DbHomeSummaryLifecycleStateFailed, } -// GetDbHomeSummaryLifecycleStateEnumValues Enumerates the set of values for DbHomeSummaryLifecycleState +// GetDbHomeSummaryLifecycleStateEnumValues Enumerates the set of values for DbHomeSummaryLifecycleStateEnum func GetDbHomeSummaryLifecycleStateEnumValues() []DbHomeSummaryLifecycleStateEnum { values := make([]DbHomeSummaryLifecycleStateEnum, 0) for _, v := range mappingDbHomeSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DbIormConfig IORM Config setting response for this database +type DbIormConfig struct { + + // Database Name. For default DbPlan, the dbName will always be `default` + DbName *string `mandatory:"false" json:"dbName"` + + // Relative priority of a database + Share *int `mandatory:"false" json:"share"` + + // Flash Cache limit, internally configured based on shares + FlashCacheLimit *string `mandatory:"false" json:"flashCacheLimit"` +} + +func (m DbIormConfig) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config_update_detail.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config_update_detail.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config_update_detail.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_iorm_config_update_detail.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DbIormConfigUpdateDetail IORM Config setting request for this database +type DbIormConfigUpdateDetail struct { + + // Database Name. For updating default DbPlan, pass in dbName as `default` + DbName *string `mandatory:"false" json:"dbName"` + + // Relative priority of a database + Share *int `mandatory:"false" json:"share"` +} + +func (m DbIormConfigUpdateDetail) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_action_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_action_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_action_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_action_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // DbNodeActionRequest wrapper for the DbNodeAction operation type DbNodeActionRequest struct { - // The database node OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` // The action to perform on the DB Node. @@ -28,12 +28,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DbNodeActionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DbNodeActionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DbNodeActionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DbNodeActionResponse wrapper for the DbNodeAction operation type DbNodeActionResponse struct { @@ -55,10 +73,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response DbNodeActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // DbNodeActionActionEnum Enum with underlying type: string type DbNodeActionActionEnum string -// Set of constants representing the allowable values for DbNodeActionAction +// Set of constants representing the allowable values for DbNodeActionActionEnum const ( DbNodeActionActionStop DbNodeActionActionEnum = "STOP" DbNodeActionActionStart DbNodeActionActionEnum = "START" @@ -73,7 +96,7 @@ "RESET": DbNodeActionActionReset, } -// GetDbNodeActionActionEnumValues Enumerates the set of values for DbNodeActionAction +// GetDbNodeActionActionEnumValues Enumerates the set of values for DbNodeActionActionEnum func GetDbNodeActionActionEnumValues() []DbNodeActionActionEnum { values := make([]DbNodeActionActionEnum, 0) for _, v := range mappingDbNodeActionAction { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,32 +12,34 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbNode A server where Oracle database software is running. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DbNode The representation of DbNode type DbNode struct { - // The OCID of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database node. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" json:"dbSystemId"` - // The OCID of the DB Node. - Id *string `mandatory:"true" json:"id"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC. + VnicId *string `mandatory:"true" json:"vnicId"` // The current state of the database node. LifecycleState DbNodeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The date and time that the DB Node was created. + // The date and time that the database node was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The OCID of the VNIC. - VnicId *string `mandatory:"true" json:"vnicId"` - - // The OCID of the backup VNIC. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup VNIC. BackupVnicId *string `mandatory:"false" json:"backupVnicId"` - // The host name for the DB Node. + // The host name for the database node. Hostname *string `mandatory:"false" json:"hostname"` - // Storage size, in GBs, of the software volume that is allocated to the DB system. This is applicable only for VM-based DBs. + // The name of the Fault Domain the instance is contained in. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. SoftwareStorageSizeInGB *int `mandatory:"false" json:"softwareStorageSizeInGB"` } @@ -48,7 +50,7 @@ // DbNodeLifecycleStateEnum Enum with underlying type: string type DbNodeLifecycleStateEnum string -// Set of constants representing the allowable values for DbNodeLifecycleState +// Set of constants representing the allowable values for DbNodeLifecycleStateEnum const ( DbNodeLifecycleStateProvisioning DbNodeLifecycleStateEnum = "PROVISIONING" DbNodeLifecycleStateAvailable DbNodeLifecycleStateEnum = "AVAILABLE" @@ -73,7 +75,7 @@ "FAILED": DbNodeLifecycleStateFailed, } -// GetDbNodeLifecycleStateEnumValues Enumerates the set of values for DbNodeLifecycleState +// GetDbNodeLifecycleStateEnumValues Enumerates the set of values for DbNodeLifecycleStateEnum func GetDbNodeLifecycleStateEnumValues() []DbNodeLifecycleStateEnum { values := make([]DbNodeLifecycleStateEnum, 0) for _, v := range mappingDbNodeLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_node_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,32 +12,36 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbNodeSummary A server where Oracle database software is running. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DbNodeSummary A server where Oracle Database software is running. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type DbNodeSummary struct { - // The OCID of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database node. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" json:"dbSystemId"` - // The OCID of the DB Node. - Id *string `mandatory:"true" json:"id"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC. + VnicId *string `mandatory:"true" json:"vnicId"` // The current state of the database node. LifecycleState DbNodeSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The date and time that the DB Node was created. + // The date and time that the database node was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The OCID of the VNIC. - VnicId *string `mandatory:"true" json:"vnicId"` - - // The OCID of the backup VNIC. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup VNIC. BackupVnicId *string `mandatory:"false" json:"backupVnicId"` - // The host name for the DB Node. + // The host name for the database node. Hostname *string `mandatory:"false" json:"hostname"` - // Storage size, in GBs, of the software volume that is allocated to the DB system. This is applicable only for VM-based DBs. + // The name of the Fault Domain the instance is contained in. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. SoftwareStorageSizeInGB *int `mandatory:"false" json:"softwareStorageSizeInGB"` } @@ -48,7 +52,7 @@ // DbNodeSummaryLifecycleStateEnum Enum with underlying type: string type DbNodeSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for DbNodeSummaryLifecycleState +// Set of constants representing the allowable values for DbNodeSummaryLifecycleStateEnum const ( DbNodeSummaryLifecycleStateProvisioning DbNodeSummaryLifecycleStateEnum = "PROVISIONING" DbNodeSummaryLifecycleStateAvailable DbNodeSummaryLifecycleStateEnum = "AVAILABLE" @@ -73,7 +77,7 @@ "FAILED": DbNodeSummaryLifecycleStateFailed, } -// GetDbNodeSummaryLifecycleStateEnumValues Enumerates the set of values for DbNodeSummaryLifecycleState +// GetDbNodeSummaryLifecycleStateEnumValues Enumerates the set of values for DbNodeSummaryLifecycleStateEnum func GetDbNodeSummaryLifecycleStateEnumValues() []DbNodeSummaryLifecycleStateEnum { values := make([]DbNodeSummaryLifecycleStateEnum, 0) for _, v := range mappingDbNodeSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,119 +12,131 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbSystem The Database Service supports several types of DB Systems, ranging in size, price, and performance. For details about each type of system, see: -// - Exadata DB Systems (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/exaoverview.htm) -// - Bare Metal and Virtual Machine DB Systems (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm) -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). -// -// For information about access control and compartments, see -// Overview of the Identity Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about Availability Domains, see -// Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). -// To get a list of Availability Domains, use the `ListAvailabilityDomains` operation -// in the Identity Service API. +// DbSystem The representation of DbSystem type DbSystem struct { - // The name of the Availability Domain that the DB System is located in. - AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. + Id *string `mandatory:"true" json:"id"` - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The number of CPU cores enabled on the DB System. - CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + // The user-friendly name for the DB system. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` - // The Oracle Database Edition that applies to all the databases on the DB System. - DatabaseEdition DbSystemDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` + // The name of the availability domain that the DB system is located in. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - // The user-friendly name for the DB System. It does not have to be unique. - DisplayName *string `mandatory:"true" json:"displayName"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + // - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20. + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and backup subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` - // The domain name for the DB System. - Domain *string `mandatory:"true" json:"domain"` + // The shape of the DB system. The shape determines resources to allocate to the DB system. + // - For virtual machine shapes, the number of CPU cores and memory + // - For bare metal and Exadata shapes, the number of CPU cores, storage, and memory + Shape *string `mandatory:"true" json:"shape"` - // The host name for the DB Node. + // The public key portion of one or more key pairs used for SSH access to the DB system. + SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + + // The hostname for the DB system. Hostname *string `mandatory:"true" json:"hostname"` - // The OCID of the DB System. - Id *string `mandatory:"true" json:"id"` + // The domain name for the DB system. + Domain *string `mandatory:"true" json:"domain"` - // The current state of the DB System. - LifecycleState DbSystemLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // The number of CPU cores enabled on the DB system. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` - // The shape of the DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. - Shape *string `mandatory:"true" json:"shape"` + // The Oracle Database edition that applies to all the databases on the DB system. + DatabaseEdition DbSystemDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` - // The public key portion of one or more key pairs used for SSH access to the DB System. - SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + // The current state of the DB system. + LifecycleState DbSystemLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the subnet the DB System is associated with. - // **Subnet Restrictions:** - // - For single node and 2-node (RAC) DB Systems, do not use a subnet that overlaps with 192.168.16.16/28 - // - For Exadata and VM-based RAC DB Systems, do not use a subnet that overlaps with 192.168.128.0/20 - // These subnets are used by the Oracle Clusterware private interconnect on the database instance. - // Specifying an overlapping subnet will cause the private interconnect to malfunction. - // This restriction applies to both the client subnet and backup subnet. - SubnetId *string `mandatory:"true" json:"subnetId"` + // List of the Fault Domains in which this DB system is provisioned. + FaultDomains []string `mandatory:"false" json:"faultDomains"` - // The OCID of the backup network subnet the DB System is associated with. Applicable only to Exadata. - // **Subnet Restriction:** See above subnetId's 'Subnet Restriction'. - // to malfunction. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems. + // **Subnet Restriction:** See the subnet restrictions information for **subnetId**. BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` - // Cluster name for Exadata and 2-node RAC DB Systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + // The time zone of the DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). + TimeZone *string `mandatory:"false" json:"timeZone"` + + // The Oracle Database version of the DB system. + Version *string `mandatory:"false" json:"version"` + + // The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. ClusterName *string `mandatory:"false" json:"clusterName"` // The percentage assigned to DATA storage (user data and database files). - // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80. + // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems. DataStoragePercentage *int `mandatory:"false" json:"dataStoragePercentage"` - // Data storage size, in GBs, that is currently available to the DB system. This is applicable only for VM-based DBs. - DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` - - // The type of redundancy configured for the DB System. - // Normal is 2-way redundancy. - // High is 3-way redundancy. - DiskRedundancy DbSystemDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` - - // The OCID of the last patch history. This is updated as soon as a patch operation is started. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the last patch history. This value is updated as soon as a patch operation starts. LastPatchHistoryEntryId *string `mandatory:"false" json:"lastPatchHistoryEntryId"` - // The Oracle license model that applies to all the databases on the DB System. The default is LICENSE_INCLUDED. - LicenseModel DbSystemLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + // The port number configured for the listener on the DB system. + ListenerPort *int `mandatory:"false" json:"listenerPort"` + + // The date and time the DB system was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - // The port number configured for the listener on the DB System. - ListenerPort *int `mandatory:"false" json:"listenerPort"` + // The type of redundancy configured for the DB system. + // NORMAL is 2-way redundancy. + // HIGH is 3-way redundancy. + DiskRedundancy DbSystemDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` - // Number of nodes in this DB system. For RAC DBs, this will be greater than 1. - NodeCount *int `mandatory:"false" json:"nodeCount"` + // True, if Sparse Diskgroup is configured for Exadata dbsystem, False, if Sparse diskgroup was not configured. + SparseDiskgroup *bool `mandatory:"false" json:"sparseDiskgroup"` - // RECO/REDO storage size, in GBs, that is currently allocated to the DB system. This is applicable only for VM-based DBs. - RecoStorageSizeInGB *int `mandatory:"false" json:"recoStorageSizeInGB"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Single Client Access Name (SCAN) IP addresses associated with the DB system. + // SCAN IP addresses are typically used for load balancing and are not assigned to any interface. + // Oracle Clusterware directs the requests to the appropriate nodes in the cluster. + // **Note:** For a single-node DB system, this list is empty. + ScanIpIds []string `mandatory:"false" json:"scanIpIds"` - // The OCID of the DNS record for the SCAN IP addresses that are associated with the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the virtual IP (VIP) addresses associated with the DB system. + // The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB system to + // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. + // **Note:** For a single-node DB system, this list is empty. + VipIds []string `mandatory:"false" json:"vipIds"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DNS record for the SCAN IP addresses that are associated with the DB system. ScanDnsRecordId *string `mandatory:"false" json:"scanDnsRecordId"` - // The OCID of the Single Client Access Name (SCAN) IP addresses associated with the DB System. - // SCAN IP addresses are typically used for load balancing and are not assigned to any interface. - // Clusterware directs the requests to the appropriate nodes in the cluster. - // - For a single-node DB System, this list is empty. - ScanIpIds []string `mandatory:"false" json:"scanIpIds"` + // The data storage size, in gigabytes, that is currently available to the DB system. Applies only for virtual machine DB systems. + DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` - // The date and time the DB System was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + // The RECO/REDO storage size, in gigabytes, that is currently allocated to the DB system. Applies only for virtual machine DB systems. + RecoStorageSizeInGB *int `mandatory:"false" json:"recoStorageSizeInGB"` - // The version of the DB System. - Version *string `mandatory:"false" json:"version"` + // The number of nodes in the DB system. For RAC DB systems, the value is greater than 1. + NodeCount *int `mandatory:"false" json:"nodeCount"` - // The OCID of the virtual IP (VIP) addresses associated with the DB System. - // The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB System to - // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. - // - For a single-node DB System, this list is empty. - VipIds []string `mandatory:"false" json:"vipIds"` + // The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED. + LicenseModel DbSystemLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + IormConfigCache *ExadataIormConfig `mandatory:"false" json:"iormConfigCache"` } func (m DbSystem) String() string { @@ -134,22 +146,22 @@ // DbSystemDatabaseEditionEnum Enum with underlying type: string type DbSystemDatabaseEditionEnum string -// Set of constants representing the allowable values for DbSystemDatabaseEdition +// Set of constants representing the allowable values for DbSystemDatabaseEditionEnum const ( DbSystemDatabaseEditionStandardEdition DbSystemDatabaseEditionEnum = "STANDARD_EDITION" DbSystemDatabaseEditionEnterpriseEdition DbSystemDatabaseEditionEnum = "ENTERPRISE_EDITION" - DbSystemDatabaseEditionEnterpriseEditionExtremePerformance DbSystemDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" DbSystemDatabaseEditionEnterpriseEditionHighPerformance DbSystemDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + DbSystemDatabaseEditionEnterpriseEditionExtremePerformance DbSystemDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" ) var mappingDbSystemDatabaseEdition = map[string]DbSystemDatabaseEditionEnum{ "STANDARD_EDITION": DbSystemDatabaseEditionStandardEdition, "ENTERPRISE_EDITION": DbSystemDatabaseEditionEnterpriseEdition, - "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": DbSystemDatabaseEditionEnterpriseEditionExtremePerformance, "ENTERPRISE_EDITION_HIGH_PERFORMANCE": DbSystemDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": DbSystemDatabaseEditionEnterpriseEditionExtremePerformance, } -// GetDbSystemDatabaseEditionEnumValues Enumerates the set of values for DbSystemDatabaseEdition +// GetDbSystemDatabaseEditionEnumValues Enumerates the set of values for DbSystemDatabaseEditionEnum func GetDbSystemDatabaseEditionEnumValues() []DbSystemDatabaseEditionEnum { values := make([]DbSystemDatabaseEditionEnum, 0) for _, v := range mappingDbSystemDatabaseEdition { @@ -158,10 +170,41 @@ return values } +// DbSystemLifecycleStateEnum Enum with underlying type: string +type DbSystemLifecycleStateEnum string + +// Set of constants representing the allowable values for DbSystemLifecycleStateEnum +const ( + DbSystemLifecycleStateProvisioning DbSystemLifecycleStateEnum = "PROVISIONING" + DbSystemLifecycleStateAvailable DbSystemLifecycleStateEnum = "AVAILABLE" + DbSystemLifecycleStateUpdating DbSystemLifecycleStateEnum = "UPDATING" + DbSystemLifecycleStateTerminating DbSystemLifecycleStateEnum = "TERMINATING" + DbSystemLifecycleStateTerminated DbSystemLifecycleStateEnum = "TERMINATED" + DbSystemLifecycleStateFailed DbSystemLifecycleStateEnum = "FAILED" +) + +var mappingDbSystemLifecycleState = map[string]DbSystemLifecycleStateEnum{ + "PROVISIONING": DbSystemLifecycleStateProvisioning, + "AVAILABLE": DbSystemLifecycleStateAvailable, + "UPDATING": DbSystemLifecycleStateUpdating, + "TERMINATING": DbSystemLifecycleStateTerminating, + "TERMINATED": DbSystemLifecycleStateTerminated, + "FAILED": DbSystemLifecycleStateFailed, +} + +// GetDbSystemLifecycleStateEnumValues Enumerates the set of values for DbSystemLifecycleStateEnum +func GetDbSystemLifecycleStateEnumValues() []DbSystemLifecycleStateEnum { + values := make([]DbSystemLifecycleStateEnum, 0) + for _, v := range mappingDbSystemLifecycleState { + values = append(values, v) + } + return values +} + // DbSystemDiskRedundancyEnum Enum with underlying type: string type DbSystemDiskRedundancyEnum string -// Set of constants representing the allowable values for DbSystemDiskRedundancy +// Set of constants representing the allowable values for DbSystemDiskRedundancyEnum const ( DbSystemDiskRedundancyHigh DbSystemDiskRedundancyEnum = "HIGH" DbSystemDiskRedundancyNormal DbSystemDiskRedundancyEnum = "NORMAL" @@ -172,7 +215,7 @@ "NORMAL": DbSystemDiskRedundancyNormal, } -// GetDbSystemDiskRedundancyEnumValues Enumerates the set of values for DbSystemDiskRedundancy +// GetDbSystemDiskRedundancyEnumValues Enumerates the set of values for DbSystemDiskRedundancyEnum func GetDbSystemDiskRedundancyEnumValues() []DbSystemDiskRedundancyEnum { values := make([]DbSystemDiskRedundancyEnum, 0) for _, v := range mappingDbSystemDiskRedundancy { @@ -184,7 +227,7 @@ // DbSystemLicenseModelEnum Enum with underlying type: string type DbSystemLicenseModelEnum string -// Set of constants representing the allowable values for DbSystemLicenseModel +// Set of constants representing the allowable values for DbSystemLicenseModelEnum const ( DbSystemLicenseModelLicenseIncluded DbSystemLicenseModelEnum = "LICENSE_INCLUDED" DbSystemLicenseModelBringYourOwnLicense DbSystemLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" @@ -195,42 +238,11 @@ "BRING_YOUR_OWN_LICENSE": DbSystemLicenseModelBringYourOwnLicense, } -// GetDbSystemLicenseModelEnumValues Enumerates the set of values for DbSystemLicenseModel +// GetDbSystemLicenseModelEnumValues Enumerates the set of values for DbSystemLicenseModelEnum func GetDbSystemLicenseModelEnumValues() []DbSystemLicenseModelEnum { values := make([]DbSystemLicenseModelEnum, 0) for _, v := range mappingDbSystemLicenseModel { values = append(values, v) } return values -} - -// DbSystemLifecycleStateEnum Enum with underlying type: string -type DbSystemLifecycleStateEnum string - -// Set of constants representing the allowable values for DbSystemLifecycleState -const ( - DbSystemLifecycleStateProvisioning DbSystemLifecycleStateEnum = "PROVISIONING" - DbSystemLifecycleStateAvailable DbSystemLifecycleStateEnum = "AVAILABLE" - DbSystemLifecycleStateUpdating DbSystemLifecycleStateEnum = "UPDATING" - DbSystemLifecycleStateTerminating DbSystemLifecycleStateEnum = "TERMINATING" - DbSystemLifecycleStateTerminated DbSystemLifecycleStateEnum = "TERMINATED" - DbSystemLifecycleStateFailed DbSystemLifecycleStateEnum = "FAILED" -) - -var mappingDbSystemLifecycleState = map[string]DbSystemLifecycleStateEnum{ - "PROVISIONING": DbSystemLifecycleStateProvisioning, - "AVAILABLE": DbSystemLifecycleStateAvailable, - "UPDATING": DbSystemLifecycleStateUpdating, - "TERMINATING": DbSystemLifecycleStateTerminating, - "TERMINATED": DbSystemLifecycleStateTerminated, - "FAILED": DbSystemLifecycleStateFailed, -} - -// GetDbSystemLifecycleStateEnumValues Enumerates the set of values for DbSystemLifecycleState -func GetDbSystemLifecycleStateEnumValues() []DbSystemLifecycleStateEnum { - values := make([]DbSystemLifecycleStateEnum, 0) - for _, v := range mappingDbSystemLifecycleState { - values = append(values, v) - } - return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_shape_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_shape_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_shape_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_shape_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,33 +12,33 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbSystemShapeSummary The shape of the DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. -// For a description of shapes, see DB System Launch Options (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/References/launchoptions.htm). +// DbSystemShapeSummary The shape of the DB system. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. +// For a description of shapes, see DB System Launch Options (https://docs.cloud.oracle.com/Content/Database/References/launchoptions.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. // If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type DbSystemShapeSummary struct { - // The maximum number of CPU cores that can be enabled on the DB System for this shape. - AvailableCoreCount *int `mandatory:"true" json:"availableCoreCount"` - - // The name of the shape used for the DB System. + // The name of the shape used for the DB system. Name *string `mandatory:"true" json:"name"` - // The discrete number by which the CPU core count for this shape can be increased or decreased. - CoreCountIncrement *int `mandatory:"false" json:"coreCountIncrement"` + // The maximum number of CPU cores that can be enabled on the DB system for this shape. + AvailableCoreCount *int `mandatory:"true" json:"availableCoreCount"` - // The maximum number of database nodes available for this shape. - MaximumNodeCount *int `mandatory:"false" json:"maximumNodeCount"` + // Deprecated. Use `name` instead of `shape`. + Shape *string `mandatory:"false" json:"shape"` - // The minimum number of CPU cores that can be enabled on the DB System for this shape. + // The minimum number of CPU cores that can be enabled on the DB system for this shape. MinimumCoreCount *int `mandatory:"false" json:"minimumCoreCount"` + // The discrete number by which the CPU core count for this shape can be increased or decreased. + CoreCountIncrement *int `mandatory:"false" json:"coreCountIncrement"` + // The minimum number of database nodes available for this shape. MinimumNodeCount *int `mandatory:"false" json:"minimumNodeCount"` - // Deprecated. Use `name` instead of `shape`. - Shape *string `mandatory:"false" json:"shape"` + // The maximum number of database nodes available for this shape. + MaximumNodeCount *int `mandatory:"false" json:"maximumNodeCount"` } func (m DbSystemShapeSummary) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_system_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,119 +12,140 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbSystemSummary The Database Service supports several types of DB Systems, ranging in size, price, and performance. For details about each type of system, see: -// - Exadata DB Systems (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/exaoverview.htm) -// - Bare Metal and Virtual Machine DB Systems (https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm) -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DbSystemSummary The Database Service supports several types of DB systems, ranging in size, price, and performance. For details about each type of system, see: +// - Exadata DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/exaoverview.htm) +// - Bare Metal and Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm) +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // // For information about access control and compartments, see -// Overview of the Identity Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). -// For information about Availability Domains, see -// Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). -// To get a list of Availability Domains, use the `ListAvailabilityDomains` operation +// Overview of the Identity Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// For information about availability domains, see +// Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). +// To get a list of availability domains, use the `ListAvailabilityDomains` operation // in the Identity Service API. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type DbSystemSummary struct { - // The name of the Availability Domain that the DB System is located in. - AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. + Id *string `mandatory:"true" json:"id"` - // The OCID of the compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The number of CPU cores enabled on the DB System. - CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + // The user-friendly name for the DB system. The name does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` - // The Oracle Database Edition that applies to all the databases on the DB System. - DatabaseEdition DbSystemSummaryDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` + // The name of the availability domain that the DB system is located in. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - // The user-friendly name for the DB System. It does not have to be unique. - DisplayName *string `mandatory:"true" json:"displayName"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + // - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20. + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and backup subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` - // The domain name for the DB System. - Domain *string `mandatory:"true" json:"domain"` + // The shape of the DB system. The shape determines resources to allocate to the DB system. + // - For virtual machine shapes, the number of CPU cores and memory + // - For bare metal and Exadata shapes, the number of CPU cores, storage, and memory + Shape *string `mandatory:"true" json:"shape"` + + // The public key portion of one or more key pairs used for SSH access to the DB system. + SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` - // The host name for the DB Node. + // The hostname for the DB system. Hostname *string `mandatory:"true" json:"hostname"` - // The OCID of the DB System. - Id *string `mandatory:"true" json:"id"` + // The domain name for the DB system. + Domain *string `mandatory:"true" json:"domain"` - // The current state of the DB System. - LifecycleState DbSystemSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // The number of CPU cores enabled on the DB system. + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` - // The shape of the DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. - Shape *string `mandatory:"true" json:"shape"` + // The Oracle Database edition that applies to all the databases on the DB system. + DatabaseEdition DbSystemSummaryDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` - // The public key portion of one or more key pairs used for SSH access to the DB System. - SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + // The current state of the DB system. + LifecycleState DbSystemSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the subnet the DB System is associated with. - // **Subnet Restrictions:** - // - For single node and 2-node (RAC) DB Systems, do not use a subnet that overlaps with 192.168.16.16/28 - // - For Exadata and VM-based RAC DB Systems, do not use a subnet that overlaps with 192.168.128.0/20 - // These subnets are used by the Oracle Clusterware private interconnect on the database instance. - // Specifying an overlapping subnet will cause the private interconnect to malfunction. - // This restriction applies to both the client subnet and backup subnet. - SubnetId *string `mandatory:"true" json:"subnetId"` + // List of the Fault Domains in which this DB system is provisioned. + FaultDomains []string `mandatory:"false" json:"faultDomains"` - // The OCID of the backup network subnet the DB System is associated with. Applicable only to Exadata. - // **Subnet Restriction:** See above subnetId's 'Subnet Restriction'. - // to malfunction. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems. + // **Subnet Restriction:** See the subnet restrictions information for **subnetId**. BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` - // Cluster name for Exadata and 2-node RAC DB Systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + // The time zone of the DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). + TimeZone *string `mandatory:"false" json:"timeZone"` + + // The Oracle Database version of the DB system. + Version *string `mandatory:"false" json:"version"` + + // The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. ClusterName *string `mandatory:"false" json:"clusterName"` // The percentage assigned to DATA storage (user data and database files). - // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80. + // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems. DataStoragePercentage *int `mandatory:"false" json:"dataStoragePercentage"` - // Data storage size, in GBs, that is currently available to the DB system. This is applicable only for VM-based DBs. - DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` - - // The type of redundancy configured for the DB System. - // Normal is 2-way redundancy. - // High is 3-way redundancy. - DiskRedundancy DbSystemSummaryDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` - - // The OCID of the last patch history. This is updated as soon as a patch operation is started. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the last patch history. This value is updated as soon as a patch operation starts. LastPatchHistoryEntryId *string `mandatory:"false" json:"lastPatchHistoryEntryId"` - // The Oracle license model that applies to all the databases on the DB System. The default is LICENSE_INCLUDED. - LicenseModel DbSystemSummaryLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + // The port number configured for the listener on the DB system. + ListenerPort *int `mandatory:"false" json:"listenerPort"` + + // The date and time the DB system was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Additional information about the current lifecycleState. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` - // The port number configured for the listener on the DB System. - ListenerPort *int `mandatory:"false" json:"listenerPort"` + // The type of redundancy configured for the DB system. + // NORMAL is 2-way redundancy. + // HIGH is 3-way redundancy. + DiskRedundancy DbSystemSummaryDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` - // Number of nodes in this DB system. For RAC DBs, this will be greater than 1. - NodeCount *int `mandatory:"false" json:"nodeCount"` + // True, if Sparse Diskgroup is configured for Exadata dbsystem, False, if Sparse diskgroup was not configured. + SparseDiskgroup *bool `mandatory:"false" json:"sparseDiskgroup"` - // RECO/REDO storage size, in GBs, that is currently allocated to the DB system. This is applicable only for VM-based DBs. - RecoStorageSizeInGB *int `mandatory:"false" json:"recoStorageSizeInGB"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Single Client Access Name (SCAN) IP addresses associated with the DB system. + // SCAN IP addresses are typically used for load balancing and are not assigned to any interface. + // Oracle Clusterware directs the requests to the appropriate nodes in the cluster. + // **Note:** For a single-node DB system, this list is empty. + ScanIpIds []string `mandatory:"false" json:"scanIpIds"` - // The OCID of the DNS record for the SCAN IP addresses that are associated with the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the virtual IP (VIP) addresses associated with the DB system. + // The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB system to + // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. + // **Note:** For a single-node DB system, this list is empty. + VipIds []string `mandatory:"false" json:"vipIds"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DNS record for the SCAN IP addresses that are associated with the DB system. ScanDnsRecordId *string `mandatory:"false" json:"scanDnsRecordId"` - // The OCID of the Single Client Access Name (SCAN) IP addresses associated with the DB System. - // SCAN IP addresses are typically used for load balancing and are not assigned to any interface. - // Clusterware directs the requests to the appropriate nodes in the cluster. - // - For a single-node DB System, this list is empty. - ScanIpIds []string `mandatory:"false" json:"scanIpIds"` + // The data storage size, in gigabytes, that is currently available to the DB system. Applies only for virtual machine DB systems. + DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` - // The date and time the DB System was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + // The RECO/REDO storage size, in gigabytes, that is currently allocated to the DB system. Applies only for virtual machine DB systems. + RecoStorageSizeInGB *int `mandatory:"false" json:"recoStorageSizeInGB"` - // The version of the DB System. - Version *string `mandatory:"false" json:"version"` + // The number of nodes in the DB system. For RAC DB systems, the value is greater than 1. + NodeCount *int `mandatory:"false" json:"nodeCount"` - // The OCID of the virtual IP (VIP) addresses associated with the DB System. - // The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB System to - // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. - // - For a single-node DB System, this list is empty. - VipIds []string `mandatory:"false" json:"vipIds"` + // The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED. + LicenseModel DbSystemSummaryLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m DbSystemSummary) String() string { @@ -134,22 +155,22 @@ // DbSystemSummaryDatabaseEditionEnum Enum with underlying type: string type DbSystemSummaryDatabaseEditionEnum string -// Set of constants representing the allowable values for DbSystemSummaryDatabaseEdition +// Set of constants representing the allowable values for DbSystemSummaryDatabaseEditionEnum const ( DbSystemSummaryDatabaseEditionStandardEdition DbSystemSummaryDatabaseEditionEnum = "STANDARD_EDITION" DbSystemSummaryDatabaseEditionEnterpriseEdition DbSystemSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION" - DbSystemSummaryDatabaseEditionEnterpriseEditionExtremePerformance DbSystemSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" DbSystemSummaryDatabaseEditionEnterpriseEditionHighPerformance DbSystemSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + DbSystemSummaryDatabaseEditionEnterpriseEditionExtremePerformance DbSystemSummaryDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" ) var mappingDbSystemSummaryDatabaseEdition = map[string]DbSystemSummaryDatabaseEditionEnum{ "STANDARD_EDITION": DbSystemSummaryDatabaseEditionStandardEdition, "ENTERPRISE_EDITION": DbSystemSummaryDatabaseEditionEnterpriseEdition, - "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": DbSystemSummaryDatabaseEditionEnterpriseEditionExtremePerformance, "ENTERPRISE_EDITION_HIGH_PERFORMANCE": DbSystemSummaryDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": DbSystemSummaryDatabaseEditionEnterpriseEditionExtremePerformance, } -// GetDbSystemSummaryDatabaseEditionEnumValues Enumerates the set of values for DbSystemSummaryDatabaseEdition +// GetDbSystemSummaryDatabaseEditionEnumValues Enumerates the set of values for DbSystemSummaryDatabaseEditionEnum func GetDbSystemSummaryDatabaseEditionEnumValues() []DbSystemSummaryDatabaseEditionEnum { values := make([]DbSystemSummaryDatabaseEditionEnum, 0) for _, v := range mappingDbSystemSummaryDatabaseEdition { @@ -158,10 +179,41 @@ return values } +// DbSystemSummaryLifecycleStateEnum Enum with underlying type: string +type DbSystemSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for DbSystemSummaryLifecycleStateEnum +const ( + DbSystemSummaryLifecycleStateProvisioning DbSystemSummaryLifecycleStateEnum = "PROVISIONING" + DbSystemSummaryLifecycleStateAvailable DbSystemSummaryLifecycleStateEnum = "AVAILABLE" + DbSystemSummaryLifecycleStateUpdating DbSystemSummaryLifecycleStateEnum = "UPDATING" + DbSystemSummaryLifecycleStateTerminating DbSystemSummaryLifecycleStateEnum = "TERMINATING" + DbSystemSummaryLifecycleStateTerminated DbSystemSummaryLifecycleStateEnum = "TERMINATED" + DbSystemSummaryLifecycleStateFailed DbSystemSummaryLifecycleStateEnum = "FAILED" +) + +var mappingDbSystemSummaryLifecycleState = map[string]DbSystemSummaryLifecycleStateEnum{ + "PROVISIONING": DbSystemSummaryLifecycleStateProvisioning, + "AVAILABLE": DbSystemSummaryLifecycleStateAvailable, + "UPDATING": DbSystemSummaryLifecycleStateUpdating, + "TERMINATING": DbSystemSummaryLifecycleStateTerminating, + "TERMINATED": DbSystemSummaryLifecycleStateTerminated, + "FAILED": DbSystemSummaryLifecycleStateFailed, +} + +// GetDbSystemSummaryLifecycleStateEnumValues Enumerates the set of values for DbSystemSummaryLifecycleStateEnum +func GetDbSystemSummaryLifecycleStateEnumValues() []DbSystemSummaryLifecycleStateEnum { + values := make([]DbSystemSummaryLifecycleStateEnum, 0) + for _, v := range mappingDbSystemSummaryLifecycleState { + values = append(values, v) + } + return values +} + // DbSystemSummaryDiskRedundancyEnum Enum with underlying type: string type DbSystemSummaryDiskRedundancyEnum string -// Set of constants representing the allowable values for DbSystemSummaryDiskRedundancy +// Set of constants representing the allowable values for DbSystemSummaryDiskRedundancyEnum const ( DbSystemSummaryDiskRedundancyHigh DbSystemSummaryDiskRedundancyEnum = "HIGH" DbSystemSummaryDiskRedundancyNormal DbSystemSummaryDiskRedundancyEnum = "NORMAL" @@ -172,7 +224,7 @@ "NORMAL": DbSystemSummaryDiskRedundancyNormal, } -// GetDbSystemSummaryDiskRedundancyEnumValues Enumerates the set of values for DbSystemSummaryDiskRedundancy +// GetDbSystemSummaryDiskRedundancyEnumValues Enumerates the set of values for DbSystemSummaryDiskRedundancyEnum func GetDbSystemSummaryDiskRedundancyEnumValues() []DbSystemSummaryDiskRedundancyEnum { values := make([]DbSystemSummaryDiskRedundancyEnum, 0) for _, v := range mappingDbSystemSummaryDiskRedundancy { @@ -184,7 +236,7 @@ // DbSystemSummaryLicenseModelEnum Enum with underlying type: string type DbSystemSummaryLicenseModelEnum string -// Set of constants representing the allowable values for DbSystemSummaryLicenseModel +// Set of constants representing the allowable values for DbSystemSummaryLicenseModelEnum const ( DbSystemSummaryLicenseModelLicenseIncluded DbSystemSummaryLicenseModelEnum = "LICENSE_INCLUDED" DbSystemSummaryLicenseModelBringYourOwnLicense DbSystemSummaryLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" @@ -195,42 +247,11 @@ "BRING_YOUR_OWN_LICENSE": DbSystemSummaryLicenseModelBringYourOwnLicense, } -// GetDbSystemSummaryLicenseModelEnumValues Enumerates the set of values for DbSystemSummaryLicenseModel +// GetDbSystemSummaryLicenseModelEnumValues Enumerates the set of values for DbSystemSummaryLicenseModelEnum func GetDbSystemSummaryLicenseModelEnumValues() []DbSystemSummaryLicenseModelEnum { values := make([]DbSystemSummaryLicenseModelEnum, 0) for _, v := range mappingDbSystemSummaryLicenseModel { values = append(values, v) } return values -} - -// DbSystemSummaryLifecycleStateEnum Enum with underlying type: string -type DbSystemSummaryLifecycleStateEnum string - -// Set of constants representing the allowable values for DbSystemSummaryLifecycleState -const ( - DbSystemSummaryLifecycleStateProvisioning DbSystemSummaryLifecycleStateEnum = "PROVISIONING" - DbSystemSummaryLifecycleStateAvailable DbSystemSummaryLifecycleStateEnum = "AVAILABLE" - DbSystemSummaryLifecycleStateUpdating DbSystemSummaryLifecycleStateEnum = "UPDATING" - DbSystemSummaryLifecycleStateTerminating DbSystemSummaryLifecycleStateEnum = "TERMINATING" - DbSystemSummaryLifecycleStateTerminated DbSystemSummaryLifecycleStateEnum = "TERMINATED" - DbSystemSummaryLifecycleStateFailed DbSystemSummaryLifecycleStateEnum = "FAILED" -) - -var mappingDbSystemSummaryLifecycleState = map[string]DbSystemSummaryLifecycleStateEnum{ - "PROVISIONING": DbSystemSummaryLifecycleStateProvisioning, - "AVAILABLE": DbSystemSummaryLifecycleStateAvailable, - "UPDATING": DbSystemSummaryLifecycleStateUpdating, - "TERMINATING": DbSystemSummaryLifecycleStateTerminating, - "TERMINATED": DbSystemSummaryLifecycleStateTerminated, - "FAILED": DbSystemSummaryLifecycleStateFailed, -} - -// GetDbSystemSummaryLifecycleStateEnumValues Enumerates the set of values for DbSystemSummaryLifecycleState -func GetDbSystemSummaryLifecycleStateEnumValues() []DbSystemSummaryLifecycleStateEnum { - values := make([]DbSystemSummaryLifecycleStateEnum, 0) - for _, v := range mappingDbSystemSummaryLifecycleState { - values = append(values, v) - } - return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_version_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_version_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_version_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/db_version_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,14 +12,17 @@ "github.com/oracle/oci-go-sdk/common" ) -// DbVersionSummary The Oracle database software version. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// DbVersionSummary The Oracle Database software version. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type DbVersionSummary struct { - // A valid Oracle database version. + // A valid Oracle Database version. Version *string `mandatory:"true" json:"version"` - // True if this version of the Oracle database software supports pluggable dbs. + // True if this version of the Oracle Database software is the latest version for a release. + IsLatestForMajorVersion *bool `mandatory:"false" json:"isLatestForMajorVersion"` + + // True if this version of the Oracle Database software supports pluggable databases. SupportsPdb *bool `mandatory:"false" json:"supportsPdb"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAutonomousDatabaseRequest wrapper for the DeleteAutonomousDatabase operation +type DeleteAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAutonomousDatabaseResponse wrapper for the DeleteAutonomousDatabase operation +type DeleteAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAutonomousDataWarehouseRequest wrapper for the DeleteAutonomousDataWarehouse operation +type DeleteAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAutonomousDataWarehouseResponse wrapper for the DeleteAutonomousDataWarehouse operation +type DeleteAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,19 +11,37 @@ // DeleteBackupRequest wrapper for the DeleteBackup operation type DeleteBackupRequest struct { - // The backup OCID. + // The backup OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). BackupId *string `mandatory:"true" contributesTo:"path" name:"backupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteBackupResponse wrapper for the DeleteBackup operation type DeleteBackupResponse struct { @@ -38,3 +56,8 @@ func (response DeleteBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_db_home_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_db_home_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_db_home_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/delete_db_home_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // DeleteDbHomeRequest wrapper for the DeleteDbHome operation type DeleteDbHomeRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` @@ -21,12 +21,30 @@ // Whether to perform a final backup of the database or not. Default is false. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. PerformFinalBackup *bool `mandatory:"false" contributesTo:"query" name:"performFinalBackup"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDbHomeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDbHomeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDbHomeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDbHomeResponse wrapper for the DeleteDbHome operation type DeleteDbHomeResponse struct { @@ -41,3 +59,8 @@ func (response DeleteDbHomeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDbHomeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ExadataIormConfig Response details which has IORM Settings for this Exadata System +type ExadataIormConfig struct { + + // The current config state of IORM settings for this Exadata System. + LifecycleState ExadataIormConfigLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Additional information about the current lifecycleState. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Value for the IORM objective + // Default is "Auto" + Objective ExadataIormConfigObjectiveEnum `mandatory:"false" json:"objective,omitempty"` + + // Array of IORM Setting for all the database in + // this Exadata DB System + DbPlans []DbIormConfig `mandatory:"false" json:"dbPlans"` +} + +func (m ExadataIormConfig) String() string { + return common.PointerString(m) +} + +// ExadataIormConfigLifecycleStateEnum Enum with underlying type: string +type ExadataIormConfigLifecycleStateEnum string + +// Set of constants representing the allowable values for ExadataIormConfigLifecycleStateEnum +const ( + ExadataIormConfigLifecycleStateBootstrapping ExadataIormConfigLifecycleStateEnum = "BOOTSTRAPPING" + ExadataIormConfigLifecycleStateEnabled ExadataIormConfigLifecycleStateEnum = "ENABLED" + ExadataIormConfigLifecycleStateDisabled ExadataIormConfigLifecycleStateEnum = "DISABLED" + ExadataIormConfigLifecycleStateUpdating ExadataIormConfigLifecycleStateEnum = "UPDATING" + ExadataIormConfigLifecycleStateFailed ExadataIormConfigLifecycleStateEnum = "FAILED" +) + +var mappingExadataIormConfigLifecycleState = map[string]ExadataIormConfigLifecycleStateEnum{ + "BOOTSTRAPPING": ExadataIormConfigLifecycleStateBootstrapping, + "ENABLED": ExadataIormConfigLifecycleStateEnabled, + "DISABLED": ExadataIormConfigLifecycleStateDisabled, + "UPDATING": ExadataIormConfigLifecycleStateUpdating, + "FAILED": ExadataIormConfigLifecycleStateFailed, +} + +// GetExadataIormConfigLifecycleStateEnumValues Enumerates the set of values for ExadataIormConfigLifecycleStateEnum +func GetExadataIormConfigLifecycleStateEnumValues() []ExadataIormConfigLifecycleStateEnum { + values := make([]ExadataIormConfigLifecycleStateEnum, 0) + for _, v := range mappingExadataIormConfigLifecycleState { + values = append(values, v) + } + return values +} + +// ExadataIormConfigObjectiveEnum Enum with underlying type: string +type ExadataIormConfigObjectiveEnum string + +// Set of constants representing the allowable values for ExadataIormConfigObjectiveEnum +const ( + ExadataIormConfigObjectiveLowLatency ExadataIormConfigObjectiveEnum = "LOW_LATENCY" + ExadataIormConfigObjectiveHighThroughput ExadataIormConfigObjectiveEnum = "HIGH_THROUGHPUT" + ExadataIormConfigObjectiveBalanced ExadataIormConfigObjectiveEnum = "BALANCED" + ExadataIormConfigObjectiveAuto ExadataIormConfigObjectiveEnum = "AUTO" + ExadataIormConfigObjectiveBasic ExadataIormConfigObjectiveEnum = "BASIC" +) + +var mappingExadataIormConfigObjective = map[string]ExadataIormConfigObjectiveEnum{ + "LOW_LATENCY": ExadataIormConfigObjectiveLowLatency, + "HIGH_THROUGHPUT": ExadataIormConfigObjectiveHighThroughput, + "BALANCED": ExadataIormConfigObjectiveBalanced, + "AUTO": ExadataIormConfigObjectiveAuto, + "BASIC": ExadataIormConfigObjectiveBasic, +} + +// GetExadataIormConfigObjectiveEnumValues Enumerates the set of values for ExadataIormConfigObjectiveEnum +func GetExadataIormConfigObjectiveEnumValues() []ExadataIormConfigObjectiveEnum { + values := make([]ExadataIormConfigObjectiveEnum, 0) + for _, v := range mappingExadataIormConfigObjective { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config_update_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config_update_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config_update_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/exadata_iorm_config_update_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ExadataIormConfigUpdateDetails IORM Setting details for this Exadata System to be updated +type ExadataIormConfigUpdateDetails struct { + + // Value for the IORM objective + // Default is "Auto" + Objective ExadataIormConfigUpdateDetailsObjectiveEnum `mandatory:"false" json:"objective,omitempty"` + + // Array of IORM Setting for all the database in + // this Exadata DB System + DbPlans []DbIormConfigUpdateDetail `mandatory:"false" json:"dbPlans"` +} + +func (m ExadataIormConfigUpdateDetails) String() string { + return common.PointerString(m) +} + +// ExadataIormConfigUpdateDetailsObjectiveEnum Enum with underlying type: string +type ExadataIormConfigUpdateDetailsObjectiveEnum string + +// Set of constants representing the allowable values for ExadataIormConfigUpdateDetailsObjectiveEnum +const ( + ExadataIormConfigUpdateDetailsObjectiveLowLatency ExadataIormConfigUpdateDetailsObjectiveEnum = "LOW_LATENCY" + ExadataIormConfigUpdateDetailsObjectiveHighThroughput ExadataIormConfigUpdateDetailsObjectiveEnum = "HIGH_THROUGHPUT" + ExadataIormConfigUpdateDetailsObjectiveBalanced ExadataIormConfigUpdateDetailsObjectiveEnum = "BALANCED" + ExadataIormConfigUpdateDetailsObjectiveAuto ExadataIormConfigUpdateDetailsObjectiveEnum = "AUTO" + ExadataIormConfigUpdateDetailsObjectiveBasic ExadataIormConfigUpdateDetailsObjectiveEnum = "BASIC" +) + +var mappingExadataIormConfigUpdateDetailsObjective = map[string]ExadataIormConfigUpdateDetailsObjectiveEnum{ + "LOW_LATENCY": ExadataIormConfigUpdateDetailsObjectiveLowLatency, + "HIGH_THROUGHPUT": ExadataIormConfigUpdateDetailsObjectiveHighThroughput, + "BALANCED": ExadataIormConfigUpdateDetailsObjectiveBalanced, + "AUTO": ExadataIormConfigUpdateDetailsObjectiveAuto, + "BASIC": ExadataIormConfigUpdateDetailsObjectiveBasic, +} + +// GetExadataIormConfigUpdateDetailsObjectiveEnumValues Enumerates the set of values for ExadataIormConfigUpdateDetailsObjectiveEnum +func GetExadataIormConfigUpdateDetailsObjectiveEnumValues() []ExadataIormConfigUpdateDetailsObjectiveEnum { + values := make([]ExadataIormConfigUpdateDetailsObjectiveEnum, 0) + for _, v := range mappingExadataIormConfigUpdateDetailsObjective { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/external_backup_job.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/external_backup_job.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/external_backup_job.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/external_backup_job.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ExternalBackupJob Provides all the details that apply to an external backup job. +type ExternalBackupJob struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated backup resource. + BackupId *string `mandatory:"true" json:"backupId"` + + // An indicator for the provisioning state of the resource. If `TRUE`, the resource is still being provisioned. + Provisioning *bool `mandatory:"true" json:"provisioning"` + + // The Swift path to use as a destination for the standalone backup. + SwiftPath *string `mandatory:"true" json:"swiftPath"` + + // The name of the Swift compartment bucket where the backup should be stored. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The tag for RMAN to apply to the backup. + Tag *string `mandatory:"true" json:"tag"` + + // The Swift user name to use for transferring the standalone backup to the designated Swift compartment bucket. + UserName *string `mandatory:"true" json:"userName"` + + // The auth token to use for access to the Swift compartment bucket that will store the standalone backup. + // For information about auth tokens, see Working with Auth Tokens (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm#two). + SwiftPassword *string `mandatory:"false" json:"swiftPassword"` +} + +func (m ExternalBackupJob) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,7 +15,7 @@ // FailoverDataGuardAssociationDetails The Data Guard association failover parameters. type FailoverDataGuardAssociationDetails struct { - // The DB System administrator password. + // The DB system administrator password. DatabaseAdminPassword *string `mandatory:"true" json:"databaseAdminPassword"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/failover_data_guard_association_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,10 +11,10 @@ // FailoverDataGuardAssociationRequest wrapper for the FailoverDataGuardAssociation operation type FailoverDataGuardAssociationRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` - // The Data Guard association's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The Data Guard association's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DataGuardAssociationId *string `mandatory:"true" contributesTo:"path" name:"dataGuardAssociationId"` // A request to perform a failover, transitioning a standby database into a primary database. @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request FailoverDataGuardAssociationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request FailoverDataGuardAssociationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request FailoverDataGuardAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // FailoverDataGuardAssociationResponse wrapper for the FailoverDataGuardAssociation operation type FailoverDataGuardAssociationResponse struct { @@ -50,3 +68,8 @@ func (response FailoverDataGuardAssociationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response FailoverDataGuardAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// GenerateAutonomousDatabaseWalletDetails Details to create and download an Oracle Autonomous Database wallet. +type GenerateAutonomousDatabaseWalletDetails struct { + + // The password to encrypt the keys inside the wallet. The password must be at least 8 characters long and must include at least 1 letter and either 1 numeric character or 1 special character. + Password *string `mandatory:"true" json:"password"` +} + +func (m GenerateAutonomousDatabaseWalletDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_database_wallet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// GenerateAutonomousDatabaseWalletRequest wrapper for the GenerateAutonomousDatabaseWallet operation +type GenerateAutonomousDatabaseWalletRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // Request to create a new Autonomous Database wallet. + GenerateAutonomousDatabaseWalletDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateAutonomousDatabaseWalletRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateAutonomousDatabaseWalletRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateAutonomousDatabaseWalletRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GenerateAutonomousDatabaseWalletResponse wrapper for the GenerateAutonomousDatabaseWallet operation +type GenerateAutonomousDatabaseWalletResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Size of the file. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The date and time the wallet was created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response GenerateAutonomousDatabaseWalletResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateAutonomousDatabaseWalletResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// GenerateAutonomousDataWarehouseWalletDetails **Deprecated.** See GenerateAutonomousDatabaseWalletDetails for reference information about creating and downloading a wallet for an Oracle Autonomous Data Warehouse. +type GenerateAutonomousDataWarehouseWalletDetails struct { + + // The password to encrypt the keys inside the wallet. The password must be at least 8 characters long and must include at least 1 letter and either 1 numeric character or 1 special character. + Password *string `mandatory:"true" json:"password"` +} + +func (m GenerateAutonomousDataWarehouseWalletDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/generate_autonomous_data_warehouse_wallet_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// GenerateAutonomousDataWarehouseWalletRequest wrapper for the GenerateAutonomousDataWarehouseWallet operation +type GenerateAutonomousDataWarehouseWalletRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // Request to create a new Autonomous Data Warehouse wallet. + GenerateAutonomousDataWarehouseWalletDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateAutonomousDataWarehouseWalletRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateAutonomousDataWarehouseWalletRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateAutonomousDataWarehouseWalletRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GenerateAutonomousDataWarehouseWalletResponse wrapper for the GenerateAutonomousDataWarehouseWallet operation +type GenerateAutonomousDataWarehouseWalletResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Size of the file. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The date and time the wallet was created, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response GenerateAutonomousDataWarehouseWalletResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateAutonomousDataWarehouseWalletResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutonomousDatabaseBackupRequest wrapper for the GetAutonomousDatabaseBackup operation +type GetAutonomousDatabaseBackupRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. + AutonomousDatabaseBackupId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseBackupId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutonomousDatabaseBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutonomousDatabaseBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutonomousDatabaseBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutonomousDatabaseBackupResponse wrapper for the GetAutonomousDatabaseBackup operation +type GetAutonomousDatabaseBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabaseBackup instance + AutonomousDatabaseBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutonomousDatabaseBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutonomousDatabaseBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutonomousDatabaseRequest wrapper for the GetAutonomousDatabase operation +type GetAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutonomousDatabaseResponse wrapper for the GetAutonomousDatabase operation +type GetAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_backup_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutonomousDataWarehouseBackupRequest wrapper for the GetAutonomousDataWarehouseBackup operation +type GetAutonomousDataWarehouseBackupRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse backup. + AutonomousDataWarehouseBackupId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseBackupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutonomousDataWarehouseBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutonomousDataWarehouseBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutonomousDataWarehouseBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutonomousDataWarehouseBackupResponse wrapper for the GetAutonomousDataWarehouseBackup operation +type GetAutonomousDataWarehouseBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouseBackup instance + AutonomousDataWarehouseBackup `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutonomousDataWarehouseBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutonomousDataWarehouseBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAutonomousDataWarehouseRequest wrapper for the GetAutonomousDataWarehouse operation +type GetAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAutonomousDataWarehouseResponse wrapper for the GetAutonomousDataWarehouse operation +type GetAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_backup_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_backup_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_backup_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_backup_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,14 +11,32 @@ // GetBackupRequest wrapper for the GetBackup operation type GetBackupRequest struct { - // The backup OCID. + // The backup OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). BackupId *string `mandatory:"true" contributesTo:"path" name:"backupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBackupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBackupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBackupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBackupResponse wrapper for the GetBackup operation type GetBackupResponse struct { @@ -39,3 +57,8 @@ func (response GetBackupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_database_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,14 +11,32 @@ // GetDatabaseRequest wrapper for the GetDatabase operation type GetDatabaseRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDatabaseRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDatabaseResponse wrapper for the GetDatabase operation type GetDatabaseResponse struct { @@ -39,3 +57,8 @@ func (response GetDatabaseResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_data_guard_association_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_data_guard_association_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_data_guard_association_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_data_guard_association_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,17 +11,35 @@ // GetDataGuardAssociationRequest wrapper for the GetDataGuardAssociation operation type GetDataGuardAssociationRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` - // The Data Guard association's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The Data Guard association's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DataGuardAssociationId *string `mandatory:"true" contributesTo:"path" name:"dataGuardAssociationId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDataGuardAssociationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDataGuardAssociationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDataGuardAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDataGuardAssociationResponse wrapper for the GetDataGuardAssociation operation type GetDataGuardAssociationResponse struct { @@ -42,3 +60,8 @@ func (response GetDataGuardAssociationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDataGuardAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_history_entry_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_history_entry_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_history_entry_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_history_entry_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,17 +11,35 @@ // GetDbHomePatchHistoryEntryRequest wrapper for the GetDbHomePatchHistoryEntry operation type GetDbHomePatchHistoryEntryRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` - // The OCID of the patch history entry. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch history entry. PatchHistoryEntryId *string `mandatory:"true" contributesTo:"path" name:"patchHistoryEntryId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbHomePatchHistoryEntryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbHomePatchHistoryEntryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbHomePatchHistoryEntryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbHomePatchHistoryEntryResponse wrapper for the GetDbHomePatchHistoryEntry operation type GetDbHomePatchHistoryEntryResponse struct { @@ -42,3 +60,8 @@ func (response GetDbHomePatchHistoryEntryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbHomePatchHistoryEntryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_patch_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,17 +11,35 @@ // GetDbHomePatchRequest wrapper for the GetDbHomePatch operation type GetDbHomePatchRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` - // The OCID of the patch. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. PatchId *string `mandatory:"true" contributesTo:"path" name:"patchId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbHomePatchRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbHomePatchRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbHomePatchRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbHomePatchResponse wrapper for the GetDbHomePatch operation type GetDbHomePatchResponse struct { @@ -39,3 +57,8 @@ func (response GetDbHomePatchResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbHomePatchResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_home_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,14 +11,32 @@ // GetDbHomeRequest wrapper for the GetDbHome operation type GetDbHomeRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbHomeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbHomeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbHomeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbHomeResponse wrapper for the GetDbHome operation type GetDbHomeResponse struct { @@ -39,3 +57,8 @@ func (response GetDbHomeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbHomeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_node_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_node_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_node_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_node_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,14 +11,32 @@ // GetDbNodeRequest wrapper for the GetDbNode operation type GetDbNodeRequest struct { - // The database node OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbNodeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbNodeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbNodeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbNodeResponse wrapper for the GetDbNode operation type GetDbNodeResponse struct { @@ -39,3 +57,8 @@ func (response GetDbNodeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbNodeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_history_entry_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_history_entry_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_history_entry_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_history_entry_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,17 +11,35 @@ // GetDbSystemPatchHistoryEntryRequest wrapper for the GetDbSystemPatchHistoryEntry operation type GetDbSystemPatchHistoryEntryRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` - // The OCID of the patch history entry. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch history entry. PatchHistoryEntryId *string `mandatory:"true" contributesTo:"path" name:"patchHistoryEntryId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbSystemPatchHistoryEntryRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbSystemPatchHistoryEntryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbSystemPatchHistoryEntryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbSystemPatchHistoryEntryResponse wrapper for the GetDbSystemPatchHistoryEntry operation type GetDbSystemPatchHistoryEntryResponse struct { @@ -42,3 +60,8 @@ func (response GetDbSystemPatchHistoryEntryResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbSystemPatchHistoryEntryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_patch_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,17 +11,35 @@ // GetDbSystemPatchRequest wrapper for the GetDbSystemPatch operation type GetDbSystemPatchRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` - // The OCID of the patch. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. PatchId *string `mandatory:"true" contributesTo:"path" name:"patchId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbSystemPatchRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbSystemPatchRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbSystemPatchRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbSystemPatchResponse wrapper for the GetDbSystemPatch operation type GetDbSystemPatchResponse struct { @@ -39,3 +57,8 @@ func (response GetDbSystemPatchResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbSystemPatchResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_db_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,14 +11,32 @@ // GetDbSystemRequest wrapper for the GetDbSystem operation type GetDbSystemRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDbSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDbSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDbSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDbSystemResponse wrapper for the GetDbSystem operation type GetDbSystemResponse struct { @@ -39,3 +57,8 @@ func (response GetDbSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDbSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_exadata_iorm_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_exadata_iorm_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_exadata_iorm_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_exadata_iorm_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetExadataIormConfigRequest wrapper for the GetExadataIormConfig operation +type GetExadataIormConfigRequest struct { + + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetExadataIormConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetExadataIormConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExadataIormConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetExadataIormConfigResponse wrapper for the GetExadataIormConfig operation +type GetExadataIormConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExadataIormConfig instance + ExadataIormConfig `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetExadataIormConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetExadataIormConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_external_backup_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_external_backup_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_external_backup_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/get_external_backup_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetExternalBackupJobRequest wrapper for the GetExternalBackupJob operation +type GetExternalBackupJobRequest struct { + + // The backup OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + BackupId *string `mandatory:"true" contributesTo:"path" name:"backupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetExternalBackupJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetExternalBackupJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExternalBackupJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetExternalBackupJobResponse wrapper for the GetExternalBackupJob operation +type GetExternalBackupJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExternalBackupJob instance + ExternalBackupJob `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetExternalBackupJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetExternalBackupJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_base.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_base.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_base.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_base.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,300 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// LaunchDbSystemBase Parameters for provisioning a bare metal, virtual machine, or Exadata DB system. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type LaunchDbSystemBase interface { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment the DB system belongs in. + GetCompartmentId() *string + + // The availability domain where the DB system is located. + GetAvailabilityDomain() *string + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + // - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20. + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and the backup subnet. + GetSubnetId() *string + + // The shape of the DB system. The shape determines resources allocated to the DB system. + // - For virtual machine shapes, the number of CPU cores and memory + // - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage + // To get a list of shapes, use the ListDbSystemShapes operation. + GetShape() *string + + // The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters. + GetSshPublicKeys() []string + + // The hostname for the DB system. The hostname must begin with an alphabetic character, and + // can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. + // The maximum length of the combined hostname and domain is 63 characters. + // **Note:** The hostname must be unique within the subnet. If it is not unique, + // the DB system will fail to provision. + GetHostname() *string + + // The number of CPU cores to enable for a bare metal or Exadata DB system. The valid values depend on the specified shape: + // - BM.DenseIO1.36 - Specify a multiple of 2, from 2 to 36. + // - BM.DenseIO2.52 - Specify a multiple of 2, from 2 to 52. + // - Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84. + // - Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168. + // - Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336. + // - Exadata.Quarter2.92 - Specify a multiple of 2, from 0 to 92. + // - Exadata.Half2.184 - Specify a multiple of 4, from 0 to 184. + // - Exadata.Full2.368 - Specify a multiple of 8, from 0 to 368. + // This parameter is not used for virtual machine DB systems because virtual machine DB systems have a set number of cores for each shape. + // For information about the number of cores for a virtual machine DB system shape, see Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm#virtualmachine) + GetCpuCoreCount() *int + + // A Fault Domain is a grouping of hardware and infrastructure within an availability domain. + // Fault Domains let you distribute your instances so that they are not on the same physical + // hardware within a single availability domain. A hardware failure or maintenance + // that affects one Fault Domain does not affect DB systems in other Fault Domains. + // If you do not specify the Fault Domain, the system selects one for you. To change the Fault + // Domain for a DB system, terminate it and launch a new DB system in the preferred Fault Domain. + // If the node count is greater than 1, you can specify which Fault Domains these nodes will be distributed into. + // The system assigns your nodes automatically to the Fault Domains you specify so that + // no Fault Domain contains more than one node. + // To get a list of Fault Domains, use the + // ListFaultDomains operation in the + // Identity and Access Management Service API. + // Example: `FAULT-DOMAIN-1` + GetFaultDomains() []string + + // The user-friendly name for the DB system. The name does not have to be unique. + GetDisplayName() *string + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems. + // **Subnet Restrictions:** See the subnet restrictions information for **subnetId**. + GetBackupSubnetId() *string + + // The time zone to use for the DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). + GetTimeZone() *string + + // If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured. + GetSparseDiskgroup() *bool + + // A domain name used for the DB system. If the Oracle-provided Internet and VCN + // Resolver is enabled for the specified subnet, the domain name for the subnet is used + // (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted. + GetDomain() *string + + // The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + GetClusterName() *string + + // The percentage assigned to DATA storage (user data and database files). + // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). + // Specify 80 or 40. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems. + GetDataStoragePercentage() *int + + // Size (in GB) of the initial data volume that will be created and attached to a virtual machine DB system. You can scale up storage after provisioning, as needed. Note that the total storage size attached will be more than the amount you specify to allow for REDO/RECO space and software volume. + GetInitialDataStorageSizeInGB() *int + + // The number of nodes to launch for a 2-node RAC virtual machine DB system. + GetNodeCount() *int + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type launchdbsystembase struct { + JsonData []byte + CompartmentId *string `mandatory:"true" json:"compartmentId"` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + SubnetId *string `mandatory:"true" json:"subnetId"` + Shape *string `mandatory:"true" json:"shape"` + SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + Hostname *string `mandatory:"true" json:"hostname"` + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + FaultDomains []string `mandatory:"false" json:"faultDomains"` + DisplayName *string `mandatory:"false" json:"displayName"` + BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` + TimeZone *string `mandatory:"false" json:"timeZone"` + SparseDiskgroup *bool `mandatory:"false" json:"sparseDiskgroup"` + Domain *string `mandatory:"false" json:"domain"` + ClusterName *string `mandatory:"false" json:"clusterName"` + DataStoragePercentage *int `mandatory:"false" json:"dataStoragePercentage"` + InitialDataStorageSizeInGB *int `mandatory:"false" json:"initialDataStorageSizeInGB"` + NodeCount *int `mandatory:"false" json:"nodeCount"` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + Source string `json:"source"` +} + +// UnmarshalJSON unmarshals json +func (m *launchdbsystembase) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerlaunchdbsystembase launchdbsystembase + s := struct { + Model Unmarshalerlaunchdbsystembase + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.AvailabilityDomain = s.Model.AvailabilityDomain + m.SubnetId = s.Model.SubnetId + m.Shape = s.Model.Shape + m.SshPublicKeys = s.Model.SshPublicKeys + m.Hostname = s.Model.Hostname + m.CpuCoreCount = s.Model.CpuCoreCount + m.FaultDomains = s.Model.FaultDomains + m.DisplayName = s.Model.DisplayName + m.BackupSubnetId = s.Model.BackupSubnetId + m.TimeZone = s.Model.TimeZone + m.SparseDiskgroup = s.Model.SparseDiskgroup + m.Domain = s.Model.Domain + m.ClusterName = s.Model.ClusterName + m.DataStoragePercentage = s.Model.DataStoragePercentage + m.InitialDataStorageSizeInGB = s.Model.InitialDataStorageSizeInGB + m.NodeCount = s.Model.NodeCount + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.Source = s.Model.Source + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *launchdbsystembase) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Source { + case "NONE": + mm := LaunchDbSystemDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DB_BACKUP": + mm := LaunchDbSystemFromBackupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetCompartmentId returns CompartmentId +func (m launchdbsystembase) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetAvailabilityDomain returns AvailabilityDomain +func (m launchdbsystembase) GetAvailabilityDomain() *string { + return m.AvailabilityDomain +} + +//GetSubnetId returns SubnetId +func (m launchdbsystembase) GetSubnetId() *string { + return m.SubnetId +} + +//GetShape returns Shape +func (m launchdbsystembase) GetShape() *string { + return m.Shape +} + +//GetSshPublicKeys returns SshPublicKeys +func (m launchdbsystembase) GetSshPublicKeys() []string { + return m.SshPublicKeys +} + +//GetHostname returns Hostname +func (m launchdbsystembase) GetHostname() *string { + return m.Hostname +} + +//GetCpuCoreCount returns CpuCoreCount +func (m launchdbsystembase) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetFaultDomains returns FaultDomains +func (m launchdbsystembase) GetFaultDomains() []string { + return m.FaultDomains +} + +//GetDisplayName returns DisplayName +func (m launchdbsystembase) GetDisplayName() *string { + return m.DisplayName +} + +//GetBackupSubnetId returns BackupSubnetId +func (m launchdbsystembase) GetBackupSubnetId() *string { + return m.BackupSubnetId +} + +//GetTimeZone returns TimeZone +func (m launchdbsystembase) GetTimeZone() *string { + return m.TimeZone +} + +//GetSparseDiskgroup returns SparseDiskgroup +func (m launchdbsystembase) GetSparseDiskgroup() *bool { + return m.SparseDiskgroup +} + +//GetDomain returns Domain +func (m launchdbsystembase) GetDomain() *string { + return m.Domain +} + +//GetClusterName returns ClusterName +func (m launchdbsystembase) GetClusterName() *string { + return m.ClusterName +} + +//GetDataStoragePercentage returns DataStoragePercentage +func (m launchdbsystembase) GetDataStoragePercentage() *int { + return m.DataStoragePercentage +} + +//GetInitialDataStorageSizeInGB returns InitialDataStorageSizeInGB +func (m launchdbsystembase) GetInitialDataStorageSizeInGB() *int { + return m.InitialDataStorageSizeInGB +} + +//GetNodeCount returns NodeCount +func (m launchdbsystembase) GetNodeCount() *int { + return m.NodeCount +} + +//GetFreeformTags returns FreeformTags +func (m launchdbsystembase) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m launchdbsystembase) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m launchdbsystembase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -9,113 +9,261 @@ package database import ( + "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // LaunchDbSystemDetails The representation of LaunchDbSystemDetails type LaunchDbSystemDetails struct { - // The Availability Domain where the DB System is located. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment the DB system belongs in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The availability domain where the DB system is located. AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` - // The Oracle Cloud ID (OCID) of the compartment the DB System belongs in. - CompartmentId *string `mandatory:"true" json:"compartmentId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + // - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20. + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and the backup subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The shape of the DB system. The shape determines resources allocated to the DB system. + // - For virtual machine shapes, the number of CPU cores and memory + // - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage + // To get a list of shapes, use the ListDbSystemShapes operation. + Shape *string `mandatory:"true" json:"shape"` + + // The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters. + SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` - // The number of CPU cores to enable. The valid values depend on the specified shape: - // - BM.DenseIO1.36 and BM.HighIO1.36 - Specify a multiple of 2, from 2 to 36. - // - BM.RACLocalStorage1.72 - Specify a multiple of 4, from 4 to 72. + // The hostname for the DB system. The hostname must begin with an alphabetic character, and + // can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. + // The maximum length of the combined hostname and domain is 63 characters. + // **Note:** The hostname must be unique within the subnet. If it is not unique, + // the DB system will fail to provision. + Hostname *string `mandatory:"true" json:"hostname"` + + // The number of CPU cores to enable for a bare metal or Exadata DB system. The valid values depend on the specified shape: + // - BM.DenseIO1.36 - Specify a multiple of 2, from 2 to 36. + // - BM.DenseIO2.52 - Specify a multiple of 2, from 2 to 52. // - Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84. // - Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168. // - Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336. - // For VM DB systems, the core count is inferred from the specific VM shape chosen, so this parameter is not used. + // - Exadata.Quarter2.92 - Specify a multiple of 2, from 0 to 92. + // - Exadata.Half2.184 - Specify a multiple of 4, from 0 to 184. + // - Exadata.Full2.368 - Specify a multiple of 8, from 0 to 368. + // This parameter is not used for virtual machine DB systems because virtual machine DB systems have a set number of cores for each shape. + // For information about the number of cores for a virtual machine DB system shape, see Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm#virtualmachine) CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` - // The Oracle Database Edition that applies to all the databases on the DB System. - // Exadata DB Systems and 2-node RAC DB Systems require ENTERPRISE_EDITION_EXTREME_PERFORMANCE. - DatabaseEdition LaunchDbSystemDetailsDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` - DbHome *CreateDbHomeDetails `mandatory:"true" json:"dbHome"` - // The host name for the DB System. The host name must begin with an alphabetic character and - // can contain a maximum of 30 alphanumeric characters, including hyphens (-). - // The maximum length of the combined hostname and domain is 63 characters. - // **Note:** The hostname must be unique within the subnet. If it is not unique, - // the DB System will fail to provision. - Hostname *string `mandatory:"true" json:"hostname"` + // A Fault Domain is a grouping of hardware and infrastructure within an availability domain. + // Fault Domains let you distribute your instances so that they are not on the same physical + // hardware within a single availability domain. A hardware failure or maintenance + // that affects one Fault Domain does not affect DB systems in other Fault Domains. + // If you do not specify the Fault Domain, the system selects one for you. To change the Fault + // Domain for a DB system, terminate it and launch a new DB system in the preferred Fault Domain. + // If the node count is greater than 1, you can specify which Fault Domains these nodes will be distributed into. + // The system assigns your nodes automatically to the Fault Domains you specify so that + // no Fault Domain contains more than one node. + // To get a list of Fault Domains, use the + // ListFaultDomains operation in the + // Identity and Access Management Service API. + // Example: `FAULT-DOMAIN-1` + FaultDomains []string `mandatory:"false" json:"faultDomains"` - // The shape of the DB System. The shape determines resources allocated to the DB System - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. To get a list of shapes, use the ListDbSystemShapes operation. - Shape *string `mandatory:"true" json:"shape"` + // The user-friendly name for the DB system. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` - // The public key portion of the key pair to use for SSH access to the DB System. Multiple public keys can be provided. The length of the combined keys cannot exceed 10,000 characters. - SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems. + // **Subnet Restrictions:** See the subnet restrictions information for **subnetId**. + BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` - // The OCID of the subnet the DB System is associated with. - // **Subnet Restrictions:** - // - For single node and 2-node (RAC) DB Systems, do not use a subnet that overlaps with 192.168.16.16/28 - // - For Exadata and VM-based RAC DB Systems, do not use a subnet that overlaps with 192.168.128.0/20 - // These subnets are used by the Oracle Clusterware private interconnect on the database instance. - // Specifying an overlapping subnet will cause the private interconnect to malfunction. - // This restriction applies to both the client subnet and backup subnet. - SubnetId *string `mandatory:"true" json:"subnetId"` + // The time zone to use for the DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). + TimeZone *string `mandatory:"false" json:"timeZone"` - // The OCID of the backup network subnet the DB System is associated with. Applicable only to Exadata. - // **Subnet Restrictions:** See above subnetId's **Subnet Restriction**. - BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` + // If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured. + SparseDiskgroup *bool `mandatory:"false" json:"sparseDiskgroup"` - // Cluster name for Exadata and 2-node RAC DB Systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + // A domain name used for the DB system. If the Oracle-provided Internet and VCN + // Resolver is enabled for the specified subnet, the domain name for the subnet is used + // (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted. + Domain *string `mandatory:"false" json:"domain"` + + // The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. ClusterName *string `mandatory:"false" json:"clusterName"` // The percentage assigned to DATA storage (user data and database files). // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). - // Specify 80 or 40. The default is 80 percent assigned to DATA storage. This is not applicable for VM based DB systems. + // Specify 80 or 40. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems. DataStoragePercentage *int `mandatory:"false" json:"dataStoragePercentage"` - // The type of redundancy configured for the DB System. + // Size (in GB) of the initial data volume that will be created and attached to a virtual machine DB system. You can scale up storage after provisioning, as needed. Note that the total storage size attached will be more than the amount you specify to allow for REDO/RECO space and software volume. + InitialDataStorageSizeInGB *int `mandatory:"false" json:"initialDataStorageSizeInGB"` + + // The number of nodes to launch for a 2-node RAC virtual machine DB system. + NodeCount *int `mandatory:"false" json:"nodeCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Oracle Database Edition that applies to all the databases on the DB system. + // Exadata DB systems and 2-node RAC DB systems require ENTERPRISE_EDITION_EXTREME_PERFORMANCE. + DatabaseEdition LaunchDbSystemDetailsDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` + + // The type of redundancy configured for the DB system. // Normal is 2-way redundancy, recommended for test and development systems. // High is 3-way redundancy, recommended for production systems. DiskRedundancy LaunchDbSystemDetailsDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` - // The user-friendly name for the DB System. It does not have to be unique. - DisplayName *string `mandatory:"false" json:"displayName"` + // The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED. + LicenseModel LaunchDbSystemDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +} - // A domain name used for the DB System. If the Oracle-provided Internet and VCN - // Resolver is enabled for the specified subnet, the domain name for the subnet is used - // (don't provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted. - Domain *string `mandatory:"false" json:"domain"` +//GetCompartmentId returns CompartmentId +func (m LaunchDbSystemDetails) GetCompartmentId() *string { + return m.CompartmentId +} - // Size, in GBs, of the initial data volume that will be created and attached to VM-shape based DB system. This storage can later be scaled up if needed. Note that the total storage size attached will be more than what is requested, to account for REDO/RECO space and software volume. - InitialDataStorageSizeInGB *int `mandatory:"false" json:"initialDataStorageSizeInGB"` +//GetFaultDomains returns FaultDomains +func (m LaunchDbSystemDetails) GetFaultDomains() []string { + return m.FaultDomains +} - // The Oracle license model that applies to all the databases on the DB System. The default is LICENSE_INCLUDED. - LicenseModel LaunchDbSystemDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +//GetDisplayName returns DisplayName +func (m LaunchDbSystemDetails) GetDisplayName() *string { + return m.DisplayName +} - // Number of nodes to launch for a VM-shape based RAC DB system. - NodeCount *int `mandatory:"false" json:"nodeCount"` +//GetAvailabilityDomain returns AvailabilityDomain +func (m LaunchDbSystemDetails) GetAvailabilityDomain() *string { + return m.AvailabilityDomain +} + +//GetSubnetId returns SubnetId +func (m LaunchDbSystemDetails) GetSubnetId() *string { + return m.SubnetId +} + +//GetBackupSubnetId returns BackupSubnetId +func (m LaunchDbSystemDetails) GetBackupSubnetId() *string { + return m.BackupSubnetId +} + +//GetShape returns Shape +func (m LaunchDbSystemDetails) GetShape() *string { + return m.Shape +} + +//GetTimeZone returns TimeZone +func (m LaunchDbSystemDetails) GetTimeZone() *string { + return m.TimeZone +} + +//GetSparseDiskgroup returns SparseDiskgroup +func (m LaunchDbSystemDetails) GetSparseDiskgroup() *bool { + return m.SparseDiskgroup +} + +//GetSshPublicKeys returns SshPublicKeys +func (m LaunchDbSystemDetails) GetSshPublicKeys() []string { + return m.SshPublicKeys +} + +//GetHostname returns Hostname +func (m LaunchDbSystemDetails) GetHostname() *string { + return m.Hostname +} + +//GetDomain returns Domain +func (m LaunchDbSystemDetails) GetDomain() *string { + return m.Domain +} + +//GetCpuCoreCount returns CpuCoreCount +func (m LaunchDbSystemDetails) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetClusterName returns ClusterName +func (m LaunchDbSystemDetails) GetClusterName() *string { + return m.ClusterName +} + +//GetDataStoragePercentage returns DataStoragePercentage +func (m LaunchDbSystemDetails) GetDataStoragePercentage() *int { + return m.DataStoragePercentage +} + +//GetInitialDataStorageSizeInGB returns InitialDataStorageSizeInGB +func (m LaunchDbSystemDetails) GetInitialDataStorageSizeInGB() *int { + return m.InitialDataStorageSizeInGB +} + +//GetNodeCount returns NodeCount +func (m LaunchDbSystemDetails) GetNodeCount() *int { + return m.NodeCount +} + +//GetFreeformTags returns FreeformTags +func (m LaunchDbSystemDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m LaunchDbSystemDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags } func (m LaunchDbSystemDetails) String() string { return common.PointerString(m) } +// MarshalJSON marshals to json representation +func (m LaunchDbSystemDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLaunchDbSystemDetails LaunchDbSystemDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeLaunchDbSystemDetails + }{ + "NONE", + (MarshalTypeLaunchDbSystemDetails)(m), + } + + return json.Marshal(&s) +} + // LaunchDbSystemDetailsDatabaseEditionEnum Enum with underlying type: string type LaunchDbSystemDetailsDatabaseEditionEnum string -// Set of constants representing the allowable values for LaunchDbSystemDetailsDatabaseEdition +// Set of constants representing the allowable values for LaunchDbSystemDetailsDatabaseEditionEnum const ( LaunchDbSystemDetailsDatabaseEditionStandardEdition LaunchDbSystemDetailsDatabaseEditionEnum = "STANDARD_EDITION" LaunchDbSystemDetailsDatabaseEditionEnterpriseEdition LaunchDbSystemDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION" - LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionExtremePerformance LaunchDbSystemDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionHighPerformance LaunchDbSystemDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionExtremePerformance LaunchDbSystemDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" ) var mappingLaunchDbSystemDetailsDatabaseEdition = map[string]LaunchDbSystemDetailsDatabaseEditionEnum{ "STANDARD_EDITION": LaunchDbSystemDetailsDatabaseEditionStandardEdition, "ENTERPRISE_EDITION": LaunchDbSystemDetailsDatabaseEditionEnterpriseEdition, - "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionExtremePerformance, "ENTERPRISE_EDITION_HIGH_PERFORMANCE": LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": LaunchDbSystemDetailsDatabaseEditionEnterpriseEditionExtremePerformance, } -// GetLaunchDbSystemDetailsDatabaseEditionEnumValues Enumerates the set of values for LaunchDbSystemDetailsDatabaseEdition +// GetLaunchDbSystemDetailsDatabaseEditionEnumValues Enumerates the set of values for LaunchDbSystemDetailsDatabaseEditionEnum func GetLaunchDbSystemDetailsDatabaseEditionEnumValues() []LaunchDbSystemDetailsDatabaseEditionEnum { values := make([]LaunchDbSystemDetailsDatabaseEditionEnum, 0) for _, v := range mappingLaunchDbSystemDetailsDatabaseEdition { @@ -127,7 +275,7 @@ // LaunchDbSystemDetailsDiskRedundancyEnum Enum with underlying type: string type LaunchDbSystemDetailsDiskRedundancyEnum string -// Set of constants representing the allowable values for LaunchDbSystemDetailsDiskRedundancy +// Set of constants representing the allowable values for LaunchDbSystemDetailsDiskRedundancyEnum const ( LaunchDbSystemDetailsDiskRedundancyHigh LaunchDbSystemDetailsDiskRedundancyEnum = "HIGH" LaunchDbSystemDetailsDiskRedundancyNormal LaunchDbSystemDetailsDiskRedundancyEnum = "NORMAL" @@ -138,7 +286,7 @@ "NORMAL": LaunchDbSystemDetailsDiskRedundancyNormal, } -// GetLaunchDbSystemDetailsDiskRedundancyEnumValues Enumerates the set of values for LaunchDbSystemDetailsDiskRedundancy +// GetLaunchDbSystemDetailsDiskRedundancyEnumValues Enumerates the set of values for LaunchDbSystemDetailsDiskRedundancyEnum func GetLaunchDbSystemDetailsDiskRedundancyEnumValues() []LaunchDbSystemDetailsDiskRedundancyEnum { values := make([]LaunchDbSystemDetailsDiskRedundancyEnum, 0) for _, v := range mappingLaunchDbSystemDetailsDiskRedundancy { @@ -150,7 +298,7 @@ // LaunchDbSystemDetailsLicenseModelEnum Enum with underlying type: string type LaunchDbSystemDetailsLicenseModelEnum string -// Set of constants representing the allowable values for LaunchDbSystemDetailsLicenseModel +// Set of constants representing the allowable values for LaunchDbSystemDetailsLicenseModelEnum const ( LaunchDbSystemDetailsLicenseModelLicenseIncluded LaunchDbSystemDetailsLicenseModelEnum = "LICENSE_INCLUDED" LaunchDbSystemDetailsLicenseModelBringYourOwnLicense LaunchDbSystemDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" @@ -161,7 +309,7 @@ "BRING_YOUR_OWN_LICENSE": LaunchDbSystemDetailsLicenseModelBringYourOwnLicense, } -// GetLaunchDbSystemDetailsLicenseModelEnumValues Enumerates the set of values for LaunchDbSystemDetailsLicenseModel +// GetLaunchDbSystemDetailsLicenseModelEnumValues Enumerates the set of values for LaunchDbSystemDetailsLicenseModelEnum func GetLaunchDbSystemDetailsLicenseModelEnumValues() []LaunchDbSystemDetailsLicenseModelEnum { values := make([]LaunchDbSystemDetailsLicenseModelEnum, 0) for _, v := range mappingLaunchDbSystemDetailsLicenseModel { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_from_backup_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_from_backup_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_from_backup_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_from_backup_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,319 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// LaunchDbSystemFromBackupDetails The representation of LaunchDbSystemFromBackupDetails +type LaunchDbSystemFromBackupDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment the DB system belongs in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The availability domain where the DB system is located. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the DB system is associated with. + // **Subnet Restrictions:** + // - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + // - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20. + // These subnets are used by the Oracle Clusterware private interconnect on the database instance. + // Specifying an overlapping subnet will cause the private interconnect to malfunction. + // This restriction applies to both the client subnet and the backup subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The shape of the DB system. The shape determines resources allocated to the DB system. + // - For virtual machine shapes, the number of CPU cores and memory + // - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage + // To get a list of shapes, use the ListDbSystemShapes operation. + Shape *string `mandatory:"true" json:"shape"` + + // The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters. + SshPublicKeys []string `mandatory:"true" json:"sshPublicKeys"` + + // The hostname for the DB system. The hostname must begin with an alphabetic character, and + // can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. + // The maximum length of the combined hostname and domain is 63 characters. + // **Note:** The hostname must be unique within the subnet. If it is not unique, + // the DB system will fail to provision. + Hostname *string `mandatory:"true" json:"hostname"` + + // The number of CPU cores to enable for a bare metal or Exadata DB system. The valid values depend on the specified shape: + // - BM.DenseIO1.36 - Specify a multiple of 2, from 2 to 36. + // - BM.DenseIO2.52 - Specify a multiple of 2, from 2 to 52. + // - Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84. + // - Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168. + // - Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336. + // - Exadata.Quarter2.92 - Specify a multiple of 2, from 0 to 92. + // - Exadata.Half2.184 - Specify a multiple of 4, from 0 to 184. + // - Exadata.Full2.368 - Specify a multiple of 8, from 0 to 368. + // This parameter is not used for virtual machine DB systems because virtual machine DB systems have a set number of cores for each shape. + // For information about the number of cores for a virtual machine DB system shape, see Virtual Machine DB Systems (https://docs.cloud.oracle.com/Content/Database/Concepts/overview.htm#virtualmachine) + CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` + + DbHome *CreateDbHomeFromBackupDetails `mandatory:"true" json:"dbHome"` + + // A Fault Domain is a grouping of hardware and infrastructure within an availability domain. + // Fault Domains let you distribute your instances so that they are not on the same physical + // hardware within a single availability domain. A hardware failure or maintenance + // that affects one Fault Domain does not affect DB systems in other Fault Domains. + // If you do not specify the Fault Domain, the system selects one for you. To change the Fault + // Domain for a DB system, terminate it and launch a new DB system in the preferred Fault Domain. + // If the node count is greater than 1, you can specify which Fault Domains these nodes will be distributed into. + // The system assigns your nodes automatically to the Fault Domains you specify so that + // no Fault Domain contains more than one node. + // To get a list of Fault Domains, use the + // ListFaultDomains operation in the + // Identity and Access Management Service API. + // Example: `FAULT-DOMAIN-1` + FaultDomains []string `mandatory:"false" json:"faultDomains"` + + // The user-friendly name for the DB system. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems. + // **Subnet Restrictions:** See the subnet restrictions information for **subnetId**. + BackupSubnetId *string `mandatory:"false" json:"backupSubnetId"` + + // The time zone to use for the DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). + TimeZone *string `mandatory:"false" json:"timeZone"` + + // If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured. + SparseDiskgroup *bool `mandatory:"false" json:"sparseDiskgroup"` + + // A domain name used for the DB system. If the Oracle-provided Internet and VCN + // Resolver is enabled for the specified subnet, the domain name for the subnet is used + // (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted. + Domain *string `mandatory:"false" json:"domain"` + + // The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + ClusterName *string `mandatory:"false" json:"clusterName"` + + // The percentage assigned to DATA storage (user data and database files). + // The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). + // Specify 80 or 40. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems. + DataStoragePercentage *int `mandatory:"false" json:"dataStoragePercentage"` + + // Size (in GB) of the initial data volume that will be created and attached to a virtual machine DB system. You can scale up storage after provisioning, as needed. Note that the total storage size attached will be more than the amount you specify to allow for REDO/RECO space and software volume. + InitialDataStorageSizeInGB *int `mandatory:"false" json:"initialDataStorageSizeInGB"` + + // The number of nodes to launch for a 2-node RAC virtual machine DB system. + NodeCount *int `mandatory:"false" json:"nodeCount"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Oracle Database Edition that applies to all the databases on the DB system. + // Exadata DB systems and 2-node RAC DB systems require ENTERPRISE_EDITION_EXTREME_PERFORMANCE. + DatabaseEdition LaunchDbSystemFromBackupDetailsDatabaseEditionEnum `mandatory:"true" json:"databaseEdition"` + + // The type of redundancy configured for the DB system. + // NORMAL 2-way redundancy, recommended for test and development systems. + // HIGH is 3-way redundancy, recommended for production systems. + DiskRedundancy LaunchDbSystemFromBackupDetailsDiskRedundancyEnum `mandatory:"false" json:"diskRedundancy,omitempty"` + + // The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED. + LicenseModel LaunchDbSystemFromBackupDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +} + +//GetCompartmentId returns CompartmentId +func (m LaunchDbSystemFromBackupDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetFaultDomains returns FaultDomains +func (m LaunchDbSystemFromBackupDetails) GetFaultDomains() []string { + return m.FaultDomains +} + +//GetDisplayName returns DisplayName +func (m LaunchDbSystemFromBackupDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetAvailabilityDomain returns AvailabilityDomain +func (m LaunchDbSystemFromBackupDetails) GetAvailabilityDomain() *string { + return m.AvailabilityDomain +} + +//GetSubnetId returns SubnetId +func (m LaunchDbSystemFromBackupDetails) GetSubnetId() *string { + return m.SubnetId +} + +//GetBackupSubnetId returns BackupSubnetId +func (m LaunchDbSystemFromBackupDetails) GetBackupSubnetId() *string { + return m.BackupSubnetId +} + +//GetShape returns Shape +func (m LaunchDbSystemFromBackupDetails) GetShape() *string { + return m.Shape +} + +//GetTimeZone returns TimeZone +func (m LaunchDbSystemFromBackupDetails) GetTimeZone() *string { + return m.TimeZone +} + +//GetSparseDiskgroup returns SparseDiskgroup +func (m LaunchDbSystemFromBackupDetails) GetSparseDiskgroup() *bool { + return m.SparseDiskgroup +} + +//GetSshPublicKeys returns SshPublicKeys +func (m LaunchDbSystemFromBackupDetails) GetSshPublicKeys() []string { + return m.SshPublicKeys +} + +//GetHostname returns Hostname +func (m LaunchDbSystemFromBackupDetails) GetHostname() *string { + return m.Hostname +} + +//GetDomain returns Domain +func (m LaunchDbSystemFromBackupDetails) GetDomain() *string { + return m.Domain +} + +//GetCpuCoreCount returns CpuCoreCount +func (m LaunchDbSystemFromBackupDetails) GetCpuCoreCount() *int { + return m.CpuCoreCount +} + +//GetClusterName returns ClusterName +func (m LaunchDbSystemFromBackupDetails) GetClusterName() *string { + return m.ClusterName +} + +//GetDataStoragePercentage returns DataStoragePercentage +func (m LaunchDbSystemFromBackupDetails) GetDataStoragePercentage() *int { + return m.DataStoragePercentage +} + +//GetInitialDataStorageSizeInGB returns InitialDataStorageSizeInGB +func (m LaunchDbSystemFromBackupDetails) GetInitialDataStorageSizeInGB() *int { + return m.InitialDataStorageSizeInGB +} + +//GetNodeCount returns NodeCount +func (m LaunchDbSystemFromBackupDetails) GetNodeCount() *int { + return m.NodeCount +} + +//GetFreeformTags returns FreeformTags +func (m LaunchDbSystemFromBackupDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m LaunchDbSystemFromBackupDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m LaunchDbSystemFromBackupDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m LaunchDbSystemFromBackupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLaunchDbSystemFromBackupDetails LaunchDbSystemFromBackupDetails + s := struct { + DiscriminatorParam string `json:"source"` + MarshalTypeLaunchDbSystemFromBackupDetails + }{ + "DB_BACKUP", + (MarshalTypeLaunchDbSystemFromBackupDetails)(m), + } + + return json.Marshal(&s) +} + +// LaunchDbSystemFromBackupDetailsDatabaseEditionEnum Enum with underlying type: string +type LaunchDbSystemFromBackupDetailsDatabaseEditionEnum string + +// Set of constants representing the allowable values for LaunchDbSystemFromBackupDetailsDatabaseEditionEnum +const ( + LaunchDbSystemFromBackupDetailsDatabaseEditionStandardEdition LaunchDbSystemFromBackupDetailsDatabaseEditionEnum = "STANDARD_EDITION" + LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEdition LaunchDbSystemFromBackupDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION" + LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionHighPerformance LaunchDbSystemFromBackupDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_HIGH_PERFORMANCE" + LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionExtremePerformance LaunchDbSystemFromBackupDetailsDatabaseEditionEnum = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE" +) + +var mappingLaunchDbSystemFromBackupDetailsDatabaseEdition = map[string]LaunchDbSystemFromBackupDetailsDatabaseEditionEnum{ + "STANDARD_EDITION": LaunchDbSystemFromBackupDetailsDatabaseEditionStandardEdition, + "ENTERPRISE_EDITION": LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEdition, + "ENTERPRISE_EDITION_HIGH_PERFORMANCE": LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionHighPerformance, + "ENTERPRISE_EDITION_EXTREME_PERFORMANCE": LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionExtremePerformance, +} + +// GetLaunchDbSystemFromBackupDetailsDatabaseEditionEnumValues Enumerates the set of values for LaunchDbSystemFromBackupDetailsDatabaseEditionEnum +func GetLaunchDbSystemFromBackupDetailsDatabaseEditionEnumValues() []LaunchDbSystemFromBackupDetailsDatabaseEditionEnum { + values := make([]LaunchDbSystemFromBackupDetailsDatabaseEditionEnum, 0) + for _, v := range mappingLaunchDbSystemFromBackupDetailsDatabaseEdition { + values = append(values, v) + } + return values +} + +// LaunchDbSystemFromBackupDetailsDiskRedundancyEnum Enum with underlying type: string +type LaunchDbSystemFromBackupDetailsDiskRedundancyEnum string + +// Set of constants representing the allowable values for LaunchDbSystemFromBackupDetailsDiskRedundancyEnum +const ( + LaunchDbSystemFromBackupDetailsDiskRedundancyHigh LaunchDbSystemFromBackupDetailsDiskRedundancyEnum = "HIGH" + LaunchDbSystemFromBackupDetailsDiskRedundancyNormal LaunchDbSystemFromBackupDetailsDiskRedundancyEnum = "NORMAL" +) + +var mappingLaunchDbSystemFromBackupDetailsDiskRedundancy = map[string]LaunchDbSystemFromBackupDetailsDiskRedundancyEnum{ + "HIGH": LaunchDbSystemFromBackupDetailsDiskRedundancyHigh, + "NORMAL": LaunchDbSystemFromBackupDetailsDiskRedundancyNormal, +} + +// GetLaunchDbSystemFromBackupDetailsDiskRedundancyEnumValues Enumerates the set of values for LaunchDbSystemFromBackupDetailsDiskRedundancyEnum +func GetLaunchDbSystemFromBackupDetailsDiskRedundancyEnumValues() []LaunchDbSystemFromBackupDetailsDiskRedundancyEnum { + values := make([]LaunchDbSystemFromBackupDetailsDiskRedundancyEnum, 0) + for _, v := range mappingLaunchDbSystemFromBackupDetailsDiskRedundancy { + values = append(values, v) + } + return values +} + +// LaunchDbSystemFromBackupDetailsLicenseModelEnum Enum with underlying type: string +type LaunchDbSystemFromBackupDetailsLicenseModelEnum string + +// Set of constants representing the allowable values for LaunchDbSystemFromBackupDetailsLicenseModelEnum +const ( + LaunchDbSystemFromBackupDetailsLicenseModelLicenseIncluded LaunchDbSystemFromBackupDetailsLicenseModelEnum = "LICENSE_INCLUDED" + LaunchDbSystemFromBackupDetailsLicenseModelBringYourOwnLicense LaunchDbSystemFromBackupDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingLaunchDbSystemFromBackupDetailsLicenseModel = map[string]LaunchDbSystemFromBackupDetailsLicenseModelEnum{ + "LICENSE_INCLUDED": LaunchDbSystemFromBackupDetailsLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": LaunchDbSystemFromBackupDetailsLicenseModelBringYourOwnLicense, +} + +// GetLaunchDbSystemFromBackupDetailsLicenseModelEnumValues Enumerates the set of values for LaunchDbSystemFromBackupDetailsLicenseModelEnum +func GetLaunchDbSystemFromBackupDetailsLicenseModelEnumValues() []LaunchDbSystemFromBackupDetailsLicenseModelEnum { + values := make([]LaunchDbSystemFromBackupDetailsLicenseModelEnum, 0) + for _, v := range mappingLaunchDbSystemFromBackupDetailsLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/launch_db_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,8 +11,8 @@ // LaunchDbSystemRequest wrapper for the LaunchDbSystem operation type LaunchDbSystemRequest struct { - // Request to launch a DB System. - LaunchDbSystemDetails `contributesTo:"body"` + // Request to launch a DB system. + LaunchDbSystemDetails LaunchDbSystemBase `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request LaunchDbSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request LaunchDbSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LaunchDbSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // LaunchDbSystemResponse wrapper for the LaunchDbSystem operation type LaunchDbSystemResponse struct { @@ -46,3 +64,8 @@ func (response LaunchDbSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response LaunchDbSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_database_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_database_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_database_backups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_database_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutonomousDatabaseBackupsRequest wrapper for the ListAutonomousDatabaseBackups operation +type ListAutonomousDatabaseBackupsRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"false" contributesTo:"query" name:"autonomousDatabaseId"` + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + // **Note:** If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted. + SortBy ListAutonomousDatabaseBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListAutonomousDatabaseBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState AutonomousDatabaseBackupSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutonomousDatabaseBackupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutonomousDatabaseBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutonomousDatabaseBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutonomousDatabaseBackupsResponse wrapper for the ListAutonomousDatabaseBackups operation +type ListAutonomousDatabaseBackupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutonomousDatabaseBackupSummary instances + Items []AutonomousDatabaseBackupSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAutonomousDatabaseBackupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutonomousDatabaseBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutonomousDatabaseBackupsSortByEnum Enum with underlying type: string +type ListAutonomousDatabaseBackupsSortByEnum string + +// Set of constants representing the allowable values for ListAutonomousDatabaseBackupsSortByEnum +const ( + ListAutonomousDatabaseBackupsSortByTimecreated ListAutonomousDatabaseBackupsSortByEnum = "TIMECREATED" + ListAutonomousDatabaseBackupsSortByDisplayname ListAutonomousDatabaseBackupsSortByEnum = "DISPLAYNAME" +) + +var mappingListAutonomousDatabaseBackupsSortBy = map[string]ListAutonomousDatabaseBackupsSortByEnum{ + "TIMECREATED": ListAutonomousDatabaseBackupsSortByTimecreated, + "DISPLAYNAME": ListAutonomousDatabaseBackupsSortByDisplayname, +} + +// GetListAutonomousDatabaseBackupsSortByEnumValues Enumerates the set of values for ListAutonomousDatabaseBackupsSortByEnum +func GetListAutonomousDatabaseBackupsSortByEnumValues() []ListAutonomousDatabaseBackupsSortByEnum { + values := make([]ListAutonomousDatabaseBackupsSortByEnum, 0) + for _, v := range mappingListAutonomousDatabaseBackupsSortBy { + values = append(values, v) + } + return values +} + +// ListAutonomousDatabaseBackupsSortOrderEnum Enum with underlying type: string +type ListAutonomousDatabaseBackupsSortOrderEnum string + +// Set of constants representing the allowable values for ListAutonomousDatabaseBackupsSortOrderEnum +const ( + ListAutonomousDatabaseBackupsSortOrderAsc ListAutonomousDatabaseBackupsSortOrderEnum = "ASC" + ListAutonomousDatabaseBackupsSortOrderDesc ListAutonomousDatabaseBackupsSortOrderEnum = "DESC" +) + +var mappingListAutonomousDatabaseBackupsSortOrder = map[string]ListAutonomousDatabaseBackupsSortOrderEnum{ + "ASC": ListAutonomousDatabaseBackupsSortOrderAsc, + "DESC": ListAutonomousDatabaseBackupsSortOrderDesc, +} + +// GetListAutonomousDatabaseBackupsSortOrderEnumValues Enumerates the set of values for ListAutonomousDatabaseBackupsSortOrderEnum +func GetListAutonomousDatabaseBackupsSortOrderEnumValues() []ListAutonomousDatabaseBackupsSortOrderEnum { + values := make([]ListAutonomousDatabaseBackupsSortOrderEnum, 0) + for _, v := range mappingListAutonomousDatabaseBackupsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_databases_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_databases_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_databases_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_databases_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutonomousDatabasesRequest wrapper for the ListAutonomousDatabases operation +type ListAutonomousDatabasesRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + // **Note:** If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted. + SortBy ListAutonomousDatabasesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListAutonomousDatabasesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState AutonomousDatabaseSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only autonomous database resources that match the specified workload type. + DbWorkload AutonomousDatabaseSummaryDbWorkloadEnum `mandatory:"false" contributesTo:"query" name:"dbWorkload" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutonomousDatabasesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutonomousDatabasesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutonomousDatabasesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutonomousDatabasesResponse wrapper for the ListAutonomousDatabases operation +type ListAutonomousDatabasesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutonomousDatabaseSummary instances + Items []AutonomousDatabaseSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAutonomousDatabasesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutonomousDatabasesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutonomousDatabasesSortByEnum Enum with underlying type: string +type ListAutonomousDatabasesSortByEnum string + +// Set of constants representing the allowable values for ListAutonomousDatabasesSortByEnum +const ( + ListAutonomousDatabasesSortByTimecreated ListAutonomousDatabasesSortByEnum = "TIMECREATED" + ListAutonomousDatabasesSortByDisplayname ListAutonomousDatabasesSortByEnum = "DISPLAYNAME" +) + +var mappingListAutonomousDatabasesSortBy = map[string]ListAutonomousDatabasesSortByEnum{ + "TIMECREATED": ListAutonomousDatabasesSortByTimecreated, + "DISPLAYNAME": ListAutonomousDatabasesSortByDisplayname, +} + +// GetListAutonomousDatabasesSortByEnumValues Enumerates the set of values for ListAutonomousDatabasesSortByEnum +func GetListAutonomousDatabasesSortByEnumValues() []ListAutonomousDatabasesSortByEnum { + values := make([]ListAutonomousDatabasesSortByEnum, 0) + for _, v := range mappingListAutonomousDatabasesSortBy { + values = append(values, v) + } + return values +} + +// ListAutonomousDatabasesSortOrderEnum Enum with underlying type: string +type ListAutonomousDatabasesSortOrderEnum string + +// Set of constants representing the allowable values for ListAutonomousDatabasesSortOrderEnum +const ( + ListAutonomousDatabasesSortOrderAsc ListAutonomousDatabasesSortOrderEnum = "ASC" + ListAutonomousDatabasesSortOrderDesc ListAutonomousDatabasesSortOrderEnum = "DESC" +) + +var mappingListAutonomousDatabasesSortOrder = map[string]ListAutonomousDatabasesSortOrderEnum{ + "ASC": ListAutonomousDatabasesSortOrderAsc, + "DESC": ListAutonomousDatabasesSortOrderDesc, +} + +// GetListAutonomousDatabasesSortOrderEnumValues Enumerates the set of values for ListAutonomousDatabasesSortOrderEnum +func GetListAutonomousDatabasesSortOrderEnumValues() []ListAutonomousDatabasesSortOrderEnum { + values := make([]ListAutonomousDatabasesSortOrderEnum, 0) + for _, v := range mappingListAutonomousDatabasesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouse_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouse_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouse_backups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouse_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,135 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutonomousDataWarehouseBackupsRequest wrapper for the ListAutonomousDataWarehouseBackups operation +type ListAutonomousDataWarehouseBackupsRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"false" contributesTo:"query" name:"autonomousDataWarehouseId"` + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + // **Note:** If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted. + SortBy ListAutonomousDataWarehouseBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListAutonomousDataWarehouseBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState AutonomousDataWarehouseBackupSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutonomousDataWarehouseBackupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutonomousDataWarehouseBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutonomousDataWarehouseBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutonomousDataWarehouseBackupsResponse wrapper for the ListAutonomousDataWarehouseBackups operation +type ListAutonomousDataWarehouseBackupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutonomousDataWarehouseBackupSummary instances + Items []AutonomousDataWarehouseBackupSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAutonomousDataWarehouseBackupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutonomousDataWarehouseBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutonomousDataWarehouseBackupsSortByEnum Enum with underlying type: string +type ListAutonomousDataWarehouseBackupsSortByEnum string + +// Set of constants representing the allowable values for ListAutonomousDataWarehouseBackupsSortByEnum +const ( + ListAutonomousDataWarehouseBackupsSortByTimecreated ListAutonomousDataWarehouseBackupsSortByEnum = "TIMECREATED" + ListAutonomousDataWarehouseBackupsSortByDisplayname ListAutonomousDataWarehouseBackupsSortByEnum = "DISPLAYNAME" +) + +var mappingListAutonomousDataWarehouseBackupsSortBy = map[string]ListAutonomousDataWarehouseBackupsSortByEnum{ + "TIMECREATED": ListAutonomousDataWarehouseBackupsSortByTimecreated, + "DISPLAYNAME": ListAutonomousDataWarehouseBackupsSortByDisplayname, +} + +// GetListAutonomousDataWarehouseBackupsSortByEnumValues Enumerates the set of values for ListAutonomousDataWarehouseBackupsSortByEnum +func GetListAutonomousDataWarehouseBackupsSortByEnumValues() []ListAutonomousDataWarehouseBackupsSortByEnum { + values := make([]ListAutonomousDataWarehouseBackupsSortByEnum, 0) + for _, v := range mappingListAutonomousDataWarehouseBackupsSortBy { + values = append(values, v) + } + return values +} + +// ListAutonomousDataWarehouseBackupsSortOrderEnum Enum with underlying type: string +type ListAutonomousDataWarehouseBackupsSortOrderEnum string + +// Set of constants representing the allowable values for ListAutonomousDataWarehouseBackupsSortOrderEnum +const ( + ListAutonomousDataWarehouseBackupsSortOrderAsc ListAutonomousDataWarehouseBackupsSortOrderEnum = "ASC" + ListAutonomousDataWarehouseBackupsSortOrderDesc ListAutonomousDataWarehouseBackupsSortOrderEnum = "DESC" +) + +var mappingListAutonomousDataWarehouseBackupsSortOrder = map[string]ListAutonomousDataWarehouseBackupsSortOrderEnum{ + "ASC": ListAutonomousDataWarehouseBackupsSortOrderAsc, + "DESC": ListAutonomousDataWarehouseBackupsSortOrderDesc, +} + +// GetListAutonomousDataWarehouseBackupsSortOrderEnumValues Enumerates the set of values for ListAutonomousDataWarehouseBackupsSortOrderEnum +func GetListAutonomousDataWarehouseBackupsSortOrderEnumValues() []ListAutonomousDataWarehouseBackupsSortOrderEnum { + values := make([]ListAutonomousDataWarehouseBackupsSortOrderEnum, 0) + for _, v := range mappingListAutonomousDataWarehouseBackupsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouses_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouses_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouses_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_autonomous_data_warehouses_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,132 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAutonomousDataWarehousesRequest wrapper for the ListAutonomousDataWarehouses operation +type ListAutonomousDataWarehousesRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + // **Note:** If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted. + SortBy ListAutonomousDataWarehousesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListAutonomousDataWarehousesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState AutonomousDataWarehouseSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAutonomousDataWarehousesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAutonomousDataWarehousesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAutonomousDataWarehousesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAutonomousDataWarehousesResponse wrapper for the ListAutonomousDataWarehouses operation +type ListAutonomousDataWarehousesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AutonomousDataWarehouseSummary instances + Items []AutonomousDataWarehouseSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAutonomousDataWarehousesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAutonomousDataWarehousesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAutonomousDataWarehousesSortByEnum Enum with underlying type: string +type ListAutonomousDataWarehousesSortByEnum string + +// Set of constants representing the allowable values for ListAutonomousDataWarehousesSortByEnum +const ( + ListAutonomousDataWarehousesSortByTimecreated ListAutonomousDataWarehousesSortByEnum = "TIMECREATED" + ListAutonomousDataWarehousesSortByDisplayname ListAutonomousDataWarehousesSortByEnum = "DISPLAYNAME" +) + +var mappingListAutonomousDataWarehousesSortBy = map[string]ListAutonomousDataWarehousesSortByEnum{ + "TIMECREATED": ListAutonomousDataWarehousesSortByTimecreated, + "DISPLAYNAME": ListAutonomousDataWarehousesSortByDisplayname, +} + +// GetListAutonomousDataWarehousesSortByEnumValues Enumerates the set of values for ListAutonomousDataWarehousesSortByEnum +func GetListAutonomousDataWarehousesSortByEnumValues() []ListAutonomousDataWarehousesSortByEnum { + values := make([]ListAutonomousDataWarehousesSortByEnum, 0) + for _, v := range mappingListAutonomousDataWarehousesSortBy { + values = append(values, v) + } + return values +} + +// ListAutonomousDataWarehousesSortOrderEnum Enum with underlying type: string +type ListAutonomousDataWarehousesSortOrderEnum string + +// Set of constants representing the allowable values for ListAutonomousDataWarehousesSortOrderEnum +const ( + ListAutonomousDataWarehousesSortOrderAsc ListAutonomousDataWarehousesSortOrderEnum = "ASC" + ListAutonomousDataWarehousesSortOrderDesc ListAutonomousDataWarehousesSortOrderEnum = "DESC" +) + +var mappingListAutonomousDataWarehousesSortOrder = map[string]ListAutonomousDataWarehousesSortOrderEnum{ + "ASC": ListAutonomousDataWarehousesSortOrderAsc, + "DESC": ListAutonomousDataWarehousesSortOrderDesc, +} + +// GetListAutonomousDataWarehousesSortOrderEnumValues Enumerates the set of values for ListAutonomousDataWarehousesSortOrderEnum +func GetListAutonomousDataWarehousesSortOrderEnumValues() []ListAutonomousDataWarehousesSortOrderEnum { + values := make([]ListAutonomousDataWarehousesSortOrderEnum, 0) + for _, v := range mappingListAutonomousDataWarehousesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_backups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_backups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_backups_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_backups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,43 +11,66 @@ // ListBackupsRequest wrapper for the ListBackups operation type ListBackupsRequest struct { - // The OCID of the database. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. DatabaseId *string `mandatory:"false" contributesTo:"query" name:"databaseId"` - // The compartment OCID. + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBackupsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBackupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBackupsResponse wrapper for the ListBackups operation type ListBackupsResponse struct { // The underlying http response RawResponse *http.Response - // The []BackupSummary instance + // A list of []BackupSummary instances Items []BackupSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListBackupsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_databases_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_databases_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_databases_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_databases_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,43 +11,124 @@ // ListDatabasesRequest wrapper for the ListDatabases operation type ListDatabasesRequest struct { - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // A database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // A database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"query" name:"dbHomeId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DBNAME is ascending. The DBNAME sort order is case sensitive. + SortBy ListDatabasesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListDatabasesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState DatabaseSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire database name given. The match is not case sensitive. + DbName *string `mandatory:"false" contributesTo:"query" name:"dbName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDatabasesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDatabasesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDatabasesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDatabasesResponse wrapper for the ListDatabases operation type ListDatabasesResponse struct { // The underlying http response RawResponse *http.Response - // The []DatabaseSummary instance + // A list of []DatabaseSummary instances Items []DatabaseSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDatabasesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDatabasesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDatabasesSortByEnum Enum with underlying type: string +type ListDatabasesSortByEnum string + +// Set of constants representing the allowable values for ListDatabasesSortByEnum +const ( + ListDatabasesSortByDbname ListDatabasesSortByEnum = "DBNAME" + ListDatabasesSortByTimecreated ListDatabasesSortByEnum = "TIMECREATED" +) + +var mappingListDatabasesSortBy = map[string]ListDatabasesSortByEnum{ + "DBNAME": ListDatabasesSortByDbname, + "TIMECREATED": ListDatabasesSortByTimecreated, +} + +// GetListDatabasesSortByEnumValues Enumerates the set of values for ListDatabasesSortByEnum +func GetListDatabasesSortByEnumValues() []ListDatabasesSortByEnum { + values := make([]ListDatabasesSortByEnum, 0) + for _, v := range mappingListDatabasesSortBy { + values = append(values, v) + } + return values +} + +// ListDatabasesSortOrderEnum Enum with underlying type: string +type ListDatabasesSortOrderEnum string + +// Set of constants representing the allowable values for ListDatabasesSortOrderEnum +const ( + ListDatabasesSortOrderAsc ListDatabasesSortOrderEnum = "ASC" + ListDatabasesSortOrderDesc ListDatabasesSortOrderEnum = "DESC" +) + +var mappingListDatabasesSortOrder = map[string]ListDatabasesSortOrderEnum{ + "ASC": ListDatabasesSortOrderAsc, + "DESC": ListDatabasesSortOrderDesc, +} + +// GetListDatabasesSortOrderEnumValues Enumerates the set of values for ListDatabasesSortOrderEnum +func GetListDatabasesSortOrderEnumValues() []ListDatabasesSortOrderEnum { + values := make([]ListDatabasesSortOrderEnum, 0) + for _, v := range mappingListDatabasesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_data_guard_associations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_data_guard_associations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_data_guard_associations_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_data_guard_associations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,40 +11,63 @@ // ListDataGuardAssociationsRequest wrapper for the ListDataGuardAssociations operation type ListDataGuardAssociationsRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDataGuardAssociationsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDataGuardAssociationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDataGuardAssociationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDataGuardAssociationsResponse wrapper for the ListDataGuardAssociations operation type ListDataGuardAssociationsResponse struct { // The underlying http response RawResponse *http.Response - // The []DataGuardAssociationSummary instance + // A list of []DataGuardAssociationSummary instances Items []DataGuardAssociationSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDataGuardAssociationsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDataGuardAssociationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patches_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patches_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patches_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patches_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,40 +11,63 @@ // ListDbHomePatchesRequest wrapper for the ListDbHomePatches operation type ListDbHomePatchesRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbHomePatchesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbHomePatchesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbHomePatchesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbHomePatchesResponse wrapper for the ListDbHomePatches operation type ListDbHomePatchesResponse struct { // The underlying http response RawResponse *http.Response - // The []PatchSummary instance + // A list of []PatchSummary instances Items []PatchSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbHomePatchesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbHomePatchesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patch_history_entries_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patch_history_entries_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patch_history_entries_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_home_patch_history_entries_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,40 +11,63 @@ // ListDbHomePatchHistoryEntriesRequest wrapper for the ListDbHomePatchHistoryEntries operation type ListDbHomePatchHistoryEntriesRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbHomePatchHistoryEntriesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbHomePatchHistoryEntriesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbHomePatchHistoryEntriesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbHomePatchHistoryEntriesResponse wrapper for the ListDbHomePatchHistoryEntries operation type ListDbHomePatchHistoryEntriesResponse struct { // The underlying http response RawResponse *http.Response - // The []PatchHistoryEntrySummary instance + // A list of []PatchHistoryEntrySummary instances Items []PatchHistoryEntrySummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbHomePatchHistoryEntriesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbHomePatchHistoryEntriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_homes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_homes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_homes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_homes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,43 +11,124 @@ // ListDbHomesRequest wrapper for the ListDbHomes operation type ListDbHomesRequest struct { - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" contributesTo:"query" name:"dbSystemId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListDbHomesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListDbHomesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState DbHomeSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbHomesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbHomesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbHomesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbHomesResponse wrapper for the ListDbHomes operation type ListDbHomesResponse struct { // The underlying http response RawResponse *http.Response - // The []DbHomeSummary instance + // A list of []DbHomeSummary instances Items []DbHomeSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbHomesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbHomesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDbHomesSortByEnum Enum with underlying type: string +type ListDbHomesSortByEnum string + +// Set of constants representing the allowable values for ListDbHomesSortByEnum +const ( + ListDbHomesSortByTimecreated ListDbHomesSortByEnum = "TIMECREATED" + ListDbHomesSortByDisplayname ListDbHomesSortByEnum = "DISPLAYNAME" +) + +var mappingListDbHomesSortBy = map[string]ListDbHomesSortByEnum{ + "TIMECREATED": ListDbHomesSortByTimecreated, + "DISPLAYNAME": ListDbHomesSortByDisplayname, +} + +// GetListDbHomesSortByEnumValues Enumerates the set of values for ListDbHomesSortByEnum +func GetListDbHomesSortByEnumValues() []ListDbHomesSortByEnum { + values := make([]ListDbHomesSortByEnum, 0) + for _, v := range mappingListDbHomesSortBy { + values = append(values, v) + } + return values +} + +// ListDbHomesSortOrderEnum Enum with underlying type: string +type ListDbHomesSortOrderEnum string + +// Set of constants representing the allowable values for ListDbHomesSortOrderEnum +const ( + ListDbHomesSortOrderAsc ListDbHomesSortOrderEnum = "ASC" + ListDbHomesSortOrderDesc ListDbHomesSortOrderEnum = "DESC" +) + +var mappingListDbHomesSortOrder = map[string]ListDbHomesSortOrderEnum{ + "ASC": ListDbHomesSortOrderAsc, + "DESC": ListDbHomesSortOrderDesc, +} + +// GetListDbHomesSortOrderEnumValues Enumerates the set of values for ListDbHomesSortOrderEnum +func GetListDbHomesSortOrderEnumValues() []ListDbHomesSortOrderEnum { + values := make([]ListDbHomesSortOrderEnum, 0) + for _, v := range mappingListDbHomesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_nodes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_nodes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_nodes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_nodes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,43 +11,119 @@ // ListDbNodesRequest wrapper for the ListDbNodes operation type ListDbNodesRequest struct { - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. DbSystemId *string `mandatory:"true" contributesTo:"query" name:"dbSystemId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Sort by TIMECREATED. Default order for TIMECREATED is descending. + SortBy ListDbNodesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListDbNodesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState DbNodeSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbNodesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbNodesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbNodesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbNodesResponse wrapper for the ListDbNodes operation type ListDbNodesResponse struct { // The underlying http response RawResponse *http.Response - // The []DbNodeSummary instance + // A list of []DbNodeSummary instances Items []DbNodeSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbNodesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbNodesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDbNodesSortByEnum Enum with underlying type: string +type ListDbNodesSortByEnum string + +// Set of constants representing the allowable values for ListDbNodesSortByEnum +const ( + ListDbNodesSortByTimecreated ListDbNodesSortByEnum = "TIMECREATED" +) + +var mappingListDbNodesSortBy = map[string]ListDbNodesSortByEnum{ + "TIMECREATED": ListDbNodesSortByTimecreated, +} + +// GetListDbNodesSortByEnumValues Enumerates the set of values for ListDbNodesSortByEnum +func GetListDbNodesSortByEnumValues() []ListDbNodesSortByEnum { + values := make([]ListDbNodesSortByEnum, 0) + for _, v := range mappingListDbNodesSortBy { + values = append(values, v) + } + return values +} + +// ListDbNodesSortOrderEnum Enum with underlying type: string +type ListDbNodesSortOrderEnum string + +// Set of constants representing the allowable values for ListDbNodesSortOrderEnum +const ( + ListDbNodesSortOrderAsc ListDbNodesSortOrderEnum = "ASC" + ListDbNodesSortOrderDesc ListDbNodesSortOrderEnum = "DESC" +) + +var mappingListDbNodesSortOrder = map[string]ListDbNodesSortOrderEnum{ + "ASC": ListDbNodesSortOrderAsc, + "DESC": ListDbNodesSortOrderDesc, +} + +// GetListDbNodesSortOrderEnumValues Enumerates the set of values for ListDbNodesSortOrderEnum +func GetListDbNodesSortOrderEnumValues() []ListDbNodesSortOrderEnum { + values := make([]ListDbNodesSortOrderEnum, 0) + for _, v := range mappingListDbNodesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patches_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patches_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patches_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patches_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,40 +11,63 @@ // ListDbSystemPatchesRequest wrapper for the ListDbSystemPatches operation type ListDbSystemPatchesRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbSystemPatchesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbSystemPatchesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbSystemPatchesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbSystemPatchesResponse wrapper for the ListDbSystemPatches operation type ListDbSystemPatchesResponse struct { // The underlying http response RawResponse *http.Response - // The []PatchSummary instance + // A list of []PatchSummary instances Items []PatchSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbSystemPatchesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbSystemPatchesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patch_history_entries_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patch_history_entries_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patch_history_entries_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_patch_history_entries_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,40 +11,63 @@ // ListDbSystemPatchHistoryEntriesRequest wrapper for the ListDbSystemPatchHistoryEntries operation type ListDbSystemPatchHistoryEntriesRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbSystemPatchHistoryEntriesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbSystemPatchHistoryEntriesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbSystemPatchHistoryEntriesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbSystemPatchHistoryEntriesResponse wrapper for the ListDbSystemPatchHistoryEntries operation type ListDbSystemPatchHistoryEntriesResponse struct { // The underlying http response RawResponse *http.Response - // The []PatchHistoryEntrySummary instance + // A list of []PatchHistoryEntrySummary instances Items []PatchHistoryEntrySummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbSystemPatchHistoryEntriesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbSystemPatchHistoryEntriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_system_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -14,40 +14,63 @@ // The name of the Availability Domain. AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbSystemShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbSystemShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbSystemShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbSystemShapesResponse wrapper for the ListDbSystemShapes operation type ListDbSystemShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []DbSystemShapeSummary instance + // A list of []DbSystemShapeSummary instances Items []DbSystemShapeSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbSystemShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbSystemShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_systems_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_systems_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_systems_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_systems_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,43 +11,128 @@ // ListDbSystemsRequest wrapper for the ListDbSystems operation type ListDbSystemsRequest struct { - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. Page *string `mandatory:"false" contributesTo:"query" name:"page"` - // The OCID of the backup. Specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup. Specify a backupId to list only the DB systems that support creating a database using this backup in this compartment. BackupId *string `mandatory:"false" contributesTo:"query" name:"backupId"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + // **Note:** If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted. + SortBy ListDbSystemsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListDbSystemsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState DbSystemSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given availability domain exactly. + AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbSystemsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbSystemsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbSystemsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbSystemsResponse wrapper for the ListDbSystems operation type ListDbSystemsResponse struct { // The underlying http response RawResponse *http.Response - // The []DbSystemSummary instance + // A list of []DbSystemSummary instances Items []DbSystemSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbSystemsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbSystemsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDbSystemsSortByEnum Enum with underlying type: string +type ListDbSystemsSortByEnum string + +// Set of constants representing the allowable values for ListDbSystemsSortByEnum +const ( + ListDbSystemsSortByTimecreated ListDbSystemsSortByEnum = "TIMECREATED" + ListDbSystemsSortByDisplayname ListDbSystemsSortByEnum = "DISPLAYNAME" +) + +var mappingListDbSystemsSortBy = map[string]ListDbSystemsSortByEnum{ + "TIMECREATED": ListDbSystemsSortByTimecreated, + "DISPLAYNAME": ListDbSystemsSortByDisplayname, +} + +// GetListDbSystemsSortByEnumValues Enumerates the set of values for ListDbSystemsSortByEnum +func GetListDbSystemsSortByEnumValues() []ListDbSystemsSortByEnum { + values := make([]ListDbSystemsSortByEnum, 0) + for _, v := range mappingListDbSystemsSortBy { + values = append(values, v) + } + return values +} + +// ListDbSystemsSortOrderEnum Enum with underlying type: string +type ListDbSystemsSortOrderEnum string + +// Set of constants representing the allowable values for ListDbSystemsSortOrderEnum +const ( + ListDbSystemsSortOrderAsc ListDbSystemsSortOrderEnum = "ASC" + ListDbSystemsSortOrderDesc ListDbSystemsSortOrderEnum = "DESC" +) + +var mappingListDbSystemsSortOrder = map[string]ListDbSystemsSortOrderEnum{ + "ASC": ListDbSystemsSortOrderAsc, + "DESC": ListDbSystemsSortOrderDesc, +} + +// GetListDbSystemsSortOrderEnumValues Enumerates the set of values for ListDbSystemsSortOrderEnum +func GetListDbSystemsSortOrderEnumValues() []ListDbSystemsSortOrderEnum { + values := make([]ListDbSystemsSortOrderEnum, 0) + for _, v := range mappingListDbSystemsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_versions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_versions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_versions_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/list_db_versions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,10 +11,10 @@ // ListDbVersionsRequest wrapper for the ListDbVersions operation type ListDbVersionsRequest struct { - // The compartment OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return. + // The maximum number of items to return per page. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The pagination token to continue listing from. @@ -22,32 +22,58 @@ // If provided, filters the results to the set of database versions which are supported for the given shape. DbSystemShape *string `mandatory:"false" contributesTo:"query" name:"dbSystemShape"` + + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). If provided, filters the results to the set of database versions which are supported for the DB system. + DbSystemId *string `mandatory:"false" contributesTo:"query" name:"dbSystemId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDbVersionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDbVersionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDbVersionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDbVersionsResponse wrapper for the ListDbVersions operation type ListDbVersionsResponse struct { // The underlying http response RawResponse *http.Response - // The []DbVersionSummary instance + // A list of []DbVersionSummary instances Items []DbVersionSummary `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDbVersionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDbVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -14,14 +14,14 @@ // PatchDetails The details about what actions to perform and using what patch to the specified target. // This is part of an update request that is applied to a version field on the target such -// as DB System, database home, etc. +// as DB system, database home, etc. type PatchDetails struct { + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. + PatchId *string `mandatory:"false" json:"patchId"` + // The action to perform on the patch. Action PatchDetailsActionEnum `mandatory:"false" json:"action,omitempty"` - - // The OCID of the patch. - PatchId *string `mandatory:"false" json:"patchId"` } func (m PatchDetails) String() string { @@ -31,7 +31,7 @@ // PatchDetailsActionEnum Enum with underlying type: string type PatchDetailsActionEnum string -// Set of constants representing the allowable values for PatchDetailsAction +// Set of constants representing the allowable values for PatchDetailsActionEnum const ( PatchDetailsActionApply PatchDetailsActionEnum = "APPLY" PatchDetailsActionPrecheck PatchDetailsActionEnum = "PRECHECK" @@ -42,7 +42,7 @@ "PRECHECK": PatchDetailsActionPrecheck, } -// GetPatchDetailsActionEnumValues Enumerates the set of values for PatchDetailsAction +// GetPatchDetailsActionEnumValues Enumerates the set of values for PatchDetailsActionEnum func GetPatchDetailsActionEnumValues() []PatchDetailsActionEnum { values := make([]PatchDetailsActionEnum, 0) for _, v := range mappingPatchDetailsAction { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,30 +12,27 @@ "github.com/oracle/oci-go-sdk/common" ) -// Patch A Patch for a DB System or DB Home. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Patch The representation of Patch type Patch struct { + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. + Id *string `mandatory:"true" json:"id"` + // The text describing this patch package. Description *string `mandatory:"true" json:"description"` - // The OCID of the patch. - Id *string `mandatory:"true" json:"id"` - // The date and time that the patch was released. TimeReleased *common.SDKTime `mandatory:"true" json:"timeReleased"` // The version of this patch package. Version *string `mandatory:"true" json:"version"` - // Actions that can possibly be performed using this patch. - AvailableActions []PatchAvailableActionsEnum `mandatory:"false" json:"availableActions,omitempty"` - // Action that is currently being performed or was completed last. LastAction PatchLastActionEnum `mandatory:"false" json:"lastAction,omitempty"` + // Actions that can possibly be performed using this patch. + AvailableActions []PatchAvailableActionsEnum `mandatory:"false" json:"availableActions,omitempty"` + // A descriptive text associated with the lifecycleState. // Typically can contain additional displayable text. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` @@ -48,47 +45,47 @@ return common.PointerString(m) } -// PatchAvailableActionsEnum Enum with underlying type: string -type PatchAvailableActionsEnum string +// PatchLastActionEnum Enum with underlying type: string +type PatchLastActionEnum string -// Set of constants representing the allowable values for PatchAvailableActions +// Set of constants representing the allowable values for PatchLastActionEnum const ( - PatchAvailableActionsApply PatchAvailableActionsEnum = "APPLY" - PatchAvailableActionsPrecheck PatchAvailableActionsEnum = "PRECHECK" + PatchLastActionApply PatchLastActionEnum = "APPLY" + PatchLastActionPrecheck PatchLastActionEnum = "PRECHECK" ) -var mappingPatchAvailableActions = map[string]PatchAvailableActionsEnum{ - "APPLY": PatchAvailableActionsApply, - "PRECHECK": PatchAvailableActionsPrecheck, +var mappingPatchLastAction = map[string]PatchLastActionEnum{ + "APPLY": PatchLastActionApply, + "PRECHECK": PatchLastActionPrecheck, } -// GetPatchAvailableActionsEnumValues Enumerates the set of values for PatchAvailableActions -func GetPatchAvailableActionsEnumValues() []PatchAvailableActionsEnum { - values := make([]PatchAvailableActionsEnum, 0) - for _, v := range mappingPatchAvailableActions { +// GetPatchLastActionEnumValues Enumerates the set of values for PatchLastActionEnum +func GetPatchLastActionEnumValues() []PatchLastActionEnum { + values := make([]PatchLastActionEnum, 0) + for _, v := range mappingPatchLastAction { values = append(values, v) } return values } -// PatchLastActionEnum Enum with underlying type: string -type PatchLastActionEnum string +// PatchAvailableActionsEnum Enum with underlying type: string +type PatchAvailableActionsEnum string -// Set of constants representing the allowable values for PatchLastAction +// Set of constants representing the allowable values for PatchAvailableActionsEnum const ( - PatchLastActionApply PatchLastActionEnum = "APPLY" - PatchLastActionPrecheck PatchLastActionEnum = "PRECHECK" + PatchAvailableActionsApply PatchAvailableActionsEnum = "APPLY" + PatchAvailableActionsPrecheck PatchAvailableActionsEnum = "PRECHECK" ) -var mappingPatchLastAction = map[string]PatchLastActionEnum{ - "APPLY": PatchLastActionApply, - "PRECHECK": PatchLastActionPrecheck, +var mappingPatchAvailableActions = map[string]PatchAvailableActionsEnum{ + "APPLY": PatchAvailableActionsApply, + "PRECHECK": PatchAvailableActionsPrecheck, } -// GetPatchLastActionEnumValues Enumerates the set of values for PatchLastAction -func GetPatchLastActionEnumValues() []PatchLastActionEnum { - values := make([]PatchLastActionEnum, 0) - for _, v := range mappingPatchLastAction { +// GetPatchAvailableActionsEnumValues Enumerates the set of values for PatchAvailableActionsEnum +func GetPatchAvailableActionsEnumValues() []PatchAvailableActionsEnum { + values := make([]PatchAvailableActionsEnum, 0) + for _, v := range mappingPatchAvailableActions { values = append(values, v) } return values @@ -97,7 +94,7 @@ // PatchLifecycleStateEnum Enum with underlying type: string type PatchLifecycleStateEnum string -// Set of constants representing the allowable values for PatchLifecycleState +// Set of constants representing the allowable values for PatchLifecycleStateEnum const ( PatchLifecycleStateAvailable PatchLifecycleStateEnum = "AVAILABLE" PatchLifecycleStateSuccess PatchLifecycleStateEnum = "SUCCESS" @@ -112,7 +109,7 @@ "FAILED": PatchLifecycleStateFailed, } -// GetPatchLifecycleStateEnumValues Enumerates the set of values for PatchLifecycleState +// GetPatchLifecycleStateEnumValues Enumerates the set of values for PatchLifecycleStateEnum func GetPatchLifecycleStateEnumValues() []PatchLifecycleStateEnum { values := make([]PatchLifecycleStateEnum, 0) for _, v := range mappingPatchLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,18 +12,18 @@ "github.com/oracle/oci-go-sdk/common" ) -// PatchHistoryEntry The record of a patch action on a specified target. +// PatchHistoryEntry The representation of PatchHistoryEntry type PatchHistoryEntry struct { - // The OCID of the patch history entry. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch history entry. Id *string `mandatory:"true" json:"id"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. + PatchId *string `mandatory:"true" json:"patchId"` + // The current state of the action. LifecycleState PatchHistoryEntryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the patch. - PatchId *string `mandatory:"true" json:"patchId"` - // The date and time when the patch action started. TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` @@ -45,7 +45,7 @@ // PatchHistoryEntryActionEnum Enum with underlying type: string type PatchHistoryEntryActionEnum string -// Set of constants representing the allowable values for PatchHistoryEntryAction +// Set of constants representing the allowable values for PatchHistoryEntryActionEnum const ( PatchHistoryEntryActionApply PatchHistoryEntryActionEnum = "APPLY" PatchHistoryEntryActionPrecheck PatchHistoryEntryActionEnum = "PRECHECK" @@ -56,7 +56,7 @@ "PRECHECK": PatchHistoryEntryActionPrecheck, } -// GetPatchHistoryEntryActionEnumValues Enumerates the set of values for PatchHistoryEntryAction +// GetPatchHistoryEntryActionEnumValues Enumerates the set of values for PatchHistoryEntryActionEnum func GetPatchHistoryEntryActionEnumValues() []PatchHistoryEntryActionEnum { values := make([]PatchHistoryEntryActionEnum, 0) for _, v := range mappingPatchHistoryEntryAction { @@ -68,7 +68,7 @@ // PatchHistoryEntryLifecycleStateEnum Enum with underlying type: string type PatchHistoryEntryLifecycleStateEnum string -// Set of constants representing the allowable values for PatchHistoryEntryLifecycleState +// Set of constants representing the allowable values for PatchHistoryEntryLifecycleStateEnum const ( PatchHistoryEntryLifecycleStateInProgress PatchHistoryEntryLifecycleStateEnum = "IN_PROGRESS" PatchHistoryEntryLifecycleStateSucceeded PatchHistoryEntryLifecycleStateEnum = "SUCCEEDED" @@ -81,7 +81,7 @@ "FAILED": PatchHistoryEntryLifecycleStateFailed, } -// GetPatchHistoryEntryLifecycleStateEnumValues Enumerates the set of values for PatchHistoryEntryLifecycleState +// GetPatchHistoryEntryLifecycleStateEnumValues Enumerates the set of values for PatchHistoryEntryLifecycleStateEnum func GetPatchHistoryEntryLifecycleStateEnumValues() []PatchHistoryEntryLifecycleStateEnum { values := make([]PatchHistoryEntryLifecycleStateEnum, 0) for _, v := range mappingPatchHistoryEntryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_history_entry_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,15 +15,15 @@ // PatchHistoryEntrySummary The record of a patch action on a specified target. type PatchHistoryEntrySummary struct { - // The OCID of the patch history entry. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch history entry. Id *string `mandatory:"true" json:"id"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. + PatchId *string `mandatory:"true" json:"patchId"` + // The current state of the action. LifecycleState PatchHistoryEntrySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // The OCID of the patch. - PatchId *string `mandatory:"true" json:"patchId"` - // The date and time when the patch action started. TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` @@ -45,7 +45,7 @@ // PatchHistoryEntrySummaryActionEnum Enum with underlying type: string type PatchHistoryEntrySummaryActionEnum string -// Set of constants representing the allowable values for PatchHistoryEntrySummaryAction +// Set of constants representing the allowable values for PatchHistoryEntrySummaryActionEnum const ( PatchHistoryEntrySummaryActionApply PatchHistoryEntrySummaryActionEnum = "APPLY" PatchHistoryEntrySummaryActionPrecheck PatchHistoryEntrySummaryActionEnum = "PRECHECK" @@ -56,7 +56,7 @@ "PRECHECK": PatchHistoryEntrySummaryActionPrecheck, } -// GetPatchHistoryEntrySummaryActionEnumValues Enumerates the set of values for PatchHistoryEntrySummaryAction +// GetPatchHistoryEntrySummaryActionEnumValues Enumerates the set of values for PatchHistoryEntrySummaryActionEnum func GetPatchHistoryEntrySummaryActionEnumValues() []PatchHistoryEntrySummaryActionEnum { values := make([]PatchHistoryEntrySummaryActionEnum, 0) for _, v := range mappingPatchHistoryEntrySummaryAction { @@ -68,7 +68,7 @@ // PatchHistoryEntrySummaryLifecycleStateEnum Enum with underlying type: string type PatchHistoryEntrySummaryLifecycleStateEnum string -// Set of constants representing the allowable values for PatchHistoryEntrySummaryLifecycleState +// Set of constants representing the allowable values for PatchHistoryEntrySummaryLifecycleStateEnum const ( PatchHistoryEntrySummaryLifecycleStateInProgress PatchHistoryEntrySummaryLifecycleStateEnum = "IN_PROGRESS" PatchHistoryEntrySummaryLifecycleStateSucceeded PatchHistoryEntrySummaryLifecycleStateEnum = "SUCCEEDED" @@ -81,7 +81,7 @@ "FAILED": PatchHistoryEntrySummaryLifecycleStateFailed, } -// GetPatchHistoryEntrySummaryLifecycleStateEnumValues Enumerates the set of values for PatchHistoryEntrySummaryLifecycleState +// GetPatchHistoryEntrySummaryLifecycleStateEnumValues Enumerates the set of values for PatchHistoryEntrySummaryLifecycleStateEnum func GetPatchHistoryEntrySummaryLifecycleStateEnumValues() []PatchHistoryEntrySummaryLifecycleStateEnum { values := make([]PatchHistoryEntrySummaryLifecycleStateEnum, 0) for _, v := range mappingPatchHistoryEntrySummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/patch_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,30 +12,30 @@ "github.com/oracle/oci-go-sdk/common" ) -// PatchSummary A Patch for a DB System or DB Home. +// PatchSummary A Patch for a DB system or DB Home. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type PatchSummary struct { + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the patch. + Id *string `mandatory:"true" json:"id"` + // The text describing this patch package. Description *string `mandatory:"true" json:"description"` - // The OCID of the patch. - Id *string `mandatory:"true" json:"id"` - // The date and time that the patch was released. TimeReleased *common.SDKTime `mandatory:"true" json:"timeReleased"` // The version of this patch package. Version *string `mandatory:"true" json:"version"` - // Actions that can possibly be performed using this patch. - AvailableActions []PatchSummaryAvailableActionsEnum `mandatory:"false" json:"availableActions,omitempty"` - // Action that is currently being performed or was completed last. LastAction PatchSummaryLastActionEnum `mandatory:"false" json:"lastAction,omitempty"` + // Actions that can possibly be performed using this patch. + AvailableActions []PatchSummaryAvailableActionsEnum `mandatory:"false" json:"availableActions,omitempty"` + // A descriptive text associated with the lifecycleState. // Typically can contain additional displayable text. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` @@ -48,47 +48,47 @@ return common.PointerString(m) } -// PatchSummaryAvailableActionsEnum Enum with underlying type: string -type PatchSummaryAvailableActionsEnum string +// PatchSummaryLastActionEnum Enum with underlying type: string +type PatchSummaryLastActionEnum string -// Set of constants representing the allowable values for PatchSummaryAvailableActions +// Set of constants representing the allowable values for PatchSummaryLastActionEnum const ( - PatchSummaryAvailableActionsApply PatchSummaryAvailableActionsEnum = "APPLY" - PatchSummaryAvailableActionsPrecheck PatchSummaryAvailableActionsEnum = "PRECHECK" + PatchSummaryLastActionApply PatchSummaryLastActionEnum = "APPLY" + PatchSummaryLastActionPrecheck PatchSummaryLastActionEnum = "PRECHECK" ) -var mappingPatchSummaryAvailableActions = map[string]PatchSummaryAvailableActionsEnum{ - "APPLY": PatchSummaryAvailableActionsApply, - "PRECHECK": PatchSummaryAvailableActionsPrecheck, +var mappingPatchSummaryLastAction = map[string]PatchSummaryLastActionEnum{ + "APPLY": PatchSummaryLastActionApply, + "PRECHECK": PatchSummaryLastActionPrecheck, } -// GetPatchSummaryAvailableActionsEnumValues Enumerates the set of values for PatchSummaryAvailableActions -func GetPatchSummaryAvailableActionsEnumValues() []PatchSummaryAvailableActionsEnum { - values := make([]PatchSummaryAvailableActionsEnum, 0) - for _, v := range mappingPatchSummaryAvailableActions { +// GetPatchSummaryLastActionEnumValues Enumerates the set of values for PatchSummaryLastActionEnum +func GetPatchSummaryLastActionEnumValues() []PatchSummaryLastActionEnum { + values := make([]PatchSummaryLastActionEnum, 0) + for _, v := range mappingPatchSummaryLastAction { values = append(values, v) } return values } -// PatchSummaryLastActionEnum Enum with underlying type: string -type PatchSummaryLastActionEnum string +// PatchSummaryAvailableActionsEnum Enum with underlying type: string +type PatchSummaryAvailableActionsEnum string -// Set of constants representing the allowable values for PatchSummaryLastAction +// Set of constants representing the allowable values for PatchSummaryAvailableActionsEnum const ( - PatchSummaryLastActionApply PatchSummaryLastActionEnum = "APPLY" - PatchSummaryLastActionPrecheck PatchSummaryLastActionEnum = "PRECHECK" + PatchSummaryAvailableActionsApply PatchSummaryAvailableActionsEnum = "APPLY" + PatchSummaryAvailableActionsPrecheck PatchSummaryAvailableActionsEnum = "PRECHECK" ) -var mappingPatchSummaryLastAction = map[string]PatchSummaryLastActionEnum{ - "APPLY": PatchSummaryLastActionApply, - "PRECHECK": PatchSummaryLastActionPrecheck, +var mappingPatchSummaryAvailableActions = map[string]PatchSummaryAvailableActionsEnum{ + "APPLY": PatchSummaryAvailableActionsApply, + "PRECHECK": PatchSummaryAvailableActionsPrecheck, } -// GetPatchSummaryLastActionEnumValues Enumerates the set of values for PatchSummaryLastAction -func GetPatchSummaryLastActionEnumValues() []PatchSummaryLastActionEnum { - values := make([]PatchSummaryLastActionEnum, 0) - for _, v := range mappingPatchSummaryLastAction { +// GetPatchSummaryAvailableActionsEnumValues Enumerates the set of values for PatchSummaryAvailableActionsEnum +func GetPatchSummaryAvailableActionsEnumValues() []PatchSummaryAvailableActionsEnum { + values := make([]PatchSummaryAvailableActionsEnum, 0) + for _, v := range mappingPatchSummaryAvailableActions { values = append(values, v) } return values @@ -97,7 +97,7 @@ // PatchSummaryLifecycleStateEnum Enum with underlying type: string type PatchSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for PatchSummaryLifecycleState +// Set of constants representing the allowable values for PatchSummaryLifecycleStateEnum const ( PatchSummaryLifecycleStateAvailable PatchSummaryLifecycleStateEnum = "AVAILABLE" PatchSummaryLifecycleStateSuccess PatchSummaryLifecycleStateEnum = "SUCCESS" @@ -112,7 +112,7 @@ "FAILED": PatchSummaryLifecycleStateFailed, } -// GetPatchSummaryLifecycleStateEnumValues Enumerates the set of values for PatchSummaryLifecycleState +// GetPatchSummaryLifecycleStateEnumValues Enumerates the set of values for PatchSummaryLifecycleStateEnum func GetPatchSummaryLifecycleStateEnumValues() []PatchSummaryLifecycleStateEnum { values := make([]PatchSummaryLifecycleStateEnum, 0) for _, v := range mappingPatchSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,7 +15,7 @@ // ReinstateDataGuardAssociationDetails The Data Guard association reinstate parameters. type ReinstateDataGuardAssociationDetails struct { - // The DB System administrator password. + // The DB system administrator password. DatabaseAdminPassword *string `mandatory:"true" json:"databaseAdminPassword"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/reinstate_data_guard_association_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,10 +11,10 @@ // ReinstateDataGuardAssociationRequest wrapper for the ReinstateDataGuardAssociation operation type ReinstateDataGuardAssociationRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` - // The Data Guard association's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The Data Guard association's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DataGuardAssociationId *string `mandatory:"true" contributesTo:"path" name:"dataGuardAssociationId"` // A request to reinstate a database in a standby role. @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ReinstateDataGuardAssociationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ReinstateDataGuardAssociationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ReinstateDataGuardAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ReinstateDataGuardAssociationResponse wrapper for the ReinstateDataGuardAssociation operation type ReinstateDataGuardAssociationResponse struct { @@ -50,3 +68,8 @@ func (response ReinstateDataGuardAssociationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ReinstateDataGuardAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// RestoreAutonomousDatabaseDetails Details to restore an Oracle Autonomous Database. +type RestoreAutonomousDatabaseDetails struct { + + // The time to restore the database to. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m RestoreAutonomousDatabaseDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// RestoreAutonomousDatabaseRequest wrapper for the RestoreAutonomousDatabase operation +type RestoreAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // Request to perform an Autonomous Database restore. + RestoreAutonomousDatabaseDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RestoreAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RestoreAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RestoreAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// RestoreAutonomousDatabaseResponse wrapper for the RestoreAutonomousDatabase operation +type RestoreAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RestoreAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RestoreAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// RestoreAutonomousDataWarehouseDetails **Deprecated.** See RestoreAutonomousDatabaseDetails for reference information about restoring an Autonomous Data Warehouse. +type RestoreAutonomousDataWarehouseDetails struct { + + // The time to restore the database to. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m RestoreAutonomousDataWarehouseDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// RestoreAutonomousDataWarehouseRequest wrapper for the RestoreAutonomousDataWarehouse operation +type RestoreAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // Request to perform an Autonomous Data Warehouse restore. + RestoreAutonomousDataWarehouseDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RestoreAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RestoreAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RestoreAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// RestoreAutonomousDataWarehouseResponse wrapper for the RestoreAutonomousDataWarehouse operation +type RestoreAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RestoreAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RestoreAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -18,11 +18,11 @@ // Restores using the backup with the System Change Number (SCN) specified. DatabaseSCN *string `mandatory:"false" json:"databaseSCN"` - // Restores to the last known good state with the least possible data loss. - Latest *bool `mandatory:"false" json:"latest"` - // Restores to the timestamp specified. Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` + + // Restores to the last known good state with the least possible data loss. + Latest *bool `mandatory:"false" json:"latest"` } func (m RestoreDatabaseDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/restore_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // RestoreDatabaseRequest wrapper for the RestoreDatabase operation type RestoreDatabaseRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` // Request to perform database restore. @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request RestoreDatabaseRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request RestoreDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RestoreDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // RestoreDatabaseResponse wrapper for the RestoreDatabase operation type RestoreDatabaseResponse struct { @@ -47,3 +65,8 @@ func (response RestoreDatabaseResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response RestoreDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StartAutonomousDatabaseRequest wrapper for the StartAutonomousDatabase operation +type StartAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StartAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StartAutonomousDatabaseResponse wrapper for the StartAutonomousDatabase operation +type StartAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StartAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/start_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StartAutonomousDataWarehouseRequest wrapper for the StartAutonomousDataWarehouse operation +type StartAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StartAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StartAutonomousDataWarehouseResponse wrapper for the StartAutonomousDataWarehouse operation +type StartAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StartAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StopAutonomousDatabaseRequest wrapper for the StopAutonomousDatabase operation +type StopAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StopAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StopAutonomousDatabaseResponse wrapper for the StopAutonomousDatabase operation +type StopAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StopAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/stop_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// StopAutonomousDataWarehouseRequest wrapper for the StopAutonomousDataWarehouse operation +type StopAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StopAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// StopAutonomousDataWarehouseResponse wrapper for the StopAutonomousDataWarehouse operation +type StopAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StopAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -15,7 +15,7 @@ // SwitchoverDataGuardAssociationDetails The Data Guard association switchover parameters. type SwitchoverDataGuardAssociationDetails struct { - // The DB System administrator password. + // The DB system administrator password. DatabaseAdminPassword *string `mandatory:"true" json:"databaseAdminPassword"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/switchover_data_guard_association_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,10 +11,10 @@ // SwitchoverDataGuardAssociationRequest wrapper for the SwitchoverDataGuardAssociation operation type SwitchoverDataGuardAssociationRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` - // The Data Guard association's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The Data Guard association's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DataGuardAssociationId *string `mandatory:"true" contributesTo:"path" name:"dataGuardAssociationId"` // Request to swtichover a primary to a standby. @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request SwitchoverDataGuardAssociationRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request SwitchoverDataGuardAssociationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SwitchoverDataGuardAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // SwitchoverDataGuardAssociationResponse wrapper for the SwitchoverDataGuardAssociation operation type SwitchoverDataGuardAssociationResponse struct { @@ -50,3 +68,8 @@ func (response SwitchoverDataGuardAssociationResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response SwitchoverDataGuardAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/terminate_db_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/terminate_db_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/terminate_db_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/terminate_db_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,19 +11,37 @@ // TerminateDbSystemRequest wrapper for the TerminateDbSystem operation type TerminateDbSystemRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request TerminateDbSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request TerminateDbSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request TerminateDbSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // TerminateDbSystemResponse wrapper for the TerminateDbSystem operation type TerminateDbSystemResponse struct { @@ -38,3 +56,8 @@ func (response TerminateDbSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response TerminateDbSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAutonomousDatabaseDetails Details to update an Oracle Autonomous Database. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateAutonomousDatabaseDetails struct { + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"false" json:"cpuCoreCount"` + + // The size, in terabytes, of the data volume that will be attached to the database. + DataStorageSizeInTBs *int `mandatory:"false" json:"dataStorageSizeInTBs"` + + // The user-friendly name for the Autonomous Database. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. + AdminPassword *string `mandatory:"false" json:"adminPassword"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The new Oracle license model that applies to the Oracle Autonomous Transaction Processing database. + LicenseModel UpdateAutonomousDatabaseDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // The client IP access control list (ACL). Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. This is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet. To delete all the existing white listed IP’s, use an array with a single empty string entry. + WhitelistedIps []string `mandatory:"false" json:"whitelistedIps"` +} + +func (m UpdateAutonomousDatabaseDetails) String() string { + return common.PointerString(m) +} + +// UpdateAutonomousDatabaseDetailsLicenseModelEnum Enum with underlying type: string +type UpdateAutonomousDatabaseDetailsLicenseModelEnum string + +// Set of constants representing the allowable values for UpdateAutonomousDatabaseDetailsLicenseModelEnum +const ( + UpdateAutonomousDatabaseDetailsLicenseModelLicenseIncluded UpdateAutonomousDatabaseDetailsLicenseModelEnum = "LICENSE_INCLUDED" + UpdateAutonomousDatabaseDetailsLicenseModelBringYourOwnLicense UpdateAutonomousDatabaseDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingUpdateAutonomousDatabaseDetailsLicenseModel = map[string]UpdateAutonomousDatabaseDetailsLicenseModelEnum{ + "LICENSE_INCLUDED": UpdateAutonomousDatabaseDetailsLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": UpdateAutonomousDatabaseDetailsLicenseModelBringYourOwnLicense, +} + +// GetUpdateAutonomousDatabaseDetailsLicenseModelEnumValues Enumerates the set of values for UpdateAutonomousDatabaseDetailsLicenseModelEnum +func GetUpdateAutonomousDatabaseDetailsLicenseModelEnumValues() []UpdateAutonomousDatabaseDetailsLicenseModelEnum { + values := make([]UpdateAutonomousDatabaseDetailsLicenseModelEnum, 0) + for _, v := range mappingUpdateAutonomousDatabaseDetailsLicenseModel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAutonomousDatabaseRequest wrapper for the UpdateAutonomousDatabase operation +type UpdateAutonomousDatabaseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // Request to update the properties of an Autonomous Database. + UpdateAutonomousDatabaseDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAutonomousDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAutonomousDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAutonomousDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAutonomousDatabaseResponse wrapper for the UpdateAutonomousDatabase operation +type UpdateAutonomousDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDatabase instance + AutonomousDatabase `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateAutonomousDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAutonomousDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. +// + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAutonomousDataWarehouseDetails **Deprecated.** See UpdateAutonomousDatabaseDetails for reference information about updating an Autonomous Data Warehouse. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateAutonomousDataWarehouseDetails struct { + + // The number of CPU cores to be made available to the database. + CpuCoreCount *int `mandatory:"false" json:"cpuCoreCount"` + + // Size, in terabytes, of the data volume that will be attached to the database. + DataStorageSizeInTBs *int `mandatory:"false" json:"dataStorageSizeInTBs"` + + // The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. + AdminPassword *string `mandatory:"false" json:"adminPassword"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateAutonomousDataWarehouseDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_autonomous_data_warehouse_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAutonomousDataWarehouseRequest wrapper for the UpdateAutonomousDataWarehouse operation +type UpdateAutonomousDataWarehouseRequest struct { + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + AutonomousDataWarehouseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDataWarehouseId"` + + // Request to update the properties of an Autonomous Data Warehouse. + UpdateAutonomousDataWarehouseDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAutonomousDataWarehouseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAutonomousDataWarehouseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAutonomousDataWarehouseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAutonomousDataWarehouseResponse wrapper for the UpdateAutonomousDataWarehouse operation +type UpdateAutonomousDataWarehouseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AutonomousDataWarehouse instance + AutonomousDataWarehouse `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateAutonomousDataWarehouseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAutonomousDataWarehouseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,9 +12,20 @@ "github.com/oracle/oci-go-sdk/common" ) -// UpdateDatabaseDetails The representation of UpdateDatabaseDetails +// UpdateDatabaseDetails Details to update a database. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type UpdateDatabaseDetails struct { DbBackupConfig *DbBackupConfig `mandatory:"false" json:"dbBackupConfig"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateDatabaseDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_database_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // UpdateDatabaseRequest wrapper for the UpdateDatabase operation type UpdateDatabaseRequest struct { - // The database OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DatabaseId *string `mandatory:"true" contributesTo:"path" name:"databaseId"` // Request to perform database update. @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDatabaseRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDatabaseRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDatabaseRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDatabaseResponse wrapper for the UpdateDatabase operation type UpdateDatabaseResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDatabaseResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,7 +12,7 @@ "github.com/oracle/oci-go-sdk/common" ) -// UpdateDbHomeDetails Describes the modification parameters for the DB Home. +// UpdateDbHomeDetails Describes the modification parameters for the database home. type UpdateDbHomeDetails struct { DbVersion *PatchDetails `mandatory:"false" json:"dbVersion"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_home_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,7 +11,7 @@ // UpdateDbHomeRequest wrapper for the UpdateDbHome operation type UpdateDbHomeRequest struct { - // The database home OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The database home OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbHomeId *string `mandatory:"true" contributesTo:"path" name:"dbHomeId"` // Request to update the properties of a DB Home. @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDbHomeRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDbHomeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDbHomeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDbHomeResponse wrapper for the UpdateDbHome operation type UpdateDbHomeResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDbHomeResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDbHomeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Database Service API @@ -12,19 +12,30 @@ "github.com/oracle/oci-go-sdk/common" ) -// UpdateDbSystemDetails Describes the modification parameters for the DB System. +// UpdateDbSystemDetails Describes the parameters for updating the DB system. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type UpdateDbSystemDetails struct { - // The number of CPU Cores to be set on the DB System. Applicable only for non-VM based DB systems. + // The new number of CPU cores to set for the DB system. Not applicable for virtual machine DB systems. CpuCoreCount *int `mandatory:"false" json:"cpuCoreCount"` - // Size, in GBs, to which the currently attached storage needs to be scaled up to for VM based DB system. This must be greater than current storage size. Note that the total storage size attached will be more than what is requested, to account for REDO/RECO space and software volume. - DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` + Version *PatchDetails `mandatory:"false" json:"version"` - // The public key portion of the key pair to use for SSH access to the DB System. Multiple public keys can be provided. The length of the combined keys cannot exceed 10,000 characters. + // The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters. SshPublicKeys []string `mandatory:"false" json:"sshPublicKeys"` - Version *PatchDetails `mandatory:"false" json:"version"` + // The size, in gigabytes, to scale the attached storage up to for this virtual machine DB system. This value must be greater than current storage size. Note that the resulting total storage size attached will be greater than the amount requested to allow for REDO/RECO space and software volume. Applies only to virtual machine DB systems. + DataStorageSizeInGBs *int `mandatory:"false" json:"dataStorageSizeInGBs"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateDbSystemDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_db_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package database @@ -11,22 +11,40 @@ // UpdateDbSystemRequest wrapper for the UpdateDbSystem operation type UpdateDbSystemRequest struct { - // The DB System OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` - // Request to update the properties of a DB System. + // Request to update the properties of a DB system. UpdateDbSystemDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDbSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDbSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDbSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDbSystemResponse wrapper for the UpdateDbSystem operation type UpdateDbSystemResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDbSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDbSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_exadata_iorm_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_exadata_iorm_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_exadata_iorm_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/database/update_exadata_iorm_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package database + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateExadataIormConfigRequest wrapper for the UpdateExadataIormConfig operation +type UpdateExadataIormConfigRequest struct { + + // The DB system OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbSystemId *string `mandatory:"true" contributesTo:"path" name:"dbSystemId"` + + // Request to perform database update. + ExadataIormConfigUpdateDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateExadataIormConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateExadataIormConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateExadataIormConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateExadataIormConfigResponse wrapper for the UpdateExadataIormConfig operation +type UpdateExadataIormConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExadataIormConfig instance + ExadataIormConfig `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateExadataIormConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateExadataIormConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateSteeringPolicyAttachmentDetails The body for defining an attachment between a steering policy and a domain. +// +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateSteeringPolicyAttachmentDetails struct { + + // The OCID of the attached steering policy. + SteeringPolicyId *string `mandatory:"true" json:"steeringPolicyId"` + + // The OCID of the attached zone. + ZoneId *string `mandatory:"true" json:"zoneId"` + + // The attached domain within the attached zone. + DomainName *string `mandatory:"true" json:"domainName"` + + // A user-friendly name for the steering policy attachment. + // Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CreateSteeringPolicyAttachmentDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateSteeringPolicyAttachmentRequest wrapper for the CreateSteeringPolicyAttachment operation +type CreateSteeringPolicyAttachmentRequest struct { + + // Details for creating a new steering policy attachment. + CreateSteeringPolicyAttachmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated before + // then due to conflicting operations (for example, if a resource has been + // deleted and purged from the system, then a retry of the original creation + // request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSteeringPolicyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSteeringPolicyAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSteeringPolicyAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateSteeringPolicyAttachmentResponse wrapper for the CreateSteeringPolicyAttachment operation +type CreateSteeringPolicyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicyAttachment instance + SteeringPolicyAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response CreateSteeringPolicyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSteeringPolicyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,176 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateSteeringPolicyDetails The body for defining a new steering policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateSteeringPolicyDetails struct { + + // The OCID of the compartment containing the steering policy. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the steering policy. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // A set of predefined rules based on the desired purpose of the steering policy. Each + // template utilizes Traffic Management's rules in a different order to produce the desired + // results when answering DNS queries. + // + // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers + // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`, + // and `LIMIT`. This gives the domain dynamic failover capability. + // + // It is **strongly recommended** to use a template other than `CUSTOM` when creating + // a steering policy. + // + // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps + // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined + // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`. + // The last rule of a template must must be a `LIMIT` rule. For more information about templates + // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). + // **Template Types** + // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers + // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed + // from the list of available answers until the endpoint is detected as healthy. + // + // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights. + // + // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic + // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm). + // + // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN. + // + // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address. + // + // * `CUSTOM` - Allows a customized configuration of rules. + Template CreateSteeringPolicyDetailsTemplateEnum `mandatory:"true" json:"template"` + + // The Time To Live (TTL) for responses from the steering policy, in seconds. + // If not specified during creation, a value of 30 seconds will be used. + Ttl *int `mandatory:"false" json:"ttl"` + + // The OCID of the health check monitor providing health data about the answers of the + // steering policy. A steering policy answer with `rdata` matching a monitored endpoint + // will use the health data of that endpoint. A steering policy answer with `rdata` not + // matching any monitored endpoint will be assumed healthy. + // + // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor + // must be created using the Health Checks service first. For more information on how to + // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm). + HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The set of all answers that can potentially issue from the steering policy. + Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"` + + // The series of rules that will be processed in sequence to reduce the pool of answers + // to a response for any given request. + // + // The first rule receives a shuffled list of all answers, and every other rule receives + // the list of answers emitted by the one preceding it. The last rule populates the + // response. + Rules []SteeringPolicyRule `mandatory:"false" json:"rules"` +} + +func (m CreateSteeringPolicyDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateSteeringPolicyDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Ttl *int `json:"ttl"` + HealthCheckMonitorId *string `json:"healthCheckMonitorId"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Answers []SteeringPolicyAnswer `json:"answers"` + Rules []steeringpolicyrule `json:"rules"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Template CreateSteeringPolicyDetailsTemplateEnum `json:"template"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Ttl = model.Ttl + m.HealthCheckMonitorId = model.HealthCheckMonitorId + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + m.Answers = make([]SteeringPolicyAnswer, len(model.Answers)) + for i, n := range model.Answers { + m.Answers[i] = n + } + m.Rules = make([]SteeringPolicyRule, len(model.Rules)) + for i, n := range model.Rules { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Rules[i] = nn.(SteeringPolicyRule) + } else { + m.Rules[i] = nil + } + } + m.CompartmentId = model.CompartmentId + m.DisplayName = model.DisplayName + m.Template = model.Template + return +} + +// CreateSteeringPolicyDetailsTemplateEnum Enum with underlying type: string +type CreateSteeringPolicyDetailsTemplateEnum string + +// Set of constants representing the allowable values for CreateSteeringPolicyDetailsTemplateEnum +const ( + CreateSteeringPolicyDetailsTemplateFailover CreateSteeringPolicyDetailsTemplateEnum = "FAILOVER" + CreateSteeringPolicyDetailsTemplateLoadBalance CreateSteeringPolicyDetailsTemplateEnum = "LOAD_BALANCE" + CreateSteeringPolicyDetailsTemplateRouteByGeo CreateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_GEO" + CreateSteeringPolicyDetailsTemplateRouteByAsn CreateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_ASN" + CreateSteeringPolicyDetailsTemplateRouteByIp CreateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_IP" + CreateSteeringPolicyDetailsTemplateCustom CreateSteeringPolicyDetailsTemplateEnum = "CUSTOM" +) + +var mappingCreateSteeringPolicyDetailsTemplate = map[string]CreateSteeringPolicyDetailsTemplateEnum{ + "FAILOVER": CreateSteeringPolicyDetailsTemplateFailover, + "LOAD_BALANCE": CreateSteeringPolicyDetailsTemplateLoadBalance, + "ROUTE_BY_GEO": CreateSteeringPolicyDetailsTemplateRouteByGeo, + "ROUTE_BY_ASN": CreateSteeringPolicyDetailsTemplateRouteByAsn, + "ROUTE_BY_IP": CreateSteeringPolicyDetailsTemplateRouteByIp, + "CUSTOM": CreateSteeringPolicyDetailsTemplateCustom, +} + +// GetCreateSteeringPolicyDetailsTemplateEnumValues Enumerates the set of values for CreateSteeringPolicyDetailsTemplateEnum +func GetCreateSteeringPolicyDetailsTemplateEnumValues() []CreateSteeringPolicyDetailsTemplateEnum { + values := make([]CreateSteeringPolicyDetailsTemplateEnum, 0) + for _, v := range mappingCreateSteeringPolicyDetailsTemplate { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateSteeringPolicyRequest wrapper for the CreateSteeringPolicy operation +type CreateSteeringPolicyRequest struct { + + // Details for creating a new steering policy. + CreateSteeringPolicyDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated before + // then due to conflicting operations (for example, if a resource has been + // deleted and purged from the system, then a retry of the original creation + // request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSteeringPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSteeringPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSteeringPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateSteeringPolicyResponse wrapper for the CreateSteeringPolicy operation +type CreateSteeringPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicy instance + SteeringPolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response CreateSteeringPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSteeringPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -13,6 +14,7 @@ ) // CreateZoneDetails The body for defining a new zone. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateZoneDetails struct { // The name of the zone. @@ -24,7 +26,20 @@ // The OCID of the compartment containing the zone. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // External master servers for the zone. + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // External master servers for the zone. `externalMasters` becomes a + // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"false" json:"externalMasters"` } @@ -35,7 +50,7 @@ // CreateZoneDetailsZoneTypeEnum Enum with underlying type: string type CreateZoneDetailsZoneTypeEnum string -// Set of constants representing the allowable values for CreateZoneDetailsZoneType +// Set of constants representing the allowable values for CreateZoneDetailsZoneTypeEnum const ( CreateZoneDetailsZoneTypePrimary CreateZoneDetailsZoneTypeEnum = "PRIMARY" CreateZoneDetailsZoneTypeSecondary CreateZoneDetailsZoneTypeEnum = "SECONDARY" @@ -46,7 +61,7 @@ "SECONDARY": CreateZoneDetailsZoneTypeSecondary, } -// GetCreateZoneDetailsZoneTypeEnumValues Enumerates the set of values for CreateZoneDetailsZoneType +// GetCreateZoneDetailsZoneTypeEnumValues Enumerates the set of values for CreateZoneDetailsZoneTypeEnum func GetCreateZoneDetailsZoneTypeEnumValues() []CreateZoneDetailsZoneTypeEnum { values := make([]CreateZoneDetailsZoneTypeEnum, 0) for _, v := range mappingCreateZoneDetailsZoneType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -16,12 +16,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateZoneRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateZoneRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateZoneRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateZoneResponse wrapper for the CreateZone operation type CreateZoneResponse struct { @@ -44,3 +62,8 @@ func (response CreateZoneResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateZoneResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -33,12 +33,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDomainRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDomainRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDomainRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDomainRecordsResponse wrapper for the DeleteDomainRecords operation type DeleteDomainRecordsResponse struct { @@ -54,3 +72,8 @@ func (response DeleteDomainRecordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDomainRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -36,12 +36,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteRRSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteRRSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteRRSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteRRSetResponse wrapper for the DeleteRRSet operation type DeleteRRSetResponse struct { @@ -57,3 +75,8 @@ func (response DeleteRRSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteRRSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteSteeringPolicyAttachmentRequest wrapper for the DeleteSteeringPolicyAttachment operation +type DeleteSteeringPolicyAttachmentRequest struct { + + // The OCID of the target steering policy attachment. + SteeringPolicyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyAttachmentId"` + + // The `If-Match` header field makes the request method conditional on the + // existence of at least one current representation of the target resource, + // when the field-value is `*`, or having a current representation of the + // target resource that has an entity-tag matching a member of the list of + // entity-tags provided in the field-value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"` + + // The `If-Unmodified-Since` header field makes the request method + // conditional on the selected representation's last modification date being + // earlier than or equal to the date provided in the field-value. This + // field accomplishes the same purpose as If-Match for cases where the user + // agent does not have an entity-tag for the representation. + IfUnmodifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Unmodified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteSteeringPolicyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSteeringPolicyAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSteeringPolicyAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteSteeringPolicyAttachmentResponse wrapper for the DeleteSteeringPolicyAttachment operation +type DeleteSteeringPolicyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need + // to contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSteeringPolicyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSteeringPolicyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteSteeringPolicyRequest wrapper for the DeleteSteeringPolicy operation +type DeleteSteeringPolicyRequest struct { + + // The OCID of the target steering policy. + SteeringPolicyId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyId"` + + // The `If-Match` header field makes the request method conditional on the + // existence of at least one current representation of the target resource, + // when the field-value is `*`, or having a current representation of the + // target resource that has an entity-tag matching a member of the list of + // entity-tags provided in the field-value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"` + + // The `If-Unmodified-Since` header field makes the request method + // conditional on the selected representation's last modification date being + // earlier than or equal to the date provided in the field-value. This + // field accomplishes the same purpose as If-Match for cases where the user + // agent does not have an entity-tag for the representation. + IfUnmodifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Unmodified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteSteeringPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSteeringPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSteeringPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteSteeringPolicyResponse wrapper for the DeleteSteeringPolicy operation +type DeleteSteeringPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need + // to contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSteeringPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSteeringPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -30,12 +30,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteZoneRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteZoneRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteZoneRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteZoneResponse wrapper for the DeleteZone operation type DeleteZoneResponse struct { @@ -51,3 +69,8 @@ func (response DeleteZoneResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteZoneResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -37,7 +38,7 @@ // SetRegion overrides the region of this client. func (client *DnsClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "dns", region) + client.Host = common.StringToRegion(region).Endpoint("dns") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +49,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -58,212 +59,834 @@ return client.config } +// CreateSteeringPolicy Creates a new steering policy in the specified compartment. For more information on +// creating policies with templates, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). +func (client DnsClient) CreateSteeringPolicy(ctx context.Context, request CreateSteeringPolicyRequest) (response CreateSteeringPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSteeringPolicy, policy) + if err != nil { + if ociResponse != nil { + response = CreateSteeringPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateSteeringPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSteeringPolicyResponse") + } + return +} + +// createSteeringPolicy implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) createSteeringPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicies") + if err != nil { + return nil, err + } + + var response CreateSteeringPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateSteeringPolicyAttachment Creates a new attachment between a steering policy and a domain, giving the +// policy permission to answer queries for the specified domain. A steering policy must +// be attached to a domain for the policy to answer DNS queries for that domain. +// For the purposes of access control, the attachment is automatically placed +// into the same compartment as the domain's zone. +func (client DnsClient) CreateSteeringPolicyAttachment(ctx context.Context, request CreateSteeringPolicyAttachmentRequest) (response CreateSteeringPolicyAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSteeringPolicyAttachment, policy) + if err != nil { + if ociResponse != nil { + response = CreateSteeringPolicyAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateSteeringPolicyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSteeringPolicyAttachmentResponse") + } + return +} + +// createSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) createSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicyAttachments") + if err != nil { + return nil, err + } + + var response CreateSteeringPolicyAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateZone Creates a new zone in the specified compartment. The `compartmentId` // query parameter is required if the `Content-Type` header for the // request is `text/dns`. func (client DnsClient) CreateZone(ctx context.Context, request CreateZoneRequest) (response CreateZoneResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/zones", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createZone, policy) + if err != nil { + if ociResponse != nil { + response = CreateZoneResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateZoneResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateZoneResponse") + } + return +} + +// createZone implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) createZone(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateZoneResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteDomainRecords Deletes all records at the specified zone and domain. func (client DnsClient) DeleteDomainRecords(ctx context.Context, request DeleteDomainRecordsRequest) (response DeleteDomainRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteDomainRecords, policy) + if err != nil { + if ociResponse != nil { + response = DeleteDomainRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDomainRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDomainRecordsResponse") + } + return +} + +// deleteDomainRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) deleteDomainRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteDomainRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteRRSet Deletes all records in the specified RRSet. func (client DnsClient) DeleteRRSet(ctx context.Context, request DeleteRRSetRequest) (response DeleteRRSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteRRSet, policy) + if err != nil { + if ociResponse != nil { + response = DeleteRRSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteRRSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteRRSetResponse") + } + return +} + +// deleteRRSet implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) deleteRRSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}/{rtype}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteRRSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteSteeringPolicy Deletes the specified steering policy. +// A `204` response indicates that the delete has been successful. +// Deletion will fail if the policy is attached to any zones. To detach a +// policy from a zone, see `DeleteSteeringPolicyAttachment`. +func (client DnsClient) DeleteSteeringPolicy(ctx context.Context, request DeleteSteeringPolicyRequest) (response DeleteSteeringPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSteeringPolicy, policy) + if err != nil { + if ociResponse != nil { + response = DeleteSteeringPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSteeringPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSteeringPolicyResponse") + } return } -// DeleteZone Deletes the specified zone. A `204` response indicates that zone has been -// successfully deleted. -func (client DnsClient) DeleteZone(ctx context.Context, request DeleteZoneRequest) (response DeleteZoneResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/zones/{zoneNameOrId}", request) +// deleteSteeringPolicy implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) deleteSteeringPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/steeringPolicies/{steeringPolicyId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSteeringPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteSteeringPolicyAttachment Deletes the specified steering policy attachment. +// A `204` response indicates that the delete has been successful. +func (client DnsClient) DeleteSteeringPolicyAttachment(ctx context.Context, request DeleteSteeringPolicyAttachmentRequest) (response DeleteSteeringPolicyAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSteeringPolicyAttachment, policy) + if err != nil { + if ociResponse != nil { + response = DeleteSteeringPolicyAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteSteeringPolicyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSteeringPolicyAttachmentResponse") + } + return +} + +// deleteSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) deleteSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}") + if err != nil { + return nil, err + } + + var response DeleteSteeringPolicyAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteZone Deletes the specified zone and all its steering policy attachments. +// A `204` response indicates that zone has been successfully deleted. +func (client DnsClient) DeleteZone(ctx context.Context, request DeleteZoneRequest) (response DeleteZoneResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteZone, policy) + if err != nil { + if ociResponse != nil { + response = DeleteZoneResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteZoneResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteZoneResponse") + } return } +// deleteZone implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) deleteZone(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}") + if err != nil { + return nil, err + } + + var response DeleteZoneResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetDomainRecords Gets a list of all records at the specified zone and domain. // The results are sorted by `rtype` in alphabetical order by default. You // can optionally filter and/or sort the results using the listed parameters. func (client DnsClient) GetDomainRecords(ctx context.Context, request GetDomainRecordsRequest) (response GetDomainRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDomainRecords, policy) + if err != nil { + if ociResponse != nil { + response = GetDomainRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDomainRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDomainRecordsResponse") + } + return +} + +// getDomainRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getDomainRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetDomainRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetRRSet Gets a list of all records in the specified RRSet. The results are // sorted by `recordHash` by default. func (client DnsClient) GetRRSet(ctx context.Context, request GetRRSetRequest) (response GetRRSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getRRSet, policy) + if err != nil { + if ociResponse != nil { + response = GetRRSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetRRSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRRSetResponse") + } + return +} + +// getRRSet implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getRRSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}/{rtype}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetRRSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSteeringPolicy Gets information about the specified steering policy. +func (client DnsClient) GetSteeringPolicy(ctx context.Context, request GetSteeringPolicyRequest) (response GetSteeringPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSteeringPolicy, policy) + if err != nil { + if ociResponse != nil { + response = GetSteeringPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetSteeringPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSteeringPolicyResponse") + } + return +} + +// getSteeringPolicy implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getSteeringPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicies/{steeringPolicyId}") + if err != nil { + return nil, err + } + + var response GetSteeringPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSteeringPolicyAttachment Gets information about the specified steering policy attachment. +func (client DnsClient) GetSteeringPolicyAttachment(ctx context.Context, request GetSteeringPolicyAttachmentRequest) (response GetSteeringPolicyAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSteeringPolicyAttachment, policy) + if err != nil { + if ociResponse != nil { + response = GetSteeringPolicyAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetSteeringPolicyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSteeringPolicyAttachmentResponse") + } return } +// getSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}") + if err != nil { + return nil, err + } + + var response GetSteeringPolicyAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetZone Gets information about the specified zone, including its creation date, // zone type, and serial. func (client DnsClient) GetZone(ctx context.Context, request GetZoneRequest) (response GetZoneResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/zones/{zoneNameOrId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getZone, policy) + if err != nil { + if ociResponse != nil { + response = GetZoneResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetZoneResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetZoneResponse") + } + return +} + +// getZone implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getZone(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetZoneResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetZoneRecords Gets all records in the specified zone. The results are // sorted by `domain` in alphabetical order by default. For more -// information about records, please see Resource Record (RR) TYPEs (https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4). +// information about records, see Resource Record (RR) TYPEs (https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4). func (client DnsClient) GetZoneRecords(ctx context.Context, request GetZoneRecordsRequest) (response GetZoneRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/zones/{zoneNameOrId}/records", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getZoneRecords, policy) + if err != nil { + if ociResponse != nil { + response = GetZoneRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetZoneRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetZoneRecordsResponse") + } + return +} + +// getZoneRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) getZoneRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetZoneRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSteeringPolicies Gets a list of all steering policies in the specified compartment. +func (client DnsClient) ListSteeringPolicies(ctx context.Context, request ListSteeringPoliciesRequest) (response ListSteeringPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSteeringPolicies, policy) + if err != nil { + if ociResponse != nil { + response = ListSteeringPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListSteeringPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSteeringPoliciesResponse") + } + return +} + +// listSteeringPolicies implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) listSteeringPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicies") + if err != nil { + return nil, err + } + + var response ListSteeringPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSteeringPolicyAttachments Lists the steering policy attachments in the specified compartment. +func (client DnsClient) ListSteeringPolicyAttachments(ctx context.Context, request ListSteeringPolicyAttachmentsRequest) (response ListSteeringPolicyAttachmentsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSteeringPolicyAttachments, policy) + if err != nil { + if ociResponse != nil { + response = ListSteeringPolicyAttachmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSteeringPolicyAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSteeringPolicyAttachmentsResponse") + } return } +// listSteeringPolicyAttachments implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) listSteeringPolicyAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicyAttachments") + if err != nil { + return nil, err + } + + var response ListSteeringPolicyAttachmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListZones Gets a list of all zones in the specified compartment. The collection // can be filtered by name, time created, and zone type. func (client DnsClient) ListZones(ctx context.Context, request ListZonesRequest) (response ListZonesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/zones", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listZones, policy) + if err != nil { + if ociResponse != nil { + response = ListZonesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListZonesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListZonesResponse") + } + return +} + +// listZones implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) listZones(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListZonesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// PatchDomainRecords Replaces records in the specified zone at a domain. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function. +// PatchDomainRecords Updates records in the specified zone at a domain. You can update +// one record or all records for the specified zone depending on the changes +// provided in the request body. You can also add or remove records using this +// function. func (client DnsClient) PatchDomainRecords(ctx context.Context, request PatchDomainRecordsRequest) (response PatchDomainRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchDomainRecords, policy) + if err != nil { + if ociResponse != nil { + response = PatchDomainRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PatchDomainRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchDomainRecordsResponse") + } + return +} + +// patchDomainRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) patchDomainRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response PatchDomainRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // PatchRRSet Updates records in the specified RRSet. func (client DnsClient) PatchRRSet(ctx context.Context, request PatchRRSetRequest) (response PatchRRSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchRRSet, policy) + if err != nil { + if ociResponse != nil { + response = PatchRRSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PatchRRSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchRRSetResponse") + } + return +} + +// patchRRSet implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) patchRRSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}/{rtype}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response PatchRRSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // PatchZoneRecords Updates a collection of records in the specified zone. You can update @@ -271,20 +894,44 @@ // changes provided in the request body. You can also add or remove records // using this function. func (client DnsClient) PatchZoneRecords(ctx context.Context, request PatchZoneRecordsRequest) (response PatchZoneRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPatch, "/zones/{zoneNameOrId}/records", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchZoneRecords, policy) + if err != nil { + if ociResponse != nil { + response = PatchZoneRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PatchZoneRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchZoneRecordsResponse") + } + return +} + +// patchZoneRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) patchZoneRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response PatchZoneRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateDomainRecords Replaces records in the specified zone at a domain with the records @@ -294,58 +941,214 @@ // does not exist in the request body, the record will be removed from the // zone. func (client DnsClient) UpdateDomainRecords(ctx context.Context, request UpdateDomainRecordsRequest) (response UpdateDomainRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateDomainRecords, policy) + if err != nil { + if ociResponse != nil { + response = UpdateDomainRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDomainRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDomainRecordsResponse") + } + return +} + +// updateDomainRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateDomainRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDomainRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateRRSet Replaces records in the specified RRSet. func (client DnsClient) UpdateRRSet(ctx context.Context, request UpdateRRSetRequest) (response UpdateRRSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateRRSet, policy) + if err != nil { + if ociResponse != nil { + response = UpdateRRSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateRRSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateRRSetResponse") + } + return +} + +// updateRRSet implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateRRSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}/{rtype}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateRRSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSteeringPolicy Updates the configuration of the specified steering policy. +func (client DnsClient) UpdateSteeringPolicy(ctx context.Context, request UpdateSteeringPolicyRequest) (response UpdateSteeringPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSteeringPolicy, policy) + if err != nil { + if ociResponse != nil { + response = UpdateSteeringPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateSteeringPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSteeringPolicyResponse") + } + return +} + +// updateSteeringPolicy implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateSteeringPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/steeringPolicies/{steeringPolicyId}") + if err != nil { + return nil, err + } + + var response UpdateSteeringPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSteeringPolicyAttachment Updates the specified steering policy attachment with your new information. +func (client DnsClient) UpdateSteeringPolicyAttachment(ctx context.Context, request UpdateSteeringPolicyAttachmentRequest) (response UpdateSteeringPolicyAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSteeringPolicyAttachment, policy) + if err != nil { + if ociResponse != nil { + response = UpdateSteeringPolicyAttachmentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSteeringPolicyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSteeringPolicyAttachmentResponse") + } return } +// updateSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}") + if err != nil { + return nil, err + } + + var response UpdateSteeringPolicyAttachmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateZone Updates the specified secondary zone with your new external master // server information. For more information about secondary zone, see -// Manage DNS Service Zone (https://docs.us-phoenix-1.oraclecloud.com/Content/DNS/Tasks/managingdnszones.htm). +// Manage DNS Service Zone (https://docs.cloud.oracle.com/iaas/Content/DNS/Tasks/managingdnszones.htm). func (client DnsClient) UpdateZone(ctx context.Context, request UpdateZoneRequest) (response UpdateZoneResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/zones/{zoneNameOrId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateZone, policy) + if err != nil { + if ociResponse != nil { + response = UpdateZoneResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateZoneResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateZoneResponse") + } + return +} + +// updateZone implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateZone(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateZoneResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateZoneRecords Replaces records in the specified zone with the records specified in the @@ -354,18 +1157,42 @@ // the body of the request. If a record in the zone does not exist in the // request body, the record will be removed from the zone. func (client DnsClient) UpdateZoneRecords(ctx context.Context, request UpdateZoneRecordsRequest) (response UpdateZoneRecordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/zones/{zoneNameOrId}/records", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateZoneRecords, policy) + if err != nil { + if ociResponse != nil { + response = UpdateZoneRecordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateZoneRecordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateZoneRecordsResponse") + } + return +} + +// updateZoneRecords implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) updateZoneRecords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateZoneRecordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -18,7 +19,8 @@ // The server's IP address (IPv4 or IPv6). Address *string `mandatory:"true" json:"address"` - // The server's port. + // The server's port. Port value must be a value of 53, otherwise omit + // the port value. Port *int `mandatory:"false" json:"port"` Tsig *Tsig `mandatory:"false" json:"tsig"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -30,7 +30,7 @@ IfModifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Modified-Since"` // The maximum number of items to return in a page of the collection. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` // The value of the `opc-next-page` response header from the previous "List" call. Page *string `mandatory:"false" contributesTo:"query" name:"page"` @@ -50,25 +50,42 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDomainRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDomainRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDomainRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDomainRecordsResponse wrapper for the GetDomainRecords operation type GetDomainRecordsResponse struct { // The underlying http response RawResponse *http.Response - // The RecordCollection instance + // A list of RecordCollection instances RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -89,10 +106,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response GetDomainRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // GetDomainRecordsSortByEnum Enum with underlying type: string type GetDomainRecordsSortByEnum string -// Set of constants representing the allowable values for GetDomainRecordsSortBy +// Set of constants representing the allowable values for GetDomainRecordsSortByEnum const ( GetDomainRecordsSortByRtype GetDomainRecordsSortByEnum = "rtype" GetDomainRecordsSortByTtl GetDomainRecordsSortByEnum = "ttl" @@ -103,7 +125,7 @@ "ttl": GetDomainRecordsSortByTtl, } -// GetGetDomainRecordsSortByEnumValues Enumerates the set of values for GetDomainRecordsSortBy +// GetGetDomainRecordsSortByEnumValues Enumerates the set of values for GetDomainRecordsSortByEnum func GetGetDomainRecordsSortByEnumValues() []GetDomainRecordsSortByEnum { values := make([]GetDomainRecordsSortByEnum, 0) for _, v := range mappingGetDomainRecordsSortBy { @@ -115,7 +137,7 @@ // GetDomainRecordsSortOrderEnum Enum with underlying type: string type GetDomainRecordsSortOrderEnum string -// Set of constants representing the allowable values for GetDomainRecordsSortOrder +// Set of constants representing the allowable values for GetDomainRecordsSortOrderEnum const ( GetDomainRecordsSortOrderAsc GetDomainRecordsSortOrderEnum = "ASC" GetDomainRecordsSortOrderDesc GetDomainRecordsSortOrderEnum = "DESC" @@ -126,7 +148,7 @@ "DESC": GetDomainRecordsSortOrderDesc, } -// GetGetDomainRecordsSortOrderEnumValues Enumerates the set of values for GetDomainRecordsSortOrder +// GetGetDomainRecordsSortOrderEnumValues Enumerates the set of values for GetDomainRecordsSortOrderEnum func GetGetDomainRecordsSortOrderEnumValues() []GetDomainRecordsSortOrderEnum { values := make([]GetDomainRecordsSortOrderEnum, 0) for _, v := range mappingGetDomainRecordsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -33,7 +33,7 @@ IfModifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Modified-Since"` // The maximum number of items to return in a page of the collection. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` // The value of the `opc-next-page` response header from the previous "List" call. Page *string `mandatory:"false" contributesTo:"query" name:"page"` @@ -43,25 +43,42 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetRRSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetRRSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRRSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetRRSetResponse wrapper for the GetRRSet operation type GetRRSetResponse struct { // The underlying http response RawResponse *http.Response - // The RrSet instance + // A list of RrSet instances RrSet `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -81,3 +98,8 @@ func (response GetRRSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetRRSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetSteeringPolicyAttachmentRequest wrapper for the GetSteeringPolicyAttachment operation +type GetSteeringPolicyAttachmentRequest struct { + + // The OCID of the target steering policy attachment. + SteeringPolicyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyAttachmentId"` + + // The `If-None-Match` header field makes the request method conditional on + // the absence of any current representation of the target resource, when + // the field-value is `*`, or having a selected representation with an + // entity-tag that does not match any of those listed in the field-value. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"If-None-Match"` + + // The `If-Modified-Since` header field makes a GET or HEAD request method + // conditional on the selected representation's modification date being more + // recent than the date provided in the field-value. Transfer of the + // selected representation's data is avoided if that data has not changed. + IfModifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Modified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSteeringPolicyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSteeringPolicyAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSteeringPolicyAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetSteeringPolicyAttachmentResponse wrapper for the GetSteeringPolicyAttachment operation +type GetSteeringPolicyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicyAttachment instance + SteeringPolicyAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetSteeringPolicyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSteeringPolicyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetSteeringPolicyRequest wrapper for the GetSteeringPolicy operation +type GetSteeringPolicyRequest struct { + + // The OCID of the target steering policy. + SteeringPolicyId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyId"` + + // The `If-None-Match` header field makes the request method conditional on + // the absence of any current representation of the target resource, when + // the field-value is `*`, or having a selected representation with an + // entity-tag that does not match any of those listed in the field-value. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"If-None-Match"` + + // The `If-Modified-Since` header field makes a GET or HEAD request method + // conditional on the selected representation's modification date being more + // recent than the date provided in the field-value. Transfer of the + // selected representation's data is avoided if that data has not changed. + IfModifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Modified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSteeringPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSteeringPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSteeringPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetSteeringPolicyResponse wrapper for the GetSteeringPolicy operation +type GetSteeringPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicy instance + SteeringPolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetSteeringPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSteeringPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -27,7 +27,7 @@ IfModifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Modified-Since"` // The maximum number of items to return in a page of the collection. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` // The value of the `opc-next-page` response header from the previous "List" call. Page *string `mandatory:"false" contributesTo:"query" name:"page"` @@ -55,25 +55,42 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetZoneRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetZoneRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetZoneRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetZoneRecordsResponse wrapper for the GetZoneRecords operation type GetZoneRecordsResponse struct { // The underlying http response RawResponse *http.Response - // The RecordCollection instance + // A list of RecordCollection instances RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -94,10 +111,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response GetZoneRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // GetZoneRecordsSortByEnum Enum with underlying type: string type GetZoneRecordsSortByEnum string -// Set of constants representing the allowable values for GetZoneRecordsSortBy +// Set of constants representing the allowable values for GetZoneRecordsSortByEnum const ( GetZoneRecordsSortByDomain GetZoneRecordsSortByEnum = "domain" GetZoneRecordsSortByRtype GetZoneRecordsSortByEnum = "rtype" @@ -110,7 +132,7 @@ "ttl": GetZoneRecordsSortByTtl, } -// GetGetZoneRecordsSortByEnumValues Enumerates the set of values for GetZoneRecordsSortBy +// GetGetZoneRecordsSortByEnumValues Enumerates the set of values for GetZoneRecordsSortByEnum func GetGetZoneRecordsSortByEnumValues() []GetZoneRecordsSortByEnum { values := make([]GetZoneRecordsSortByEnum, 0) for _, v := range mappingGetZoneRecordsSortBy { @@ -122,7 +144,7 @@ // GetZoneRecordsSortOrderEnum Enum with underlying type: string type GetZoneRecordsSortOrderEnum string -// Set of constants representing the allowable values for GetZoneRecordsSortOrder +// Set of constants representing the allowable values for GetZoneRecordsSortOrderEnum const ( GetZoneRecordsSortOrderAsc GetZoneRecordsSortOrderEnum = "ASC" GetZoneRecordsSortOrderDesc GetZoneRecordsSortOrderEnum = "DESC" @@ -133,7 +155,7 @@ "DESC": GetZoneRecordsSortOrderDesc, } -// GetGetZoneRecordsSortOrderEnumValues Enumerates the set of values for GetZoneRecordsSortOrder +// GetGetZoneRecordsSortOrderEnumValues Enumerates the set of values for GetZoneRecordsSortOrderEnum func GetGetZoneRecordsSortOrderEnumValues() []GetZoneRecordsSortOrderEnum { values := make([]GetZoneRecordsSortOrderEnum, 0) for _, v := range mappingGetZoneRecordsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -28,12 +28,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetZoneRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetZoneRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetZoneRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetZoneResponse wrapper for the GetZone operation type GetZoneResponse struct { @@ -56,3 +74,8 @@ func (response GetZoneResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetZoneResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,159 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListSteeringPoliciesRequest wrapper for the ListSteeringPolicies operation +type ListSteeringPoliciesRequest struct { + + // The OCID of the compartment the resource belongs to. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a page of the collection. + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The OCID of a resource. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The displayName of a resource. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The partial displayName of a resource. Will match any resource whose name + // (case-insensitive) contains the provided value. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // Search by health check monitor OCID. + // Will match any resource whose health check monitor ID matches the provided value. + HealthCheckMonitorId *string `mandatory:"false" contributesTo:"query" name:"healthCheckMonitorId"` + + // An RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) timestamp that states + // all returned resources were created on or after the indicated time. + TimeCreatedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedGreaterThanOrEqualTo"` + + // An RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) timestamp that states + // all returned resources were created before the indicated time. + TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` + + // Search by steering template type. + // Will match any resource whose template type matches the provided value. + Template *string `mandatory:"false" contributesTo:"query" name:"template"` + + // The state of a resource. + LifecycleState SteeringPolicySummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The field by which to sort steering policies. If unspecified, defaults to `timeCreated`. + SortBy ListSteeringPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The order to sort the resources. + SortOrder ListSteeringPoliciesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSteeringPoliciesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSteeringPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSteeringPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListSteeringPoliciesResponse wrapper for the ListSteeringPolicies operation +type ListSteeringPoliciesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []SteeringPolicySummary instances + Items []SteeringPolicySummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // The total number of items that match the query. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListSteeringPoliciesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSteeringPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSteeringPoliciesSortByEnum Enum with underlying type: string +type ListSteeringPoliciesSortByEnum string + +// Set of constants representing the allowable values for ListSteeringPoliciesSortByEnum +const ( + ListSteeringPoliciesSortByDisplayname ListSteeringPoliciesSortByEnum = "displayName" + ListSteeringPoliciesSortByTimecreated ListSteeringPoliciesSortByEnum = "timeCreated" + ListSteeringPoliciesSortByTemplate ListSteeringPoliciesSortByEnum = "template" +) + +var mappingListSteeringPoliciesSortBy = map[string]ListSteeringPoliciesSortByEnum{ + "displayName": ListSteeringPoliciesSortByDisplayname, + "timeCreated": ListSteeringPoliciesSortByTimecreated, + "template": ListSteeringPoliciesSortByTemplate, +} + +// GetListSteeringPoliciesSortByEnumValues Enumerates the set of values for ListSteeringPoliciesSortByEnum +func GetListSteeringPoliciesSortByEnumValues() []ListSteeringPoliciesSortByEnum { + values := make([]ListSteeringPoliciesSortByEnum, 0) + for _, v := range mappingListSteeringPoliciesSortBy { + values = append(values, v) + } + return values +} + +// ListSteeringPoliciesSortOrderEnum Enum with underlying type: string +type ListSteeringPoliciesSortOrderEnum string + +// Set of constants representing the allowable values for ListSteeringPoliciesSortOrderEnum +const ( + ListSteeringPoliciesSortOrderAsc ListSteeringPoliciesSortOrderEnum = "ASC" + ListSteeringPoliciesSortOrderDesc ListSteeringPoliciesSortOrderEnum = "DESC" +) + +var mappingListSteeringPoliciesSortOrder = map[string]ListSteeringPoliciesSortOrderEnum{ + "ASC": ListSteeringPoliciesSortOrderAsc, + "DESC": ListSteeringPoliciesSortOrderDesc, +} + +// GetListSteeringPoliciesSortOrderEnumValues Enumerates the set of values for ListSteeringPoliciesSortOrderEnum +func GetListSteeringPoliciesSortOrderEnumValues() []ListSteeringPoliciesSortOrderEnum { + values := make([]ListSteeringPoliciesSortOrderEnum, 0) + for _, v := range mappingListSteeringPoliciesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,163 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListSteeringPolicyAttachmentsRequest wrapper for the ListSteeringPolicyAttachments operation +type ListSteeringPolicyAttachmentsRequest struct { + + // The OCID of the compartment the resource belongs to. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a page of the collection. + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The OCID of a resource. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The displayName of a resource. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Search by steering policy OCID. + // Will match any resource whose steering policy ID matches the provided value. + SteeringPolicyId *string `mandatory:"false" contributesTo:"query" name:"steeringPolicyId"` + + // Search by zone OCID. + // Will match any resource whose zone ID matches the provided value. + ZoneId *string `mandatory:"false" contributesTo:"query" name:"zoneId"` + + // Search by domain. + // Will match any record whose domain (case-insensitive) equals the provided value. + Domain *string `mandatory:"false" contributesTo:"query" name:"domain"` + + // Search by domain. + // Will match any record whose domain (case-insensitive) contains the provided value. + DomainContains *string `mandatory:"false" contributesTo:"query" name:"domainContains"` + + // An RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) timestamp that states + // all returned resources were created on or after the indicated time. + TimeCreatedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedGreaterThanOrEqualTo"` + + // An RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) timestamp that states + // all returned resources were created before the indicated time. + TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` + + // The state of a resource. + LifecycleState SteeringPolicyAttachmentSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The field by which to sort steering policy attachments. If unspecified, defaults to `timeCreated`. + SortBy ListSteeringPolicyAttachmentsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The order to sort the resources. + SortOrder ListSteeringPolicyAttachmentsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSteeringPolicyAttachmentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSteeringPolicyAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSteeringPolicyAttachmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListSteeringPolicyAttachmentsResponse wrapper for the ListSteeringPolicyAttachments operation +type ListSteeringPolicyAttachmentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []SteeringPolicyAttachmentSummary instances + Items []SteeringPolicyAttachmentSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // The total number of items that match the query. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListSteeringPolicyAttachmentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSteeringPolicyAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSteeringPolicyAttachmentsSortByEnum Enum with underlying type: string +type ListSteeringPolicyAttachmentsSortByEnum string + +// Set of constants representing the allowable values for ListSteeringPolicyAttachmentsSortByEnum +const ( + ListSteeringPolicyAttachmentsSortByDisplayname ListSteeringPolicyAttachmentsSortByEnum = "displayName" + ListSteeringPolicyAttachmentsSortByTimecreated ListSteeringPolicyAttachmentsSortByEnum = "timeCreated" + ListSteeringPolicyAttachmentsSortByDomainname ListSteeringPolicyAttachmentsSortByEnum = "domainName" +) + +var mappingListSteeringPolicyAttachmentsSortBy = map[string]ListSteeringPolicyAttachmentsSortByEnum{ + "displayName": ListSteeringPolicyAttachmentsSortByDisplayname, + "timeCreated": ListSteeringPolicyAttachmentsSortByTimecreated, + "domainName": ListSteeringPolicyAttachmentsSortByDomainname, +} + +// GetListSteeringPolicyAttachmentsSortByEnumValues Enumerates the set of values for ListSteeringPolicyAttachmentsSortByEnum +func GetListSteeringPolicyAttachmentsSortByEnumValues() []ListSteeringPolicyAttachmentsSortByEnum { + values := make([]ListSteeringPolicyAttachmentsSortByEnum, 0) + for _, v := range mappingListSteeringPolicyAttachmentsSortBy { + values = append(values, v) + } + return values +} + +// ListSteeringPolicyAttachmentsSortOrderEnum Enum with underlying type: string +type ListSteeringPolicyAttachmentsSortOrderEnum string + +// Set of constants representing the allowable values for ListSteeringPolicyAttachmentsSortOrderEnum +const ( + ListSteeringPolicyAttachmentsSortOrderAsc ListSteeringPolicyAttachmentsSortOrderEnum = "ASC" + ListSteeringPolicyAttachmentsSortOrderDesc ListSteeringPolicyAttachmentsSortOrderEnum = "DESC" +) + +var mappingListSteeringPolicyAttachmentsSortOrder = map[string]ListSteeringPolicyAttachmentsSortOrderEnum{ + "ASC": ListSteeringPolicyAttachmentsSortOrderAsc, + "DESC": ListSteeringPolicyAttachmentsSortOrderDesc, +} + +// GetListSteeringPolicyAttachmentsSortOrderEnumValues Enumerates the set of values for ListSteeringPolicyAttachmentsSortOrderEnum +func GetListSteeringPolicyAttachmentsSortOrderEnumValues() []ListSteeringPolicyAttachmentsSortOrderEnum { + values := make([]ListSteeringPolicyAttachmentsSortOrderEnum, 0) + for _, v := range mappingListSteeringPolicyAttachmentsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -15,7 +15,7 @@ CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The maximum number of items to return in a page of the collection. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` // The value of the `opc-next-page` response header from the previous "List" call. Page *string `mandatory:"false" contributesTo:"query" name:"page"` @@ -40,33 +40,50 @@ // all returned resources were created before the indicated time. TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` + // The state of a resource. + LifecycleState ListZonesLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + // The field by which to sort zones. SortBy ListZonesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The order to sort the resources. SortOrder ListZonesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` - // The state of a resource. - LifecycleState ListZonesLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListZonesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListZonesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListZonesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListZonesResponse wrapper for the ListZones operation type ListZonesResponse struct { // The underlying http response RawResponse *http.Response - // The []ZoneSummary instance + // A list of []ZoneSummary instances Items []ZoneSummary `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -82,10 +99,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListZonesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListZonesZoneTypeEnum Enum with underlying type: string type ListZonesZoneTypeEnum string -// Set of constants representing the allowable values for ListZonesZoneType +// Set of constants representing the allowable values for ListZonesZoneTypeEnum const ( ListZonesZoneTypePrimary ListZonesZoneTypeEnum = "PRIMARY" ListZonesZoneTypeSecondary ListZonesZoneTypeEnum = "SECONDARY" @@ -96,7 +118,7 @@ "SECONDARY": ListZonesZoneTypeSecondary, } -// GetListZonesZoneTypeEnumValues Enumerates the set of values for ListZonesZoneType +// GetListZonesZoneTypeEnumValues Enumerates the set of values for ListZonesZoneTypeEnum func GetListZonesZoneTypeEnumValues() []ListZonesZoneTypeEnum { values := make([]ListZonesZoneTypeEnum, 0) for _, v := range mappingListZonesZoneType { @@ -105,10 +127,39 @@ return values } +// ListZonesLifecycleStateEnum Enum with underlying type: string +type ListZonesLifecycleStateEnum string + +// Set of constants representing the allowable values for ListZonesLifecycleStateEnum +const ( + ListZonesLifecycleStateActive ListZonesLifecycleStateEnum = "ACTIVE" + ListZonesLifecycleStateCreating ListZonesLifecycleStateEnum = "CREATING" + ListZonesLifecycleStateDeleted ListZonesLifecycleStateEnum = "DELETED" + ListZonesLifecycleStateDeleting ListZonesLifecycleStateEnum = "DELETING" + ListZonesLifecycleStateFailed ListZonesLifecycleStateEnum = "FAILED" +) + +var mappingListZonesLifecycleState = map[string]ListZonesLifecycleStateEnum{ + "ACTIVE": ListZonesLifecycleStateActive, + "CREATING": ListZonesLifecycleStateCreating, + "DELETED": ListZonesLifecycleStateDeleted, + "DELETING": ListZonesLifecycleStateDeleting, + "FAILED": ListZonesLifecycleStateFailed, +} + +// GetListZonesLifecycleStateEnumValues Enumerates the set of values for ListZonesLifecycleStateEnum +func GetListZonesLifecycleStateEnumValues() []ListZonesLifecycleStateEnum { + values := make([]ListZonesLifecycleStateEnum, 0) + for _, v := range mappingListZonesLifecycleState { + values = append(values, v) + } + return values +} + // ListZonesSortByEnum Enum with underlying type: string type ListZonesSortByEnum string -// Set of constants representing the allowable values for ListZonesSortBy +// Set of constants representing the allowable values for ListZonesSortByEnum const ( ListZonesSortByName ListZonesSortByEnum = "name" ListZonesSortByZonetype ListZonesSortByEnum = "zoneType" @@ -121,7 +172,7 @@ "timeCreated": ListZonesSortByTimecreated, } -// GetListZonesSortByEnumValues Enumerates the set of values for ListZonesSortBy +// GetListZonesSortByEnumValues Enumerates the set of values for ListZonesSortByEnum func GetListZonesSortByEnumValues() []ListZonesSortByEnum { values := make([]ListZonesSortByEnum, 0) for _, v := range mappingListZonesSortBy { @@ -133,7 +184,7 @@ // ListZonesSortOrderEnum Enum with underlying type: string type ListZonesSortOrderEnum string -// Set of constants representing the allowable values for ListZonesSortOrder +// Set of constants representing the allowable values for ListZonesSortOrderEnum const ( ListZonesSortOrderAsc ListZonesSortOrderEnum = "ASC" ListZonesSortOrderDesc ListZonesSortOrderEnum = "DESC" @@ -144,40 +195,11 @@ "DESC": ListZonesSortOrderDesc, } -// GetListZonesSortOrderEnumValues Enumerates the set of values for ListZonesSortOrder +// GetListZonesSortOrderEnumValues Enumerates the set of values for ListZonesSortOrderEnum func GetListZonesSortOrderEnumValues() []ListZonesSortOrderEnum { values := make([]ListZonesSortOrderEnum, 0) for _, v := range mappingListZonesSortOrder { values = append(values, v) } return values -} - -// ListZonesLifecycleStateEnum Enum with underlying type: string -type ListZonesLifecycleStateEnum string - -// Set of constants representing the allowable values for ListZonesLifecycleState -const ( - ListZonesLifecycleStateActive ListZonesLifecycleStateEnum = "ACTIVE" - ListZonesLifecycleStateCreating ListZonesLifecycleStateEnum = "CREATING" - ListZonesLifecycleStateDeleted ListZonesLifecycleStateEnum = "DELETED" - ListZonesLifecycleStateDeleting ListZonesLifecycleStateEnum = "DELETING" - ListZonesLifecycleStateFailed ListZonesLifecycleStateEnum = "FAILED" -) - -var mappingListZonesLifecycleState = map[string]ListZonesLifecycleStateEnum{ - "ACTIVE": ListZonesLifecycleStateActive, - "CREATING": ListZonesLifecycleStateCreating, - "DELETED": ListZonesLifecycleStateDeleted, - "DELETING": ListZonesLifecycleStateDeleting, - "FAILED": ListZonesLifecycleStateFailed, -} - -// GetListZonesLifecycleStateEnumValues Enumerates the set of values for ListZonesLifecycleState -func GetListZonesLifecycleStateEnumValues() []ListZonesLifecycleStateEnum { - values := make([]ListZonesLifecycleStateEnum, 0) - for _, v := range mappingListZonesLifecycleState { - values = append(values, v) - } - return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,25 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Nameserver A server that has been set up to answer DNS queries for a zone. +type Nameserver struct { + + // The hostname of the nameserver. + Hostname *string `mandatory:"true" json:"hostname"` +} + +func (m Nameserver) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -36,12 +36,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request PatchDomainRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request PatchDomainRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchDomainRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // PatchDomainRecordsResponse wrapper for the PatchDomainRecords operation type PatchDomainRecordsResponse struct { @@ -51,10 +69,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -74,3 +91,8 @@ func (response PatchDomainRecordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response PatchDomainRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -39,12 +39,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request PatchRRSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request PatchRRSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchRRSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // PatchRRSetResponse wrapper for the PatchRRSet operation type PatchRRSetResponse struct { @@ -54,10 +72,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -77,3 +94,8 @@ func (response PatchRRSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response PatchRRSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -33,12 +33,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request PatchZoneRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request PatchZoneRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchZoneRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // PatchZoneRecordsResponse wrapper for the PatchZoneRecords operation type PatchZoneRecordsResponse struct { @@ -48,10 +66,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -71,3 +88,8 @@ func (response PatchZoneRecordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response PatchZoneRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -19,7 +20,9 @@ Domain *string `mandatory:"true" json:"domain"` // The record's data, as whitespace-delimited tokens in - // type-specific presentation format. + // type-specific presentation format. All RDATA is normalized and the + // returned presentation of your RDATA may differ from its initial input. + // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm) Rdata *string `mandatory:"true" json:"rdata"` // The canonical name for the record's type, such as A or CNAME. For more diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -12,7 +13,8 @@ "github.com/oracle/oci-go-sdk/common" ) -// Record A DNS resource record. For more information about DNS records, see RFC 1034 (https://tools.ietf.org/html/rfc1034#section-3.6). +// Record A DNS resource record. For more information, see +// Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm). type Record struct { // The fully qualified domain name where the record can be located. @@ -26,7 +28,9 @@ IsProtected *bool `mandatory:"false" json:"isProtected"` // The record's data, as whitespace-delimited tokens in - // type-specific presentation format. + // type-specific presentation format. All RDATA is normalized and the + // returned presentation of your RDATA may differ from its initial input. + // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm) Rdata *string `mandatory:"false" json:"rdata"` // The latest version of the record's zone in which its RRSet differs diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -28,7 +29,9 @@ IsProtected *bool `mandatory:"false" json:"isProtected"` // The record's data, as whitespace-delimited tokens in - // type-specific presentation format. + // type-specific presentation format. All RDATA is normalized and the + // returned presentation of your RDATA may differ from its initial input. + // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm) Rdata *string `mandatory:"false" json:"rdata"` // The latest version of the record's zone in which its RRSet differs @@ -43,15 +46,19 @@ Ttl *int `mandatory:"false" json:"ttl"` // A description of how a record relates to a PATCH operation. + // // - `REQUIRE` indicates a precondition that record data **must** already exist. // - `PROHIBIT` indicates a precondition that record data **must not** already exist. // - `ADD` indicates that record data **must** exist after successful application. // - `REMOVE` indicates that record data **must not** exist after successful application. + // // **Note:** `ADD` and `REMOVE` operations can succeed even if // they require no changes when applied, such as when the described // records are already present or absent. + // // **Note:** `ADD` and `REMOVE` operations can describe changes for // more than one record. + // // **Example:** `{ "domain": "www.example.com", "rtype": "AAAA", "ttl": 60 }` // specifies a new TTL for every record in the www.example.com AAAA RRSet. Operation RecordOperationOperationEnum `mandatory:"false" json:"operation,omitempty"` @@ -64,7 +71,7 @@ // RecordOperationOperationEnum Enum with underlying type: string type RecordOperationOperationEnum string -// Set of constants representing the allowable values for RecordOperationOperation +// Set of constants representing the allowable values for RecordOperationOperationEnum const ( RecordOperationOperationRequire RecordOperationOperationEnum = "REQUIRE" RecordOperationOperationProhibit RecordOperationOperationEnum = "PROHIBIT" @@ -79,7 +86,7 @@ "REMOVE": RecordOperationOperationRemove, } -// GetRecordOperationOperationEnumValues Enumerates the set of values for RecordOperationOperation +// GetRecordOperationOperationEnumValues Enumerates the set of values for RecordOperationOperationEnum func GetRecordOperationOperationEnumValues() []RecordOperationOperationEnum { values := make([]RecordOperationOperationEnum, 0) for _, v := range mappingRecordOperationOperation { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyAnswer DNS record data with metadata for processing in a steering policy. +// +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type SteeringPolicyAnswer struct { + + // A user-friendly name for the answer, unique within the steering policy. + // An answer's `name` property can be referenced in `answerCondition` properties + // of rules using `answer.name`. + // **Example:** + // "rules": [ + // { + // "ruleType": "FILTER", + // "defaultAnswerData": [ + // { + // "answerCondition": "answer.name == 'server 1'", + // "shouldKeep": true + // } + // ] + // } + // ] + Name *string `mandatory:"true" json:"name"` + + // The canonical name for the record's type. Only A, AAAA, and CNAME are supported. For more + // information, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm). + Rtype *string `mandatory:"true" json:"rtype"` + + // The record's data, as whitespace-delimited tokens in + // type-specific presentation format. All RDATA is normalized and the + // returned presentation of your RDATA may differ from its initial input. + // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm). + Rdata *string `mandatory:"true" json:"rdata"` + + // The freeform name of a group of one or more records in which this record is included, + // such as "LAX data center". An answer's `pool` property can be referenced in `answerCondition` + // properties of rules using `answer.pool`. + // **Example:** + // "rules": [ + // { + // "ruleType": "FILTER", + // "defaultAnswerData": [ + // { + // "answerCondition": "answer.pool == 'US East Servers'", + // "shouldKeep": true + // } + // ] + // } + // ] + Pool *string `mandatory:"false" json:"pool"` + + // Set this property to `true` to indicate that the answer is administratively disabled, + // such as when the corresponding server is down for maintenance. An answer's `isDisabled` + // property can be referenced in `answerCondition` properties in rules using `answer.isDisabled`. + // **Example:** + // "rules": [ + // { + // "ruleType": "FILTER", + // "defaultAnswerData": [ + // { + // "answerCondition": "answer.isDisabled != true", + // "shouldKeep": true + // } + // ] + // }, + IsDisabled *bool `mandatory:"false" json:"isDisabled"` +} + +func (m SteeringPolicyAnswer) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,86 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyAttachment An attachment between a steering policy and a domain. An attachment constructs +// DNS responses using its steering policy instead of the records at its defined domain. +// Only records of the policy's covered rtype are blocked at the domain. +// A domain can have a maximum of one attachment covering any given rtype. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type SteeringPolicyAttachment struct { + + // The OCID of the attached steering policy. + SteeringPolicyId *string `mandatory:"false" json:"steeringPolicyId"` + + // The OCID of the attached zone. + ZoneId *string `mandatory:"false" json:"zoneId"` + + // The attached domain within the attached zone. + DomainName *string `mandatory:"false" json:"domainName"` + + // A user-friendly name for the steering policy attachment. + // Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The record types covered by the attachment at the domain. The set of record types is + // determined by aggregating the record types from the answers defined in the steering + // policy. + Rtypes []string `mandatory:"false" json:"rtypes"` + + // The OCID of the compartment containing the steering policy attachment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The canonical absolute URL of the resource. + Self *string `mandatory:"false" json:"self"` + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // The date and time the resource was created, expressed in RFC 3339 timestamp format. + // **Example:** `2016-07-22T17:23:59:60Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current state of the resource. + LifecycleState SteeringPolicyAttachmentLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m SteeringPolicyAttachment) String() string { + return common.PointerString(m) +} + +// SteeringPolicyAttachmentLifecycleStateEnum Enum with underlying type: string +type SteeringPolicyAttachmentLifecycleStateEnum string + +// Set of constants representing the allowable values for SteeringPolicyAttachmentLifecycleStateEnum +const ( + SteeringPolicyAttachmentLifecycleStateCreating SteeringPolicyAttachmentLifecycleStateEnum = "CREATING" + SteeringPolicyAttachmentLifecycleStateActive SteeringPolicyAttachmentLifecycleStateEnum = "ACTIVE" + SteeringPolicyAttachmentLifecycleStateDeleting SteeringPolicyAttachmentLifecycleStateEnum = "DELETING" +) + +var mappingSteeringPolicyAttachmentLifecycleState = map[string]SteeringPolicyAttachmentLifecycleStateEnum{ + "CREATING": SteeringPolicyAttachmentLifecycleStateCreating, + "ACTIVE": SteeringPolicyAttachmentLifecycleStateActive, + "DELETING": SteeringPolicyAttachmentLifecycleStateDeleting, +} + +// GetSteeringPolicyAttachmentLifecycleStateEnumValues Enumerates the set of values for SteeringPolicyAttachmentLifecycleStateEnum +func GetSteeringPolicyAttachmentLifecycleStateEnumValues() []SteeringPolicyAttachmentLifecycleStateEnum { + values := make([]SteeringPolicyAttachmentLifecycleStateEnum, 0) + for _, v := range mappingSteeringPolicyAttachmentLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyAttachmentSummary An attachment between a steering policy and a domain. +type SteeringPolicyAttachmentSummary struct { + + // The OCID of the attached steering policy. + SteeringPolicyId *string `mandatory:"false" json:"steeringPolicyId"` + + // The OCID of the attached zone. + ZoneId *string `mandatory:"false" json:"zoneId"` + + // The attached domain within the attached zone. + DomainName *string `mandatory:"false" json:"domainName"` + + // A user-friendly name for the steering policy attachment. + // Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The record types covered by the attachment at the domain. The set of record types is + // determined by aggregating the record types from the answers defined in the steering + // policy. + Rtypes []string `mandatory:"false" json:"rtypes"` + + // The OCID of the compartment containing the steering policy attachment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The canonical absolute URL of the resource. + Self *string `mandatory:"false" json:"self"` + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // The date and time the resource was created, expressed in RFC 3339 timestamp format. + // **Example:** `2016-07-22T17:23:59:60Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current state of the resource. + LifecycleState SteeringPolicyAttachmentSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m SteeringPolicyAttachmentSummary) String() string { + return common.PointerString(m) +} + +// SteeringPolicyAttachmentSummaryLifecycleStateEnum Enum with underlying type: string +type SteeringPolicyAttachmentSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SteeringPolicyAttachmentSummaryLifecycleStateEnum +const ( + SteeringPolicyAttachmentSummaryLifecycleStateCreating SteeringPolicyAttachmentSummaryLifecycleStateEnum = "CREATING" + SteeringPolicyAttachmentSummaryLifecycleStateActive SteeringPolicyAttachmentSummaryLifecycleStateEnum = "ACTIVE" + SteeringPolicyAttachmentSummaryLifecycleStateDeleting SteeringPolicyAttachmentSummaryLifecycleStateEnum = "DELETING" +) + +var mappingSteeringPolicyAttachmentSummaryLifecycleState = map[string]SteeringPolicyAttachmentSummaryLifecycleStateEnum{ + "CREATING": SteeringPolicyAttachmentSummaryLifecycleStateCreating, + "ACTIVE": SteeringPolicyAttachmentSummaryLifecycleStateActive, + "DELETING": SteeringPolicyAttachmentSummaryLifecycleStateDeleting, +} + +// GetSteeringPolicyAttachmentSummaryLifecycleStateEnumValues Enumerates the set of values for SteeringPolicyAttachmentSummaryLifecycleStateEnum +func GetSteeringPolicyAttachmentSummaryLifecycleStateEnumValues() []SteeringPolicyAttachmentSummaryLifecycleStateEnum { + values := make([]SteeringPolicyAttachmentSummaryLifecycleStateEnum, 0) + for _, v := range mappingSteeringPolicyAttachmentSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyFilterAnswerData The representation of SteeringPolicyFilterAnswerData +type SteeringPolicyFilterAnswerData struct { + + // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties. + AnswerCondition *string `mandatory:"false" json:"answerCondition"` + + // Keeps the answer only if the value is `true`. + ShouldKeep *bool `mandatory:"false" json:"shouldKeep"` +} + +func (m SteeringPolicyFilterAnswerData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyFilterRuleCase The representation of SteeringPolicyFilterRuleCase +type SteeringPolicyFilterRuleCase struct { + + // An expression that uses conditions at the time of a DNS query to indicate + // whether a case matches. Conditions may include the geographical location, IP + // subnet, or ASN the DNS query originated. **Example:** If you have an + // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition` + // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that + // matches queries from that office. + CaseCondition *string `mandatory:"false" json:"caseCondition"` + + // An array of `SteeringPolicyFilterAnswerData` objects. + AnswerData []SteeringPolicyFilterAnswerData `mandatory:"false" json:"answerData"` +} + +func (m SteeringPolicyFilterRuleCase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyFilterRule The representation of SteeringPolicyFilterRule +type SteeringPolicyFilterRule struct { + + // A user-defined description of the rule's purpose or behavior. + Description *string `mandatory:"false" json:"description"` + + // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate + // configurations for how it should behave during processing for any given DNS query. When a rule has + // no sequence of `cases`, it is always evaluated with the same configuration during processing. When + // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a + // non-empty sequence of `cases`, its behavior during processing is configured by the first matching + // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no + // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression + // evaluates to true for the given query. + Cases []SteeringPolicyFilterRuleCase `mandatory:"false" json:"cases"` + + // Defines a default set of answer conditions and values that are applied to an answer when + // `cases` is not defined for the rule, or a matching case does not have any matching + // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is + // defined and there are no matching cases. In this scenario, the next rule will be processed. + DefaultAnswerData []SteeringPolicyFilterAnswerData `mandatory:"false" json:"defaultAnswerData"` +} + +//GetDescription returns Description +func (m SteeringPolicyFilterRule) GetDescription() *string { + return m.Description +} + +func (m SteeringPolicyFilterRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m SteeringPolicyFilterRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSteeringPolicyFilterRule SteeringPolicyFilterRule + s := struct { + DiscriminatorParam string `json:"ruleType"` + MarshalTypeSteeringPolicyFilterRule + }{ + "FILTER", + (MarshalTypeSteeringPolicyFilterRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,224 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicy A DNS steering policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type SteeringPolicy struct { + + // The OCID of the compartment containing the steering policy. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // A user-friendly name for the steering policy. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The Time To Live (TTL) for responses from the steering policy, in seconds. + // If not specified during creation, a value of 30 seconds will be used. + Ttl *int `mandatory:"false" json:"ttl"` + + // The OCID of the health check monitor providing health data about the answers of the + // steering policy. A steering policy answer with `rdata` matching a monitored endpoint + // will use the health data of that endpoint. A steering policy answer with `rdata` not + // matching any monitored endpoint will be assumed healthy. + // + // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor + // must be created using the Health Checks service first. For more information on how to + // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm). + HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"` + + // A set of predefined rules based on the desired purpose of the steering policy. Each + // template utilizes Traffic Management's rules in a different order to produce the desired + // results when answering DNS queries. + // + // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers + // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`, + // and `LIMIT`. This gives the domain dynamic failover capability. + // + // It is **strongly recommended** to use a template other than `CUSTOM` when creating + // a steering policy. + // + // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps + // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined + // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`. + // The last rule of a template must must be a `LIMIT` rule. For more information about templates + // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). + // **Template Types** + // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers + // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed + // from the list of available answers until the endpoint is detected as healthy. + // + // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights. + // + // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic + // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm). + // + // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN. + // + // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address. + // + // * `CUSTOM` - Allows a customized configuration of rules. + Template SteeringPolicyTemplateEnum `mandatory:"false" json:"template,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The set of all answers that can potentially issue from the steering policy. + Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"` + + // The series of rules that will be processed in sequence to reduce the pool of answers + // to a response for any given request. + // + // The first rule receives a shuffled list of all answers, and every other rule receives + // the list of answers emitted by the one preceding it. The last rule populates the + // response. + Rules []SteeringPolicyRule `mandatory:"false" json:"rules"` + + // The canonical absolute URL of the resource. + Self *string `mandatory:"false" json:"self"` + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // The date and time the resource was created, expressed in RFC 3339 timestamp format. + // **Example:** `2016-07-22T17:23:59:60Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current state of the resource. + LifecycleState SteeringPolicyLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m SteeringPolicy) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *SteeringPolicy) UnmarshalJSON(data []byte) (e error) { + model := struct { + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Ttl *int `json:"ttl"` + HealthCheckMonitorId *string `json:"healthCheckMonitorId"` + Template SteeringPolicyTemplateEnum `json:"template"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Answers []SteeringPolicyAnswer `json:"answers"` + Rules []steeringpolicyrule `json:"rules"` + Self *string `json:"self"` + Id *string `json:"id"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState SteeringPolicyLifecycleStateEnum `json:"lifecycleState"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.CompartmentId = model.CompartmentId + m.DisplayName = model.DisplayName + m.Ttl = model.Ttl + m.HealthCheckMonitorId = model.HealthCheckMonitorId + m.Template = model.Template + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + m.Answers = make([]SteeringPolicyAnswer, len(model.Answers)) + for i, n := range model.Answers { + m.Answers[i] = n + } + m.Rules = make([]SteeringPolicyRule, len(model.Rules)) + for i, n := range model.Rules { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Rules[i] = nn.(SteeringPolicyRule) + } else { + m.Rules[i] = nil + } + } + m.Self = model.Self + m.Id = model.Id + m.TimeCreated = model.TimeCreated + m.LifecycleState = model.LifecycleState + return +} + +// SteeringPolicyTemplateEnum Enum with underlying type: string +type SteeringPolicyTemplateEnum string + +// Set of constants representing the allowable values for SteeringPolicyTemplateEnum +const ( + SteeringPolicyTemplateFailover SteeringPolicyTemplateEnum = "FAILOVER" + SteeringPolicyTemplateLoadBalance SteeringPolicyTemplateEnum = "LOAD_BALANCE" + SteeringPolicyTemplateRouteByGeo SteeringPolicyTemplateEnum = "ROUTE_BY_GEO" + SteeringPolicyTemplateRouteByAsn SteeringPolicyTemplateEnum = "ROUTE_BY_ASN" + SteeringPolicyTemplateRouteByIp SteeringPolicyTemplateEnum = "ROUTE_BY_IP" + SteeringPolicyTemplateCustom SteeringPolicyTemplateEnum = "CUSTOM" +) + +var mappingSteeringPolicyTemplate = map[string]SteeringPolicyTemplateEnum{ + "FAILOVER": SteeringPolicyTemplateFailover, + "LOAD_BALANCE": SteeringPolicyTemplateLoadBalance, + "ROUTE_BY_GEO": SteeringPolicyTemplateRouteByGeo, + "ROUTE_BY_ASN": SteeringPolicyTemplateRouteByAsn, + "ROUTE_BY_IP": SteeringPolicyTemplateRouteByIp, + "CUSTOM": SteeringPolicyTemplateCustom, +} + +// GetSteeringPolicyTemplateEnumValues Enumerates the set of values for SteeringPolicyTemplateEnum +func GetSteeringPolicyTemplateEnumValues() []SteeringPolicyTemplateEnum { + values := make([]SteeringPolicyTemplateEnum, 0) + for _, v := range mappingSteeringPolicyTemplate { + values = append(values, v) + } + return values +} + +// SteeringPolicyLifecycleStateEnum Enum with underlying type: string +type SteeringPolicyLifecycleStateEnum string + +// Set of constants representing the allowable values for SteeringPolicyLifecycleStateEnum +const ( + SteeringPolicyLifecycleStateActive SteeringPolicyLifecycleStateEnum = "ACTIVE" + SteeringPolicyLifecycleStateCreating SteeringPolicyLifecycleStateEnum = "CREATING" + SteeringPolicyLifecycleStateDeleted SteeringPolicyLifecycleStateEnum = "DELETED" + SteeringPolicyLifecycleStateDeleting SteeringPolicyLifecycleStateEnum = "DELETING" +) + +var mappingSteeringPolicyLifecycleState = map[string]SteeringPolicyLifecycleStateEnum{ + "ACTIVE": SteeringPolicyLifecycleStateActive, + "CREATING": SteeringPolicyLifecycleStateCreating, + "DELETED": SteeringPolicyLifecycleStateDeleted, + "DELETING": SteeringPolicyLifecycleStateDeleting, +} + +// GetSteeringPolicyLifecycleStateEnumValues Enumerates the set of values for SteeringPolicyLifecycleStateEnum +func GetSteeringPolicyLifecycleStateEnumValues() []SteeringPolicyLifecycleStateEnum { + values := make([]SteeringPolicyLifecycleStateEnum, 0) + for _, v := range mappingSteeringPolicyLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyHealthRuleCase The representation of SteeringPolicyHealthRuleCase +type SteeringPolicyHealthRuleCase struct { + + // An expression that uses conditions at the time of a DNS query to indicate + // whether a case matches. Conditions may include the geographical location, IP + // subnet, or ASN the DNS query originated. **Example:** If you have an + // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition` + // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that + // matches queries from that office. + CaseCondition *string `mandatory:"false" json:"caseCondition"` +} + +func (m SteeringPolicyHealthRuleCase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyHealthRule The representation of SteeringPolicyHealthRule +type SteeringPolicyHealthRule struct { + + // A user-defined description of the rule's purpose or behavior. + Description *string `mandatory:"false" json:"description"` + + // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate + // configurations for how it should behave during processing for any given DNS query. When a rule has + // no sequence of `cases`, it is always evaluated with the same configuration during processing. When + // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a + // non-empty sequence of `cases`, its behavior during processing is configured by the first matching + // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no + // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression + // evaluates to true for the given query. + Cases []SteeringPolicyHealthRuleCase `mandatory:"false" json:"cases"` +} + +//GetDescription returns Description +func (m SteeringPolicyHealthRule) GetDescription() *string { + return m.Description +} + +func (m SteeringPolicyHealthRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m SteeringPolicyHealthRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSteeringPolicyHealthRule SteeringPolicyHealthRule + s := struct { + DiscriminatorParam string `json:"ruleType"` + MarshalTypeSteeringPolicyHealthRule + }{ + "HEALTH", + (MarshalTypeSteeringPolicyHealthRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyLimitRuleCase The representation of SteeringPolicyLimitRuleCase +type SteeringPolicyLimitRuleCase struct { + + // The number of answers allowed to remain after the limit rule has been processed, keeping only the + // first of the remaining answers in the list. Example: If the `count` property is set to `2` and + // four answers remain before the limit rule is processed, only the first two answers in the list will + // remain after the limit rule has been processed. + Count *int `mandatory:"true" json:"count"` + + // An expression that uses conditions at the time of a DNS query to indicate + // whether a case matches. Conditions may include the geographical location, IP + // subnet, or ASN the DNS query originated. **Example:** If you have an + // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition` + // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that + // matches queries from that office. + CaseCondition *string `mandatory:"false" json:"caseCondition"` +} + +func (m SteeringPolicyLimitRuleCase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyLimitRule The representation of SteeringPolicyLimitRule +type SteeringPolicyLimitRule struct { + + // A user-defined description of the rule's purpose or behavior. + Description *string `mandatory:"false" json:"description"` + + // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate + // configurations for how it should behave during processing for any given DNS query. When a rule has + // no sequence of `cases`, it is always evaluated with the same configuration during processing. When + // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a + // non-empty sequence of `cases`, its behavior during processing is configured by the first matching + // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no + // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression + // evaluates to true for the given query. + Cases []SteeringPolicyLimitRuleCase `mandatory:"false" json:"cases"` + + // Defines a default count if `cases` is not defined for the rule or a matching case does + // not define `count`. `defaultCount` is **not** applied if `cases` is defined and there + // are no matching cases. In this scenario, the next rule will be processed. If no rules + // remain to be processed, the answer will be chosen from the remaining list of answers. + DefaultCount *int `mandatory:"false" json:"defaultCount"` +} + +//GetDescription returns Description +func (m SteeringPolicyLimitRule) GetDescription() *string { + return m.Description +} + +func (m SteeringPolicyLimitRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m SteeringPolicyLimitRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSteeringPolicyLimitRule SteeringPolicyLimitRule + s := struct { + DiscriminatorParam string `json:"ruleType"` + MarshalTypeSteeringPolicyLimitRule + }{ + "LIMIT", + (MarshalTypeSteeringPolicyLimitRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyPriorityAnswerData The representation of SteeringPolicyPriorityAnswerData +type SteeringPolicyPriorityAnswerData struct { + + // The rank assigned to the set of answers that match the expression in `answerCondition`. + // Answers with the lowest values move to the beginning of the list without changing the + // relative order of those with the same value. Answers can be given a value between `0` and `255`. + Value *int `mandatory:"true" json:"value"` + + // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties. + AnswerCondition *string `mandatory:"false" json:"answerCondition"` +} + +func (m SteeringPolicyPriorityAnswerData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyPriorityRuleCase The representation of SteeringPolicyPriorityRuleCase +type SteeringPolicyPriorityRuleCase struct { + + // An expression that uses conditions at the time of a DNS query to indicate + // whether a case matches. Conditions may include the geographical location, IP + // subnet, or ASN the DNS query originated. **Example:** If you have an + // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition` + // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that + // matches queries from that office. + CaseCondition *string `mandatory:"false" json:"caseCondition"` + + // An array of `SteeringPolicyPriorityAnswerData` objects. + AnswerData []SteeringPolicyPriorityAnswerData `mandatory:"false" json:"answerData"` +} + +func (m SteeringPolicyPriorityRuleCase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyPriorityRule The representation of SteeringPolicyPriorityRule +type SteeringPolicyPriorityRule struct { + + // A user-defined description of the rule's purpose or behavior. + Description *string `mandatory:"false" json:"description"` + + // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate + // configurations for how it should behave during processing for any given DNS query. When a rule has + // no sequence of `cases`, it is always evaluated with the same configuration during processing. When + // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a + // non-empty sequence of `cases`, its behavior during processing is configured by the first matching + // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no + // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression + // evaluates to true for the given query. + Cases []SteeringPolicyPriorityRuleCase `mandatory:"false" json:"cases"` + + // Defines a default set of answer conditions and values that are applied to an answer when + // `cases` is not defined for the rule or a matching case does not have any matching + // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is + // defined and there are no matching cases. In this scenario, the next rule will be processed. + DefaultAnswerData []SteeringPolicyPriorityAnswerData `mandatory:"false" json:"defaultAnswerData"` +} + +//GetDescription returns Description +func (m SteeringPolicyPriorityRule) GetDescription() *string { + return m.Description +} + +func (m SteeringPolicyPriorityRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m SteeringPolicyPriorityRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSteeringPolicyPriorityRule SteeringPolicyPriorityRule + s := struct { + DiscriminatorParam string `json:"ruleType"` + MarshalTypeSteeringPolicyPriorityRule + }{ + "PRIORITY", + (MarshalTypeSteeringPolicyPriorityRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyRule The configuration of the sorting and filtering behaviors in a steering policy. Rules can +// filter and sort answers based on weight, priority, endpoint health, and other data. +// +// A rule may optionally include a sequence of cases, each with an optional `caseCondition` +// expression. Cases allow a sequence of conditions to be defined that will apply different +// parameters to the rule when the conditions are met. For more information about cases, +// see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). +// +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type SteeringPolicyRule interface { + + // A user-defined description of the rule's purpose or behavior. + GetDescription() *string +} + +type steeringpolicyrule struct { + JsonData []byte + Description *string `mandatory:"false" json:"description"` + RuleType string `json:"ruleType"` +} + +// UnmarshalJSON unmarshals json +func (m *steeringpolicyrule) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersteeringpolicyrule steeringpolicyrule + s := struct { + Model Unmarshalersteeringpolicyrule + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Description = s.Model.Description + m.RuleType = s.Model.RuleType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *steeringpolicyrule) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.RuleType { + case "FILTER": + mm := SteeringPolicyFilterRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "WEIGHTED": + mm := SteeringPolicyWeightedRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "LIMIT": + mm := SteeringPolicyLimitRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "HEALTH": + mm := SteeringPolicyHealthRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "PRIORITY": + mm := SteeringPolicyPriorityRule{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetDescription returns Description +func (m steeringpolicyrule) GetDescription() *string { + return m.Description +} + +func (m steeringpolicyrule) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,160 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicySummary A DNS steering policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type SteeringPolicySummary struct { + + // The OCID of the compartment containing the steering policy. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // A user-friendly name for the steering policy. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The Time To Live (TTL) for responses from the steering policy, in seconds. + // If not specified during creation, a value of 30 seconds will be used. + Ttl *int `mandatory:"false" json:"ttl"` + + // The OCID of the health check monitor providing health data about the answers of the + // steering policy. A steering policy answer with `rdata` matching a monitored endpoint + // will use the health data of that endpoint. A steering policy answer with `rdata` not + // matching any monitored endpoint will be assumed healthy. + // + // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor + // must be created using the Health Checks service first. For more information on how to + // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm). + HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"` + + // A set of predefined rules based on the desired purpose of the steering policy. Each + // template utilizes Traffic Management's rules in a different order to produce the desired + // results when answering DNS queries. + // + // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers + // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`, + // and `LIMIT`. This gives the domain dynamic failover capability. + // + // It is **strongly recommended** to use a template other than `CUSTOM` when creating + // a steering policy. + // + // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps + // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined + // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`. + // The last rule of a template must must be a `LIMIT` rule. For more information about templates + // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). + // **Template Types** + // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers + // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed + // from the list of available answers until the endpoint is detected as healthy. + // + // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights. + // + // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic + // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm). + // + // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN. + // + // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address. + // + // * `CUSTOM` - Allows a customized configuration of rules. + Template SteeringPolicySummaryTemplateEnum `mandatory:"false" json:"template,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The canonical absolute URL of the resource. + Self *string `mandatory:"false" json:"self"` + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // The date and time the resource was created, expressed in RFC 3339 timestamp format. + // **Example:** `2016-07-22T17:23:59:60Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current state of the resource. + LifecycleState SteeringPolicySummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m SteeringPolicySummary) String() string { + return common.PointerString(m) +} + +// SteeringPolicySummaryTemplateEnum Enum with underlying type: string +type SteeringPolicySummaryTemplateEnum string + +// Set of constants representing the allowable values for SteeringPolicySummaryTemplateEnum +const ( + SteeringPolicySummaryTemplateFailover SteeringPolicySummaryTemplateEnum = "FAILOVER" + SteeringPolicySummaryTemplateLoadBalance SteeringPolicySummaryTemplateEnum = "LOAD_BALANCE" + SteeringPolicySummaryTemplateRouteByGeo SteeringPolicySummaryTemplateEnum = "ROUTE_BY_GEO" + SteeringPolicySummaryTemplateRouteByAsn SteeringPolicySummaryTemplateEnum = "ROUTE_BY_ASN" + SteeringPolicySummaryTemplateRouteByIp SteeringPolicySummaryTemplateEnum = "ROUTE_BY_IP" + SteeringPolicySummaryTemplateCustom SteeringPolicySummaryTemplateEnum = "CUSTOM" +) + +var mappingSteeringPolicySummaryTemplate = map[string]SteeringPolicySummaryTemplateEnum{ + "FAILOVER": SteeringPolicySummaryTemplateFailover, + "LOAD_BALANCE": SteeringPolicySummaryTemplateLoadBalance, + "ROUTE_BY_GEO": SteeringPolicySummaryTemplateRouteByGeo, + "ROUTE_BY_ASN": SteeringPolicySummaryTemplateRouteByAsn, + "ROUTE_BY_IP": SteeringPolicySummaryTemplateRouteByIp, + "CUSTOM": SteeringPolicySummaryTemplateCustom, +} + +// GetSteeringPolicySummaryTemplateEnumValues Enumerates the set of values for SteeringPolicySummaryTemplateEnum +func GetSteeringPolicySummaryTemplateEnumValues() []SteeringPolicySummaryTemplateEnum { + values := make([]SteeringPolicySummaryTemplateEnum, 0) + for _, v := range mappingSteeringPolicySummaryTemplate { + values = append(values, v) + } + return values +} + +// SteeringPolicySummaryLifecycleStateEnum Enum with underlying type: string +type SteeringPolicySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SteeringPolicySummaryLifecycleStateEnum +const ( + SteeringPolicySummaryLifecycleStateActive SteeringPolicySummaryLifecycleStateEnum = "ACTIVE" + SteeringPolicySummaryLifecycleStateCreating SteeringPolicySummaryLifecycleStateEnum = "CREATING" + SteeringPolicySummaryLifecycleStateDeleted SteeringPolicySummaryLifecycleStateEnum = "DELETED" + SteeringPolicySummaryLifecycleStateDeleting SteeringPolicySummaryLifecycleStateEnum = "DELETING" +) + +var mappingSteeringPolicySummaryLifecycleState = map[string]SteeringPolicySummaryLifecycleStateEnum{ + "ACTIVE": SteeringPolicySummaryLifecycleStateActive, + "CREATING": SteeringPolicySummaryLifecycleStateCreating, + "DELETED": SteeringPolicySummaryLifecycleStateDeleted, + "DELETING": SteeringPolicySummaryLifecycleStateDeleting, +} + +// GetSteeringPolicySummaryLifecycleStateEnumValues Enumerates the set of values for SteeringPolicySummaryLifecycleStateEnum +func GetSteeringPolicySummaryLifecycleStateEnumValues() []SteeringPolicySummaryLifecycleStateEnum { + values := make([]SteeringPolicySummaryLifecycleStateEnum, 0) + for _, v := range mappingSteeringPolicySummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyWeightedAnswerData The representation of SteeringPolicyWeightedAnswerData +type SteeringPolicyWeightedAnswerData struct { + + // The weight assigned to the set of selected answers. Answers with a higher weight will be served + // more frequently. Answers can be given a value between `0` and `255`. + Value *int `mandatory:"true" json:"value"` + + // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties. + AnswerCondition *string `mandatory:"false" json:"answerCondition"` +} + +func (m SteeringPolicyWeightedAnswerData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyWeightedRuleCase The representation of SteeringPolicyWeightedRuleCase +type SteeringPolicyWeightedRuleCase struct { + + // An expression that uses conditions at the time of a DNS query to indicate + // whether a case matches. Conditions may include the geographical location, IP + // subnet, or ASN the DNS query originated. **Example:** If you have an + // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition` + // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that + // matches queries from that office. + CaseCondition *string `mandatory:"false" json:"caseCondition"` + + // An array of `SteeringPolicyWeightedAnswerData` objects. + AnswerData []SteeringPolicyWeightedAnswerData `mandatory:"false" json:"answerData"` +} + +func (m SteeringPolicyWeightedRuleCase) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SteeringPolicyWeightedRule The representation of SteeringPolicyWeightedRule +type SteeringPolicyWeightedRule struct { + + // A user-defined description of the rule's purpose or behavior. + Description *string `mandatory:"false" json:"description"` + + // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate + // configurations for how it should behave during processing for any given DNS query. When a rule has + // no sequence of `cases`, it is always evaluated with the same configuration during processing. When + // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a + // non-empty sequence of `cases`, its behavior during processing is configured by the first matching + // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no + // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression + // evaluates to true for the given query. + Cases []SteeringPolicyWeightedRuleCase `mandatory:"false" json:"cases"` + + // Defines a default set of answer conditions and values that are applied to an answer when + // `cases` is not defined for the rule or a matching case does not have any matching + // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is + // defined and there are no matching cases. In this scenario, the next rule will be processed. + DefaultAnswerData []SteeringPolicyWeightedAnswerData `mandatory:"false" json:"defaultAnswerData"` +} + +//GetDescription returns Description +func (m SteeringPolicyWeightedRule) GetDescription() *string { + return m.Description +} + +func (m SteeringPolicyWeightedRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m SteeringPolicyWeightedRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeSteeringPolicyWeightedRule SteeringPolicyWeightedRule + s := struct { + DiscriminatorParam string `json:"ruleType"` + MarshalTypeSteeringPolicyWeightedRule + }{ + "WEIGHTED", + (MarshalTypeSteeringPolicyWeightedRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -22,8 +23,9 @@ Secret *string `mandatory:"true" json:"secret"` // TSIG Algorithms are encoded as domain names, but most consist of only one - // non-empty label, which is not required to be explicitly absolute. For a - // full list of TSIG algorithms, see Secret Key Transaction Authentication for DNS (TSIG) Algorithm Names (http://www.iana.org/assignments/tsig-algorithm-names/tsig-algorithm-names.xhtml#tsig-algorithm-names-1) + // non-empty label, which is not required to be explicitly absolute. + // Applicable algorithms include: hmac-sha1, hmac-sha224, hmac-sha256, + // hmac-sha512. For more information on these algorithms, see RFC 4635 (https://tools.ietf.org/html/rfc4635#section-2). Algorithm *string `mandatory:"true" json:"algorithm"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -36,12 +36,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDomainRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDomainRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDomainRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDomainRecordsResponse wrapper for the UpdateDomainRecords operation type UpdateDomainRecordsResponse struct { @@ -51,10 +69,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -74,3 +91,8 @@ func (response UpdateDomainRecordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDomainRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -39,12 +39,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateRRSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateRRSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateRRSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateRRSetResponse wrapper for the UpdateRRSet operation type UpdateRRSetResponse struct { @@ -54,10 +72,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -77,3 +94,8 @@ func (response UpdateRRSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateRRSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateSteeringPolicyAttachmentDetails The body for updating a steering policy attachment. +// +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateSteeringPolicyAttachmentDetails struct { + + // A user-friendly name for the steering policy attachment. + // Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m UpdateSteeringPolicyAttachmentDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateSteeringPolicyAttachmentRequest wrapper for the UpdateSteeringPolicyAttachment operation +type UpdateSteeringPolicyAttachmentRequest struct { + + // The OCID of the target steering policy attachment. + SteeringPolicyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyAttachmentId"` + + // New data for the steering policy attachment. + UpdateSteeringPolicyAttachmentDetails `contributesTo:"body"` + + // The `If-Match` header field makes the request method conditional on the + // existence of at least one current representation of the target resource, + // when the field-value is `*`, or having a current representation of the + // target resource that has an entity-tag matching a member of the list of + // entity-tags provided in the field-value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"` + + // The `If-Unmodified-Since` header field makes the request method + // conditional on the selected representation's last modification date being + // earlier than or equal to the date provided in the field-value. This + // field accomplishes the same purpose as If-Match for cases where the user + // agent does not have an entity-tag for the representation. + IfUnmodifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Unmodified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSteeringPolicyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSteeringPolicyAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSteeringPolicyAttachmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateSteeringPolicyAttachmentResponse wrapper for the UpdateSteeringPolicyAttachment operation +type UpdateSteeringPolicyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicyAttachment instance + SteeringPolicyAttachment `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateSteeringPolicyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSteeringPolicyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,173 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateSteeringPolicyDetails The body for updating a steering policy. New rules and answers provided in the request will +// replace the existing rules and answers in the policy. +// +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateSteeringPolicyDetails struct { + + // A user-friendly name for the steering policy. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The Time To Live (TTL) for responses from the steering policy, in seconds. + // If not specified during creation, a value of 30 seconds will be used. + Ttl *int `mandatory:"false" json:"ttl"` + + // The OCID of the health check monitor providing health data about the answers of the + // steering policy. A steering policy answer with `rdata` matching a monitored endpoint + // will use the health data of that endpoint. A steering policy answer with `rdata` not + // matching any monitored endpoint will be assumed healthy. + // + // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor + // must be created using the Health Checks service first. For more information on how to + // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm). + HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"` + + // A set of predefined rules based on the desired purpose of the steering policy. Each + // template utilizes Traffic Management's rules in a different order to produce the desired + // results when answering DNS queries. + // + // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers + // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`, + // and `LIMIT`. This gives the domain dynamic failover capability. + // + // It is **strongly recommended** to use a template other than `CUSTOM` when creating + // a steering policy. + // + // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps + // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined + // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`. + // The last rule of a template must must be a `LIMIT` rule. For more information about templates + // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm). + // **Template Types** + // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers + // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed + // from the list of available answers until the endpoint is detected as healthy. + // + // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights. + // + // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic + // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm). + // + // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN. + // + // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address. + // + // * `CUSTOM` - Allows a customized configuration of rules. + Template UpdateSteeringPolicyDetailsTemplateEnum `mandatory:"false" json:"template,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The set of all answers that can potentially issue from the steering policy. + Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"` + + // The series of rules that will be processed in sequence to reduce the pool of answers + // to a response for any given request. + // + // The first rule receives a shuffled list of all answers, and every other rule receives + // the list of answers emitted by the one preceding it. The last rule populates the + // response. + Rules []SteeringPolicyRule `mandatory:"false" json:"rules"` +} + +func (m UpdateSteeringPolicyDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateSteeringPolicyDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Ttl *int `json:"ttl"` + HealthCheckMonitorId *string `json:"healthCheckMonitorId"` + Template UpdateSteeringPolicyDetailsTemplateEnum `json:"template"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Answers []SteeringPolicyAnswer `json:"answers"` + Rules []steeringpolicyrule `json:"rules"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DisplayName = model.DisplayName + m.Ttl = model.Ttl + m.HealthCheckMonitorId = model.HealthCheckMonitorId + m.Template = model.Template + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + m.Answers = make([]SteeringPolicyAnswer, len(model.Answers)) + for i, n := range model.Answers { + m.Answers[i] = n + } + m.Rules = make([]SteeringPolicyRule, len(model.Rules)) + for i, n := range model.Rules { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Rules[i] = nn.(SteeringPolicyRule) + } else { + m.Rules[i] = nil + } + } + return +} + +// UpdateSteeringPolicyDetailsTemplateEnum Enum with underlying type: string +type UpdateSteeringPolicyDetailsTemplateEnum string + +// Set of constants representing the allowable values for UpdateSteeringPolicyDetailsTemplateEnum +const ( + UpdateSteeringPolicyDetailsTemplateFailover UpdateSteeringPolicyDetailsTemplateEnum = "FAILOVER" + UpdateSteeringPolicyDetailsTemplateLoadBalance UpdateSteeringPolicyDetailsTemplateEnum = "LOAD_BALANCE" + UpdateSteeringPolicyDetailsTemplateRouteByGeo UpdateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_GEO" + UpdateSteeringPolicyDetailsTemplateRouteByAsn UpdateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_ASN" + UpdateSteeringPolicyDetailsTemplateRouteByIp UpdateSteeringPolicyDetailsTemplateEnum = "ROUTE_BY_IP" + UpdateSteeringPolicyDetailsTemplateCustom UpdateSteeringPolicyDetailsTemplateEnum = "CUSTOM" +) + +var mappingUpdateSteeringPolicyDetailsTemplate = map[string]UpdateSteeringPolicyDetailsTemplateEnum{ + "FAILOVER": UpdateSteeringPolicyDetailsTemplateFailover, + "LOAD_BALANCE": UpdateSteeringPolicyDetailsTemplateLoadBalance, + "ROUTE_BY_GEO": UpdateSteeringPolicyDetailsTemplateRouteByGeo, + "ROUTE_BY_ASN": UpdateSteeringPolicyDetailsTemplateRouteByAsn, + "ROUTE_BY_IP": UpdateSteeringPolicyDetailsTemplateRouteByIp, + "CUSTOM": UpdateSteeringPolicyDetailsTemplateCustom, +} + +// GetUpdateSteeringPolicyDetailsTemplateEnumValues Enumerates the set of values for UpdateSteeringPolicyDetailsTemplateEnum +func GetUpdateSteeringPolicyDetailsTemplateEnumValues() []UpdateSteeringPolicyDetailsTemplateEnum { + values := make([]UpdateSteeringPolicyDetailsTemplateEnum, 0) + for _, v := range mappingUpdateSteeringPolicyDetailsTemplate { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package dns + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateSteeringPolicyRequest wrapper for the UpdateSteeringPolicy operation +type UpdateSteeringPolicyRequest struct { + + // The OCID of the target steering policy. + SteeringPolicyId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyId"` + + // New data for the steering policy. + UpdateSteeringPolicyDetails `contributesTo:"body"` + + // The `If-Match` header field makes the request method conditional on the + // existence of at least one current representation of the target resource, + // when the field-value is `*`, or having a current representation of the + // target resource that has an entity-tag matching a member of the list of + // entity-tags provided in the field-value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"` + + // The `If-Unmodified-Since` header field makes the request method + // conditional on the selected representation's last modification date being + // earlier than or equal to the date provided in the field-value. This + // field accomplishes the same purpose as If-Match for cases where the user + // agent does not have an entity-tag for the representation. + IfUnmodifiedSince *string `mandatory:"false" contributesTo:"header" name:"If-Unmodified-Since"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSteeringPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSteeringPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSteeringPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateSteeringPolicyResponse wrapper for the UpdateSteeringPolicy operation +type UpdateSteeringPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SteeringPolicy instance + SteeringPolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide the request + // ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateSteeringPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSteeringPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -13,9 +14,23 @@ ) // UpdateZoneDetails The body for updating a zone. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type UpdateZoneDetails struct { - // External master servers for the zone. + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // External master servers for the zone. `externalMasters` becomes a + // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"false" json:"externalMasters"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -33,12 +33,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateZoneRecordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateZoneRecordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateZoneRecordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateZoneRecordsResponse wrapper for the UpdateZoneRecords operation type UpdateZoneRecordsResponse struct { @@ -48,10 +66,9 @@ // The RecordCollection instance RecordCollection `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if - // this header appears in the response, then a partial list might have - // been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // The total number of items that match the query. @@ -71,3 +88,8 @@ func (response UpdateZoneRecordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateZoneRecordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns @@ -33,12 +33,30 @@ // The OCID of the compartment the resource belongs to. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateZoneRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateZoneRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateZoneRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateZoneResponse wrapper for the UpdateZone operation type UpdateZoneResponse struct { @@ -61,3 +79,8 @@ func (response UpdateZoneResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateZoneResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -13,6 +14,7 @@ ) // Zone A DNS zone. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type Zone struct { // The name of the zone. @@ -24,7 +26,20 @@ // The OCID of the compartment containing the zone. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // External master servers for the zone. + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // External master servers for the zone. `externalMasters` becomes a + // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"false" json:"externalMasters"` // The canonical absolute URL of the resource. @@ -33,7 +48,7 @@ // The OCID of the zone. Id *string `mandatory:"false" json:"id"` - // The date and time the image was created in "YYYY-MM-ddThh:mmZ" format + // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format // with a Z offset, as defined by RFC 3339. // **Example:** `2016-07-22T17:23:59:60Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -44,10 +59,13 @@ Version *string `mandatory:"false" json:"version"` // The current serial of the zone. As seen in the zone's SOA record. - Serial *int `mandatory:"false" json:"serial"` + Serial *int64 `mandatory:"false" json:"serial"` // The current state of the zone resource. LifecycleState ZoneLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The authoritative nameservers for the zone. + Nameservers []Nameserver `mandatory:"false" json:"nameservers"` } func (m Zone) String() string { @@ -57,7 +75,7 @@ // ZoneZoneTypeEnum Enum with underlying type: string type ZoneZoneTypeEnum string -// Set of constants representing the allowable values for ZoneZoneType +// Set of constants representing the allowable values for ZoneZoneTypeEnum const ( ZoneZoneTypePrimary ZoneZoneTypeEnum = "PRIMARY" ZoneZoneTypeSecondary ZoneZoneTypeEnum = "SECONDARY" @@ -68,7 +86,7 @@ "SECONDARY": ZoneZoneTypeSecondary, } -// GetZoneZoneTypeEnumValues Enumerates the set of values for ZoneZoneType +// GetZoneZoneTypeEnumValues Enumerates the set of values for ZoneZoneTypeEnum func GetZoneZoneTypeEnumValues() []ZoneZoneTypeEnum { values := make([]ZoneZoneTypeEnum, 0) for _, v := range mappingZoneZoneType { @@ -80,7 +98,7 @@ // ZoneLifecycleStateEnum Enum with underlying type: string type ZoneLifecycleStateEnum string -// Set of constants representing the allowable values for ZoneLifecycleState +// Set of constants representing the allowable values for ZoneLifecycleStateEnum const ( ZoneLifecycleStateActive ZoneLifecycleStateEnum = "ACTIVE" ZoneLifecycleStateCreating ZoneLifecycleStateEnum = "CREATING" @@ -97,7 +115,7 @@ "FAILED": ZoneLifecycleStateFailed, } -// GetZoneLifecycleStateEnumValues Enumerates the set of values for ZoneLifecycleState +// GetZoneLifecycleStateEnumValues Enumerates the set of values for ZoneLifecycleStateEnum func GetZoneLifecycleStateEnumValues() []ZoneLifecycleStateEnum { values := make([]ZoneLifecycleStateEnum, 0) for _, v := range mappingZoneLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Public DNS Service +// DNS API // -// API for managing DNS zones, records, and policies. +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). // package dns @@ -13,6 +14,7 @@ ) // ZoneSummary A DNS zone. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type ZoneSummary struct { // The name of the zone. @@ -24,13 +26,25 @@ // The OCID of the compartment containing the zone. CompartmentId *string `mandatory:"false" json:"compartmentId"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // + // **Example:** `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // The canonical absolute URL of the resource. Self *string `mandatory:"false" json:"self"` // The OCID of the zone. Id *string `mandatory:"false" json:"id"` - // The date and time the image was created in "YYYY-MM-ddThh:mmZ" format + // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format // with a Z offset, as defined by RFC 3339. // **Example:** `2016-07-22T17:23:59:60Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -41,7 +55,10 @@ Version *string `mandatory:"false" json:"version"` // The current serial of the zone. As seen in the zone's SOA record. - Serial *int `mandatory:"false" json:"serial"` + Serial *int64 `mandatory:"false" json:"serial"` + + // The current state of the zone resource. + LifecycleState ZoneSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` } func (m ZoneSummary) String() string { @@ -51,7 +68,7 @@ // ZoneSummaryZoneTypeEnum Enum with underlying type: string type ZoneSummaryZoneTypeEnum string -// Set of constants representing the allowable values for ZoneSummaryZoneType +// Set of constants representing the allowable values for ZoneSummaryZoneTypeEnum const ( ZoneSummaryZoneTypePrimary ZoneSummaryZoneTypeEnum = "PRIMARY" ZoneSummaryZoneTypeSecondary ZoneSummaryZoneTypeEnum = "SECONDARY" @@ -62,11 +79,40 @@ "SECONDARY": ZoneSummaryZoneTypeSecondary, } -// GetZoneSummaryZoneTypeEnumValues Enumerates the set of values for ZoneSummaryZoneType +// GetZoneSummaryZoneTypeEnumValues Enumerates the set of values for ZoneSummaryZoneTypeEnum func GetZoneSummaryZoneTypeEnumValues() []ZoneSummaryZoneTypeEnum { values := make([]ZoneSummaryZoneTypeEnum, 0) for _, v := range mappingZoneSummaryZoneType { values = append(values, v) } return values +} + +// ZoneSummaryLifecycleStateEnum Enum with underlying type: string +type ZoneSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ZoneSummaryLifecycleStateEnum +const ( + ZoneSummaryLifecycleStateActive ZoneSummaryLifecycleStateEnum = "ACTIVE" + ZoneSummaryLifecycleStateCreating ZoneSummaryLifecycleStateEnum = "CREATING" + ZoneSummaryLifecycleStateDeleted ZoneSummaryLifecycleStateEnum = "DELETED" + ZoneSummaryLifecycleStateDeleting ZoneSummaryLifecycleStateEnum = "DELETING" + ZoneSummaryLifecycleStateFailed ZoneSummaryLifecycleStateEnum = "FAILED" +) + +var mappingZoneSummaryLifecycleState = map[string]ZoneSummaryLifecycleStateEnum{ + "ACTIVE": ZoneSummaryLifecycleStateActive, + "CREATING": ZoneSummaryLifecycleStateCreating, + "DELETED": ZoneSummaryLifecycleStateDeleted, + "DELETING": ZoneSummaryLifecycleStateDeleting, + "FAILED": ZoneSummaryLifecycleStateFailed, +} + +// GetZoneSummaryLifecycleStateEnumValues Enumerates the set of values for ZoneSummaryLifecycleStateEnum +func GetZoneSummaryLifecycleStateEnumValues() []ZoneSummaryLifecycleStateEnum { + values := make([]ZoneSummaryLifecycleStateEnum, 0) + for _, v := range mappingZoneSummaryLifecycleState { + values = append(values, v) + } + return values } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -16,10 +17,20 @@ type CreateSenderDetails struct { // The OCID of the compartment that contains the sender. - CompartmentId *string `mandatory:"false" json:"compartmentId"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` // The email address of the sender. - EmailAddress *string `mandatory:"false" json:"emailAddress"` + EmailAddress *string `mandatory:"true" json:"emailAddress"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateSenderDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_sender_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,29 @@ // Create a sender. CreateSenderDetails `contributesTo:"body"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSenderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSenderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSenderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSenderResponse wrapper for the CreateSender operation type CreateSenderResponse struct { @@ -32,8 +49,16 @@ // to contact Oracle about a particular request, please provide the // request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` } func (response CreateSenderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSenderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -18,10 +19,10 @@ // The OCID of the compartment to contain the suppression. Since // suppressions are at the customer level, this must be the tenancy // OCID. - CompartmentId *string `mandatory:"false" json:"compartmentId"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` // The recipient email address of the suppression. - EmailAddress *string `mandatory:"false" json:"emailAddress"` + EmailAddress *string `mandatory:"true" json:"emailAddress"` } func (m CreateSuppressionDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/create_suppression_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,29 @@ // Adds a single email address to the suppression list for a compartment's tenancy. CreateSuppressionDetails `contributesTo:"body"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSuppressionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSuppressionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSuppressionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSuppressionResponse wrapper for the CreateSuppression operation type CreateSuppressionResponse struct { @@ -35,3 +52,8 @@ func (response CreateSuppressionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSuppressionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_sender_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_sender_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_sender_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_sender_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,34 @@ // The unique OCID of the sender. SenderId *string `mandatory:"true" contributesTo:"path" name:"senderId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSenderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSenderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSenderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSenderResponse wrapper for the DeleteSender operation type DeleteSenderResponse struct { @@ -34,3 +56,8 @@ func (response DeleteSenderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSenderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_suppression_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_suppression_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_suppression_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/delete_suppression_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,29 @@ // The unique OCID of the suppression. SuppressionId *string `mandatory:"true" contributesTo:"path" name:"suppressionId"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSuppressionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSuppressionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSuppressionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSuppressionResponse wrapper for the DeleteSuppression operation type DeleteSuppressionResponse struct { @@ -34,3 +51,8 @@ func (response DeleteSuppressionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSuppressionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/email_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/email_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/email_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/email_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -37,7 +38,7 @@ // SetRegion overrides the region of this client. func (client *EmailClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "email", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("email", "https://email.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +49,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -60,149 +61,389 @@ // CreateSender Creates a sender for a tenancy in a given compartment. func (client EmailClient) CreateSender(ctx context.Context, request CreateSenderRequest) (response CreateSenderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/senders", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createSender, policy) + if err != nil { + if ociResponse != nil { + response = CreateSenderResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateSenderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSenderResponse") + } + return +} + +// createSender implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) createSender(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/senders") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSenderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateSuppression Adds recipient email addresses to the suppression list for a tenancy. +// Addresses added to the suppression list via the API are denoted as +// "MANUAL" in the `reason` field. *Note:* All email addresses added to the +// suppression list are normalized to include only lowercase letters. func (client EmailClient) CreateSuppression(ctx context.Context, request CreateSuppressionRequest) (response CreateSuppressionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/suppressions", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createSuppression, policy) + if err != nil { + if ociResponse != nil { + response = CreateSuppressionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateSuppressionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSuppressionResponse") + } + return +} + +// createSuppression implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) createSuppression(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/suppressions") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSuppressionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteSender Deletes an approved sender for a tenancy in a given compartment for a // provided `senderId`. func (client EmailClient) DeleteSender(ctx context.Context, request DeleteSenderRequest) (response DeleteSenderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/senders/{senderId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSender, policy) + if err != nil { + if ociResponse != nil { + response = DeleteSenderResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSenderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSenderResponse") + } + return +} + +// deleteSender implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) deleteSender(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/senders/{senderId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSenderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteSuppression Removes a suppressed recipient email address from the suppression list // for a tenancy in a given compartment for a provided `suppressionId`. func (client EmailClient) DeleteSuppression(ctx context.Context, request DeleteSuppressionRequest) (response DeleteSuppressionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/suppressions/{suppressionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSuppression, policy) + if err != nil { + if ociResponse != nil { + response = DeleteSuppressionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSuppressionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSuppressionResponse") + } + return +} + +// deleteSuppression implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) deleteSuppression(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/suppressions/{suppressionId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSuppressionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetSender Gets an approved sender for a given `senderId`. func (client EmailClient) GetSender(ctx context.Context, request GetSenderRequest) (response GetSenderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/senders/{senderId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSender, policy) + if err != nil { + if ociResponse != nil { + response = GetSenderResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetSenderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSenderResponse") + } + return +} + +// getSender implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) getSender(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/senders/{senderId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetSenderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetSuppression Gets the details of a suppressed recipient email address for a given // `suppressionId`. Each suppression is given a unique OCID. func (client EmailClient) GetSuppression(ctx context.Context, request GetSuppressionRequest) (response GetSuppressionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/suppressions/{suppressionId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSuppression, policy) + if err != nil { + if ociResponse != nil { + response = GetSuppressionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetSuppressionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSuppressionResponse") + } + return +} + +// getSuppression implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) getSuppression(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/suppressions/{suppressionId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetSuppressionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListSenders Gets a collection of approved sender email addresses and sender IDs. func (client EmailClient) ListSenders(ctx context.Context, request ListSendersRequest) (response ListSendersResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/senders", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSenders, policy) + if err != nil { + if ociResponse != nil { + response = ListSendersResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSendersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSendersResponse") + } + return +} + +// listSenders implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) listSenders(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/senders") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListSendersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListSuppressions Gets a list of suppressed recipient email addresses for a user. The // `compartmentId` for suppressions must be a tenancy OCID. The returned list // is sorted by creation time in descending order. func (client EmailClient) ListSuppressions(ctx context.Context, request ListSuppressionsRequest) (response ListSuppressionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/suppressions", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSuppressions, policy) + if err != nil { + if ociResponse != nil { + response = ListSuppressionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSuppressionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSuppressionsResponse") + } + return +} + +// listSuppressions implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) listSuppressions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/suppressions") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListSuppressionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSender Replaces the set of tags for a sender with the tags provided. If either freeform +// or defined tags are omitted, the tags for that set remain the same. Each set must +// include the full set of tags for the sender, partial updates are not permitted. +// For more information about tagging, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). +func (client EmailClient) UpdateSender(ctx context.Context, request UpdateSenderRequest) (response UpdateSenderResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSender, policy) + if err != nil { + if ociResponse != nil { + response = UpdateSenderResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSenderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSenderResponse") + } return } + +// updateSender implements the OCIOperation interface (enables retrying operations) +func (client EmailClient) updateSender(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/senders/{senderId}") + if err != nil { + return nil, err + } + + var response UpdateSenderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_sender_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_sender_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_sender_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_sender_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,29 @@ // The unique OCID of the sender. SenderId *string `mandatory:"true" contributesTo:"path" name:"senderId"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetSenderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetSenderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSenderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetSenderResponse wrapper for the GetSender operation type GetSenderResponse struct { @@ -32,8 +49,16 @@ // to contact Oracle about a particular request, please provide the // request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` } func (response GetSenderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetSenderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_suppression_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_suppression_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_suppression_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/get_suppression_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -13,12 +13,29 @@ // The unique OCID of the suppression. SuppressionId *string `mandatory:"true" contributesTo:"path" name:"suppressionId"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetSuppressionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetSuppressionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSuppressionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetSuppressionResponse wrapper for the GetSuppression operation type GetSuppressionResponse struct { @@ -35,3 +52,8 @@ func (response GetSuppressionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetSuppressionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_senders_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_senders_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_senders_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_senders_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -14,17 +14,23 @@ // The OCID for the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // The current state of a sender. LifecycleState SenderLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // The email address of the approved sender. EmailAddress *string `mandatory:"false" contributesTo:"query" name:"emailAddress"` - // The value of the `opc-next-page` response header from the previous - // GET request. + // For list pagination. The value of the opc-next-page response header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` - // The maximum number of items to return in a paginated GET request. + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. `1` is the minimum, `1000` is the maximum. For important details about + // how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The field to sort by. The `TIMECREATED` value returns the list in in @@ -35,19 +41,33 @@ // The sort order to use, either ascending or descending order. SortOrder ListSendersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSendersRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSendersRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSendersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSendersResponse wrapper for the ListSenders operation type ListSendersResponse struct { // The underlying http response RawResponse *http.Response - // The []SenderSummary instance + // A list of []SenderSummary instances Items []SenderSummary `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need @@ -55,13 +75,16 @@ // request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of items. If this header appears in the - // response, then a partial list might have been returned. Include - // this value for the `page` parameter in subsequent GET - // requests to return the next batch of items. - // of items. + // For list pagination. When this header appears in the response, additional + // pages of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + // For list pagination. When this header appears in the response, previous pages + // of results exist. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` + // The total number of items returned from the request. OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` } @@ -70,10 +93,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListSendersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListSendersSortByEnum Enum with underlying type: string type ListSendersSortByEnum string -// Set of constants representing the allowable values for ListSendersSortBy +// Set of constants representing the allowable values for ListSendersSortByEnum const ( ListSendersSortByTimecreated ListSendersSortByEnum = "TIMECREATED" ListSendersSortByEmailaddress ListSendersSortByEnum = "EMAILADDRESS" @@ -84,7 +112,7 @@ "EMAILADDRESS": ListSendersSortByEmailaddress, } -// GetListSendersSortByEnumValues Enumerates the set of values for ListSendersSortBy +// GetListSendersSortByEnumValues Enumerates the set of values for ListSendersSortByEnum func GetListSendersSortByEnumValues() []ListSendersSortByEnum { values := make([]ListSendersSortByEnum, 0) for _, v := range mappingListSendersSortBy { @@ -96,7 +124,7 @@ // ListSendersSortOrderEnum Enum with underlying type: string type ListSendersSortOrderEnum string -// Set of constants representing the allowable values for ListSendersSortOrder +// Set of constants representing the allowable values for ListSendersSortOrderEnum const ( ListSendersSortOrderAsc ListSendersSortOrderEnum = "ASC" ListSendersSortOrderDesc ListSendersSortOrderEnum = "DESC" @@ -107,7 +135,7 @@ "DESC": ListSendersSortOrderDesc, } -// GetListSendersSortOrderEnumValues Enumerates the set of values for ListSendersSortOrder +// GetListSendersSortOrderEnumValues Enumerates the set of values for ListSendersSortOrderEnum func GetListSendersSortOrderEnumValues() []ListSendersSortOrderEnum { values := make([]ListSendersSortOrderEnum, 0) for _, v := range mappingListSendersSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_suppressions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_suppressions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_suppressions_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/list_suppressions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package email @@ -14,6 +14,9 @@ // The OCID for the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // The email address of the suppression. EmailAddress *string `mandatory:"false" contributesTo:"query" name:"emailAddress"` @@ -35,11 +38,14 @@ // **Example:** 2016-12-19T16:39:57.600Z TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` - // The value of the `opc-next-page` response header from the previous - // GET request. + // For list pagination. The value of the opc-next-page response header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` - // The maximum number of items to return in a paginated GET request. + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. `1` is the minimum, `1000` is the maximum. For important details about + // how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // The field to sort by. The `TIMECREATED` value returns the list in in @@ -50,19 +56,33 @@ // The sort order to use, either ascending or descending order. SortOrder ListSuppressionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSuppressionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSuppressionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSuppressionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSuppressionsResponse wrapper for the ListSuppressions operation type ListSuppressionsResponse struct { // The underlying http response RawResponse *http.Response - // The []SuppressionSummary instance + // A list of []SuppressionSummary instances Items []SuppressionSummary `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need @@ -70,21 +90,30 @@ // request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of items. If this header appears in the - // response, then a partial list might have been returned. Include - // this value for the `page` parameter in subsequent GET - // requests to return the next batch of items. + // For list pagination. When this header appears in the response, additional + // pages of results remain. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For list pagination. When this header appears in the response, previous pages + // of results exist. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } func (response ListSuppressionsResponse) String() string { return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListSuppressionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListSuppressionsSortByEnum Enum with underlying type: string type ListSuppressionsSortByEnum string -// Set of constants representing the allowable values for ListSuppressionsSortBy +// Set of constants representing the allowable values for ListSuppressionsSortByEnum const ( ListSuppressionsSortByTimecreated ListSuppressionsSortByEnum = "TIMECREATED" ListSuppressionsSortByEmailaddress ListSuppressionsSortByEnum = "EMAILADDRESS" @@ -95,7 +124,7 @@ "EMAILADDRESS": ListSuppressionsSortByEmailaddress, } -// GetListSuppressionsSortByEnumValues Enumerates the set of values for ListSuppressionsSortBy +// GetListSuppressionsSortByEnumValues Enumerates the set of values for ListSuppressionsSortByEnum func GetListSuppressionsSortByEnumValues() []ListSuppressionsSortByEnum { values := make([]ListSuppressionsSortByEnum, 0) for _, v := range mappingListSuppressionsSortBy { @@ -107,7 +136,7 @@ // ListSuppressionsSortOrderEnum Enum with underlying type: string type ListSuppressionsSortOrderEnum string -// Set of constants representing the allowable values for ListSuppressionsSortOrder +// Set of constants representing the allowable values for ListSuppressionsSortOrderEnum const ( ListSuppressionsSortOrderAsc ListSuppressionsSortOrderEnum = "ASC" ListSuppressionsSortOrderDesc ListSuppressionsSortOrderEnum = "DESC" @@ -118,7 +147,7 @@ "DESC": ListSuppressionsSortOrderDesc, } -// GetListSuppressionsSortOrderEnumValues Enumerates the set of values for ListSuppressionsSortOrder +// GetListSuppressionsSortOrderEnumValues Enumerates the set of values for ListSuppressionsSortOrderEnum func GetListSuppressionsSortOrderEnumValues() []ListSuppressionsSortOrderEnum { values := make([]ListSuppressionsSortOrderEnum, 0) for _, v := range mappingListSuppressionsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -15,6 +16,9 @@ // Sender The full information representing an approved sender. type Sender struct { + // The OCID for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + // Email address of the sender. EmailAddress *string `mandatory:"false" json:"emailAddress"` @@ -22,7 +26,7 @@ Id *string `mandatory:"false" json:"id"` // Value of the SPF field. For more information about SPF, please see - // SPF Authentication (https://docs.us-phoenix-1.oraclecloud.com/Content/Email/Concepts/emaildeliveryoverview.htm#spf). + // SPF Authentication (https://docs.cloud.oracle.com/Content/Email/Concepts/overview.htm#components). IsSpf *bool `mandatory:"false" json:"isSpf"` // The sender's current lifecycle state. @@ -31,6 +35,16 @@ // The date and time the approved sender was added in "YYYY-MM-ddThh:mmZ" // format with a Z offset, as defined by RFC 3339. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m Sender) String() string { @@ -40,7 +54,7 @@ // SenderLifecycleStateEnum Enum with underlying type: string type SenderLifecycleStateEnum string -// Set of constants representing the allowable values for SenderLifecycleState +// Set of constants representing the allowable values for SenderLifecycleStateEnum const ( SenderLifecycleStateCreating SenderLifecycleStateEnum = "CREATING" SenderLifecycleStateActive SenderLifecycleStateEnum = "ACTIVE" @@ -55,7 +69,7 @@ "DELETED": SenderLifecycleStateDeleted, } -// GetSenderLifecycleStateEnumValues Enumerates the set of values for SenderLifecycleState +// GetSenderLifecycleStateEnumValues Enumerates the set of values for SenderLifecycleStateEnum func GetSenderLifecycleStateEnumValues() []SenderLifecycleStateEnum { values := make([]SenderLifecycleStateEnum, 0) for _, v := range mappingSenderLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/sender_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -15,6 +16,9 @@ // SenderSummary The email addresses and `senderId` representing an approved sender. type SenderSummary struct { + // The OCID for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The email address of the sender. EmailAddress *string `mandatory:"false" json:"emailAddress"` @@ -27,6 +31,16 @@ // Date time the approved sender was added, in "YYYY-MM-ddThh:mmZ" // format with a Z offset, as defined by RFC 3339. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m SenderSummary) String() string { @@ -36,7 +50,7 @@ // SenderSummaryLifecycleStateEnum Enum with underlying type: string type SenderSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for SenderSummaryLifecycleState +// Set of constants representing the allowable values for SenderSummaryLifecycleStateEnum const ( SenderSummaryLifecycleStateCreating SenderSummaryLifecycleStateEnum = "CREATING" SenderSummaryLifecycleStateActive SenderSummaryLifecycleStateEnum = "ACTIVE" @@ -51,7 +65,7 @@ "DELETED": SenderSummaryLifecycleStateDeleted, } -// GetSenderSummaryLifecycleStateEnumValues Enumerates the set of values for SenderSummaryLifecycleState +// GetSenderSummaryLifecycleStateEnumValues Enumerates the set of values for SenderSummaryLifecycleStateEnum func GetSenderSummaryLifecycleStateEnumValues() []SenderSummaryLifecycleStateEnum { values := make([]SenderSummaryLifecycleStateEnum, 0) for _, v := range mappingSenderSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -15,16 +16,21 @@ // Suppression The full information representing an email suppression. type Suppression struct { + // The OCID of the compartment to contain the suppression. Since + // suppressions are at the customer level, this must be the tenancy + // OCID. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + // Email address of the suppression. EmailAddress *string `mandatory:"false" json:"emailAddress"` // The unique ID of the suppression. Id *string `mandatory:"false" json:"id"` - // The reason that the email address was suppressed. For more information on the types of bounces, see Suppresion List (https://docs.us-phoenix-1.oraclecloud.com/Content/Email/Concepts/emaildeliveryoverview.htm#suppressionlist). + // The reason that the email address was suppressed. For more information on the types of bounces, see Suppression List (https://docs.cloud.oracle.com/Content/Email/Concepts/overview.htm#components). Reason SuppressionReasonEnum `mandatory:"false" json:"reason,omitempty"` - // The date and time the approved sender was added in "YYYY-MM-ddThh:mmZ" + // The date and time the suppression was added in "YYYY-MM-ddThh:mmZ" // format with a Z offset, as defined by RFC 3339. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } @@ -36,7 +42,7 @@ // SuppressionReasonEnum Enum with underlying type: string type SuppressionReasonEnum string -// Set of constants representing the allowable values for SuppressionReason +// Set of constants representing the allowable values for SuppressionReasonEnum const ( SuppressionReasonUnknown SuppressionReasonEnum = "UNKNOWN" SuppressionReasonHardbounce SuppressionReasonEnum = "HARDBOUNCE" @@ -55,7 +61,7 @@ "UNSUBSCRIBE": SuppressionReasonUnsubscribe, } -// GetSuppressionReasonEnumValues Enumerates the set of values for SuppressionReason +// GetSuppressionReasonEnumValues Enumerates the set of values for SuppressionReasonEnum func GetSuppressionReasonEnumValues() []SuppressionReasonEnum { values := make([]SuppressionReasonEnum, 0) for _, v := range mappingSuppressionReason { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/suppression_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Email Delivery Service API +// Email Delivery API // -// API spec for managing OCI Email Delivery services. +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). // package email @@ -15,6 +16,9 @@ // SuppressionSummary The full information representing a suppression. type SuppressionSummary struct { + // The OCID for the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The email address of the suppression. EmailAddress *string `mandatory:"false" json:"emailAddress"` @@ -37,7 +41,7 @@ // SuppressionSummaryReasonEnum Enum with underlying type: string type SuppressionSummaryReasonEnum string -// Set of constants representing the allowable values for SuppressionSummaryReason +// Set of constants representing the allowable values for SuppressionSummaryReasonEnum const ( SuppressionSummaryReasonUnknown SuppressionSummaryReasonEnum = "UNKNOWN" SuppressionSummaryReasonHardbounce SuppressionSummaryReasonEnum = "HARDBOUNCE" @@ -56,7 +60,7 @@ "UNSUBSCRIBE": SuppressionSummaryReasonUnsubscribe, } -// GetSuppressionSummaryReasonEnumValues Enumerates the set of values for SuppressionSummaryReason +// GetSuppressionSummaryReasonEnumValues Enumerates the set of values for SuppressionSummaryReasonEnum func GetSuppressionSummaryReasonEnumValues() []SuppressionSummaryReasonEnum { values := make([]SuppressionSummaryReasonEnum, 0) for _, v := range mappingSuppressionSummaryReason { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Email Delivery API +// +// API for the Email Delivery service. Use this API to send high-volume, application-generated +// emails. For more information, see Overview of the Email Delivery Service (https://docs.cloud.oracle.com/iaas/Content/Email/Concepts/overview.htm). +// + +package email + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateSenderDetails The details allowed for updating a sender. +type UpdateSenderDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateSenderDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/email/update_sender_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package email + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateSenderRequest wrapper for the UpdateSender operation +type UpdateSenderRequest struct { + + // The unique OCID of the sender. + SenderId *string `mandatory:"true" contributesTo:"path" name:"senderId"` + + // update details for sender. + UpdateSenderDetails `contributesTo:"body"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The request ID for tracing from the system + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSenderRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSenderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSenderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateSenderResponse wrapper for the UpdateSender operation +type UpdateSenderResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Sender instance + Sender `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need + // to contact Oracle about a particular request, please provide the + // request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateSenderResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSenderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_audit_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_audit_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_audit_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_audit_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -16,7 +16,7 @@ func ExampleListEvents() { c, clerr := audit.NewAuditClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) // list events for last 5 hour req := audit.ListEventsRequest{ @@ -26,7 +26,7 @@ } _, err := c.ListEvents(context.Background(), req) - helpers.LogIfError(err) + helpers.FatalIfError(err) //log.Printf("events returned back: %v", resp.Items) fmt.Println("list events completed") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_containerengine_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_containerengine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_containerengine_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_containerengine_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,324 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// +// Example code for Container Engine API +// +package example + +import ( + "context" + "fmt" + "strings" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/containerengine" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/oracle/oci-go-sdk/identity" +) + +// Example for how to do CRUD on cluster, how to get kubernets config and +// how to work with WorkRequest +func ExampleClusterCRUD() { + ctx := context.Background() + c, clerr := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + // create network resources for cluster. + // this sample is to demonstrate how to use cluster APIs + // for more configuration setup, please refer to the link here: + // https://docs.cloud.oracle.com/Content/ContEng/Concepts/contengnetworkconfig.htm + vcnID, subnet1ID, subnet2ID, _ := createVCNWithSubnets(ctx) + + defaulKubetVersion := getDefaultKubernetesVersion(c) + createClusterResp := createCluster(ctx, c, vcnID, defaulKubetVersion, subnet1ID, subnet2ID) + + // wait until work request complete + workReqResp := waitUntilWorkRequestComplete(c, createClusterResp.OpcWorkRequestId) + fmt.Println("cluster created") + + // update cluster with a new name and upgrade the kubernets version + updateReq := containerengine.UpdateClusterRequest{} + + // please see the document here for actionType values: + // https://docs.cloud.oracle.com/api/#/en/containerengine/20180222/datatypes/WorkRequestResource + clusterID := getResourceID(workReqResp.Resources, containerengine.WorkRequestResourceActionTypeCreated, "CLUSTER") + updateReq.ClusterId = clusterID + defer deleteCluster(ctx, c, clusterID) + updateReq.Name = common.String("GOSDK_Sample_New_CE") + + getReq := containerengine.GetClusterRequest{ + ClusterId: updateReq.ClusterId, + } + + getResp, err := c.GetCluster(ctx, getReq) + // check for upgrade versions + if len(getResp.Cluster.AvailableKubernetesUpgrades) > 0 { + // if newer version available, set it for upgrade + updateReq.KubernetesVersion = common.String(getResp.Cluster.AvailableKubernetesUpgrades[0]) + } + + updateResp, err := c.UpdateCluster(ctx, updateReq) + helpers.FatalIfError(err) + fmt.Println("updating cluster") + + // wait until update complete + workReqResp = waitUntilWorkRequestComplete(c, updateResp.OpcWorkRequestId) + fmt.Println("cluster updated") + + // get cluster + getResp, err = c.GetCluster(ctx, getReq) + helpers.FatalIfError(err) + + fmt.Printf("cluster name updated to %s\n", *getResp.Name) + + // Output: + // create VCN complete + // create subnet1 complete + // create subnet2 complete + // create subnet3 complete + // creating cluster + // cluster created + // updating cluster + // cluster updated + // cluster name updated to GOSDK_Sample_New_CE + // deleting cluster +} + +// Example for NodePool +func ExampleNodePoolCRUD() { + ctx := context.Background() + c, clerr := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + // create network resources for cluster + vcnID, subnet1ID, subnet2ID, subnet3ID := createVCNWithSubnets(ctx) + + // create cluster + kubeVersion := getDefaultKubernetesVersion(c) + createClusterResp := createCluster(ctx, c, vcnID, kubeVersion, subnet1ID, subnet2ID) + + // wait until work request complete + workReqResp := waitUntilWorkRequestComplete(c, createClusterResp.OpcWorkRequestId) + fmt.Println("cluster created") + clusterID := getResourceID(workReqResp.Resources, containerengine.WorkRequestResourceActionTypeCreated, "CLUSTER") + + // create NodePool + createNodePoolReq := containerengine.CreateNodePoolRequest{} + createNodePoolReq.CompartmentId = helpers.CompartmentID() + createNodePoolReq.Name = common.String("GOSDK_SAMPLE_NP") + createNodePoolReq.ClusterId = clusterID + createNodePoolReq.KubernetesVersion = common.String(kubeVersion) + createNodePoolReq.NodeImageName = common.String("Oracle-Linux-7.4") + createNodePoolReq.NodeShape = common.String("VM.Standard1.1") + createNodePoolReq.SubnetIds = []string{subnet3ID} + createNodePoolReq.InitialNodeLabels = []containerengine.KeyValue{{Key: common.String("foo"), Value: common.String("bar")}} + + createNodePoolResp, err := c.CreateNodePool(ctx, createNodePoolReq) + helpers.FatalIfError(err) + fmt.Println("creating nodepool") + + workReqResp = waitUntilWorkRequestComplete(c, createNodePoolResp.OpcWorkRequestId) + fmt.Println("nodepool created") + + nodePoolID := getResourceID(workReqResp.Resources, containerengine.WorkRequestResourceActionTypeCreated, "NODEPOOL") + + defer func() { + deleteNodePool(ctx, c, nodePoolID) + deleteCluster(ctx, c, clusterID) + }() + + // update NodePool + updateNodePoolReq := containerengine.UpdateNodePoolRequest{ + NodePoolId: nodePoolID, + } + + updateNodePoolReq.Name = common.String("GOSDK_SAMPLE_NP_NEW") + updateNodePoolResp, err := c.UpdateNodePool(ctx, updateNodePoolReq) + helpers.FatalIfError(err) + fmt.Println("updating nodepool") + + workReqResp = waitUntilWorkRequestComplete(c, updateNodePoolResp.OpcWorkRequestId) + fmt.Println("nodepool updated") + + // Output: + // create VCN complete + // create subnet1 complete + // create subnet2 complete + // create subnet3 complete + // creating cluster + // cluster created + // creating nodepool + // nodepool created + // updating NodePool + // nodepool updated + // deleting nodepool + // deleting cluster +} + +func ExampleKubeConfig() { + ctx := context.Background() + c, clerr := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + clusterID := common.String("[YOUR CLUSTER ID]") + req := containerengine.CreateKubeconfigRequest{ + ClusterId: clusterID, + } + + req.Expiration = common.Int(360) + + _, err := c.CreateKubeconfig(ctx, req) + helpers.FatalIfError(err) + fmt.Println("create kubeconfig") + + // Output: + // create kubeconfig +} + +// Example for work request query +func ExampleWorkRequestQuery() { + ctx := context.Background() + c, clerr := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + workRequestID := common.String("[YOUR WORK REQUEST ID]") + listErrorReq := containerengine.ListWorkRequestErrorsRequest{ + CompartmentId: helpers.CompartmentID(), + WorkRequestId: workRequestID, + } + + _, err := c.ListWorkRequestErrors(ctx, listErrorReq) + helpers.FatalIfError(err) + fmt.Println("list work request errors") + + listLogReq := containerengine.ListWorkRequestLogsRequest{ + CompartmentId: helpers.CompartmentID(), + WorkRequestId: workRequestID, + } + + _, err = c.ListWorkRequestLogs(ctx, listLogReq) + helpers.FatalIfError(err) + fmt.Println("list work request logs") + + // Output: + // list work request errors + // list work request logs +} + +// wait until work request finish +func waitUntilWorkRequestComplete(client containerengine.ContainerEngineClient, workReuqestID *string) containerengine.GetWorkRequestResponse { + // retry GetWorkRequest call until TimeFinished is set + shouldRetryFunc := func(r common.OCIOperationResponse) bool { + return r.Response.(containerengine.GetWorkRequestResponse).TimeFinished == nil + } + + getWorkReq := containerengine.GetWorkRequestRequest{ + WorkRequestId: workReuqestID, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(shouldRetryFunc), + } + + getResp, err := client.GetWorkRequest(context.Background(), getWorkReq) + helpers.FatalIfError(err) + return getResp +} + +// create a cluster +func createCluster( + ctx context.Context, + client containerengine.ContainerEngineClient, + vcnID, kubernetesVersion, subnet1ID, subnet2ID string) containerengine.CreateClusterResponse { + req := containerengine.CreateClusterRequest{} + req.Name = common.String("GOSDK_Sample_CE") + req.CompartmentId = helpers.CompartmentID() + req.VcnId = common.String(vcnID) + req.KubernetesVersion = common.String(kubernetesVersion) + req.Options = &containerengine.ClusterCreateOptions{ + ServiceLbSubnetIds: []string{subnet1ID, subnet2ID}, + } + + fmt.Println("creating cluster") + resp, err := client.CreateCluster(ctx, req) + helpers.FatalIfError(err) + + return resp +} + +// delete a cluster +func deleteCluster(ctx context.Context, client containerengine.ContainerEngineClient, clusterID *string) { + deleteReq := containerengine.DeleteClusterRequest{ + ClusterId: clusterID, + } + + client.DeleteCluster(ctx, deleteReq) + + fmt.Println("deleting cluster") +} + +// delete a node pool +func deleteNodePool(ctx context.Context, client containerengine.ContainerEngineClient, nodePoolID *string) { + deleteReq := containerengine.DeleteNodePoolRequest{ + NodePoolId: nodePoolID, + } + + client.DeleteNodePool(ctx, deleteReq) + + fmt.Println("deleting nodepool") +} + +// create VCN and subnets, return id of these three resources +func createVCNWithSubnets(ctx context.Context) (vcnID, subnet1ID, subnet2ID, subnet3ID string) { + // create a new VCN + vcn := CreateOrGetVcn() + fmt.Println("create VCN complete") + + subnet1 := CreateOrGetSubnet() + fmt.Println("create subnet1 complete") + + // create a subnet in different availability domain + identityClient, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(err) + req := identity.ListAvailabilityDomainsRequest{} + req.CompartmentId = helpers.CompartmentID() + response, err := identityClient.ListAvailabilityDomains(ctx, req) + helpers.FatalIfError(err) + if len(response.Items) < 3 { + fmt.Println("require at least 3 avilability domains to create three subnets") + } + + availableDomain := response.Items[1].Name + + subnet2 := CreateOrGetSubnetWithDetails(common.String(subnetDisplayName2), common.String("10.0.1.0/24"), common.String("subnetdns2"), availableDomain) + fmt.Println("create subnet2 complete") + + availableDomain = response.Items[2].Name + subnet3 := CreateOrGetSubnetWithDetails(common.String(subnetDisplayName3), common.String("10.0.2.0/24"), common.String("subnetdns3"), availableDomain) + fmt.Println("create subnet3 complete") + + return *vcn.Id, *subnet1.Id, *subnet2.Id, *subnet3.Id +} + +func getDefaultKubernetesVersion(client containerengine.ContainerEngineClient) string { + getClusterOptionsReq := containerengine.GetClusterOptionsRequest{ + ClusterOptionId: common.String("all"), + } + getClusterOptionsResp, err := client.GetClusterOptions(context.Background(), getClusterOptionsReq) + helpers.FatalIfError(err) + kubernetesVersion := getClusterOptionsResp.KubernetesVersions + + if len(kubernetesVersion) < 1 { + fmt.Println("Kubernetes version not available") + } + + return kubernetesVersion[0] +} + +// getResourceID return a resource ID based on the filter of resource actionType and entityType +func getResourceID(resources []containerengine.WorkRequestResource, actionType containerengine.WorkRequestResourceActionTypeEnum, entityType string) *string { + for _, resource := range resources { + if resource.ActionType == actionType && strings.ToUpper(*resource.EntityType) == entityType { + return resource.Identifier + } + } + + fmt.Println("cannot find matched resources") + return nil +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_pagination_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_pagination_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_pagination_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_pagination_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -17,7 +17,7 @@ // ExampleListShapes_Pagination demostrate how to use page parameter func ExampleListShapes_Pagination() { c, err := core.NewComputeClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) request := core.ListShapesRequest{ CompartmentId: helpers.CompartmentID(), @@ -31,7 +31,7 @@ } for r, err := listShapesFunc(request); ; r, err = listShapesFunc(request) { - helpers.LogIfError(err) + helpers.FatalIfError(err) log.Printf("list shapes returns: %v", r.Items) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_core_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -9,7 +9,6 @@ "context" "fmt" "log" - "time" "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/core" @@ -20,6 +19,7 @@ vcnDisplayName = "OCI-GOSDK-Sample-VCN" subnetDisplayName1 = "OCI-GOSDK-Sample-Subnet1" subnetDisplayName2 = "OCI-GOSDK-Sample-Subnet2" + subnetDisplayName3 = "OCI-GOSDK-Sample-Subnet3" // replace following variables with your instance info // this is used by ExampleCreateImageDetails_Polymorphic @@ -31,7 +31,7 @@ // after execute this sample code, otherwise, you will be charged for the running instance func ExampleLaunchInstance() { c, err := core.NewComputeClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) ctx := context.Background() // create the launch instance request @@ -46,47 +46,69 @@ request.SubnetId = subnet.Id // get a image - image := listImages(ctx, c)[0] + image := listImages(ctx, c)[30] fmt.Println("list images") request.ImageId = image.Id // get all the shapes and filter the list by compatibility with the image shapes := listShapes(ctx, c, request.ImageId) fmt.Println("list shapes") - request.Shape = shapes[0].Shape + request.Shape = shapes[1].Shape - createResp, err := c.LaunchInstance(ctx, request) - helpers.LogIfError(err) - fmt.Println("instance created") + // default retry policy will retry on non-200 response + request.RequestMetadata = helpers.GetRequestMetadataWithDefaultRetryPolicy() - // get new created instance - getInstance := func() (interface{}, error) { - request := core.GetInstanceRequest{ - InstanceId: createResp.Instance.Id, - } + createResp, err := c.LaunchInstance(ctx, request) + helpers.FatalIfError(err) - readResp, err := c.GetInstance(ctx, request) + fmt.Println("launching instance") - if err != nil { - return nil, err + // should retry condition check which returns a bool value indicating whether to do retry or not + // it checks the lifecycle status equals to Running or not for this case + shouldRetryFunc := func(r common.OCIOperationResponse) bool { + if converted, ok := r.Response.(core.GetInstanceResponse); ok { + return converted.LifecycleState != core.InstanceLifecycleStateRunning } + return true + } - return readResp, err + // create get instance request with a retry policy which takes a function + // to determine shouldRetry or not + pollingGetRequest := core.GetInstanceRequest{ + InstanceId: createResp.Instance.Id, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(shouldRetryFunc), } - // wait for instance lifecyle become running - helpers.LogIfError( - helpers.RetryUntilTrueOrError( - getInstance, - helpers.CheckLifecycleState(string(core.InstanceLifecycleStateRunning)), - time.Tick(10*time.Second), - time.After((5 * time.Minute)))) + instance, pollError := c.GetInstance(ctx, pollingGetRequest) + helpers.FatalIfError(pollError) + + fmt.Println("instance launched") + + attachVnicResponse, err := c.AttachVnic(context.Background(), core.AttachVnicRequest{ + AttachVnicDetails: core.AttachVnicDetails{ + CreateVnicDetails: &core.CreateVnicDetails{ + SubnetId: subnet.Id, + AssignPublicIp: common.Bool(true), + }, + InstanceId: instance.Id, + }, + }) + + helpers.FatalIfError(err) + fmt.Println("vnic attached") + + _, err = c.DetachVnic(context.Background(), core.DetachVnicRequest{ + VnicAttachmentId: attachVnicResponse.Id, + }) + + helpers.FatalIfError(err) + fmt.Println("vnic dettached") defer func() { terminateInstance(ctx, c, createResp.Id) client, clerr := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) vcnID := subnet.VcnId deleteSubnet(ctx, client, subnet.Id) @@ -97,7 +119,10 @@ // subnet created // list images // list shapes - // instance created + // launching instance + // instance launched + // vnic attached + // vnic dettached // terminating instance // instance terminated // deleteing subnet @@ -122,17 +147,17 @@ request.ImageSourceDetails = sourceDetails c, err := core.NewComputeClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) _, err = c.CreateImage(context.Background(), request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("image created") } // CreateOrGetVcn either creates a new Virtual Cloud Network (VCN) or get the one already exist func CreateOrGetVcn() core.Vcn { c, clerr := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) ctx := context.Background() vcnItems := listVcns(ctx, c) @@ -152,7 +177,7 @@ request.DnsLabel = common.String("vcndns") r, err := c.CreateVcn(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Vcn } @@ -169,7 +194,7 @@ // with detail info func CreateOrGetSubnetWithDetails(displayName *string, cidrBlock *string, dnsLabel *string, availableDomain *string) core.Subnet { c, clerr := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) ctx := context.Background() subnets := listSubnets(ctx, c) @@ -193,34 +218,30 @@ request.CidrBlock = cidrBlock request.DisplayName = displayName request.DnsLabel = dnsLabel + request.RequestMetadata = helpers.GetRequestMetadataWithDefaultRetryPolicy() vcn := CreateOrGetVcn() request.VcnId = vcn.Id r, err := c.CreateSubnet(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) - getSubnet := func() (interface{}, error) { - getReq := core.GetSubnetRequest{ - SubnetId: r.Id, - } - - getResp, err := c.GetSubnet(ctx, getReq) - - if err != nil { - return nil, err + // retry condition check, stop unitl return true + pollUntilAvailable := func(r common.OCIOperationResponse) bool { + if converted, ok := r.Response.(core.GetSubnetResponse); ok { + return converted.LifecycleState != core.SubnetLifecycleStateAvailable } + return true + } - return getResp, nil + pollGetRequest := core.GetSubnetRequest{ + SubnetId: r.Id, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(pollUntilAvailable), } // wait for lifecyle become running - helpers.LogIfError( - helpers.RetryUntilTrueOrError( - getSubnet, - helpers.CheckLifecycleState(string(core.SubnetLifecycleStateAvailable)), - time.Tick(10*time.Second), - time.After((5 * time.Minute)))) + _, pollErr := c.GetSubnet(ctx, pollGetRequest) + helpers.FatalIfError(pollErr) // update the security rules getReq := core.GetSecurityListRequest{ @@ -228,7 +249,7 @@ } getResp, err := c.GetSecurityList(ctx, getReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) // this security rule allows remote control the instance portRange := core.PortRange{ @@ -251,7 +272,7 @@ updateReq.IngressSecurityRules = newRules _, err = c.UpdateSecurityList(ctx, updateReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Subnet } @@ -262,7 +283,7 @@ } r, err := c.ListVcns(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Items } @@ -275,7 +296,7 @@ } r, err := c.ListSubnets(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Items } @@ -286,7 +307,7 @@ } r, err := c.ListImages(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Items } @@ -299,7 +320,7 @@ } r, err := c.ListShapes(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) if r.Items == nil || len(r.Items) == 0 { log.Fatalln("Invalid response from ListShapes") @@ -310,120 +331,110 @@ func terminateInstance(ctx context.Context, c core.ComputeClient, id *string) { request := core.TerminateInstanceRequest{ - InstanceId: id, + InstanceId: id, + RequestMetadata: helpers.GetRequestMetadataWithDefaultRetryPolicy(), } _, err := c.TerminateInstance(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("terminating instance") - // get new created instance - getInstance := func() (interface{}, error) { - request := core.GetInstanceRequest{ - InstanceId: id, + // should retry condition check which returns a bool value indicating whether to do retry or not + // it checks the lifecycle status equals to Terminated or not for this case + shouldRetryFunc := func(r common.OCIOperationResponse) bool { + if converted, ok := r.Response.(core.GetInstanceResponse); ok { + return converted.LifecycleState != core.InstanceLifecycleStateTerminated } - - readResp, err := c.GetInstance(ctx, request) - - if err != nil { - if readResp.RawResponse.StatusCode == 404 { - // cannot find resources which means it's been deleted - return core.Instance{LifecycleState: core.InstanceLifecycleStateTerminated}, nil - } - return nil, err - } - - return readResp, err + return true } - // wait for instance lifecyle become terminated - helpers.LogIfError( - helpers.RetryUntilTrueOrError( - getInstance, - helpers.CheckLifecycleState(string(core.InstanceLifecycleStateTerminated)), - time.Tick(10*time.Second), - time.After((5 * time.Minute)))) + pollGetRequest := core.GetInstanceRequest{ + InstanceId: id, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(shouldRetryFunc), + } + _, pollErr := c.GetInstance(ctx, pollGetRequest) + helpers.FatalIfError(pollErr) fmt.Println("instance terminated") - } func deleteVcn(ctx context.Context, c core.VirtualNetworkClient, id *string) { request := core.DeleteVcnRequest{ - VcnId: id, + VcnId: id, + RequestMetadata: helpers.GetRequestMetadataWithDefaultRetryPolicy(), } fmt.Println("deleteing VCN") _, err := c.DeleteVcn(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) - getVcn := func() (interface{}, error) { - getReq := core.GetVcnRequest{ - VcnId: id, + // should retry condition check which returns a bool value indicating whether to do retry or not + // it checks the lifecycle status equals to Terminated or not for this case + shouldRetryFunc := func(r common.OCIOperationResponse) bool { + if serviceError, ok := common.IsServiceError(r.Error); ok && serviceError.GetHTTPStatusCode() == 404 { + // resource been deleted, stop retry + return false } - getResp, err := c.GetVcn(ctx, getReq) - - if err != nil { - if getResp.RawResponse.StatusCode == 404 { - // resource cannot found which means it's been deleted in this case - return core.Vcn{LifecycleState: core.VcnLifecycleStateTerminated}, nil - } - - return nil, err + if converted, ok := r.Response.(core.GetVcnResponse); ok { + return converted.LifecycleState != core.VcnLifecycleStateTerminated } - - return getResp, nil + return true } - // wait for lifecyle become terminated - helpers.LogIfError( - helpers.RetryUntilTrueOrError( - getVcn, - helpers.CheckLifecycleState(string(core.VcnLifecycleStateTerminated)), - time.Tick(10*time.Second), - time.After((5 * time.Minute)))) + pollGetRequest := core.GetVcnRequest{ + VcnId: id, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(shouldRetryFunc), + } + _, pollErr := c.GetVcn(ctx, pollGetRequest) + if serviceError, ok := common.IsServiceError(pollErr); !ok || + (ok && serviceError.GetHTTPStatusCode() != 404) { + // fail if the error is not service error or + // if the error is service error and status code not equals to 404 + helpers.FatalIfError(pollErr) + } fmt.Println("VCN deleted") } func deleteSubnet(ctx context.Context, c core.VirtualNetworkClient, id *string) { request := core.DeleteSubnetRequest{ - SubnetId: id, + SubnetId: id, + RequestMetadata: helpers.GetRequestMetadataWithDefaultRetryPolicy(), } _, err := c.DeleteSubnet(context.Background(), request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("deleteing subnet") - getSubnet := func() (interface{}, error) { - getReq := core.GetSubnetRequest{ - SubnetId: id, + // should retry condition check which returns a bool value indicating whether to do retry or not + // it checks the lifecycle status equals to Terminated or not for this case + shouldRetryFunc := func(r common.OCIOperationResponse) bool { + if serviceError, ok := common.IsServiceError(r.Error); ok && serviceError.GetHTTPStatusCode() == 404 { + // resource been deleted + return false } - getResp, err := c.GetSubnet(ctx, getReq) - - if err != nil { - if getResp.RawResponse.StatusCode == 404 { - // resource cannot found which means it's been deleted in this case - return core.Subnet{LifecycleState: core.SubnetLifecycleStateTerminated}, nil - } - - return nil, err + if converted, ok := r.Response.(core.GetSubnetResponse); ok { + return converted.LifecycleState != core.SubnetLifecycleStateTerminated } + return true + } - return getResp, nil + pollGetRequest := core.GetSubnetRequest{ + SubnetId: id, + RequestMetadata: helpers.GetRequestMetadataWithCustomizedRetryPolicy(shouldRetryFunc), } - // wait for lifecyle become terminated - helpers.LogIfError( - helpers.RetryUntilTrueOrError( - getSubnet, - helpers.CheckLifecycleState(string(core.SubnetLifecycleStateTerminated)), - time.Tick(10*time.Second), - time.After((5 * time.Minute)))) + _, pollErr := c.GetSubnet(ctx, pollGetRequest) + if serviceError, ok := common.IsServiceError(pollErr); !ok || + (ok && serviceError.GetHTTPStatusCode() != 404) { + // fail if the error is not service error or + // if the error is service error and status code not equals to 404 + helpers.FatalIfError(pollErr) + } fmt.Println("subnet deleted") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_email_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_email_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_email_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_email_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -22,7 +22,7 @@ func ExampleEmailSender() { client, err := email.NewEmailClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) ctx := context.Background() @@ -34,7 +34,7 @@ } createResp, err := client.CreateSender(ctx, createReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("email sender created") getReq := email.GetSenderRequest{ @@ -42,7 +42,7 @@ } getResp, err := client.GetSender(ctx, getReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("get email sender") log.Printf("get email sender with email address %s\n", *getResp.EmailAddress) @@ -55,7 +55,7 @@ } listResp, err := client.ListSenders(ctx, listReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) log.Printf("list email senders return %v results\n", len(listResp.Items)) fmt.Println("list email senders") @@ -65,7 +65,7 @@ } _, err = client.DeleteSender(ctx, deleteReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("email sender deleted") }() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_identity_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_identity_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_identity_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_identity_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/example/helpers" "github.com/oracle/oci-go-sdk/identity" + "net/http" ) // ExampleListAvailabilityDomains Lists the Availability Domains in your tenancy. @@ -20,18 +21,18 @@ // the value for the compartment ID (remember that the tenancy is simply the root compartment). func ExampleListAvailabilityDomains() { c, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) // The OCID of the tenancy containing the compartment. tenancyID, err := common.DefaultConfigProvider().TenancyOCID() - helpers.LogIfError(err) + helpers.FatalIfError(err) request := identity.ListAvailabilityDomainsRequest{ CompartmentId: &tenancyID, } r, err := c.ListAvailabilityDomains(context.Background(), request) - helpers.LogIfError(err) + helpers.FatalIfError(err) log.Printf("list of available domains: %v", r.Items) fmt.Println("list available domains completed") @@ -39,3 +40,34 @@ // Output: // list available domains completed } + +// ExampleListGroupsWithCustomSignedHeader Lists groups by passing a custom signed header in the request +func ExampleListGroupsWithCustomSignedHeader() { + provider := common.DefaultConfigProvider() + c, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(err) + + //Bear in mind that services expect well known headers to be signed. Signing arbitrary headers + //might lead to authentication errors + customHeader := "opc-my-token" + allHeaders := append(common.DefaultGenericHeaders(), customHeader) + c.Signer = common.RequestSigner(provider, allHeaders, common.DefaultBodyHeaders()) + c.Interceptor = func(request *http.Request) error { + request.Header.Add(customHeader, "customvalue") + return nil + } + + // The OCID of the tenancy containing the compartment. + tenancyID, _ := provider.TenancyOCID() + request := identity.ListGroupsRequest{ + CompartmentId: common.String(tenancyID), + } + r, err := c.ListGroups(context.Background(), request) + helpers.FatalIfError(err) + + log.Printf("list groups completed: %v", r.Items) + fmt.Println("list groups completed") + + // Output: + // list groups completed +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_instance_principals_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_instance_principals_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_instance_principals_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_instance_principals_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -2,22 +2,26 @@ import ( "context" + "crypto/tls" + "crypto/x509" "fmt" + "log" + "net/http" + "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/common/auth" "github.com/oracle/oci-go-sdk/example/helpers" "github.com/oracle/oci-go-sdk/identity" - "log" ) // ExampleInstancePrincipals lists the availability domains in your tenancy. // Make sure you run this example from a instance with the right permissions. In this example // the root compartment is read from the OCI_ROOT_COMPARTMENT_ID environment variable. -// More information on instance principals can be found here: https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/callingservicesfrominstances.htm +// More information on instance principals can be found here: https://docs.cloud.oracle.com/Content/Identity/Tasks/callingservicesfrominstances.htm func ExampleInstancePrincipals() { provider, err := auth.InstancePrincipalConfigurationProvider() - helpers.LogIfError(err) + helpers.FatalIfError(err) tenancyID := helpers.RootCompartmentID() request := identity.ListAvailabilityDomainsRequest{ @@ -31,7 +35,7 @@ client.SetRegion(string(common.RegionLHR)) r, err := client.ListAvailabilityDomains(context.Background(), request) - helpers.LogIfError(err) + helpers.FatalIfError(err) log.Printf("list of available domains: %v", r.Items) fmt.Println("Done") @@ -39,3 +43,36 @@ // Output: // Done } + +// ExampleInstancePrincipalsWithCustomClient lists the availability domains in your tenancy. +// Similar to the example above, this example shows how to customize the client. +func ExampleInstancePrincipalsWithCustomClient() { + + // Just load the system cert pool for demonstration purposes. + rootCaPool, err := x509.SystemCertPool() + + helpers.FatalIfError(err) + + provider, err := auth.InstancePrincipalConfigurationProviderWithCustomClient(func(dispatcher common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) { + client := dispatcher.(*http.Client) + client.Transport = &http.Transport{ + TLSClientConfig: &tls.Config{ + RootCAs: rootCaPool, + }, + } + return client, nil + }) + + tenancyID := helpers.RootCompartmentID() + request := identity.ListAvailabilityDomainsRequest{ + CompartmentId: tenancyID, + } + + client, err := identity.NewIdentityClientWithConfigurationProvider(provider) + + r, err := client.ListAvailabilityDomains(context.Background(), request) + helpers.FatalIfError(err) + + log.Printf("list of available domains: %v", r.Items) + fmt.Println("Done") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_loadbalancer_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_loadbalancer_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_loadbalancer_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_loadbalancer_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -25,7 +25,7 @@ c, clerr := loadbalancer.NewLoadBalancerClientWithConfigurationProvider(common.DefaultConfigProvider()) ctx := context.Background() - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) request := loadbalancer.CreateLoadBalancerRequest{} request.CompartmentId = helpers.CompartmentID() @@ -36,11 +36,11 @@ // create a subnet in different availability domain identityClient, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) req := identity.ListAvailabilityDomainsRequest{} req.CompartmentId = helpers.CompartmentID() response, err := identityClient.ListAvailabilityDomains(ctx, req) - helpers.LogIfError(err) + helpers.FatalIfError(err) availableDomain := response.Items[1].Name subnet2 := CreateOrGetSubnetWithDetails(common.String(subnetDisplayName2), common.String("10.0.1.0/24"), common.String("subnetdns2"), availableDomain) @@ -54,7 +54,7 @@ request.ShapeName = shapes[0].Name _, err = c.CreateLoadBalancer(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("create load balancer complete") @@ -82,7 +82,7 @@ } // wait for instance lifecyle state become running - helpers.LogIfError( + helpers.FatalIfError( helpers.RetryUntilTrueOrError( loadBalancerLifecycleStateCheck, helpers.CheckLifecycleState(string(loadbalancer.LoadBalancerLifecycleStateActive)), @@ -97,7 +97,7 @@ deleteLoadbalancer(ctx, c, newCreatedLoadBalancer.Id) client, clerr := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) vcnID := subnet1.VcnId deleteSubnet(ctx, client, subnet1.Id) @@ -127,7 +127,7 @@ } r, err := client.ListShapes(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Items } @@ -139,7 +139,7 @@ } r, err := client.ListLoadBalancers(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) return r.Items } @@ -149,7 +149,7 @@ } _, err := client.DeleteLoadBalancer(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("deleting load balancer") // get loadbalancer @@ -177,7 +177,7 @@ } // wait for load balancer been deleted - helpers.LogIfError( + helpers.FatalIfError( helpers.RetryUntilTrueOrError( loadBalancerLifecycleStateCheck, helpers.CheckLifecycleState(string(loadbalancer.LoadBalancerLifecycleStateDeleted)), diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_objectstorage_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_objectstorage_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_objectstorage_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_objectstorage_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -7,24 +7,22 @@ import ( "context" - "crypto/sha256" "fmt" "io" - "io/ioutil" - "math/rand" + "log" "os" "path" - "time" "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/example/helpers" "github.com/oracle/oci-go-sdk/objectstorage" + "github.com/oracle/oci-go-sdk/objectstorage/transfer" ) // ExampleObjectStorage_UploadFile shows how to create a bucket and upload a file func ExampleObjectStorage_UploadFile() { c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) ctx := context.Background() bname := helpers.GetRandomString(8) @@ -34,7 +32,7 @@ defer deleteBucket(ctx, c, namespace, bname) contentlen := 1024 * 1000 - filepath, filesize := writeTempFileOfSize(int64(contentlen)) + filepath, filesize := helpers.WriteTempFileOfSize(int64(contentlen)) filename := path.Base(filepath) defer func() { os.Remove(filename) @@ -42,10 +40,10 @@ file, e := os.Open(filepath) defer file.Close() - helpers.LogIfError(e) + helpers.FatalIfError(e) - e = putObject(ctx, c, namespace, bname, filename, int(filesize), file, nil) - helpers.LogIfError(e) + e = putObject(ctx, c, namespace, bname, filename, filesize, file, nil) + helpers.FatalIfError(e) defer deleteObject(ctx, c, namespace, bname, filename) // Output: @@ -56,15 +54,160 @@ // delete bucket } +func ExampleObjectStorage_UploadManager_UploadFile() { + c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + ctx := context.Background() + bname := "bname" + namespace := getNamespace(ctx, c) + + createBucket(ctx, c, namespace, bname) + defer deleteBucket(ctx, c, namespace, bname) + + contentlen := 1024 * 1000 * 300 // 300MB + filepath, _ := helpers.WriteTempFileOfSize(int64(contentlen)) + filename := path.Base(filepath) + defer os.Remove(filename) + + uploadManager := transfer.NewUploadManager() + objectName := "sampleFileUploadObj" + + req := transfer.UploadFileRequest{ + UploadRequest: transfer.UploadRequest{ + NamespaceName: common.String(namespace), + BucketName: common.String(bname), + ObjectName: common.String(objectName), + //PartSize: common.Int(10000000), + }, + FilePath: filepath, + } + + // if you want to overwrite default value, you can do it + // as: transfer.UploadRequest.AllowMultipartUploads = common.Bool(false) // default is true + // or: transfer.UploadRequest.AllowParrallelUploads = common.Bool(false) // default is true + resp, err := uploadManager.UploadFile(ctx, req) + + if err != nil && resp.IsResumable() { + resp, err = uploadManager.ResumeUploadFile(ctx, *resp.MultipartUploadResponse.UploadID) + if err != nil { + fmt.Println(resp) + } + } + + defer deleteObject(ctx, c, namespace, bname, objectName) + fmt.Println("file uploaded") + + // Output: + // get namespace + // create bucket + // file uploaded + // delete object + // delete bucket +} + +func ExampleObjectStorage_UploadManager_Stream() { + c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + ctx := context.Background() + bname := "bname" + namespace := getNamespace(ctx, c) + + createBucket(ctx, c, namespace, bname) + defer deleteBucket(ctx, c, namespace, bname) + + contentlen := 1024 * 1000 * 130 // 130MB + filepath, _ := helpers.WriteTempFileOfSize(int64(contentlen)) + filename := path.Base(filepath) + defer func() { + os.Remove(filename) + }() + + uploadManager := transfer.NewUploadManager() + objectName := "sampleStreamUploadObj" + + file, _ := os.Open(filepath) + defer file.Close() + + req := transfer.UploadStreamRequest{ + UploadRequest: transfer.UploadRequest{ + NamespaceName: common.String(namespace), + BucketName: common.String(bname), + ObjectName: common.String(objectName), + }, + StreamReader: file, // any struct implements the io.Reader interface + } + + // if you want to overwrite default value, you can do it + // as: transfer.UploadRequest.AllowMultipartUploads = common.Bool(false) // default is true + // or: transfer.UploadRequest.AllowParrallelUploads = common.Bool(false) // default is true + _, err := uploadManager.UploadStream(context.Background(), req) + + if err != nil { + fmt.Println(err) + } + + defer deleteObject(ctx, c, namespace, bname, objectName) + fmt.Println("stream uploaded") + + // Output: + // get namespace + // create bucket + // stream uploaded + // delete object + // delete bucket +} + +// Example for getting Object Storage namespace of a tenancy that is not their own. This +// is useful in cross-tenant Object Storage operations. Object Storage namespace can be retrieved using the +// compartment id of the target tenancy if the user has necessary permissions to access that tenancy. +// +// For example if Tenant A wants to access Tenant B's object storage namespace then Tenant A has to define +// a policy similar to following: +// +// DEFINE TENANCY TenantB AS +// ENDORSE GROUP TO {TENANCY_INSPECT} IN TENANCY TenantB +// +// and Tenant B should add a policy similar to following: +// +// DEFINE TENANCY TenantA AS +// DEFINE GROUP TenantAGroup AS +// ADMIT GROUP TenantAGroup OF TENANCY TenantA TO {TENANCY_INSPECT} IN TENANCY +// +// This example covers only GetNamespace operation across tenants. Additional permissions +// will be required to perform more Object Storage operations. +// +// ExampleObjectStorage_GetNamespace shows how to get namespace providing compartmentId. +func ExampleObjectStorage_GetNamespace() { + c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) + helpers.FatalIfError(clerr) + + ctx := context.Background() + + request := objectstorage.GetNamespaceRequest{} + request.CompartmentId = helpers.CompartmentID() + + r, err := c.GetNamespace(ctx, request) + helpers.FatalIfError(err) + + log.Printf("Namespace for compartment %s is: %s", *request.CompartmentId, *r.Value) + + fmt.Println("Namespace retrieved") + + // Output: + // Namespace retrieved +} + func getNamespace(ctx context.Context, c objectstorage.ObjectStorageClient) string { request := objectstorage.GetNamespaceRequest{} r, err := c.GetNamespace(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("get namespace") return *r.Value } -func putObject(ctx context.Context, c objectstorage.ObjectStorageClient, namespace, bucketname, objectname string, contentLen int, content io.ReadCloser, metadata map[string]string) error { +func putObject(ctx context.Context, c objectstorage.ObjectStorageClient, namespace, bucketname, objectname string, contentLen int64, content io.ReadCloser, metadata map[string]string) error { request := objectstorage.PutObjectRequest{ NamespaceName: &namespace, BucketName: &bucketname, @@ -85,7 +228,7 @@ ObjectName: &objectname, } _, err = c.DeleteObject(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("delete object") return } @@ -99,7 +242,7 @@ request.Metadata = make(map[string]string) request.PublicAccessType = objectstorage.CreateBucketDetailsPublicAccessTypeNopublicaccess _, err := c.CreateBucket(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("create bucket") } @@ -110,20 +253,8 @@ BucketName: &name, } _, err = c.DeleteBucket(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("delete bucket") return } - -func writeTempFileOfSize(filesize int64) (fileName string, fileSize int64) { - hash := sha256.New() - f, _ := ioutil.TempFile("", "OCIGOSDKSampleFile") - ra := rand.New(rand.NewSource(time.Now().UnixNano())) - defer f.Close() - writer := io.MultiWriter(f, hash) - written, _ := io.CopyN(writer, ra, filesize) - fileName = f.Name() - fileSize = written - return -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_rawrequest_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_rawrequest_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_rawrequest_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_rawrequest_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -23,7 +23,7 @@ // create request request, err := http.NewRequest("GET", url, nil) - helpers.LogIfError(err) + helpers.FatalIfError(err) // Set the Date header request.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) @@ -43,7 +43,7 @@ // Execute the request resp, err := client.Do(request) - helpers.LogIfError(err) + helpers.FatalIfError(err) defer resp.Body.Close() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcemanager_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcemanager_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcemanager_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcemanager_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,118 @@ +package example + +import ( + "context" + "fmt" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/oracle/oci-go-sdk/resourcemanager" +) + +// ExampleResourceManager for how to do CRUD for Resource Manager Stack +// The comparement id is read from the environment variable OCI_COMPARTMENT_ID +func ExampleResourceManager() { + provider := common.DefaultConfigProvider() + client, err := resourcemanager.NewResourceManagerClientWithConfigurationProvider(provider) + helpers.FatalIfError(err) + + ctx := context.Background() + + stackID := createStack(ctx, provider, client) + defer deleteStack(ctx, stackID, client) + listStacks(ctx, client) + updateStack(ctx, stackID, client) + getStack(ctx, stackID, client) + + // Output: + // create stack completed + // list stacks completed + // update stack completed + // get stack completed + // delete stack completed +} + +func createStack(ctx context.Context, provider common.ConfigurationProvider, client resourcemanager.ResourceManagerClient) string { + stackName := fmt.Sprintf("test-%s", helpers.GetRandomString(8)) + region, _ := provider.Region() + tenancyOcid, _ := provider.TenancyOCID() + + // create resource manager stack with type ZIP_UPLOAD by passing a base64 encoded Terraform zip string + // user has multiple ways to create stack, details check https://docs.cloud.oracle.com/iaas/api/#/en/resourcemanager/20180917/datatypes/CreateConfigSourceDetails + req := resourcemanager.CreateStackRequest{ + CreateStackDetails: resourcemanager.CreateStackDetails{ + CompartmentId: helpers.CompartmentID(), + ConfigSource: resourcemanager.CreateZipUploadConfigSourceDetails{ + WorkingDirectory: common.String("vcn"), + ZipFileBase64Encoded: common.String("[pls use your base64 encoded TF template]"), + }, + DisplayName: common.String(stackName), + Description: common.String(fmt.Sprintf("%s-description", stackName)), + Variables: map[string]string{ + "compartment_ocid": *helpers.CompartmentID(), + "region": region, + "tenancy_ocid": tenancyOcid, + }, + }, + } + + stackResp, err := client.CreateStack(ctx, req) + helpers.FatalIfError(err) + + fmt.Println("create stack completed") + return *stackResp.Stack.Id +} + +func updateStack(ctx context.Context, stackID string, client resourcemanager.ResourceManagerClient) { + stackName := fmt.Sprintf("test-v1-%s", helpers.GetRandomString(8)) + + // update displayName and description of resource manager stack + req := resourcemanager.UpdateStackRequest{ + StackId: common.String(stackID), + UpdateStackDetails: resourcemanager.UpdateStackDetails{ + DisplayName: common.String(stackName), + Description: common.String(fmt.Sprintf("%s-description", stackName)), + }, + } + + _, err := client.UpdateStack(ctx, req) + helpers.FatalIfError(err) + + fmt.Println("update stack completed") +} + +func listStacks(ctx context.Context, client resourcemanager.ResourceManagerClient) { + req := resourcemanager.ListStacksRequest{ + CompartmentId: helpers.CompartmentID(), + } + + // list resource manager stack + _, err := client.ListStacks(ctx, req) + helpers.FatalIfError(err) + + fmt.Println("list stacks completed") +} + +func getStack(ctx context.Context, stackID string, client resourcemanager.ResourceManagerClient) { + req := resourcemanager.GetStackRequest{ + StackId: common.String(stackID), + } + + // get details a particular resource manager stack + _, err := client.GetStack(ctx, req) + helpers.FatalIfError(err) + + fmt.Println("get stack completed") +} + +func deleteStack(ctx context.Context, stackID string, client resourcemanager.ResourceManagerClient) { + req := resourcemanager.DeleteStackRequest{ + StackId: common.String(stackID), + } + + // delete a resource manager stack + _, err := client.DeleteStack(ctx, req) + helpers.FatalIfError(err) + + fmt.Println("delete stack completed") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcesearch_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcesearch_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcesearch_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_resourcesearch_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Example for Resource Search Service +// +// Search for resources across your cloud infrastructure + +package example + +import ( + "context" + "fmt" + "log" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/oracle/oci-go-sdk/resourcesearch" +) + +func Example_ResourceSearch() { + client, err := resourcesearch.NewResourceSearchClientWithConfigurationProvider(common.DefaultConfigProvider()) + ctx := context.Background() + helpers.FatalIfError(err) + + // list resource types + listReq := resourcesearch.ListResourceTypesRequest{} + listResp, err := client.ListResourceTypes(ctx, listReq) + fmt.Println("list resource types") + + for _, element := range listResp.Items { + log.Printf("Resource: %s", *element.Name) + } + + // get group type details + getReq := resourcesearch.GetResourceTypeRequest{ + Name: common.String("Group"), + } + getResp, err := client.GetResourceType(context.Background(), getReq) + helpers.FatalIfError(err) + fmt.Println("get group type details") + log.Printf("Resource type: %s", getResp.ResourceType) + + // search resource by freetext + searchReq := resourcesearch.SearchResourcesRequest{ + SearchDetails: resourcesearch.FreeTextSearchDetails{ + Text: common.String("displayname"), + }, + } + + freeSearchResp, err := client.SearchResources(context.Background(), searchReq) + helpers.FatalIfError(err) + fmt.Println("search resource by freetext") + + for _, element := range freeSearchResp.Items { + log.Printf("Resource: %s", element) + } + + searchReq.SearchDetails = resourcesearch.StructuredSearchDetails{ + MatchingContextType: resourcesearch.SearchDetailsMatchingContextTypeHighlights, + Query: common.String("query all resources"), + } + + structureSearchResp, err := client.SearchResources(context.Background(), searchReq) + helpers.FatalIfError(err) + + // search resource by structured query + fmt.Println("search resource by structured query") + + for _, element := range structureSearchResp.Items { + log.Printf("Resource: %s", element) + } + + // Output: + // list resource types + // get group type details + // search resource by freetext + // search resource by structured query +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_retry_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_retry_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_retry_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_retry_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// +// Example code for using retry for SDK APIs +// + +package example + +import ( + "context" + "fmt" + "math" + "time" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/oracle/oci-go-sdk/identity" +) + +// ExampleRetry shows how to use retry for Create and Delete groups, please +// refer to example_core_test.go->ExampleLaunchInstance for more examples +func ExampleRetry() { + // create and delete group with retry + client, clerr := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) + ctx := context.Background() + helpers.FatalIfError(clerr) + + request := identity.CreateGroupRequest{} + request.CompartmentId = helpers.RootCompartmentID() + request.Name = common.String("GoSDK_Sample_Group") + request.Description = common.String("GoSDK Sample Group Description") + + // maximum times of retry + attempts := uint(10) + + // retry for all non-200 status code + retryOnAllNon200ResponseCodes := func(r common.OCIOperationResponse) bool { + return !(r.Error == nil && 199 < r.Response.HTTPResponse().StatusCode && r.Response.HTTPResponse().StatusCode < 300) + } + + nextDuration := func(r common.OCIOperationResponse) time.Duration { + // you might want wait longer for next retry when your previous one failed + // this function will return the duration as: + // 1s, 2s, 4s, 8s, 16s, 32s, 64s etc... + return time.Duration(math.Pow(float64(2), float64(r.AttemptNumber-1))) * time.Second + } + + defaultRetryPolicy := common.NewRetryPolicy(attempts, retryOnAllNon200ResponseCodes, nextDuration) + + // create request metadata for retry + request.RequestMetadata = common.RequestMetadata{ + RetryPolicy: &defaultRetryPolicy, + } + + resp, err := client.CreateGroup(ctx, request) + helpers.FatalIfError(err) + fmt.Println("Creating Group") + + // Get with polling + shouldRetry := func(r common.OCIOperationResponse) bool { + if _, isServiceError := common.IsServiceError(r.Error); isServiceError { + // not service error, could be network error or other errors which prevents + // request send to server, will do retry here + return true + } + + if converted, ok := r.Response.(identity.GetGroupResponse); ok { + // do the retry until lifecycle state become active + return converted.LifecycleState != identity.GroupLifecycleStateActive + } + + return true + } + + lifecycleStateCheckRetryPolicy := common.NewRetryPolicy(attempts, shouldRetry, nextDuration) + + getRequest := identity.GetGroupRequest{ + GroupId: resp.Id, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: &lifecycleStateCheckRetryPolicy, + }, + } + + _, errAfterPolling := client.GetGroup(ctx, getRequest) + helpers.FatalIfError(errAfterPolling) + fmt.Println("Group Created") + + defer func() { + // if we've successfully created a group, make sure that we delete it + rDel := identity.DeleteGroupRequest{ + GroupId: resp.Id, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: &defaultRetryPolicy, + }, + } + + _, err = client.DeleteGroup(ctx, rDel) + helpers.FatalIfError(err) + fmt.Println("Group Deleted") + }() + + // Output: + // Creating Group + // Group Created + // Group Deleted +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_tagging_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_tagging_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_tagging_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_tagging_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -19,7 +19,7 @@ // ExampleTagging shows the sample for tag and tagNamespace operations: create, update, get, list etc... func ExampleTagging() { c, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) ctx := context.Background() tagNamespaceID := createTagNamespace(ctx, c, common.String("GOSDKSampleTagNamespaceName")) @@ -35,7 +35,7 @@ TagName: tagName, } _, err = c.GetTag(ctx, getTagReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("get tag") // list tags, list operations are paginated and take a "page" parameter @@ -45,7 +45,7 @@ TagNamespaceId: tagNamespaceID, } _, err = c.ListTags(ctx, listTagReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("list tag") // get tag namespace @@ -53,7 +53,7 @@ TagNamespaceId: tagNamespaceID, } _, err = c.GetTagNamespace(ctx, getTagNamespaceReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("get tag namespace") // list tag namespaces @@ -61,7 +61,7 @@ CompartmentId: helpers.CompartmentID(), } _, err = c.ListTagNamespaces(ctx, listTagNamespaceReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("list tag namespace") // retire a tag namespace by using the update tag namespace operation @@ -73,7 +73,7 @@ } _, err = c.UpdateTagNamespace(ctx, updateTagNamespaceReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("tag namespace retired") // retire a tag by using the update tag operation @@ -85,7 +85,7 @@ }, } _, err = c.UpdateTag(ctx, updateTagReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("tag retired") // reactivate a tag namespace @@ -98,7 +98,7 @@ } _, err = c.UpdateTagNamespace(ctx, updateTagNamespaceReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("tag namespace reactivated") // Output: @@ -117,7 +117,7 @@ func ExampleFreeformAndDefinedTag() { // create a tag namespace and two tags identityClient, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(err) + helpers.FatalIfError(err) ctx := context.Background() @@ -141,14 +141,14 @@ // correspond to the name of a tag within the specified namespace (and the namespace must exist). freeformTags := map[string]string{"free": "form", "another": "item"} definedTags := map[string]map[string]interface{}{ - tagNamespaceName: map[string]interface{}{ + tagNamespaceName: { tagName: "hello", tagName2: "world", }, } coreClient, clerr := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider()) - helpers.LogIfError(clerr) + helpers.FatalIfError(clerr) // create a new VCN with tags createVCNReq := core.CreateVcnRequest{ @@ -171,7 +171,7 @@ resp, err = coreClient.CreateVcn(ctx, createVCNReq) } - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("VCN created with tags") // replace the tag @@ -189,14 +189,14 @@ }, } _, err = coreClient.UpdateVcn(ctx, updateVCNReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("VCN tag updated") // remove the tag from VCN updateVCNReq.FreeformTags = nil updateVCNReq.DefinedTags = nil _, err = coreClient.UpdateVcn(ctx, updateVCNReq) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("VCN tag removed") defer func() { @@ -205,7 +205,7 @@ } _, err = coreClient.DeleteVcn(ctx, request) - helpers.LogIfError(err) + helpers.FatalIfError(err) fmt.Println("VCN deleted") }() @@ -226,7 +226,7 @@ req.Description = common.String("GOSDK Sample TagNamespace Description") resp, err := client.CreateTagNamespace(context.Background(), req) - helpers.LogIfError(err) + helpers.FatalIfError(err) return resp.Id } @@ -241,7 +241,7 @@ req.FreeformTags = map[string]string{"GOSDKSampleTagKey": "GOSDKSampleTagValue"} resp, err := client.CreateTag(context.Background(), req) - helpers.LogIfError(err) + helpers.FatalIfError(err) return resp.Id } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_test.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/example_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,6 +1,6 @@ // Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. // -// Example code for OCI GOSDK +// Example code for Oracle Cloud Infrastructure Go SDK // package example diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/args.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/args.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/args.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/args.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,6 +1,6 @@ // Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. // -// Helper methods for OCI GOSDK Samples +// Helper methods for Oracle Cloud Infrastructure Go SDK Samples // package helpers diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/helper.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/helper.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/helper.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/example/helpers/helper.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,21 +1,27 @@ // Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. // -// Helper methods for OCI GOSDK Samples +// Helper methods for Oracle Cloud Infrastructure Go SDK Samples // package helpers import ( + "crypto/sha256" "fmt" + "io" + "io/ioutil" "log" + "math" "math/rand" "reflect" "strings" "time" + + "github.com/oracle/oci-go-sdk/common" ) -// LogIfError is equivalent to Println() followed by a call to os.Exit(1) if error is not nil -func LogIfError(err error) { +// FatalIfError is equivalent to Println() followed by a call to os.Exit(1) if error is not nil +func FatalIfError(err error) { if err != nil { log.Fatalln(err.Error()) } @@ -99,6 +105,45 @@ } } +// GetRequestMetadataWithDefaultRetryPolicy returns a requestMetadata with default retry policy +// which will do retry for non-200 status code return back from service +// Notes: not all non-200 status code should do retry, this should be based on specific operation +// such as delete operation followed with get operation will retrun 404 if resource already been +// deleted +func GetRequestMetadataWithDefaultRetryPolicy() common.RequestMetadata { + return common.RequestMetadata{ + RetryPolicy: getDefaultRetryPolicy(), + } +} + +// GetRequestMetadataWithCustomizedRetryPolicy returns a requestMetadata which will do the retry based on +// input function (retry until the function return false) +func GetRequestMetadataWithCustomizedRetryPolicy(fn func(r common.OCIOperationResponse) bool) common.RequestMetadata { + return common.RequestMetadata{ + RetryPolicy: getExponentialBackoffRetryPolicy(uint(20), fn), + } +} + +func getDefaultRetryPolicy() *common.RetryPolicy { + // how many times to do the retry + attempts := uint(10) + + // retry for all non-200 status code + retryOnAllNon200ResponseCodes := func(r common.OCIOperationResponse) bool { + return !(r.Error == nil && 199 < r.Response.HTTPResponse().StatusCode && r.Response.HTTPResponse().StatusCode < 300) + } + return getExponentialBackoffRetryPolicy(attempts, retryOnAllNon200ResponseCodes) +} + +func getExponentialBackoffRetryPolicy(n uint, fn func(r common.OCIOperationResponse) bool) *common.RetryPolicy { + // the duration between each retry operation, you might want to waite longer each time the retry fails + exponentialBackoff := func(r common.OCIOperationResponse) time.Duration { + return time.Duration(math.Pow(float64(2), float64(r.AttemptNumber-1))) * time.Second + } + policy := common.NewRetryPolicy(n, fn, exponentialBackoff) + return &policy +} + // GetRandomString returns a random string with length equals to n func GetRandomString(n int) string { letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") @@ -109,3 +154,16 @@ } return string(b) } + +// WriteTempFileOfSize output random content to a file +func WriteTempFileOfSize(filesize int64) (fileName string, fileSize int64) { + hash := sha256.New() + f, _ := ioutil.TempFile("", "OCIGOSDKSampleFile") + ra := rand.New(rand.NewSource(time.Now().UnixNano())) + defer f.Close() + writer := io.MultiWriter(f, hash) + written, _ := io.CopyN(writer, ra, filesize) + fileName = f.Name() + fileSize = written + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/client_options.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/client_options.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/client_options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/client_options.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// File Storage Service API +// +// The API for the File Storage Service. +// + +package filestorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ClientOptions NFS export options applied to a specified set of +// clients. Only governs access through the associated +// export. Access to the same file system through a different +// export (on the same or different mount target) will be governed +// by that export's export options. +type ClientOptions struct { + + // Clients these options should apply to. Must be a either + // single IPv4 address or single IPv4 CIDR block. + // **Note:** Access will also be limited by any applicable VCN + // security rules and the ability to route IP packets to the + // mount target. Mount targets do not have Internet-routable IP addresses. + Source *string `mandatory:"true" json:"source"` + + // If `true`, clients accessing the file system through this + // export must connect from a privileged source port. If + // unspecified, defaults to `true`. + RequirePrivilegedSourcePort *bool `mandatory:"false" json:"requirePrivilegedSourcePort"` + + // Type of access to grant clients using the file system + // through this export. If unspecified defaults to `READ_ONLY`. + Access ClientOptionsAccessEnum `mandatory:"false" json:"access,omitempty"` + + // Used when clients accessing the file system through this export + // have their UID and GID remapped to 'anonymousUid' and + // 'anonymousGid'. If `ALL`, all users and groups are remapped; + // if `ROOT`, only the root user and group (UID/GID 0) are + // remapped; if `NONE`, no remapping is done. If unspecified, + // defaults to `ROOT`. + IdentitySquash ClientOptionsIdentitySquashEnum `mandatory:"false" json:"identitySquash,omitempty"` + + // UID value to remap to when squashing a client UID (see + // identitySquash for more details.) If unspecified, defaults + // to `65534`. + AnonymousUid *int64 `mandatory:"false" json:"anonymousUid"` + + // GID value to remap to when squashing a client GID (see + // identitySquash for more details.) If unspecified defaults + // to `65534`. + AnonymousGid *int64 `mandatory:"false" json:"anonymousGid"` +} + +func (m ClientOptions) String() string { + return common.PointerString(m) +} + +// ClientOptionsAccessEnum Enum with underlying type: string +type ClientOptionsAccessEnum string + +// Set of constants representing the allowable values for ClientOptionsAccessEnum +const ( + ClientOptionsAccessWrite ClientOptionsAccessEnum = "READ_WRITE" + ClientOptionsAccessOnly ClientOptionsAccessEnum = "READ_ONLY" +) + +var mappingClientOptionsAccess = map[string]ClientOptionsAccessEnum{ + "READ_WRITE": ClientOptionsAccessWrite, + "READ_ONLY": ClientOptionsAccessOnly, +} + +// GetClientOptionsAccessEnumValues Enumerates the set of values for ClientOptionsAccessEnum +func GetClientOptionsAccessEnumValues() []ClientOptionsAccessEnum { + values := make([]ClientOptionsAccessEnum, 0) + for _, v := range mappingClientOptionsAccess { + values = append(values, v) + } + return values +} + +// ClientOptionsIdentitySquashEnum Enum with underlying type: string +type ClientOptionsIdentitySquashEnum string + +// Set of constants representing the allowable values for ClientOptionsIdentitySquashEnum +const ( + ClientOptionsIdentitySquashNone ClientOptionsIdentitySquashEnum = "NONE" + ClientOptionsIdentitySquashRoot ClientOptionsIdentitySquashEnum = "ROOT" + ClientOptionsIdentitySquashAll ClientOptionsIdentitySquashEnum = "ALL" +) + +var mappingClientOptionsIdentitySquash = map[string]ClientOptionsIdentitySquashEnum{ + "NONE": ClientOptionsIdentitySquashNone, + "ROOT": ClientOptionsIdentitySquashRoot, + "ALL": ClientOptionsIdentitySquashAll, +} + +// GetClientOptionsIdentitySquashEnumValues Enumerates the set of values for ClientOptionsIdentitySquashEnum +func GetClientOptionsIdentitySquashEnumValues() []ClientOptionsIdentitySquashEnum { + values := make([]ClientOptionsIdentitySquashEnum, 0) + for _, v := range mappingClientOptionsIdentitySquash { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -25,6 +25,26 @@ // Avoid entering confidential information. // Example: `/mediafiles` Path *string `mandatory:"true" json:"path"` + + // Export options for the new export. If left unspecified, + // defaults to: + // [ + // { + // "source" : "0.0.0.0/0", + // "requirePrivilegedSourcePort" : false, + // "access" : "READ_WRITE", + // "identitySquash" : "NONE" + // } + // ] + // **Note:** Mount targets do not have Internet-routable IP + // addresses. Therefore they will not be reachable from the + // Internet, even if an associated `ClientOptions` item has + // a source of `0.0.0.0/0`. + // **If set to the empty array then the export will not be + // visible to any clients.** + // The export's `exportOptions` can be changed after creation + // using the `UpdateExport` operation. + ExportOptions []ClientOptions `mandatory:"false" json:"exportOptions"` } func (m CreateExportDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_export_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateExportRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateExportRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateExportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateExportResponse wrapper for the CreateExport operation type CreateExportResponse struct { @@ -47,3 +65,8 @@ func (response CreateExportResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateExportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -26,6 +26,17 @@ // Avoid entering confidential information. // Example: `My file system` DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateFileSystemDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_file_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateFileSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateFileSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateFileSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateFileSystemResponse wrapper for the CreateFileSystem operation type CreateFileSystemResponse struct { @@ -47,3 +65,8 @@ func (response CreateFileSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateFileSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -38,7 +38,7 @@ // with RFC 952 (https://tools.ietf.org/html/rfc952) // and RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see - // DNS in Your Virtual Cloud Network (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm). + // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `files-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` @@ -47,6 +47,17 @@ // assigns a private IP address from the subnet. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" json:"ipAddress"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateMountTargetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_mount_target_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateMountTargetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateMountTargetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateMountTargetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateMountTargetResponse wrapper for the CreateMountTarget operation type CreateMountTargetResponse struct { @@ -47,3 +65,8 @@ func (response CreateMountTargetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -15,7 +15,7 @@ // CreateSnapshotDetails The representation of CreateSnapshotDetails type CreateSnapshotDetails struct { - // The OCID of this export's file system. + // The OCID of the file system to take a snapshot of. FileSystemId *string `mandatory:"true" json:"fileSystemId"` // Name of the snapshot. This value is immutable. It must also be unique with respect @@ -24,6 +24,17 @@ // Avoid entering confidential information. // Example: `Sunday` Name *string `mandatory:"true" json:"name"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateSnapshotDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/create_snapshot_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSnapshotRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSnapshotRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSnapshotRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSnapshotResponse wrapper for the CreateSnapshot operation type CreateSnapshotResponse struct { @@ -47,3 +65,8 @@ func (response CreateSnapshotResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSnapshotResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_export_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_export_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_export_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_export_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteExportRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteExportRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteExportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteExportResponse wrapper for the DeleteExport operation type DeleteExportResponse struct { @@ -41,3 +59,8 @@ func (response DeleteExportResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteExportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_file_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_file_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_file_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_file_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteFileSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteFileSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteFileSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteFileSystemResponse wrapper for the DeleteFileSystem operation type DeleteFileSystemResponse struct { @@ -41,3 +59,8 @@ func (response DeleteFileSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteFileSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_mount_target_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_mount_target_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_mount_target_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_mount_target_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteMountTargetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteMountTargetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteMountTargetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteMountTargetResponse wrapper for the DeleteMountTarget operation type DeleteMountTargetResponse struct { @@ -41,3 +59,8 @@ func (response DeleteMountTargetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_snapshot_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_snapshot_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_snapshot_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/delete_snapshot_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -20,12 +20,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSnapshotRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSnapshotRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSnapshotRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSnapshotResponse wrapper for the DeleteSnapshot operation type DeleteSnapshotResponse struct { @@ -41,3 +59,8 @@ func (response DeleteSnapshotResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSnapshotResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -23,19 +23,46 @@ // the same export set, except those in a 'DELETED' state, the path element // sequence for the first export resource can't contain the // complete path element sequence of the second export resource. +// // For example, the following are acceptable: -// * /foo and /bar -// * /foo1 and /foo2 -// * /foo and /foo1 +// * /example and /path +// * /example1 and /example2 +// * /example and /example1 // The following examples are not acceptable: -// * /foo and /foo/bar -// * / and /foo +// * /example and /example/path +// * / and /example // Paths may not end in a slash (/). No path element can be a period (.) // or two periods in sequence (..). All path elements must be 255 bytes or less. // No two non-'DELETED' export resources in the same export set can // reference the same file system. +// Use `exportOptions` to control access to an export. For more information, see +// Export Options (https://docs.cloud.oracle.com/Content/File/Tasks/exportoptions.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type Export struct { + // Policies that apply to NFS requests made through this + // export. `exportOptions` contains a sequential list of + // `ClientOptions`. Each `ClientOptions` item defines the + // export options that are applied to a specified + // set of clients. + // For each NFS request, the first `ClientOptions` option + // in the list whose `source` attribute matches the source + // IP address of the request is applied. + // If a client source IP address does not match the `source` + // property of any `ClientOptions` in the list, then the + // export will be invisible to that client. This export will + // not be returned by `MOUNTPROC_EXPORT` calls made by the client + // and any attempt to mount or access the file system through + // this export will result in an error. + // **Exports without defined `ClientOptions` are invisible to all clients.** + // If one export is invisible to a particular client, associated file + // systems may still be accessible through other exports on the same + // or different mount targets. + // To completely deny client access to a file system, be sure that the client + // source IP address is not included in any export for any mount target + // associated with the file system. + ExportOptions []ClientOptions `mandatory:"true" json:"exportOptions"` + // The OCID of this export's export set. ExportSetId *string `mandatory:"true" json:"exportSetId"` @@ -66,7 +93,7 @@ // ExportLifecycleStateEnum Enum with underlying type: string type ExportLifecycleStateEnum string -// Set of constants representing the allowable values for ExportLifecycleState +// Set of constants representing the allowable values for ExportLifecycleStateEnum const ( ExportLifecycleStateCreating ExportLifecycleStateEnum = "CREATING" ExportLifecycleStateActive ExportLifecycleStateEnum = "ACTIVE" @@ -81,7 +108,7 @@ "DELETED": ExportLifecycleStateDeleted, } -// GetExportLifecycleStateEnumValues Enumerates the set of values for ExportLifecycleState +// GetExportLifecycleStateEnumValues Enumerates the set of values for ExportLifecycleStateEnum func GetExportLifecycleStateEnumValues() []ExportLifecycleStateEnum { values := make([]ExportLifecycleStateEnum, 0) for _, v := range mappingExportLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -14,6 +14,7 @@ // ExportSet A set of file systems to export through one or more mount // targets. Composed of zero or more export resources. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type ExportSet struct { // The OCID of the compartment that contains the export set. @@ -52,9 +53,9 @@ // `maxFsStatBytes` minus the metered size of the file // system. If the metered size is larger than `maxFsStatBytes`, // then `fbytes` and `abytes` will both be '0'. - MaxFsStatBytes *int `mandatory:"false" json:"maxFsStatBytes"` + MaxFsStatBytes *int64 `mandatory:"false" json:"maxFsStatBytes"` - // Controls the maximum `ffiles`, `ffiles`, and `afiles` + // Controls the maximum `tfiles`, `ffiles`, and `afiles` // values reported by `NFS FSSTAT` calls through any associated // mount targets. This is an advanced feature. For most // applications, use the default value. The @@ -63,7 +64,7 @@ // `maxFsStatFiles` minus the metered size of the file // system. If the metered size is larger than `maxFsStatFiles`, // then `ffiles` and `afiles` will both be '0'. - MaxFsStatFiles *int `mandatory:"false" json:"maxFsStatFiles"` + MaxFsStatFiles *int64 `mandatory:"false" json:"maxFsStatFiles"` } func (m ExportSet) String() string { @@ -73,7 +74,7 @@ // ExportSetLifecycleStateEnum Enum with underlying type: string type ExportSetLifecycleStateEnum string -// Set of constants representing the allowable values for ExportSetLifecycleState +// Set of constants representing the allowable values for ExportSetLifecycleStateEnum const ( ExportSetLifecycleStateCreating ExportSetLifecycleStateEnum = "CREATING" ExportSetLifecycleStateActive ExportSetLifecycleStateEnum = "ACTIVE" @@ -88,7 +89,7 @@ "DELETED": ExportSetLifecycleStateDeleted, } -// GetExportSetLifecycleStateEnumValues Enumerates the set of values for ExportSetLifecycleState +// GetExportSetLifecycleStateEnumValues Enumerates the set of values for ExportSetLifecycleStateEnum func GetExportSetLifecycleStateEnumValues() []ExportSetLifecycleStateEnum { values := make([]ExportSetLifecycleStateEnum, 0) for _, v := range mappingExportSetLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_set_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -50,7 +50,7 @@ // ExportSetSummaryLifecycleStateEnum Enum with underlying type: string type ExportSetSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for ExportSetSummaryLifecycleState +// Set of constants representing the allowable values for ExportSetSummaryLifecycleStateEnum const ( ExportSetSummaryLifecycleStateCreating ExportSetSummaryLifecycleStateEnum = "CREATING" ExportSetSummaryLifecycleStateActive ExportSetSummaryLifecycleStateEnum = "ACTIVE" @@ -65,7 +65,7 @@ "DELETED": ExportSetSummaryLifecycleStateDeleted, } -// GetExportSetSummaryLifecycleStateEnumValues Enumerates the set of values for ExportSetSummaryLifecycleState +// GetExportSetSummaryLifecycleStateEnumValues Enumerates the set of values for ExportSetSummaryLifecycleStateEnum func GetExportSetSummaryLifecycleStateEnumValues() []ExportSetSummaryLifecycleStateEnum { values := make([]ExportSetSummaryLifecycleStateEnum, 0) for _, v := range mappingExportSetSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/export_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -45,7 +45,7 @@ // ExportSummaryLifecycleStateEnum Enum with underlying type: string type ExportSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for ExportSummaryLifecycleState +// Set of constants representing the allowable values for ExportSummaryLifecycleStateEnum const ( ExportSummaryLifecycleStateCreating ExportSummaryLifecycleStateEnum = "CREATING" ExportSummaryLifecycleStateActive ExportSummaryLifecycleStateEnum = "ACTIVE" @@ -60,7 +60,7 @@ "DELETED": ExportSummaryLifecycleStateDeleted, } -// GetExportSummaryLifecycleStateEnumValues Enumerates the set of values for ExportSummaryLifecycleState +// GetExportSummaryLifecycleStateEnumValues Enumerates the set of values for ExportSummaryLifecycleStateEnum func GetExportSummaryLifecycleStateEnumValues() []ExportSummaryLifecycleStateEnum { values := make([]ExportSummaryLifecycleStateEnum, 0) for _, v := range mappingExportSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/filestorage_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/filestorage_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/filestorage_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/filestorage_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -37,7 +37,7 @@ // SetRegion overrides the region of this client. func (client *FileStorageClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "filestorage", region) + client.Host = common.StringToRegion(region).Endpoint("filestorage") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +48,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -61,20 +61,49 @@ // CreateExport Creates a new export in the specified export set, path, and // file system. func (client FileStorageClient) CreateExport(ctx context.Context, request CreateExportRequest) (response CreateExportResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/exports", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createExport, policy) if err != nil { + if ociResponse != nil { + response = CreateExportResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateExportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateExportResponse") + } + return +} + +// createExport implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) createExport(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/exports") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateExportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateFileSystem Creates a new file system in the specified compartment and @@ -87,9 +116,9 @@ // mount target's IP address. You can associate a file system with // more than one mount target at a time. // For information about access control and compartments, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about availability domains, see Regions and -// Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). +// Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To get a list of availability domains, use the // `ListAvailabilityDomains` operation in the Identity and Access // Management Service API. @@ -100,20 +129,49 @@ // resource's OCID by using a List API operation on that resource // type or by viewing the resource in the Console. func (client FileStorageClient) CreateFileSystem(ctx context.Context, request CreateFileSystemRequest) (response CreateFileSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/fileSystems", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createFileSystem, policy) if err != nil { + if ociResponse != nil { + response = CreateFileSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateFileSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateFileSystemResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// createFileSystem implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) createFileSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/fileSystems") + if err != nil { + return nil, err + } + + var response CreateFileSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateMountTarget Creates a new mount target in the specified compartment and @@ -132,9 +190,9 @@ // Allow at least three IP addresses for each mount target. // For information about access control and compartments, see // Overview of the IAM -// Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about availability domains, see Regions and -// Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). +// Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To get a list of availability domains, use the // `ListAvailabilityDomains` operation in the Identity and Access // Management Service API. @@ -145,348 +203,899 @@ // resource's OCID by using a List API operation on that resource // type, or by viewing the resource in the Console. func (client FileStorageClient) CreateMountTarget(ctx context.Context, request CreateMountTargetRequest) (response CreateMountTargetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/mountTargets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createMountTarget, policy) if err != nil { + if ociResponse != nil { + response = CreateMountTargetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMountTargetResponse") + } + return +} + +// createMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) createMountTarget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mountTargets") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateMountTargetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateSnapshot Creates a new snapshot of the specified file system. You // can access the snapshot at `.snapshot/`. func (client FileStorageClient) CreateSnapshot(ctx context.Context, request CreateSnapshotRequest) (response CreateSnapshotResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/snapshots", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSnapshot, policy) if err != nil { + if ociResponse != nil { + response = CreateSnapshotResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateSnapshotResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSnapshotResponse") + } + return +} + +// createSnapshot implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) createSnapshot(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/snapshots") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSnapshotResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteExport Deletes the specified export. func (client FileStorageClient) DeleteExport(ctx context.Context, request DeleteExportRequest) (response DeleteExportResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/exports/{exportId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteExport, policy) if err != nil { + if ociResponse != nil { + response = DeleteExportResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteExportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteExportResponse") + } + return +} + +// deleteExport implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) deleteExport(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/exports/{exportId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteExportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteFileSystem Deletes the specified file system. Before you delete the file system, // verify that no remaining export resources still reference it. Deleting a // file system also deletes all of its snapshots. func (client FileStorageClient) DeleteFileSystem(ctx context.Context, request DeleteFileSystemRequest) (response DeleteFileSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/fileSystems/{fileSystemId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteFileSystem, policy) if err != nil { + if ociResponse != nil { + response = DeleteFileSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteFileSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteFileSystemResponse") + } + return +} + +// deleteFileSystem implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) deleteFileSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/fileSystems/{fileSystemId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteFileSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteMountTarget Deletes the specified mount target. This operation also deletes the // mount target's VNICs. func (client FileStorageClient) DeleteMountTarget(ctx context.Context, request DeleteMountTargetRequest) (response DeleteMountTargetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/mountTargets/{mountTargetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteMountTarget, policy) if err != nil { + if ociResponse != nil { + response = DeleteMountTargetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMountTargetResponse") + } + return +} + +// deleteMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) deleteMountTarget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mountTargets/{mountTargetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteMountTargetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteSnapshot Deletes the specified snapshot. func (client FileStorageClient) DeleteSnapshot(ctx context.Context, request DeleteSnapshotRequest) (response DeleteSnapshotResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/snapshots/{snapshotId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSnapshot, policy) if err != nil { + if ociResponse != nil { + response = DeleteSnapshotResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteSnapshotResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSnapshotResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// deleteSnapshot implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) deleteSnapshot(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/snapshots/{snapshotId}") + if err != nil { + return nil, err + } + + var response DeleteSnapshotResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetExport Gets the specified export's information. func (client FileStorageClient) GetExport(ctx context.Context, request GetExportRequest) (response GetExportResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/exports/{exportId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getExport, policy) if err != nil { + if ociResponse != nil { + response = GetExportResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetExportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExportResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getExport implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getExport(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exports/{exportId}") + if err != nil { + return nil, err + } + + var response GetExportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetExportSet Gets the specified export set's information. func (client FileStorageClient) GetExportSet(ctx context.Context, request GetExportSetRequest) (response GetExportSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/exportSets/{exportSetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getExportSet, policy) if err != nil { + if ociResponse != nil { + response = GetExportSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetExportSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExportSetResponse") + } + return +} + +// getExportSet implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getExportSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exportSets/{exportSetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetExportSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetFileSystem Gets the specified file system's information. func (client FileStorageClient) GetFileSystem(ctx context.Context, request GetFileSystemRequest) (response GetFileSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/fileSystems/{fileSystemId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getFileSystem, policy) if err != nil { + if ociResponse != nil { + response = GetFileSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetFileSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetFileSystemResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getFileSystem implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getFileSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fileSystems/{fileSystemId}") + if err != nil { + return nil, err + } + + var response GetFileSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetMountTarget Gets the specified mount target's information. func (client FileStorageClient) GetMountTarget(ctx context.Context, request GetMountTargetRequest) (response GetMountTargetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/mountTargets/{mountTargetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getMountTarget, policy) if err != nil { + if ociResponse != nil { + response = GetMountTargetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMountTargetResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getMountTarget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mountTargets/{mountTargetId}") + if err != nil { + return nil, err + } + + var response GetMountTargetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetSnapshot Gets the specified snapshot's information. func (client FileStorageClient) GetSnapshot(ctx context.Context, request GetSnapshotRequest) (response GetSnapshotResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/snapshots/{snapshotId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSnapshot, policy) if err != nil { + if ociResponse != nil { + response = GetSnapshotResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetSnapshotResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSnapshotResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getSnapshot implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getSnapshot(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/snapshots/{snapshotId}") + if err != nil { + return nil, err + } + + var response GetSnapshotResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListExportSets Lists the export set resources in the specified compartment. func (client FileStorageClient) ListExportSets(ctx context.Context, request ListExportSetsRequest) (response ListExportSetsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/exportSets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listExportSets, policy) if err != nil { + if ociResponse != nil { + response = ListExportSetsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListExportSetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExportSetsResponse") + } + return +} + +// listExportSets implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listExportSets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exportSets") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListExportSetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListExports Lists the export resources in the specified compartment. You must -// also specify an export set, a file system, or both. +// ListExports Lists export resources by compartment, file system, or export +// set. You must specify an export set ID, a file system ID, and +// / or a compartment ID. func (client FileStorageClient) ListExports(ctx context.Context, request ListExportsRequest) (response ListExportsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/exports", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listExports, policy) if err != nil { + if ociResponse != nil { + response = ListExportsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListExportsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExportsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listExports implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listExports(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exports") + if err != nil { + return nil, err + } + + var response ListExportsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListFileSystems Lists the file system resources in the specified compartment. func (client FileStorageClient) ListFileSystems(ctx context.Context, request ListFileSystemsRequest) (response ListFileSystemsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/fileSystems", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listFileSystems, policy) if err != nil { + if ociResponse != nil { + response = ListFileSystemsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListFileSystemsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListFileSystemsResponse") + } + return +} + +// listFileSystems implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listFileSystems(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fileSystems") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListFileSystemsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListMountTargets Lists the mount target resources in the specified compartment. func (client FileStorageClient) ListMountTargets(ctx context.Context, request ListMountTargetsRequest) (response ListMountTargetsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/mountTargets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listMountTargets, policy) if err != nil { + if ociResponse != nil { + response = ListMountTargetsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListMountTargetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMountTargetsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listMountTargets implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listMountTargets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mountTargets") + if err != nil { + return nil, err + } + + var response ListMountTargetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListSnapshots Lists snapshots of the specified file system. func (client FileStorageClient) ListSnapshots(ctx context.Context, request ListSnapshotsRequest) (response ListSnapshotsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/snapshots", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSnapshots, policy) if err != nil { + if ociResponse != nil { + response = ListSnapshotsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListSnapshotsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSnapshotsResponse") + } + return +} + +// listSnapshots implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listSnapshots(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/snapshots") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListSnapshotsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateExport Updates the specified export's information. +func (client FileStorageClient) UpdateExport(ctx context.Context, request UpdateExportRequest) (response UpdateExportResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateExport, policy) + if err != nil { + if ociResponse != nil { + response = UpdateExportResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateExportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateExportResponse") + } return } +// updateExport implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateExport(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/exports/{exportId}") + if err != nil { + return nil, err + } + + var response UpdateExportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateExportSet Updates the specified export set's information. func (client FileStorageClient) UpdateExportSet(ctx context.Context, request UpdateExportSetRequest) (response UpdateExportSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/exportSets/{exportSetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateExportSet, policy) if err != nil { + if ociResponse != nil { + response = UpdateExportSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateExportSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateExportSetResponse") + } + return +} + +// updateExportSet implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateExportSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/exportSets/{exportSetId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateExportSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateFileSystem Updates the specified file system's information. // You can use this operation to rename a file system. func (client FileStorageClient) UpdateFileSystem(ctx context.Context, request UpdateFileSystemRequest) (response UpdateFileSystemResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/fileSystems/{fileSystemId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateFileSystem, policy) if err != nil { + if ociResponse != nil { + response = UpdateFileSystemResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateFileSystemResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateFileSystemResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateFileSystem implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateFileSystem(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/fileSystems/{fileSystemId}") + if err != nil { + return nil, err + } + + var response UpdateFileSystemResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateMountTarget Updates the specified mount target's information. func (client FileStorageClient) UpdateMountTarget(ctx context.Context, request UpdateMountTargetRequest) (response UpdateMountTargetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/mountTargets/{mountTargetId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateMountTarget, policy) if err != nil { + if ociResponse != nil { + response = UpdateMountTargetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateMountTargetResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateMountTarget(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/mountTargets/{mountTargetId}") + if err != nil { + return nil, err + } + + var response UpdateMountTargetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSnapshot Updates the specified snapshot's information. +func (client FileStorageClient) UpdateSnapshot(ctx context.Context, request UpdateSnapshotRequest) (response UpdateSnapshotResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSnapshot, policy) + if err != nil { + if ociResponse != nil { + response = UpdateSnapshotResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSnapshotResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSnapshotResponse") + } return } + +// updateSnapshot implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateSnapshot(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/snapshots/{snapshotId}") + if err != nil { + return nil, err + } + + var response UpdateSnapshotResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -20,14 +20,15 @@ // IAM policy. If you're not authorized, talk to an // administrator. If you're an administrator who needs to write // policies to give users access, see Getting Started with -// Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type FileSystem struct { // The number of bytes consumed by the file system, including // any snapshots. This number reflects the metered size of the file // system and is updated asynchronously with respect to // updates to the file system. - MeteredBytes *int `mandatory:"true" json:"meteredBytes"` + MeteredBytes *int64 `mandatory:"true" json:"meteredBytes"` // The OCID of the compartment that contains the file system. CompartmentId *string `mandatory:"true" json:"compartmentId"` @@ -52,6 +53,17 @@ // as a blank or NULL value. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m FileSystem) String() string { @@ -61,7 +73,7 @@ // FileSystemLifecycleStateEnum Enum with underlying type: string type FileSystemLifecycleStateEnum string -// Set of constants representing the allowable values for FileSystemLifecycleState +// Set of constants representing the allowable values for FileSystemLifecycleStateEnum const ( FileSystemLifecycleStateCreating FileSystemLifecycleStateEnum = "CREATING" FileSystemLifecycleStateActive FileSystemLifecycleStateEnum = "ACTIVE" @@ -76,7 +88,7 @@ "DELETED": FileSystemLifecycleStateDeleted, } -// GetFileSystemLifecycleStateEnumValues Enumerates the set of values for FileSystemLifecycleState +// GetFileSystemLifecycleStateEnumValues Enumerates the set of values for FileSystemLifecycleStateEnum func GetFileSystemLifecycleStateEnumValues() []FileSystemLifecycleStateEnum { values := make([]FileSystemLifecycleStateEnum, 0) for _, v := range mappingFileSystemLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/file_system_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -18,9 +18,8 @@ // The number of bytes consumed by the file system, including // any snapshots. This number reflects the metered size of the file // system and is updated asynchronously with respect to - // updates to the file system. For details on file system - // metering see File System Metering (https://docs.us-phoenix-1.oraclecloud.com/Content/File/Concepts/metering.htm). - MeteredBytes *int `mandatory:"true" json:"meteredBytes"` + // updates to the file system. + MeteredBytes *int64 `mandatory:"true" json:"meteredBytes"` // The OCID of the compartment that contains the file system. CompartmentId *string `mandatory:"true" json:"compartmentId"` @@ -54,7 +53,7 @@ // FileSystemSummaryLifecycleStateEnum Enum with underlying type: string type FileSystemSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for FileSystemSummaryLifecycleState +// Set of constants representing the allowable values for FileSystemSummaryLifecycleStateEnum const ( FileSystemSummaryLifecycleStateCreating FileSystemSummaryLifecycleStateEnum = "CREATING" FileSystemSummaryLifecycleStateActive FileSystemSummaryLifecycleStateEnum = "ACTIVE" @@ -69,7 +68,7 @@ "DELETED": FileSystemSummaryLifecycleStateDeleted, } -// GetFileSystemSummaryLifecycleStateEnumValues Enumerates the set of values for FileSystemSummaryLifecycleState +// GetFileSystemSummaryLifecycleStateEnumValues Enumerates the set of values for FileSystemSummaryLifecycleStateEnum func GetFileSystemSummaryLifecycleStateEnumValues() []FileSystemSummaryLifecycleStateEnum { values := make([]FileSystemSummaryLifecycleStateEnum, 0) for _, v := range mappingFileSystemSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -13,12 +13,30 @@ // The OCID of the export. ExportId *string `mandatory:"true" contributesTo:"path" name:"exportId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetExportRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetExportRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetExportResponse wrapper for the GetExport operation type GetExportResponse struct { @@ -40,3 +58,8 @@ func (response GetExportResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetExportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_export_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -13,12 +13,30 @@ // The OCID of the export set. ExportSetId *string `mandatory:"true" contributesTo:"path" name:"exportSetId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetExportSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetExportSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExportSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetExportSetResponse wrapper for the GetExportSet operation type GetExportSetResponse struct { @@ -40,3 +58,8 @@ func (response GetExportSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetExportSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_file_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_file_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_file_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_file_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -13,12 +13,30 @@ // The OCID of the file system. FileSystemId *string `mandatory:"true" contributesTo:"path" name:"fileSystemId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetFileSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetFileSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetFileSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetFileSystemResponse wrapper for the GetFileSystem operation type GetFileSystemResponse struct { @@ -40,3 +58,8 @@ func (response GetFileSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetFileSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_mount_target_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_mount_target_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_mount_target_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_mount_target_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -13,12 +13,30 @@ // The OCID of the mount target. MountTargetId *string `mandatory:"true" contributesTo:"path" name:"mountTargetId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetMountTargetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetMountTargetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMountTargetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetMountTargetResponse wrapper for the GetMountTarget operation type GetMountTargetResponse struct { @@ -40,3 +58,8 @@ func (response GetMountTargetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_snapshot_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_snapshot_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_snapshot_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/get_snapshot_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -13,12 +13,30 @@ // The OCID of the snapshot. SnapshotId *string `mandatory:"true" contributesTo:"path" name:"snapshotId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetSnapshotRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetSnapshotRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSnapshotRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetSnapshotResponse wrapper for the GetSnapshot operation type GetSnapshotResponse struct { @@ -40,3 +58,8 @@ func (response GetSnapshotResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetSnapshotResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_export_sets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_export_sets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_export_sets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_export_sets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -18,11 +18,18 @@ // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A user-friendly name. It does not have to be unique, and it is changeable. @@ -46,26 +53,43 @@ // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. SortOrder ListExportSetsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListExportSetsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListExportSetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExportSetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListExportSetsResponse wrapper for the ListExportSets operation type ListExportSetsResponse struct { // The underlying http response RawResponse *http.Response - // The []ExportSetSummary instance + // A list of []ExportSetSummary instances Items []ExportSetSummary `presentIn:"body"` - // For pagination of a list of items. When paging through - // a list, if this header appears in the response, then a - // partial list might have been returned. Include this - // value as the `page` parameter for the subsequent GET - // request to get the next batch of items. + // For list pagination. When this header appears in the response, + // additional pages of results remain. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If @@ -78,10 +102,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListExportSetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListExportSetsLifecycleStateEnum Enum with underlying type: string type ListExportSetsLifecycleStateEnum string -// Set of constants representing the allowable values for ListExportSetsLifecycleState +// Set of constants representing the allowable values for ListExportSetsLifecycleStateEnum const ( ListExportSetsLifecycleStateCreating ListExportSetsLifecycleStateEnum = "CREATING" ListExportSetsLifecycleStateActive ListExportSetsLifecycleStateEnum = "ACTIVE" @@ -98,7 +127,7 @@ "FAILED": ListExportSetsLifecycleStateFailed, } -// GetListExportSetsLifecycleStateEnumValues Enumerates the set of values for ListExportSetsLifecycleState +// GetListExportSetsLifecycleStateEnumValues Enumerates the set of values for ListExportSetsLifecycleStateEnum func GetListExportSetsLifecycleStateEnumValues() []ListExportSetsLifecycleStateEnum { values := make([]ListExportSetsLifecycleStateEnum, 0) for _, v := range mappingListExportSetsLifecycleState { @@ -110,7 +139,7 @@ // ListExportSetsSortByEnum Enum with underlying type: string type ListExportSetsSortByEnum string -// Set of constants representing the allowable values for ListExportSetsSortBy +// Set of constants representing the allowable values for ListExportSetsSortByEnum const ( ListExportSetsSortByTimecreated ListExportSetsSortByEnum = "TIMECREATED" ListExportSetsSortByDisplayname ListExportSetsSortByEnum = "DISPLAYNAME" @@ -121,7 +150,7 @@ "DISPLAYNAME": ListExportSetsSortByDisplayname, } -// GetListExportSetsSortByEnumValues Enumerates the set of values for ListExportSetsSortBy +// GetListExportSetsSortByEnumValues Enumerates the set of values for ListExportSetsSortByEnum func GetListExportSetsSortByEnumValues() []ListExportSetsSortByEnum { values := make([]ListExportSetsSortByEnum, 0) for _, v := range mappingListExportSetsSortBy { @@ -133,7 +162,7 @@ // ListExportSetsSortOrderEnum Enum with underlying type: string type ListExportSetsSortOrderEnum string -// Set of constants representing the allowable values for ListExportSetsSortOrder +// Set of constants representing the allowable values for ListExportSetsSortOrderEnum const ( ListExportSetsSortOrderAsc ListExportSetsSortOrderEnum = "ASC" ListExportSetsSortOrderDesc ListExportSetsSortOrderEnum = "DESC" @@ -144,7 +173,7 @@ "DESC": ListExportSetsSortOrderDesc, } -// GetListExportSetsSortOrderEnumValues Enumerates the set of values for ListExportSetsSortOrder +// GetListExportSetsSortOrderEnumValues Enumerates the set of values for ListExportSetsSortOrderEnum func GetListExportSetsSortOrderEnumValues() []ListExportSetsSortOrderEnum { values := make([]ListExportSetsSortOrderEnum, 0) for _, v := range mappingListExportSetsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_exports_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_exports_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_exports_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_exports_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -12,13 +12,20 @@ type ListExportsRequest struct { // The OCID of the compartment. - CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` - // The maximum number of items to return in a paginated "List" call. + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the export set. @@ -44,26 +51,43 @@ // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. SortOrder ListExportsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListExportsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListExportsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExportsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListExportsResponse wrapper for the ListExports operation type ListExportsResponse struct { // The underlying http response RawResponse *http.Response - // The []ExportSummary instance + // A list of []ExportSummary instances Items []ExportSummary `presentIn:"body"` - // For pagination of a list of items. When paging through - // a list, if this header appears in the response, then a - // partial list might have been returned. Include this - // value as the `page` parameter for the subsequent GET - // request to get the next batch of items. + // For list pagination. When this header appears in the response, + // additional pages of results remain. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If @@ -76,10 +100,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListExportsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListExportsLifecycleStateEnum Enum with underlying type: string type ListExportsLifecycleStateEnum string -// Set of constants representing the allowable values for ListExportsLifecycleState +// Set of constants representing the allowable values for ListExportsLifecycleStateEnum const ( ListExportsLifecycleStateCreating ListExportsLifecycleStateEnum = "CREATING" ListExportsLifecycleStateActive ListExportsLifecycleStateEnum = "ACTIVE" @@ -96,7 +125,7 @@ "FAILED": ListExportsLifecycleStateFailed, } -// GetListExportsLifecycleStateEnumValues Enumerates the set of values for ListExportsLifecycleState +// GetListExportsLifecycleStateEnumValues Enumerates the set of values for ListExportsLifecycleStateEnum func GetListExportsLifecycleStateEnumValues() []ListExportsLifecycleStateEnum { values := make([]ListExportsLifecycleStateEnum, 0) for _, v := range mappingListExportsLifecycleState { @@ -108,7 +137,7 @@ // ListExportsSortByEnum Enum with underlying type: string type ListExportsSortByEnum string -// Set of constants representing the allowable values for ListExportsSortBy +// Set of constants representing the allowable values for ListExportsSortByEnum const ( ListExportsSortByTimecreated ListExportsSortByEnum = "TIMECREATED" ListExportsSortByPath ListExportsSortByEnum = "PATH" @@ -119,7 +148,7 @@ "PATH": ListExportsSortByPath, } -// GetListExportsSortByEnumValues Enumerates the set of values for ListExportsSortBy +// GetListExportsSortByEnumValues Enumerates the set of values for ListExportsSortByEnum func GetListExportsSortByEnumValues() []ListExportsSortByEnum { values := make([]ListExportsSortByEnum, 0) for _, v := range mappingListExportsSortBy { @@ -131,7 +160,7 @@ // ListExportsSortOrderEnum Enum with underlying type: string type ListExportsSortOrderEnum string -// Set of constants representing the allowable values for ListExportsSortOrder +// Set of constants representing the allowable values for ListExportsSortOrderEnum const ( ListExportsSortOrderAsc ListExportsSortOrderEnum = "ASC" ListExportsSortOrderDesc ListExportsSortOrderEnum = "DESC" @@ -142,7 +171,7 @@ "DESC": ListExportsSortOrderDesc, } -// GetListExportsSortOrderEnumValues Enumerates the set of values for ListExportsSortOrder +// GetListExportsSortOrderEnumValues Enumerates the set of values for ListExportsSortOrderEnum func GetListExportsSortOrderEnumValues() []ListExportsSortOrderEnum { values := make([]ListExportsSortOrderEnum, 0) for _, v := range mappingListExportsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_file_systems_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_file_systems_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_file_systems_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_file_systems_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -18,11 +18,18 @@ // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A user-friendly name. It does not have to be unique, and it is changeable. @@ -46,26 +53,43 @@ // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. SortOrder ListFileSystemsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListFileSystemsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListFileSystemsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListFileSystemsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListFileSystemsResponse wrapper for the ListFileSystems operation type ListFileSystemsResponse struct { // The underlying http response RawResponse *http.Response - // The []FileSystemSummary instance + // A list of []FileSystemSummary instances Items []FileSystemSummary `presentIn:"body"` - // For pagination of a list of items. When paging through - // a list, if this header appears in the response, then a - // partial list might have been returned. Include this - // value as the `page` parameter for the subsequent GET - // request to get the next batch of items. + // For list pagination. When this header appears in the response, + // additional pages of results remain. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If @@ -78,10 +102,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListFileSystemsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListFileSystemsLifecycleStateEnum Enum with underlying type: string type ListFileSystemsLifecycleStateEnum string -// Set of constants representing the allowable values for ListFileSystemsLifecycleState +// Set of constants representing the allowable values for ListFileSystemsLifecycleStateEnum const ( ListFileSystemsLifecycleStateCreating ListFileSystemsLifecycleStateEnum = "CREATING" ListFileSystemsLifecycleStateActive ListFileSystemsLifecycleStateEnum = "ACTIVE" @@ -98,7 +127,7 @@ "FAILED": ListFileSystemsLifecycleStateFailed, } -// GetListFileSystemsLifecycleStateEnumValues Enumerates the set of values for ListFileSystemsLifecycleState +// GetListFileSystemsLifecycleStateEnumValues Enumerates the set of values for ListFileSystemsLifecycleStateEnum func GetListFileSystemsLifecycleStateEnumValues() []ListFileSystemsLifecycleStateEnum { values := make([]ListFileSystemsLifecycleStateEnum, 0) for _, v := range mappingListFileSystemsLifecycleState { @@ -110,7 +139,7 @@ // ListFileSystemsSortByEnum Enum with underlying type: string type ListFileSystemsSortByEnum string -// Set of constants representing the allowable values for ListFileSystemsSortBy +// Set of constants representing the allowable values for ListFileSystemsSortByEnum const ( ListFileSystemsSortByTimecreated ListFileSystemsSortByEnum = "TIMECREATED" ListFileSystemsSortByDisplayname ListFileSystemsSortByEnum = "DISPLAYNAME" @@ -121,7 +150,7 @@ "DISPLAYNAME": ListFileSystemsSortByDisplayname, } -// GetListFileSystemsSortByEnumValues Enumerates the set of values for ListFileSystemsSortBy +// GetListFileSystemsSortByEnumValues Enumerates the set of values for ListFileSystemsSortByEnum func GetListFileSystemsSortByEnumValues() []ListFileSystemsSortByEnum { values := make([]ListFileSystemsSortByEnum, 0) for _, v := range mappingListFileSystemsSortBy { @@ -133,7 +162,7 @@ // ListFileSystemsSortOrderEnum Enum with underlying type: string type ListFileSystemsSortOrderEnum string -// Set of constants representing the allowable values for ListFileSystemsSortOrder +// Set of constants representing the allowable values for ListFileSystemsSortOrderEnum const ( ListFileSystemsSortOrderAsc ListFileSystemsSortOrderEnum = "ASC" ListFileSystemsSortOrderDesc ListFileSystemsSortOrderEnum = "DESC" @@ -144,7 +173,7 @@ "DESC": ListFileSystemsSortOrderDesc, } -// GetListFileSystemsSortOrderEnumValues Enumerates the set of values for ListFileSystemsSortOrder +// GetListFileSystemsSortOrderEnumValues Enumerates the set of values for ListFileSystemsSortOrderEnum func GetListFileSystemsSortOrderEnumValues() []ListFileSystemsSortOrderEnum { values := make([]ListFileSystemsSortOrderEnum, 0) for _, v := range mappingListFileSystemsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_mount_targets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_mount_targets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_mount_targets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_mount_targets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -18,11 +18,18 @@ // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` - // The maximum number of items to return in a paginated "List" call. + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A user-friendly name. It does not have to be unique, and it is changeable. @@ -49,26 +56,43 @@ // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. SortOrder ListMountTargetsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListMountTargetsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListMountTargetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMountTargetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListMountTargetsResponse wrapper for the ListMountTargets operation type ListMountTargetsResponse struct { // The underlying http response RawResponse *http.Response - // The []MountTargetSummary instance + // A list of []MountTargetSummary instances Items []MountTargetSummary `presentIn:"body"` - // For pagination of a list of items. When paging through - // a list, if this header appears in the response, then a - // partial list might have been returned. Include this - // value as the `page` parameter for the subsequent GET - // request to get the next batch of items. + // For list pagination. When this header appears in the response, + // additional pages of results remain. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If @@ -81,10 +105,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListMountTargetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListMountTargetsLifecycleStateEnum Enum with underlying type: string type ListMountTargetsLifecycleStateEnum string -// Set of constants representing the allowable values for ListMountTargetsLifecycleState +// Set of constants representing the allowable values for ListMountTargetsLifecycleStateEnum const ( ListMountTargetsLifecycleStateCreating ListMountTargetsLifecycleStateEnum = "CREATING" ListMountTargetsLifecycleStateActive ListMountTargetsLifecycleStateEnum = "ACTIVE" @@ -101,7 +130,7 @@ "FAILED": ListMountTargetsLifecycleStateFailed, } -// GetListMountTargetsLifecycleStateEnumValues Enumerates the set of values for ListMountTargetsLifecycleState +// GetListMountTargetsLifecycleStateEnumValues Enumerates the set of values for ListMountTargetsLifecycleStateEnum func GetListMountTargetsLifecycleStateEnumValues() []ListMountTargetsLifecycleStateEnum { values := make([]ListMountTargetsLifecycleStateEnum, 0) for _, v := range mappingListMountTargetsLifecycleState { @@ -113,7 +142,7 @@ // ListMountTargetsSortByEnum Enum with underlying type: string type ListMountTargetsSortByEnum string -// Set of constants representing the allowable values for ListMountTargetsSortBy +// Set of constants representing the allowable values for ListMountTargetsSortByEnum const ( ListMountTargetsSortByTimecreated ListMountTargetsSortByEnum = "TIMECREATED" ListMountTargetsSortByDisplayname ListMountTargetsSortByEnum = "DISPLAYNAME" @@ -124,7 +153,7 @@ "DISPLAYNAME": ListMountTargetsSortByDisplayname, } -// GetListMountTargetsSortByEnumValues Enumerates the set of values for ListMountTargetsSortBy +// GetListMountTargetsSortByEnumValues Enumerates the set of values for ListMountTargetsSortByEnum func GetListMountTargetsSortByEnumValues() []ListMountTargetsSortByEnum { values := make([]ListMountTargetsSortByEnum, 0) for _, v := range mappingListMountTargetsSortBy { @@ -136,7 +165,7 @@ // ListMountTargetsSortOrderEnum Enum with underlying type: string type ListMountTargetsSortOrderEnum string -// Set of constants representing the allowable values for ListMountTargetsSortOrder +// Set of constants representing the allowable values for ListMountTargetsSortOrderEnum const ( ListMountTargetsSortOrderAsc ListMountTargetsSortOrderEnum = "ASC" ListMountTargetsSortOrderDesc ListMountTargetsSortOrderEnum = "DESC" @@ -147,7 +176,7 @@ "DESC": ListMountTargetsSortOrderDesc, } -// GetListMountTargetsSortOrderEnumValues Enumerates the set of values for ListMountTargetsSortOrder +// GetListMountTargetsSortOrderEnumValues Enumerates the set of values for ListMountTargetsSortOrderEnum func GetListMountTargetsSortOrderEnumValues() []ListMountTargetsSortOrderEnum { values := make([]ListMountTargetsSortOrderEnum, 0) for _, v := range mappingListMountTargetsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_snapshots_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_snapshots_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_snapshots_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/list_snapshots_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -14,11 +14,18 @@ // The OCID of the file system. FileSystemId *string `mandatory:"true" contributesTo:"query" name:"fileSystemId"` - // The maximum number of items to return in a paginated "List" call. + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Filter results by the specified lifecycle state. Must be a valid @@ -32,26 +39,43 @@ // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. SortOrder ListSnapshotsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSnapshotsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSnapshotsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSnapshotsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSnapshotsResponse wrapper for the ListSnapshots operation type ListSnapshotsResponse struct { // The underlying http response RawResponse *http.Response - // The []SnapshotSummary instance + // A list of []SnapshotSummary instances Items []SnapshotSummary `presentIn:"body"` - // For pagination of a list of items. When paging through - // a list, if this header appears in the response, then a - // partial list might have been returned. Include this - // value as the `page` parameter for the subsequent GET - // request to get the next batch of items. + // For list pagination. When this header appears in the response, + // additional pages of results remain. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If @@ -64,10 +88,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListSnapshotsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListSnapshotsLifecycleStateEnum Enum with underlying type: string type ListSnapshotsLifecycleStateEnum string -// Set of constants representing the allowable values for ListSnapshotsLifecycleState +// Set of constants representing the allowable values for ListSnapshotsLifecycleStateEnum const ( ListSnapshotsLifecycleStateCreating ListSnapshotsLifecycleStateEnum = "CREATING" ListSnapshotsLifecycleStateActive ListSnapshotsLifecycleStateEnum = "ACTIVE" @@ -84,7 +113,7 @@ "FAILED": ListSnapshotsLifecycleStateFailed, } -// GetListSnapshotsLifecycleStateEnumValues Enumerates the set of values for ListSnapshotsLifecycleState +// GetListSnapshotsLifecycleStateEnumValues Enumerates the set of values for ListSnapshotsLifecycleStateEnum func GetListSnapshotsLifecycleStateEnumValues() []ListSnapshotsLifecycleStateEnum { values := make([]ListSnapshotsLifecycleStateEnum, 0) for _, v := range mappingListSnapshotsLifecycleState { @@ -96,7 +125,7 @@ // ListSnapshotsSortOrderEnum Enum with underlying type: string type ListSnapshotsSortOrderEnum string -// Set of constants representing the allowable values for ListSnapshotsSortOrder +// Set of constants representing the allowable values for ListSnapshotsSortOrderEnum const ( ListSnapshotsSortOrderAsc ListSnapshotsSortOrderEnum = "ASC" ListSnapshotsSortOrderDesc ListSnapshotsSortOrderEnum = "DESC" @@ -107,7 +136,7 @@ "DESC": ListSnapshotsSortOrderDesc, } -// GetListSnapshotsSortOrderEnumValues Enumerates the set of values for ListSnapshotsSortOrder +// GetListSnapshotsSortOrderEnumValues Enumerates the set of values for ListSnapshotsSortOrderEnum func GetListSnapshotsSortOrderEnumValues() []ListSnapshotsSortOrderEnum { values := make([]ListSnapshotsSortOrderEnum, 0) for _, v := range mappingListSnapshotsSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -15,6 +15,7 @@ // MountTarget Provides access to a collection of file systems through one or more VNICs on a // specified subnet. The set of file systems is controlled through the // referenced export set. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type MountTarget struct { // The OCID of the compartment that contains the mount target. @@ -54,6 +55,17 @@ // systems will be exported through Network File System (NFS) protocol on this // mount target. ExportSetId *string `mandatory:"false" json:"exportSetId"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m MountTarget) String() string { @@ -63,7 +75,7 @@ // MountTargetLifecycleStateEnum Enum with underlying type: string type MountTargetLifecycleStateEnum string -// Set of constants representing the allowable values for MountTargetLifecycleState +// Set of constants representing the allowable values for MountTargetLifecycleStateEnum const ( MountTargetLifecycleStateCreating MountTargetLifecycleStateEnum = "CREATING" MountTargetLifecycleStateActive MountTargetLifecycleStateEnum = "ACTIVE" @@ -80,7 +92,7 @@ "FAILED": MountTargetLifecycleStateFailed, } -// GetMountTargetLifecycleStateEnumValues Enumerates the set of values for MountTargetLifecycleState +// GetMountTargetLifecycleStateEnumValues Enumerates the set of values for MountTargetLifecycleStateEnum func GetMountTargetLifecycleStateEnumValues() []MountTargetLifecycleStateEnum { values := make([]MountTargetLifecycleStateEnum, 0) for _, v := range mappingMountTargetLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/mount_target_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -58,7 +58,7 @@ // MountTargetSummaryLifecycleStateEnum Enum with underlying type: string type MountTargetSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for MountTargetSummaryLifecycleState +// Set of constants representing the allowable values for MountTargetSummaryLifecycleStateEnum const ( MountTargetSummaryLifecycleStateCreating MountTargetSummaryLifecycleStateEnum = "CREATING" MountTargetSummaryLifecycleStateActive MountTargetSummaryLifecycleStateEnum = "ACTIVE" @@ -75,7 +75,7 @@ "FAILED": MountTargetSummaryLifecycleStateFailed, } -// GetMountTargetSummaryLifecycleStateEnumValues Enumerates the set of values for MountTargetSummaryLifecycleState +// GetMountTargetSummaryLifecycleStateEnumValues Enumerates the set of values for MountTargetSummaryLifecycleStateEnum func GetMountTargetSummaryLifecycleStateEnumValues() []MountTargetSummaryLifecycleStateEnum { values := make([]MountTargetSummaryLifecycleStateEnum, 0) for _, v := range mappingMountTargetSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -13,6 +13,7 @@ ) // Snapshot A point-in-time snapshot of a specified file system. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type Snapshot struct { // The OCID of the file system from which the snapshot @@ -34,6 +35,17 @@ // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m Snapshot) String() string { @@ -43,7 +55,7 @@ // SnapshotLifecycleStateEnum Enum with underlying type: string type SnapshotLifecycleStateEnum string -// Set of constants representing the allowable values for SnapshotLifecycleState +// Set of constants representing the allowable values for SnapshotLifecycleStateEnum const ( SnapshotLifecycleStateCreating SnapshotLifecycleStateEnum = "CREATING" SnapshotLifecycleStateActive SnapshotLifecycleStateEnum = "ACTIVE" @@ -58,7 +70,7 @@ "DELETED": SnapshotLifecycleStateDeleted, } -// GetSnapshotLifecycleStateEnumValues Enumerates the set of values for SnapshotLifecycleState +// GetSnapshotLifecycleStateEnumValues Enumerates the set of values for SnapshotLifecycleStateEnum func GetSnapshotLifecycleStateEnumValues() []SnapshotLifecycleStateEnum { values := make([]SnapshotLifecycleStateEnum, 0) for _, v := range mappingSnapshotLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/snapshot_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -43,7 +43,7 @@ // SnapshotSummaryLifecycleStateEnum Enum with underlying type: string type SnapshotSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for SnapshotSummaryLifecycleState +// Set of constants representing the allowable values for SnapshotSummaryLifecycleStateEnum const ( SnapshotSummaryLifecycleStateCreating SnapshotSummaryLifecycleStateEnum = "CREATING" SnapshotSummaryLifecycleStateActive SnapshotSummaryLifecycleStateEnum = "ACTIVE" @@ -58,7 +58,7 @@ "DELETED": SnapshotSummaryLifecycleStateDeleted, } -// GetSnapshotSummaryLifecycleStateEnumValues Enumerates the set of values for SnapshotSummaryLifecycleState +// GetSnapshotSummaryLifecycleStateEnumValues Enumerates the set of values for SnapshotSummaryLifecycleStateEnum func GetSnapshotSummaryLifecycleStateEnumValues() []SnapshotSummaryLifecycleStateEnum { values := make([]SnapshotSummaryLifecycleStateEnum, 0) for _, v := range mappingSnapshotSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// File Storage Service API +// +// The API for the File Storage Service. +// + +package filestorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateExportDetails The representation of UpdateExportDetails +type UpdateExportDetails struct { + + // New export options for the export. + // **Setting to the empty array will make the export invisible to all clients.** + // Leaving unset will leave the `exportOptions` unchanged. + ExportOptions []ClientOptions `mandatory:"false" json:"exportOptions"` +} + +func (m UpdateExportDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package filestorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateExportRequest wrapper for the UpdateExport operation +type UpdateExportRequest struct { + + // The OCID of the export. + ExportId *string `mandatory:"true" contributesTo:"path" name:"exportId"` + + // Details object for updating an export. + UpdateExportDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateExportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateExportRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateExportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateExportResponse wrapper for the UpdateExport operation +type UpdateExportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Export instance + Export `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateExportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateExportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -29,7 +29,7 @@ // `maxFsStatBytes` minus the metered size of the file // system. If the metered size is larger than `maxFsStatBytes`, // then `fbytes` and `abytes` will both be '0'. - MaxFsStatBytes *int `mandatory:"false" json:"maxFsStatBytes"` + MaxFsStatBytes *int64 `mandatory:"false" json:"maxFsStatBytes"` // Controls the maximum `ffiles`, `ffiles`, and `afiles` // values reported by `NFS FSSTAT` calls through any associated @@ -40,7 +40,7 @@ // `maxFsStatFiles` minus the metered size of the file // system. If the metered size is larger than `maxFsStatFiles`, // then `ffiles` and `afiles` will both be '0'. - MaxFsStatFiles *int `mandatory:"false" json:"maxFsStatFiles"` + MaxFsStatFiles *int64 `mandatory:"false" json:"maxFsStatFiles"` } func (m UpdateExportSetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_export_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -23,12 +23,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateExportSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateExportSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateExportSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateExportSetResponse wrapper for the UpdateExportSet operation type UpdateExportSetResponse struct { @@ -50,3 +68,8 @@ func (response UpdateExportSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateExportSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -19,6 +19,17 @@ // Avoid entering confidential information. // Example: `My file system` DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateFileSystemDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_file_system_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -23,12 +23,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateFileSystemRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateFileSystemRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateFileSystemRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateFileSystemResponse wrapper for the UpdateFileSystem operation type UpdateFileSystemResponse struct { @@ -50,3 +68,8 @@ func (response UpdateFileSystemResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateFileSystemResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // File Storage Service API @@ -19,6 +19,17 @@ // Avoid entering confidential information. // Example: `My mount target` DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateMountTargetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_mount_target_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage @@ -23,12 +23,30 @@ // The resource will be updated or deleted only if the etag you // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateMountTargetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateMountTargetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateMountTargetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateMountTargetResponse wrapper for the UpdateMountTarget operation type UpdateMountTargetResponse struct { @@ -50,3 +68,8 @@ func (response UpdateMountTargetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// File Storage Service API +// +// The API for the File Storage Service. +// + +package filestorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateSnapshotDetails The representation of UpdateSnapshotDetails +type UpdateSnapshotDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair + // with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateSnapshotDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/filestorage/update_snapshot_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package filestorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateSnapshotRequest wrapper for the UpdateSnapshot operation +type UpdateSnapshotRequest struct { + + // The OCID of the snapshot. + SnapshotId *string `mandatory:"true" contributesTo:"path" name:"snapshotId"` + + // Details object for updating a snapshot. + UpdateSnapshotDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSnapshotRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSnapshotRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSnapshotRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateSnapshotResponse wrapper for the UpdateSnapshot operation +type UpdateSnapshotResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Snapshot instance + Snapshot `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If + // you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateSnapshotResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSnapshotResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/.gitignore juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/.gitignore --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/.gitignore 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/.gitignore 2019-06-28 17:13:01.000000000 +0000 @@ -10,3 +10,4 @@ .vscode/* target/ bin/ +temp/ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/connection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/connection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/connection.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/connection.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Connection The network connection results. +type Connection struct { + + // The connection IP address. + Address *string `mandatory:"false" json:"address"` + + // The port. + Port *int `mandatory:"false" json:"port"` +} + +func (m Connection) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateHttpMonitorDetails The request body used to create an HTTP monitor. +type CreateHttpMonitorDetails struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + Targets []string `mandatory:"true" json:"targets"` + + Protocol CreateHttpMonitorDetailsProtocolEnum `mandatory:"true" json:"protocol"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"true" json:"intervalInSeconds"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Method CreateHttpMonitorDetailsMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The optional URL path to probe, including query parameters. + Path *string `mandatory:"false" json:"path"` + + // A dictionary of HTTP request headers. + // *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. + Headers map[string]string `mandatory:"false" json:"headers"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateHttpMonitorDetails) String() string { + return common.PointerString(m) +} + +// CreateHttpMonitorDetailsProtocolEnum Enum with underlying type: string +type CreateHttpMonitorDetailsProtocolEnum string + +// Set of constants representing the allowable values for CreateHttpMonitorDetailsProtocolEnum +const ( + CreateHttpMonitorDetailsProtocolHttp CreateHttpMonitorDetailsProtocolEnum = "HTTP" + CreateHttpMonitorDetailsProtocolHttps CreateHttpMonitorDetailsProtocolEnum = "HTTPS" +) + +var mappingCreateHttpMonitorDetailsProtocol = map[string]CreateHttpMonitorDetailsProtocolEnum{ + "HTTP": CreateHttpMonitorDetailsProtocolHttp, + "HTTPS": CreateHttpMonitorDetailsProtocolHttps, +} + +// GetCreateHttpMonitorDetailsProtocolEnumValues Enumerates the set of values for CreateHttpMonitorDetailsProtocolEnum +func GetCreateHttpMonitorDetailsProtocolEnumValues() []CreateHttpMonitorDetailsProtocolEnum { + values := make([]CreateHttpMonitorDetailsProtocolEnum, 0) + for _, v := range mappingCreateHttpMonitorDetailsProtocol { + values = append(values, v) + } + return values +} + +// CreateHttpMonitorDetailsMethodEnum Enum with underlying type: string +type CreateHttpMonitorDetailsMethodEnum string + +// Set of constants representing the allowable values for CreateHttpMonitorDetailsMethodEnum +const ( + CreateHttpMonitorDetailsMethodGet CreateHttpMonitorDetailsMethodEnum = "GET" + CreateHttpMonitorDetailsMethodHead CreateHttpMonitorDetailsMethodEnum = "HEAD" +) + +var mappingCreateHttpMonitorDetailsMethod = map[string]CreateHttpMonitorDetailsMethodEnum{ + "GET": CreateHttpMonitorDetailsMethodGet, + "HEAD": CreateHttpMonitorDetailsMethodHead, +} + +// GetCreateHttpMonitorDetailsMethodEnumValues Enumerates the set of values for CreateHttpMonitorDetailsMethodEnum +func GetCreateHttpMonitorDetailsMethodEnumValues() []CreateHttpMonitorDetailsMethodEnum { + values := make([]CreateHttpMonitorDetailsMethodEnum, 0) + for _, v := range mappingCreateHttpMonitorDetailsMethod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_http_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateHttpMonitorRequest wrapper for the CreateHttpMonitor operation +type CreateHttpMonitorRequest struct { + + // The configuration details for creating an HTTP monitor. + CreateHttpMonitorDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateHttpMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateHttpMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateHttpMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateHttpMonitorResponse wrapper for the CreateHttpMonitor operation +type CreateHttpMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HttpMonitor instance + HttpMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The URL of the newly created monitor. + Location *string `presentIn:"header" name:"location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateHttpMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateHttpMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateOnDemandHttpProbeDetails The request body used to create an on-demand HTTP probe. +type CreateOnDemandHttpProbeDetails struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + Targets []string `mandatory:"true" json:"targets"` + + Protocol CreateOnDemandHttpProbeDetailsProtocolEnum `mandatory:"true" json:"protocol"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Method CreateOnDemandHttpProbeDetailsMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The optional URL path to probe, including query parameters. + Path *string `mandatory:"false" json:"path"` + + // A dictionary of HTTP request headers. + // *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. + Headers map[string]string `mandatory:"false" json:"headers"` +} + +func (m CreateOnDemandHttpProbeDetails) String() string { + return common.PointerString(m) +} + +// CreateOnDemandHttpProbeDetailsProtocolEnum Enum with underlying type: string +type CreateOnDemandHttpProbeDetailsProtocolEnum string + +// Set of constants representing the allowable values for CreateOnDemandHttpProbeDetailsProtocolEnum +const ( + CreateOnDemandHttpProbeDetailsProtocolHttp CreateOnDemandHttpProbeDetailsProtocolEnum = "HTTP" + CreateOnDemandHttpProbeDetailsProtocolHttps CreateOnDemandHttpProbeDetailsProtocolEnum = "HTTPS" +) + +var mappingCreateOnDemandHttpProbeDetailsProtocol = map[string]CreateOnDemandHttpProbeDetailsProtocolEnum{ + "HTTP": CreateOnDemandHttpProbeDetailsProtocolHttp, + "HTTPS": CreateOnDemandHttpProbeDetailsProtocolHttps, +} + +// GetCreateOnDemandHttpProbeDetailsProtocolEnumValues Enumerates the set of values for CreateOnDemandHttpProbeDetailsProtocolEnum +func GetCreateOnDemandHttpProbeDetailsProtocolEnumValues() []CreateOnDemandHttpProbeDetailsProtocolEnum { + values := make([]CreateOnDemandHttpProbeDetailsProtocolEnum, 0) + for _, v := range mappingCreateOnDemandHttpProbeDetailsProtocol { + values = append(values, v) + } + return values +} + +// CreateOnDemandHttpProbeDetailsMethodEnum Enum with underlying type: string +type CreateOnDemandHttpProbeDetailsMethodEnum string + +// Set of constants representing the allowable values for CreateOnDemandHttpProbeDetailsMethodEnum +const ( + CreateOnDemandHttpProbeDetailsMethodGet CreateOnDemandHttpProbeDetailsMethodEnum = "GET" + CreateOnDemandHttpProbeDetailsMethodHead CreateOnDemandHttpProbeDetailsMethodEnum = "HEAD" +) + +var mappingCreateOnDemandHttpProbeDetailsMethod = map[string]CreateOnDemandHttpProbeDetailsMethodEnum{ + "GET": CreateOnDemandHttpProbeDetailsMethodGet, + "HEAD": CreateOnDemandHttpProbeDetailsMethodHead, +} + +// GetCreateOnDemandHttpProbeDetailsMethodEnumValues Enumerates the set of values for CreateOnDemandHttpProbeDetailsMethodEnum +func GetCreateOnDemandHttpProbeDetailsMethodEnumValues() []CreateOnDemandHttpProbeDetailsMethodEnum { + values := make([]CreateOnDemandHttpProbeDetailsMethodEnum, 0) + for _, v := range mappingCreateOnDemandHttpProbeDetailsMethod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_http_probe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateOnDemandHttpProbeRequest wrapper for the CreateOnDemandHttpProbe operation +type CreateOnDemandHttpProbeRequest struct { + + // The configuration of the HTTP probe. + CreateOnDemandHttpProbeDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateOnDemandHttpProbeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateOnDemandHttpProbeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateOnDemandHttpProbeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateOnDemandHttpProbeResponse wrapper for the CreateOnDemandHttpProbe operation +type CreateOnDemandHttpProbeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HttpProbe instance + HttpProbe `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The URL for fetching probe results. + Location *string `presentIn:"header" name:"location"` +} + +func (response CreateOnDemandHttpProbeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateOnDemandHttpProbeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateOnDemandPingProbeDetails The request body used to create an on-demand ping probe. +type CreateOnDemandPingProbeDetails struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + Targets []string `mandatory:"true" json:"targets"` + + Protocol CreateOnDemandPingProbeDetailsProtocolEnum `mandatory:"true" json:"protocol"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` +} + +func (m CreateOnDemandPingProbeDetails) String() string { + return common.PointerString(m) +} + +// CreateOnDemandPingProbeDetailsProtocolEnum Enum with underlying type: string +type CreateOnDemandPingProbeDetailsProtocolEnum string + +// Set of constants representing the allowable values for CreateOnDemandPingProbeDetailsProtocolEnum +const ( + CreateOnDemandPingProbeDetailsProtocolIcmp CreateOnDemandPingProbeDetailsProtocolEnum = "ICMP" + CreateOnDemandPingProbeDetailsProtocolTcp CreateOnDemandPingProbeDetailsProtocolEnum = "TCP" +) + +var mappingCreateOnDemandPingProbeDetailsProtocol = map[string]CreateOnDemandPingProbeDetailsProtocolEnum{ + "ICMP": CreateOnDemandPingProbeDetailsProtocolIcmp, + "TCP": CreateOnDemandPingProbeDetailsProtocolTcp, +} + +// GetCreateOnDemandPingProbeDetailsProtocolEnumValues Enumerates the set of values for CreateOnDemandPingProbeDetailsProtocolEnum +func GetCreateOnDemandPingProbeDetailsProtocolEnumValues() []CreateOnDemandPingProbeDetailsProtocolEnum { + values := make([]CreateOnDemandPingProbeDetailsProtocolEnum, 0) + for _, v := range mappingCreateOnDemandPingProbeDetailsProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_on_demand_ping_probe_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateOnDemandPingProbeRequest wrapper for the CreateOnDemandPingProbe operation +type CreateOnDemandPingProbeRequest struct { + + // Configuration details for creating an on-demand ping probe. + CreateOnDemandPingProbeDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateOnDemandPingProbeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateOnDemandPingProbeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateOnDemandPingProbeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateOnDemandPingProbeResponse wrapper for the CreateOnDemandPingProbe operation +type CreateOnDemandPingProbeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PingProbe instance + PingProbe `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The URL for fetching probe results. + Location *string `presentIn:"header" name:"location"` +} + +func (response CreateOnDemandPingProbeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateOnDemandPingProbeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreatePingMonitorDetails The request body used to create a Ping monitor. +type CreatePingMonitorDetails struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + Targets []string `mandatory:"true" json:"targets"` + + Protocol CreatePingMonitorDetailsProtocolEnum `mandatory:"true" json:"protocol"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"true" json:"intervalInSeconds"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreatePingMonitorDetails) String() string { + return common.PointerString(m) +} + +// CreatePingMonitorDetailsProtocolEnum Enum with underlying type: string +type CreatePingMonitorDetailsProtocolEnum string + +// Set of constants representing the allowable values for CreatePingMonitorDetailsProtocolEnum +const ( + CreatePingMonitorDetailsProtocolIcmp CreatePingMonitorDetailsProtocolEnum = "ICMP" + CreatePingMonitorDetailsProtocolTcp CreatePingMonitorDetailsProtocolEnum = "TCP" +) + +var mappingCreatePingMonitorDetailsProtocol = map[string]CreatePingMonitorDetailsProtocolEnum{ + "ICMP": CreatePingMonitorDetailsProtocolIcmp, + "TCP": CreatePingMonitorDetailsProtocolTcp, +} + +// GetCreatePingMonitorDetailsProtocolEnumValues Enumerates the set of values for CreatePingMonitorDetailsProtocolEnum +func GetCreatePingMonitorDetailsProtocolEnumValues() []CreatePingMonitorDetailsProtocolEnum { + values := make([]CreatePingMonitorDetailsProtocolEnum, 0) + for _, v := range mappingCreatePingMonitorDetailsProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/create_ping_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreatePingMonitorRequest wrapper for the CreatePingMonitor operation +type CreatePingMonitorRequest struct { + + // The configuration details for creating a ping monitor. + CreatePingMonitorDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreatePingMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreatePingMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePingMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreatePingMonitorResponse wrapper for the CreatePingMonitor operation +type CreatePingMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PingMonitor instance + PingMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The URL of the newly created monitor. + Location *string `presentIn:"header" name:"location"` + + // An entity tag that uniquely identifies a version of the resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreatePingMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreatePingMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_http_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_http_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_http_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_http_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteHttpMonitorRequest wrapper for the DeleteHttpMonitor operation +type DeleteHttpMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET + // or POST response for that resource. The resource will be updated or deleted + // only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteHttpMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteHttpMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteHttpMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteHttpMonitorResponse wrapper for the DeleteHttpMonitor operation +type DeleteHttpMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteHttpMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteHttpMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_ping_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_ping_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_ping_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/delete_ping_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeletePingMonitorRequest wrapper for the DeletePingMonitor operation +type DeletePingMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET + // or POST response for that resource. The resource will be updated or deleted + // only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeletePingMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeletePingMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePingMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeletePingMonitorResponse wrapper for the DeletePingMonitor operation +type DeletePingMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeletePingMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeletePingMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/dns.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/dns.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/dns.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/dns.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Dns The DNS resolution results. +type Dns struct { + + // Total DNS resolution duration, in milliseconds. Calculated using `domainLookupEnd` + // minus `domainLookupStart`. + DomainLookupDuration *float64 `mandatory:"false" json:"domainLookupDuration"` + + // The addresses returned by DNS resolution. + Addresses []string `mandatory:"false" json:"addresses"` +} + +func (m Dns) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/geolocation.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/geolocation.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/geolocation.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/geolocation.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Geolocation Geographic information about a vantage point. +type Geolocation struct { + + // An opaque identifier for the geographic location of the vantage point. + GeoKey *string `mandatory:"false" json:"geoKey"` + + // The ISO 3166-2 code for this location's first-level administrative + // division, either a US state or Canadian province. Only included for locations + // in the US or Canada. For a list of codes, see + // Country Codes (https://www.iso.org/obp/ui/#search). + AdminDivCode *string `mandatory:"false" json:"adminDivCode"` + + // Common English-language name for the city. + CityName *string `mandatory:"false" json:"cityName"` + + // The ISO 3166-1 alpha-2 country code. For a list of codes, + // see Country Codes (https://www.iso.org/obp/ui/#search). + CountryCode *string `mandatory:"false" json:"countryCode"` + + // The common English-language name for the country. + CountryName *string `mandatory:"false" json:"countryName"` + + // Degrees north of the Equator. + Latitude *float32 `mandatory:"false" json:"latitude"` + + // Degrees east of the prime meridian. + Longitude *float32 `mandatory:"false" json:"longitude"` +} + +func (m Geolocation) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_http_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_http_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_http_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_http_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetHttpMonitorRequest wrapper for the GetHttpMonitor operation +type GetHttpMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The `If-None-Match` header field makes the request method conditional on + // the absence of any current representation of the target resource, when + // the field-value is `*`, or having a selected representation with an + // entity-tag that does not match any of those listed in the field-value. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetHttpMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHttpMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHttpMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetHttpMonitorResponse wrapper for the GetHttpMonitor operation +type GetHttpMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HttpMonitor instance + HttpMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetHttpMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHttpMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_ping_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_ping_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_ping_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/get_ping_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetPingMonitorRequest wrapper for the GetPingMonitor operation +type GetPingMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The `If-None-Match` header field makes the request method conditional on + // the absence of any current representation of the target resource, when + // the field-value is `*`, or having a selected representation with an + // entity-tag that does not match any of those listed in the field-value. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPingMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPingMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPingMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetPingMonitorResponse wrapper for the GetPingMonitor operation +type GetPingMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PingMonitor instance + PingMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // An entity tag that uniquely identifies a version of the resource. + Etag *string `presentIn:"header" name:"etag"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetPingMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPingMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/healthchecks_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/healthchecks_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/healthchecks_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/healthchecks_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,724 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//HealthChecksClient a client for HealthChecks +type HealthChecksClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewHealthChecksClientWithConfigurationProvider Creates a new default HealthChecks client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewHealthChecksClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client HealthChecksClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = HealthChecksClient{BaseClient: baseClient} + client.BasePath = "20180501" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *HealthChecksClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("healthchecks") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *HealthChecksClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *HealthChecksClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateHttpMonitor Creates an HTTP monitor. Vantage points will be automatically selected if not specified, +// and probes will be initiated from each vantage point to each of the targets at the frequency +// specified by `intervalInSeconds`. +func (client HealthChecksClient) CreateHttpMonitor(ctx context.Context, request CreateHttpMonitorRequest) (response CreateHttpMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createHttpMonitor, policy) + if err != nil { + if ociResponse != nil { + response = CreateHttpMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateHttpMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateHttpMonitorResponse") + } + return +} + +// createHttpMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) createHttpMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/httpMonitors") + if err != nil { + return nil, err + } + + var response CreateHttpMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateOnDemandHttpProbe Creates an on-demand HTTP probe. The location response header contains the URL for +// fetching the probe results. +// *Note:* On-demand probe configurations are not saved. +func (client HealthChecksClient) CreateOnDemandHttpProbe(ctx context.Context, request CreateOnDemandHttpProbeRequest) (response CreateOnDemandHttpProbeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createOnDemandHttpProbe, policy) + if err != nil { + if ociResponse != nil { + response = CreateOnDemandHttpProbeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateOnDemandHttpProbeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateOnDemandHttpProbeResponse") + } + return +} + +// createOnDemandHttpProbe implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) createOnDemandHttpProbe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/httpProbeResults") + if err != nil { + return nil, err + } + + var response CreateOnDemandHttpProbeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateOnDemandPingProbe Creates an on-demand ping probe. The location response header contains the URL for +// fetching probe results. +// *Note:* The on-demand probe configuration is not saved. +func (client HealthChecksClient) CreateOnDemandPingProbe(ctx context.Context, request CreateOnDemandPingProbeRequest) (response CreateOnDemandPingProbeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createOnDemandPingProbe, policy) + if err != nil { + if ociResponse != nil { + response = CreateOnDemandPingProbeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateOnDemandPingProbeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateOnDemandPingProbeResponse") + } + return +} + +// createOnDemandPingProbe implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) createOnDemandPingProbe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/pingProbeResults") + if err != nil { + return nil, err + } + + var response CreateOnDemandPingProbeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreatePingMonitor Creates a ping monitor. Vantage points will be automatically selected if not specified, +// and probes will be initiated from each vantage point to each of the targets at the frequency +// specified by `intervalInSeconds`. +func (client HealthChecksClient) CreatePingMonitor(ctx context.Context, request CreatePingMonitorRequest) (response CreatePingMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createPingMonitor, policy) + if err != nil { + if ociResponse != nil { + response = CreatePingMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreatePingMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePingMonitorResponse") + } + return +} + +// createPingMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) createPingMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/pingMonitors") + if err != nil { + return nil, err + } + + var response CreatePingMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteHttpMonitor Deletes the HTTP monitor and its configuration. All future probes of this +// monitor are stopped. Results associated with the monitor are not deleted. +func (client HealthChecksClient) DeleteHttpMonitor(ctx context.Context, request DeleteHttpMonitorRequest) (response DeleteHttpMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteHttpMonitor, policy) + if err != nil { + if ociResponse != nil { + response = DeleteHttpMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteHttpMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteHttpMonitorResponse") + } + return +} + +// deleteHttpMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) deleteHttpMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/httpMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response DeleteHttpMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeletePingMonitor Deletes the ping monitor and its configuration. All future probes of this +// monitor are stopped. Results associated with the monitor are not deleted. +func (client HealthChecksClient) DeletePingMonitor(ctx context.Context, request DeletePingMonitorRequest) (response DeletePingMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deletePingMonitor, policy) + if err != nil { + if ociResponse != nil { + response = DeletePingMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeletePingMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePingMonitorResponse") + } + return +} + +// deletePingMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) deletePingMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/pingMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response DeletePingMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHttpMonitor Gets the configuration for the specified monitor. +func (client HealthChecksClient) GetHttpMonitor(ctx context.Context, request GetHttpMonitorRequest) (response GetHttpMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHttpMonitor, policy) + if err != nil { + if ociResponse != nil { + response = GetHttpMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetHttpMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHttpMonitorResponse") + } + return +} + +// getHttpMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) getHttpMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/httpMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response GetHttpMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPingMonitor Gets the configuration for the specified ping monitor. +func (client HealthChecksClient) GetPingMonitor(ctx context.Context, request GetPingMonitorRequest) (response GetPingMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPingMonitor, policy) + if err != nil { + if ociResponse != nil { + response = GetPingMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetPingMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPingMonitorResponse") + } + return +} + +// getPingMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) getPingMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/pingMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response GetPingMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHealthChecksVantagePoints Gets information about all vantage points available to the user. +func (client HealthChecksClient) ListHealthChecksVantagePoints(ctx context.Context, request ListHealthChecksVantagePointsRequest) (response ListHealthChecksVantagePointsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHealthChecksVantagePoints, policy) + if err != nil { + if ociResponse != nil { + response = ListHealthChecksVantagePointsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListHealthChecksVantagePointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHealthChecksVantagePointsResponse") + } + return +} + +// listHealthChecksVantagePoints implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) listHealthChecksVantagePoints(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vantagePoints") + if err != nil { + return nil, err + } + + var response ListHealthChecksVantagePointsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHttpMonitors Gets a list of HTTP monitors. +func (client HealthChecksClient) ListHttpMonitors(ctx context.Context, request ListHttpMonitorsRequest) (response ListHttpMonitorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHttpMonitors, policy) + if err != nil { + if ociResponse != nil { + response = ListHttpMonitorsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListHttpMonitorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHttpMonitorsResponse") + } + return +} + +// listHttpMonitors implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) listHttpMonitors(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/httpMonitors") + if err != nil { + return nil, err + } + + var response ListHttpMonitorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHttpProbeResults Gets the HTTP probe results for the specified probe or monitor, where +// the `probeConfigurationId` is the OCID of either a monitor or an +// on-demand probe. +func (client HealthChecksClient) ListHttpProbeResults(ctx context.Context, request ListHttpProbeResultsRequest) (response ListHttpProbeResultsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHttpProbeResults, policy) + if err != nil { + if ociResponse != nil { + response = ListHttpProbeResultsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListHttpProbeResultsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHttpProbeResultsResponse") + } + return +} + +// listHttpProbeResults implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) listHttpProbeResults(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/httpProbeResults/{probeConfigurationId}") + if err != nil { + return nil, err + } + + var response ListHttpProbeResultsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPingMonitors Gets a list of configured ping monitors. +// Results are paginated based on `page` and `limit`. The `opc-next-page` header provides +// a URL for fetching the next page. +func (client HealthChecksClient) ListPingMonitors(ctx context.Context, request ListPingMonitorsRequest) (response ListPingMonitorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPingMonitors, policy) + if err != nil { + if ociResponse != nil { + response = ListPingMonitorsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListPingMonitorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPingMonitorsResponse") + } + return +} + +// listPingMonitors implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) listPingMonitors(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/pingMonitors") + if err != nil { + return nil, err + } + + var response ListPingMonitorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPingProbeResults Returns the results for the specified probe, where the `probeConfigurationId` +// is the OCID of either a monitor or an on-demand probe. +// Results are paginated based on `page` and `limit`. The `opc-next-page` header provides +// a URL for fetching the next page. Use `sortOrder` to set the order of the +// results. If `sortOrder` is unspecified, results are sorted in ascending order by +// `startTime`. +func (client HealthChecksClient) ListPingProbeResults(ctx context.Context, request ListPingProbeResultsRequest) (response ListPingProbeResultsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPingProbeResults, policy) + if err != nil { + if ociResponse != nil { + response = ListPingProbeResultsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListPingProbeResultsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPingProbeResultsResponse") + } + return +} + +// listPingProbeResults implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) listPingProbeResults(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/pingProbeResults/{probeConfigurationId}") + if err != nil { + return nil, err + } + + var response ListPingProbeResultsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateHttpMonitor Updates the configuration of the specified HTTP monitor. Only the fields +// specified in the request body will be updated; all other configuration +// properties will remain unchanged. +func (client HealthChecksClient) UpdateHttpMonitor(ctx context.Context, request UpdateHttpMonitorRequest) (response UpdateHttpMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateHttpMonitor, policy) + if err != nil { + if ociResponse != nil { + response = UpdateHttpMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateHttpMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHttpMonitorResponse") + } + return +} + +// updateHttpMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) updateHttpMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/httpMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response UpdateHttpMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdatePingMonitor Updates the configuration of the specified ping monitor. Only the fields +// specified in the request body will be updated; all other configuration properties +// will remain unchanged. +func (client HealthChecksClient) UpdatePingMonitor(ctx context.Context, request UpdatePingMonitorRequest) (response UpdatePingMonitorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updatePingMonitor, policy) + if err != nil { + if ociResponse != nil { + response = UpdatePingMonitorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdatePingMonitorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePingMonitorResponse") + } + return +} + +// updatePingMonitor implements the OCIOperation interface (enables retrying operations) +func (client HealthChecksClient) updatePingMonitor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/pingMonitors/{monitorId}") + if err != nil { + return nil, err + } + + var response UpdatePingMonitorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/health_checks_vantage_point_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/health_checks_vantage_point_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/health_checks_vantage_point_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/health_checks_vantage_point_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HealthChecksVantagePointSummary Information about a vantage point. +type HealthChecksVantagePointSummary struct { + + // The display name for the vantage point. Display names are determined by + // the best information available and may change over time. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The organization on whose infrastructure this vantage point resides. + // Provider names are not unique, as Oracle Cloud Infrastructure maintains + // many vantage points in each major provider. + ProviderName *string `mandatory:"false" json:"providerName"` + + // The unique, permanent name for the vantage point. + Name *string `mandatory:"false" json:"name"` + + Geo *Geolocation `mandatory:"false" json:"geo"` + + // An array of objects that describe how traffic to this vantage point is + // routed, including which prefixes and ASNs connect it to the internet. + // The addresses are sorted from the most-specific to least-specific + // prefix (the smallest network to largest network). When a prefix has + // multiple origin ASNs (MOAS routing), they are sorted by weight + // (highest to lowest). Weight is determined by the total percentage of + // peers observing the prefix originating from an ASN. Only present if + // `fields` includes `routing`. The field will be null if the address's + // routing information is unknown. + Routing []Routing `mandatory:"false" json:"routing"` +} + +func (m HealthChecksVantagePointSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,121 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpMonitor This model contains all of the mutable and immutable properties for an HTTP monitor. +type HttpMonitor struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol HttpMonitorProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + Method HttpMonitorMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The optional URL path to probe, including query parameters. + Path *string `mandatory:"false" json:"path"` + + // A dictionary of HTTP request headers. + // *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. + Headers map[string]string `mandatory:"false" json:"headers"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m HttpMonitor) String() string { + return common.PointerString(m) +} + +// HttpMonitorProtocolEnum Enum with underlying type: string +type HttpMonitorProtocolEnum string + +// Set of constants representing the allowable values for HttpMonitorProtocolEnum +const ( + HttpMonitorProtocolHttp HttpMonitorProtocolEnum = "HTTP" + HttpMonitorProtocolHttps HttpMonitorProtocolEnum = "HTTPS" +) + +var mappingHttpMonitorProtocol = map[string]HttpMonitorProtocolEnum{ + "HTTP": HttpMonitorProtocolHttp, + "HTTPS": HttpMonitorProtocolHttps, +} + +// GetHttpMonitorProtocolEnumValues Enumerates the set of values for HttpMonitorProtocolEnum +func GetHttpMonitorProtocolEnumValues() []HttpMonitorProtocolEnum { + values := make([]HttpMonitorProtocolEnum, 0) + for _, v := range mappingHttpMonitorProtocol { + values = append(values, v) + } + return values +} + +// HttpMonitorMethodEnum Enum with underlying type: string +type HttpMonitorMethodEnum string + +// Set of constants representing the allowable values for HttpMonitorMethodEnum +const ( + HttpMonitorMethodGet HttpMonitorMethodEnum = "GET" + HttpMonitorMethodHead HttpMonitorMethodEnum = "HEAD" +) + +var mappingHttpMonitorMethod = map[string]HttpMonitorMethodEnum{ + "GET": HttpMonitorMethodGet, + "HEAD": HttpMonitorMethodHead, +} + +// GetHttpMonitorMethodEnumValues Enumerates the set of values for HttpMonitorMethodEnum +func GetHttpMonitorMethodEnumValues() []HttpMonitorMethodEnum { + values := make([]HttpMonitorMethodEnum, 0) + for _, v := range mappingHttpMonitorMethod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_monitor_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpMonitorSummary A summary containing all of the mutable and immutable properties for an HTTP monitor. +type HttpMonitorSummary struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + Protocol HttpMonitorSummaryProtocolEnum `mandatory:"false" json:"protocol,omitempty"` +} + +func (m HttpMonitorSummary) String() string { + return common.PointerString(m) +} + +// HttpMonitorSummaryProtocolEnum Enum with underlying type: string +type HttpMonitorSummaryProtocolEnum string + +// Set of constants representing the allowable values for HttpMonitorSummaryProtocolEnum +const ( + HttpMonitorSummaryProtocolHttp HttpMonitorSummaryProtocolEnum = "HTTP" + HttpMonitorSummaryProtocolHttps HttpMonitorSummaryProtocolEnum = "HTTPS" +) + +var mappingHttpMonitorSummaryProtocol = map[string]HttpMonitorSummaryProtocolEnum{ + "HTTP": HttpMonitorSummaryProtocolHttp, + "HTTPS": HttpMonitorSummaryProtocolHttps, +} + +// GetHttpMonitorSummaryProtocolEnumValues Enumerates the set of values for HttpMonitorSummaryProtocolEnum +func GetHttpMonitorSummaryProtocolEnumValues() []HttpMonitorSummaryProtocolEnum { + values := make([]HttpMonitorSummaryProtocolEnum, 0) + for _, v := range mappingHttpMonitorSummaryProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpProbe A summary that contains all of the mutable and immutable properties for an HTTP probe. +type HttpProbe struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol HttpProbeProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + Method HttpProbeMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The optional URL path to probe, including query parameters. + Path *string `mandatory:"false" json:"path"` + + // A dictionary of HTTP request headers. + // *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. + Headers map[string]string `mandatory:"false" json:"headers"` +} + +func (m HttpProbe) String() string { + return common.PointerString(m) +} + +// HttpProbeProtocolEnum Enum with underlying type: string +type HttpProbeProtocolEnum string + +// Set of constants representing the allowable values for HttpProbeProtocolEnum +const ( + HttpProbeProtocolHttp HttpProbeProtocolEnum = "HTTP" + HttpProbeProtocolHttps HttpProbeProtocolEnum = "HTTPS" +) + +var mappingHttpProbeProtocol = map[string]HttpProbeProtocolEnum{ + "HTTP": HttpProbeProtocolHttp, + "HTTPS": HttpProbeProtocolHttps, +} + +// GetHttpProbeProtocolEnumValues Enumerates the set of values for HttpProbeProtocolEnum +func GetHttpProbeProtocolEnumValues() []HttpProbeProtocolEnum { + values := make([]HttpProbeProtocolEnum, 0) + for _, v := range mappingHttpProbeProtocol { + values = append(values, v) + } + return values +} + +// HttpProbeMethodEnum Enum with underlying type: string +type HttpProbeMethodEnum string + +// Set of constants representing the allowable values for HttpProbeMethodEnum +const ( + HttpProbeMethodGet HttpProbeMethodEnum = "GET" + HttpProbeMethodHead HttpProbeMethodEnum = "HEAD" +) + +var mappingHttpProbeMethod = map[string]HttpProbeMethodEnum{ + "GET": HttpProbeMethodGet, + "HEAD": HttpProbeMethodHead, +} + +// GetHttpProbeMethodEnumValues Enumerates the set of values for HttpProbeMethodEnum +func GetHttpProbeMethodEnumValues() []HttpProbeMethodEnum { + values := make([]HttpProbeMethodEnum, 0) + for _, v := range mappingHttpProbeMethod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_method.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_method.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_method.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_method.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpProbeMethod The supported HTTP methods available for probes. +type HttpProbeMethod struct { +} + +func (m HttpProbeMethod) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_protocol.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_protocol.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_protocol.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_protocol.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpProbeProtocol The supported protocols available for HTTP probes. +type HttpProbeProtocol struct { +} + +func (m HttpProbeProtocol) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_result_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_result_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_result_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/http_probe_result_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HttpProbeResultSummary The results returned by running an HTTP probe. All times and durations are +// returned in milliseconds. All times are relative to the POSIX epoch +// (1970-01-01T00:00Z). Time properties conform to W3C Resource Timing. +// For more information, see +// PerformanceResourceTiming (https://w3c.github.io/resource-timing/#sec-resource-timing) +// interface. +type HttpProbeResultSummary struct { + + // A value identifying this specific probe result. The key is only unique within + // the results of its probe configuration. The key may be reused after 90 days. + Key *string `mandatory:"false" json:"key"` + + // The OCID of the monitor or on-demand probe responsible for creating this result. + ProbeConfigurationId *string `mandatory:"false" json:"probeConfigurationId"` + + // The date and time the probe was executed, expressed in milliseconds since the + // POSIX epoch. This field is defined by the PerformanceResourceTiming interface + // of the W3C Resource Timing specification. For more information, see + // Resource Timing (https://w3c.github.io/resource-timing/#sec-resource-timing). + StartTime *float64 `mandatory:"false" json:"startTime"` + + // The target hostname or IP address of the probe. + Target *string `mandatory:"false" json:"target"` + + // The name of the vantage point that executed the probe. + VantagePointName *string `mandatory:"false" json:"vantagePointName"` + + // True if the probe did not complete before the configured `timeoutInSeconds` value. + IsTimedOut *bool `mandatory:"false" json:"isTimedOut"` + + // True if the probe result is determined to be healthy based on probe + // type-specific criteria. For HTTP probes, a probe result is considered + // healthy if the HTTP response code is greater than or equal to 200 and + // less than 300. + IsHealthy *bool `mandatory:"false" json:"isHealthy"` + + // The category of error if an error occurs executing the probe. + // The `errorMessage` field provides a message with the error details. + // * NONE - No error + // * DNS - DNS errors + // * TRANSPORT - Transport-related errors, for example a "TLS certificate expired" error. + // * NETWORK - Network-related errors, for example a "network unreachable" error. + // * SYSTEM - Internal system errors. + ErrorCategory HttpProbeResultSummaryErrorCategoryEnum `mandatory:"false" json:"errorCategory,omitempty"` + + // The error information indicating why a probe execution failed. + ErrorMessage *string `mandatory:"false" json:"errorMessage"` + + Protocol HttpProbeResultSummaryProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + Connection *TcpConnection `mandatory:"false" json:"connection"` + + Dns *Dns `mandatory:"false" json:"dns"` + + // The HTTP response status code. + StatusCode *int `mandatory:"false" json:"statusCode"` + + // The time immediately before the vantage point starts the domain name lookup for + // the resource. + DomainLookupStart *float64 `mandatory:"false" json:"domainLookupStart"` + + // The time immediately before the vantage point finishes the domain name lookup for + // the resource. + DomainLookupEnd *float64 `mandatory:"false" json:"domainLookupEnd"` + + // The time immediately before the vantage point starts establishing the connection + // to the server to retrieve the resource. + ConnectStart *float64 `mandatory:"false" json:"connectStart"` + + // The time immediately before the vantage point starts the handshake process to + // secure the current connection. + SecureConnectionStart *float64 `mandatory:"false" json:"secureConnectionStart"` + + // The time immediately after the vantage point finishes establishing the connection + // to the server to retrieve the resource. + ConnectEnd *float64 `mandatory:"false" json:"connectEnd"` + + // The time immediately before the vantage point starts to fetch the resource. + FetchStart *float64 `mandatory:"false" json:"fetchStart"` + + // The time immediately before the vantage point starts requesting the resource from + // the server. + RequestStart *float64 `mandatory:"false" json:"requestStart"` + + // The time immediately after the vantage point's HTTP parser receives the first byte + // of the response. + ResponseStart *float64 `mandatory:"false" json:"responseStart"` + + // The time immediately after the vantage point receives the last byte of the response + // or immediately before the transport connection is closed, whichever comes first. + ResponseEnd *float64 `mandatory:"false" json:"responseEnd"` + + // The total duration from start of request until response is fully consumed or the + // connection is closed. + Duration *float64 `mandatory:"false" json:"duration"` + + // The size, in octets, of the payload body prior to removing any applied + // content-codings. + EncodedBodySize *int `mandatory:"false" json:"encodedBodySize"` +} + +func (m HttpProbeResultSummary) String() string { + return common.PointerString(m) +} + +// HttpProbeResultSummaryErrorCategoryEnum Enum with underlying type: string +type HttpProbeResultSummaryErrorCategoryEnum string + +// Set of constants representing the allowable values for HttpProbeResultSummaryErrorCategoryEnum +const ( + HttpProbeResultSummaryErrorCategoryNone HttpProbeResultSummaryErrorCategoryEnum = "NONE" + HttpProbeResultSummaryErrorCategoryDns HttpProbeResultSummaryErrorCategoryEnum = "DNS" + HttpProbeResultSummaryErrorCategoryTransport HttpProbeResultSummaryErrorCategoryEnum = "TRANSPORT" + HttpProbeResultSummaryErrorCategoryNetwork HttpProbeResultSummaryErrorCategoryEnum = "NETWORK" + HttpProbeResultSummaryErrorCategorySystem HttpProbeResultSummaryErrorCategoryEnum = "SYSTEM" +) + +var mappingHttpProbeResultSummaryErrorCategory = map[string]HttpProbeResultSummaryErrorCategoryEnum{ + "NONE": HttpProbeResultSummaryErrorCategoryNone, + "DNS": HttpProbeResultSummaryErrorCategoryDns, + "TRANSPORT": HttpProbeResultSummaryErrorCategoryTransport, + "NETWORK": HttpProbeResultSummaryErrorCategoryNetwork, + "SYSTEM": HttpProbeResultSummaryErrorCategorySystem, +} + +// GetHttpProbeResultSummaryErrorCategoryEnumValues Enumerates the set of values for HttpProbeResultSummaryErrorCategoryEnum +func GetHttpProbeResultSummaryErrorCategoryEnumValues() []HttpProbeResultSummaryErrorCategoryEnum { + values := make([]HttpProbeResultSummaryErrorCategoryEnum, 0) + for _, v := range mappingHttpProbeResultSummaryErrorCategory { + values = append(values, v) + } + return values +} + +// HttpProbeResultSummaryProtocolEnum Enum with underlying type: string +type HttpProbeResultSummaryProtocolEnum string + +// Set of constants representing the allowable values for HttpProbeResultSummaryProtocolEnum +const ( + HttpProbeResultSummaryProtocolHttp HttpProbeResultSummaryProtocolEnum = "HTTP" + HttpProbeResultSummaryProtocolHttps HttpProbeResultSummaryProtocolEnum = "HTTPS" +) + +var mappingHttpProbeResultSummaryProtocol = map[string]HttpProbeResultSummaryProtocolEnum{ + "HTTP": HttpProbeResultSummaryProtocolHttp, + "HTTPS": HttpProbeResultSummaryProtocolHttps, +} + +// GetHttpProbeResultSummaryProtocolEnumValues Enumerates the set of values for HttpProbeResultSummaryProtocolEnum +func GetHttpProbeResultSummaryProtocolEnumValues() []HttpProbeResultSummaryProtocolEnum { + values := make([]HttpProbeResultSummaryProtocolEnum, 0) + for _, v := range mappingHttpProbeResultSummaryProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_health_checks_vantage_points_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_health_checks_vantage_points_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_health_checks_vantage_points_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_health_checks_vantage_points_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListHealthChecksVantagePointsRequest wrapper for the ListHealthChecksVantagePoints operation +type ListHealthChecksVantagePointsRequest struct { + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by when listing vantage points. + SortBy ListHealthChecksVantagePointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Controls the sort order of results. + SortOrder ListHealthChecksVantagePointsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filters results that exactly match the `name` field. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Filters results that exactly match the `displayName` field. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHealthChecksVantagePointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHealthChecksVantagePointsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHealthChecksVantagePointsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListHealthChecksVantagePointsResponse wrapper for the ListHealthChecksVantagePoints operation +type ListHealthChecksVantagePointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []HealthChecksVantagePointSummary instances + Items []HealthChecksVantagePointSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if + // this header appears in the response, then there may be additional + // items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListHealthChecksVantagePointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHealthChecksVantagePointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHealthChecksVantagePointsSortByEnum Enum with underlying type: string +type ListHealthChecksVantagePointsSortByEnum string + +// Set of constants representing the allowable values for ListHealthChecksVantagePointsSortByEnum +const ( + ListHealthChecksVantagePointsSortByName ListHealthChecksVantagePointsSortByEnum = "name" + ListHealthChecksVantagePointsSortByDisplayname ListHealthChecksVantagePointsSortByEnum = "displayName" +) + +var mappingListHealthChecksVantagePointsSortBy = map[string]ListHealthChecksVantagePointsSortByEnum{ + "name": ListHealthChecksVantagePointsSortByName, + "displayName": ListHealthChecksVantagePointsSortByDisplayname, +} + +// GetListHealthChecksVantagePointsSortByEnumValues Enumerates the set of values for ListHealthChecksVantagePointsSortByEnum +func GetListHealthChecksVantagePointsSortByEnumValues() []ListHealthChecksVantagePointsSortByEnum { + values := make([]ListHealthChecksVantagePointsSortByEnum, 0) + for _, v := range mappingListHealthChecksVantagePointsSortBy { + values = append(values, v) + } + return values +} + +// ListHealthChecksVantagePointsSortOrderEnum Enum with underlying type: string +type ListHealthChecksVantagePointsSortOrderEnum string + +// Set of constants representing the allowable values for ListHealthChecksVantagePointsSortOrderEnum +const ( + ListHealthChecksVantagePointsSortOrderAsc ListHealthChecksVantagePointsSortOrderEnum = "ASC" + ListHealthChecksVantagePointsSortOrderDesc ListHealthChecksVantagePointsSortOrderEnum = "DESC" +) + +var mappingListHealthChecksVantagePointsSortOrder = map[string]ListHealthChecksVantagePointsSortOrderEnum{ + "ASC": ListHealthChecksVantagePointsSortOrderAsc, + "DESC": ListHealthChecksVantagePointsSortOrderDesc, +} + +// GetListHealthChecksVantagePointsSortOrderEnumValues Enumerates the set of values for ListHealthChecksVantagePointsSortOrderEnum +func GetListHealthChecksVantagePointsSortOrderEnumValues() []ListHealthChecksVantagePointsSortOrderEnum { + values := make([]ListHealthChecksVantagePointsSortOrderEnum, 0) + for _, v := range mappingListHealthChecksVantagePointsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_monitors_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_monitors_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_monitors_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_monitors_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,130 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListHttpMonitorsRequest wrapper for the ListHttpMonitors operation +type ListHttpMonitorsRequest struct { + + // Filters results by compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by when listing monitors. + SortBy ListHttpMonitorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Controls the sort order of results. + SortOrder ListHttpMonitorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filters results that exactly match the `displayName` field. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHttpMonitorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHttpMonitorsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHttpMonitorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListHttpMonitorsResponse wrapper for the ListHttpMonitors operation +type ListHttpMonitorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []HttpMonitorSummary instances + Items []HttpMonitorSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this + // header appears in the response, then a partial list might have been + // returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListHttpMonitorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHttpMonitorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHttpMonitorsSortByEnum Enum with underlying type: string +type ListHttpMonitorsSortByEnum string + +// Set of constants representing the allowable values for ListHttpMonitorsSortByEnum +const ( + ListHttpMonitorsSortById ListHttpMonitorsSortByEnum = "id" + ListHttpMonitorsSortByDisplayname ListHttpMonitorsSortByEnum = "displayName" +) + +var mappingListHttpMonitorsSortBy = map[string]ListHttpMonitorsSortByEnum{ + "id": ListHttpMonitorsSortById, + "displayName": ListHttpMonitorsSortByDisplayname, +} + +// GetListHttpMonitorsSortByEnumValues Enumerates the set of values for ListHttpMonitorsSortByEnum +func GetListHttpMonitorsSortByEnumValues() []ListHttpMonitorsSortByEnum { + values := make([]ListHttpMonitorsSortByEnum, 0) + for _, v := range mappingListHttpMonitorsSortBy { + values = append(values, v) + } + return values +} + +// ListHttpMonitorsSortOrderEnum Enum with underlying type: string +type ListHttpMonitorsSortOrderEnum string + +// Set of constants representing the allowable values for ListHttpMonitorsSortOrderEnum +const ( + ListHttpMonitorsSortOrderAsc ListHttpMonitorsSortOrderEnum = "ASC" + ListHttpMonitorsSortOrderDesc ListHttpMonitorsSortOrderEnum = "DESC" +) + +var mappingListHttpMonitorsSortOrder = map[string]ListHttpMonitorsSortOrderEnum{ + "ASC": ListHttpMonitorsSortOrderAsc, + "DESC": ListHttpMonitorsSortOrderDesc, +} + +// GetListHttpMonitorsSortOrderEnumValues Enumerates the set of values for ListHttpMonitorsSortOrderEnum +func GetListHttpMonitorsSortOrderEnumValues() []ListHttpMonitorsSortOrderEnum { + values := make([]ListHttpMonitorsSortOrderEnum, 0) + for _, v := range mappingListHttpMonitorsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_probe_results_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_probe_results_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_probe_results_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_http_probe_results_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListHttpProbeResultsRequest wrapper for the ListHttpProbeResults operation +type ListHttpProbeResultsRequest struct { + + // The OCID of a monitor or on-demand probe. + ProbeConfigurationId *string `mandatory:"true" contributesTo:"path" name:"probeConfigurationId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Returns results with a `startTime` equal to or greater than the specified value. + StartTimeGreaterThanOrEqualTo *float64 `mandatory:"false" contributesTo:"query" name:"startTimeGreaterThanOrEqualTo"` + + // Returns results with a `startTime` equal to or less than the specified value. + StartTimeLessThanOrEqualTo *float64 `mandatory:"false" contributesTo:"query" name:"startTimeLessThanOrEqualTo"` + + // Controls the sort order of results. + SortOrder ListHttpProbeResultsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filters results that match the `target`. + Target *string `mandatory:"false" contributesTo:"query" name:"target"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHttpProbeResultsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHttpProbeResultsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHttpProbeResultsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListHttpProbeResultsResponse wrapper for the ListHttpProbeResults operation +type ListHttpProbeResultsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []HttpProbeResultSummary instances + Items []HttpProbeResultSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this + // header appears in the response, then a partial list might have been + // returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListHttpProbeResultsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHttpProbeResultsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHttpProbeResultsSortOrderEnum Enum with underlying type: string +type ListHttpProbeResultsSortOrderEnum string + +// Set of constants representing the allowable values for ListHttpProbeResultsSortOrderEnum +const ( + ListHttpProbeResultsSortOrderAsc ListHttpProbeResultsSortOrderEnum = "ASC" + ListHttpProbeResultsSortOrderDesc ListHttpProbeResultsSortOrderEnum = "DESC" +) + +var mappingListHttpProbeResultsSortOrder = map[string]ListHttpProbeResultsSortOrderEnum{ + "ASC": ListHttpProbeResultsSortOrderAsc, + "DESC": ListHttpProbeResultsSortOrderDesc, +} + +// GetListHttpProbeResultsSortOrderEnumValues Enumerates the set of values for ListHttpProbeResultsSortOrderEnum +func GetListHttpProbeResultsSortOrderEnumValues() []ListHttpProbeResultsSortOrderEnum { + values := make([]ListHttpProbeResultsSortOrderEnum, 0) + for _, v := range mappingListHttpProbeResultsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_monitors_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_monitors_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_monitors_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_monitors_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,130 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListPingMonitorsRequest wrapper for the ListPingMonitors operation +type ListPingMonitorsRequest struct { + + // Filters results by compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by when listing monitors. + SortBy ListPingMonitorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Controls the sort order of results. + SortOrder ListPingMonitorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filters results that exactly match the `displayName` field. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListPingMonitorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPingMonitorsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPingMonitorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListPingMonitorsResponse wrapper for the ListPingMonitors operation +type ListPingMonitorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []PingMonitorSummary instances + Items []PingMonitorSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this + // header appears in the response, then a partial list might have been + // returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListPingMonitorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPingMonitorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPingMonitorsSortByEnum Enum with underlying type: string +type ListPingMonitorsSortByEnum string + +// Set of constants representing the allowable values for ListPingMonitorsSortByEnum +const ( + ListPingMonitorsSortById ListPingMonitorsSortByEnum = "id" + ListPingMonitorsSortByDisplayname ListPingMonitorsSortByEnum = "displayName" +) + +var mappingListPingMonitorsSortBy = map[string]ListPingMonitorsSortByEnum{ + "id": ListPingMonitorsSortById, + "displayName": ListPingMonitorsSortByDisplayname, +} + +// GetListPingMonitorsSortByEnumValues Enumerates the set of values for ListPingMonitorsSortByEnum +func GetListPingMonitorsSortByEnumValues() []ListPingMonitorsSortByEnum { + values := make([]ListPingMonitorsSortByEnum, 0) + for _, v := range mappingListPingMonitorsSortBy { + values = append(values, v) + } + return values +} + +// ListPingMonitorsSortOrderEnum Enum with underlying type: string +type ListPingMonitorsSortOrderEnum string + +// Set of constants representing the allowable values for ListPingMonitorsSortOrderEnum +const ( + ListPingMonitorsSortOrderAsc ListPingMonitorsSortOrderEnum = "ASC" + ListPingMonitorsSortOrderDesc ListPingMonitorsSortOrderEnum = "DESC" +) + +var mappingListPingMonitorsSortOrder = map[string]ListPingMonitorsSortOrderEnum{ + "ASC": ListPingMonitorsSortOrderAsc, + "DESC": ListPingMonitorsSortOrderDesc, +} + +// GetListPingMonitorsSortOrderEnumValues Enumerates the set of values for ListPingMonitorsSortOrderEnum +func GetListPingMonitorsSortOrderEnumValues() []ListPingMonitorsSortOrderEnum { + values := make([]ListPingMonitorsSortOrderEnum, 0) + for _, v := range mappingListPingMonitorsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_probe_results_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_probe_results_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_probe_results_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/list_ping_probe_results_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListPingProbeResultsRequest wrapper for the ListPingProbeResults operation +type ListPingProbeResultsRequest struct { + + // The OCID of a monitor or on-demand probe. + ProbeConfigurationId *string `mandatory:"true" contributesTo:"path" name:"probeConfigurationId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Returns results with a `startTime` equal to or greater than the specified value. + StartTimeGreaterThanOrEqualTo *float64 `mandatory:"false" contributesTo:"query" name:"startTimeGreaterThanOrEqualTo"` + + // Returns results with a `startTime` equal to or less than the specified value. + StartTimeLessThanOrEqualTo *float64 `mandatory:"false" contributesTo:"query" name:"startTimeLessThanOrEqualTo"` + + // Controls the sort order of results. + SortOrder ListPingProbeResultsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filters results that match the `target`. + Target *string `mandatory:"false" contributesTo:"query" name:"target"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListPingProbeResultsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPingProbeResultsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPingProbeResultsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListPingProbeResultsResponse wrapper for the ListPingProbeResults operation +type ListPingProbeResultsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []PingProbeResultSummary instances + Items []PingProbeResultSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, + // if this header appears in the response, then there may be + // additional items still to get. Include this value as the `page` + // parameter for the subsequent GET request. For information about + // pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListPingProbeResultsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPingProbeResultsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPingProbeResultsSortOrderEnum Enum with underlying type: string +type ListPingProbeResultsSortOrderEnum string + +// Set of constants representing the allowable values for ListPingProbeResultsSortOrderEnum +const ( + ListPingProbeResultsSortOrderAsc ListPingProbeResultsSortOrderEnum = "ASC" + ListPingProbeResultsSortOrderDesc ListPingProbeResultsSortOrderEnum = "DESC" +) + +var mappingListPingProbeResultsSortOrder = map[string]ListPingProbeResultsSortOrderEnum{ + "ASC": ListPingProbeResultsSortOrderAsc, + "DESC": ListPingProbeResultsSortOrderDesc, +} + +// GetListPingProbeResultsSortOrderEnumValues Enumerates the set of values for ListPingProbeResultsSortOrderEnum +func GetListPingProbeResultsSortOrderEnumValues() []ListPingProbeResultsSortOrderEnum { + values := make([]ListPingProbeResultsSortOrderEnum, 0) + for _, v := range mappingListPingProbeResultsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PingMonitor A summary containing all of the mutable and immutable properties for a ping monitor. +type PingMonitor struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol PingMonitorProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m PingMonitor) String() string { + return common.PointerString(m) +} + +// PingMonitorProtocolEnum Enum with underlying type: string +type PingMonitorProtocolEnum string + +// Set of constants representing the allowable values for PingMonitorProtocolEnum +const ( + PingMonitorProtocolIcmp PingMonitorProtocolEnum = "ICMP" + PingMonitorProtocolTcp PingMonitorProtocolEnum = "TCP" +) + +var mappingPingMonitorProtocol = map[string]PingMonitorProtocolEnum{ + "ICMP": PingMonitorProtocolIcmp, + "TCP": PingMonitorProtocolTcp, +} + +// GetPingMonitorProtocolEnumValues Enumerates the set of values for PingMonitorProtocolEnum +func GetPingMonitorProtocolEnumValues() []PingMonitorProtocolEnum { + values := make([]PingMonitorProtocolEnum, 0) + for _, v := range mappingPingMonitorProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_monitor_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PingMonitorSummary This model contains all of the mutable and immutable summary properties for an HTTP monitor. +type PingMonitorSummary struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + Protocol PingMonitorSummaryProtocolEnum `mandatory:"false" json:"protocol,omitempty"` +} + +func (m PingMonitorSummary) String() string { + return common.PointerString(m) +} + +// PingMonitorSummaryProtocolEnum Enum with underlying type: string +type PingMonitorSummaryProtocolEnum string + +// Set of constants representing the allowable values for PingMonitorSummaryProtocolEnum +const ( + PingMonitorSummaryProtocolIcmp PingMonitorSummaryProtocolEnum = "ICMP" + PingMonitorSummaryProtocolTcp PingMonitorSummaryProtocolEnum = "TCP" +) + +var mappingPingMonitorSummaryProtocol = map[string]PingMonitorSummaryProtocolEnum{ + "ICMP": PingMonitorSummaryProtocolIcmp, + "TCP": PingMonitorSummaryProtocolTcp, +} + +// GetPingMonitorSummaryProtocolEnumValues Enumerates the set of values for PingMonitorSummaryProtocolEnum +func GetPingMonitorSummaryProtocolEnumValues() []PingMonitorSummaryProtocolEnum { + values := make([]PingMonitorSummaryProtocolEnum, 0) + for _, v := range mappingPingMonitorSummaryProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PingProbe This model contains all of the mutable and immutable properties for a ping probe. +type PingProbe struct { + + // The OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // A URL for fetching the probe results. + ResultsUrl *string `mandatory:"false" json:"resultsUrl"` + + // The OCID of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol PingProbeProtocolEnum `mandatory:"false" json:"protocol,omitempty"` +} + +func (m PingProbe) String() string { + return common.PointerString(m) +} + +// PingProbeProtocolEnum Enum with underlying type: string +type PingProbeProtocolEnum string + +// Set of constants representing the allowable values for PingProbeProtocolEnum +const ( + PingProbeProtocolIcmp PingProbeProtocolEnum = "ICMP" + PingProbeProtocolTcp PingProbeProtocolEnum = "TCP" +) + +var mappingPingProbeProtocol = map[string]PingProbeProtocolEnum{ + "ICMP": PingProbeProtocolIcmp, + "TCP": PingProbeProtocolTcp, +} + +// GetPingProbeProtocolEnumValues Enumerates the set of values for PingProbeProtocolEnum +func GetPingProbeProtocolEnumValues() []PingProbeProtocolEnum { + values := make([]PingProbeProtocolEnum, 0) + for _, v := range mappingPingProbeProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_protocol.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_protocol.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_protocol.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_protocol.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PingProbeProtocol The protocols for ping probes. +type PingProbeProtocol struct { +} + +func (m PingProbeProtocol) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_result_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_result_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_result_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/ping_probe_result_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PingProbeResultSummary The results returned by running a ping probe. All times and durations are +// returned in milliseconds. All times are relative to the POSIX epoch +// (1970-01-01T00:00Z). +type PingProbeResultSummary struct { + + // A value identifying this specific probe result. The key is only unique within + // the results of its probe configuration. The key may be reused after 90 days. + Key *string `mandatory:"false" json:"key"` + + // The OCID of the monitor or on-demand probe responsible for creating this result. + ProbeConfigurationId *string `mandatory:"false" json:"probeConfigurationId"` + + // The date and time the probe was executed, expressed in milliseconds since the + // POSIX epoch. This field is defined by the PerformanceResourceTiming interface + // of the W3C Resource Timing specification. For more information, see + // Resource Timing (https://w3c.github.io/resource-timing/#sec-resource-timing). + StartTime *float64 `mandatory:"false" json:"startTime"` + + // The target hostname or IP address of the probe. + Target *string `mandatory:"false" json:"target"` + + // The name of the vantage point that executed the probe. + VantagePointName *string `mandatory:"false" json:"vantagePointName"` + + // True if the probe did not complete before the configured `timeoutInSeconds` value. + IsTimedOut *bool `mandatory:"false" json:"isTimedOut"` + + // True if the probe result is determined to be healthy based on probe + // type-specific criteria. For HTTP probes, a probe result is considered + // healthy if the HTTP response code is greater than or equal to 200 and + // less than 300. + IsHealthy *bool `mandatory:"false" json:"isHealthy"` + + // The category of error if an error occurs executing the probe. + // The `errorMessage` field provides a message with the error details. + // * NONE - No error + // * DNS - DNS errors + // * TRANSPORT - Transport-related errors, for example a "TLS certificate expired" error. + // * NETWORK - Network-related errors, for example a "network unreachable" error. + // * SYSTEM - Internal system errors. + ErrorCategory PingProbeResultSummaryErrorCategoryEnum `mandatory:"false" json:"errorCategory,omitempty"` + + // The error information indicating why a probe execution failed. + ErrorMessage *string `mandatory:"false" json:"errorMessage"` + + Protocol PingProbeResultSummaryProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + Connection *Connection `mandatory:"false" json:"connection"` + + Dns *Dns `mandatory:"false" json:"dns"` + + // The time immediately before the vantage point starts the domain name lookup for + // the resource. + DomainLookupStart *float64 `mandatory:"false" json:"domainLookupStart"` + + // The time immediately before the vantage point finishes the domain name lookup for + // the resource. + DomainLookupEnd *float64 `mandatory:"false" json:"domainLookupEnd"` + + // The latency of the probe execution, in milliseconds. + LatencyInMs *float64 `mandatory:"false" json:"latencyInMs"` + + // The ICMP code of the response message. This field is not used when the protocol + // is set to TCP. For more information on ICMP codes, see + // Internet Control Message Protocol (ICMP) Parameters (https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml). + IcmpCode *int `mandatory:"false" json:"icmpCode"` +} + +func (m PingProbeResultSummary) String() string { + return common.PointerString(m) +} + +// PingProbeResultSummaryErrorCategoryEnum Enum with underlying type: string +type PingProbeResultSummaryErrorCategoryEnum string + +// Set of constants representing the allowable values for PingProbeResultSummaryErrorCategoryEnum +const ( + PingProbeResultSummaryErrorCategoryNone PingProbeResultSummaryErrorCategoryEnum = "NONE" + PingProbeResultSummaryErrorCategoryDns PingProbeResultSummaryErrorCategoryEnum = "DNS" + PingProbeResultSummaryErrorCategoryTransport PingProbeResultSummaryErrorCategoryEnum = "TRANSPORT" + PingProbeResultSummaryErrorCategoryNetwork PingProbeResultSummaryErrorCategoryEnum = "NETWORK" + PingProbeResultSummaryErrorCategorySystem PingProbeResultSummaryErrorCategoryEnum = "SYSTEM" +) + +var mappingPingProbeResultSummaryErrorCategory = map[string]PingProbeResultSummaryErrorCategoryEnum{ + "NONE": PingProbeResultSummaryErrorCategoryNone, + "DNS": PingProbeResultSummaryErrorCategoryDns, + "TRANSPORT": PingProbeResultSummaryErrorCategoryTransport, + "NETWORK": PingProbeResultSummaryErrorCategoryNetwork, + "SYSTEM": PingProbeResultSummaryErrorCategorySystem, +} + +// GetPingProbeResultSummaryErrorCategoryEnumValues Enumerates the set of values for PingProbeResultSummaryErrorCategoryEnum +func GetPingProbeResultSummaryErrorCategoryEnumValues() []PingProbeResultSummaryErrorCategoryEnum { + values := make([]PingProbeResultSummaryErrorCategoryEnum, 0) + for _, v := range mappingPingProbeResultSummaryErrorCategory { + values = append(values, v) + } + return values +} + +// PingProbeResultSummaryProtocolEnum Enum with underlying type: string +type PingProbeResultSummaryProtocolEnum string + +// Set of constants representing the allowable values for PingProbeResultSummaryProtocolEnum +const ( + PingProbeResultSummaryProtocolIcmp PingProbeResultSummaryProtocolEnum = "ICMP" + PingProbeResultSummaryProtocolTcp PingProbeResultSummaryProtocolEnum = "TCP" +) + +var mappingPingProbeResultSummaryProtocol = map[string]PingProbeResultSummaryProtocolEnum{ + "ICMP": PingProbeResultSummaryProtocolIcmp, + "TCP": PingProbeResultSummaryProtocolTcp, +} + +// GetPingProbeResultSummaryProtocolEnumValues Enumerates the set of values for PingProbeResultSummaryProtocolEnum +func GetPingProbeResultSummaryProtocolEnumValues() []PingProbeResultSummaryProtocolEnum { + values := make([]PingProbeResultSummaryProtocolEnum, 0) + for _, v := range mappingPingProbeResultSummaryProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/routing.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/routing.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/routing.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/routing.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Routing The routing information for a vantage point. +type Routing struct { + + // The registry label for `asn`, usually the name of the organization that + // owns the ASN. May be omitted or null. + AsLabel *string `mandatory:"false" json:"asLabel"` + + // The Autonomous System Number (ASN) identifying the organization + // responsible for routing packets to `prefix`. + Asn *int `mandatory:"false" json:"asn"` + + // An IP prefix (CIDR syntax) that is less specific than + // `address`, through which `address` is routed. + Prefix *string `mandatory:"false" json:"prefix"` + + // An integer between 0 and 100 used to select between multiple + // origin ASNs when routing to `prefix`. Most prefixes have + // exactly one origin ASN, in which case `weight` will be 100. + Weight *int `mandatory:"false" json:"weight"` +} + +func (m Routing) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/tcp_connection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/tcp_connection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/tcp_connection.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/tcp_connection.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// TcpConnection TCP connection results. All durations are in milliseconds. +type TcpConnection struct { + + // The connection IP address. + Address *string `mandatory:"false" json:"address"` + + // The port. + Port *int `mandatory:"false" json:"port"` + + // Total connect duration, calculated using `connectEnd` minus `connectStart`. + ConnectDuration *float64 `mandatory:"false" json:"connectDuration"` + + // The duration to secure the connection. This value will be zero for + // insecure connections. Calculated using `connectEnd` minus `secureConnectionStart`. + SecureConnectDuration *float64 `mandatory:"false" json:"secureConnectDuration"` +} + +func (m TcpConnection) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateHttpMonitorDetails The request body used to update an HTTP monitor. +type UpdateHttpMonitorDetails struct { + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol UpdateHttpMonitorDetailsProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + Method UpdateHttpMonitorDetailsMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The optional URL path to probe, including query parameters. + Path *string `mandatory:"false" json:"path"` + + // A dictionary of HTTP request headers. + // *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. + Headers map[string]string `mandatory:"false" json:"headers"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateHttpMonitorDetails) String() string { + return common.PointerString(m) +} + +// UpdateHttpMonitorDetailsProtocolEnum Enum with underlying type: string +type UpdateHttpMonitorDetailsProtocolEnum string + +// Set of constants representing the allowable values for UpdateHttpMonitorDetailsProtocolEnum +const ( + UpdateHttpMonitorDetailsProtocolHttp UpdateHttpMonitorDetailsProtocolEnum = "HTTP" + UpdateHttpMonitorDetailsProtocolHttps UpdateHttpMonitorDetailsProtocolEnum = "HTTPS" +) + +var mappingUpdateHttpMonitorDetailsProtocol = map[string]UpdateHttpMonitorDetailsProtocolEnum{ + "HTTP": UpdateHttpMonitorDetailsProtocolHttp, + "HTTPS": UpdateHttpMonitorDetailsProtocolHttps, +} + +// GetUpdateHttpMonitorDetailsProtocolEnumValues Enumerates the set of values for UpdateHttpMonitorDetailsProtocolEnum +func GetUpdateHttpMonitorDetailsProtocolEnumValues() []UpdateHttpMonitorDetailsProtocolEnum { + values := make([]UpdateHttpMonitorDetailsProtocolEnum, 0) + for _, v := range mappingUpdateHttpMonitorDetailsProtocol { + values = append(values, v) + } + return values +} + +// UpdateHttpMonitorDetailsMethodEnum Enum with underlying type: string +type UpdateHttpMonitorDetailsMethodEnum string + +// Set of constants representing the allowable values for UpdateHttpMonitorDetailsMethodEnum +const ( + UpdateHttpMonitorDetailsMethodGet UpdateHttpMonitorDetailsMethodEnum = "GET" + UpdateHttpMonitorDetailsMethodHead UpdateHttpMonitorDetailsMethodEnum = "HEAD" +) + +var mappingUpdateHttpMonitorDetailsMethod = map[string]UpdateHttpMonitorDetailsMethodEnum{ + "GET": UpdateHttpMonitorDetailsMethodGet, + "HEAD": UpdateHttpMonitorDetailsMethodHead, +} + +// GetUpdateHttpMonitorDetailsMethodEnumValues Enumerates the set of values for UpdateHttpMonitorDetailsMethodEnum +func GetUpdateHttpMonitorDetailsMethodEnumValues() []UpdateHttpMonitorDetailsMethodEnum { + values := make([]UpdateHttpMonitorDetailsMethodEnum, 0) + for _, v := range mappingUpdateHttpMonitorDetailsMethod { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_http_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateHttpMonitorRequest wrapper for the UpdateHttpMonitor operation +type UpdateHttpMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // The configuration details to update for the HTTP monitor. + UpdateHttpMonitorDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET + // or POST response for that resource. The resource will be updated or deleted + // only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateHttpMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateHttpMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHttpMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateHttpMonitorResponse wrapper for the UpdateHttpMonitor operation +type UpdateHttpMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HttpMonitor instance + HttpMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateHttpMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHttpMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Health Checks API +// +// API for the Health Checks service. Use this API to manage endpoint probes and monitors. +// For more information, see +// Overview of the Health Checks Service (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Concepts/healthchecks.htm). +// + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdatePingMonitorDetails The request body used to update a ping monitor. +type UpdatePingMonitorDetails struct { + Targets []string `mandatory:"false" json:"targets"` + + VantagePointNames []string `mandatory:"false" json:"vantagePointNames"` + + // The port on which to probe endpoints. If unspecified, probes will use the + // default port of their protocol. + Port *int `mandatory:"false" json:"port"` + + // The probe timeout in seconds. Valid values: 10, 20, 30, and 60. + // The probe timeout must be less than or equal to `intervalInSeconds` for monitors. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + Protocol UpdatePingMonitorDetailsProtocolEnum `mandatory:"false" json:"protocol,omitempty"` + + // A user-friendly and mutable name suitable for display in a user interface. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The monitor interval in seconds. Valid values: 10, 30, and 60. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Enables or disables the monitor. Set to 'true' to launch monitoring. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, + // see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdatePingMonitorDetails) String() string { + return common.PointerString(m) +} + +// UpdatePingMonitorDetailsProtocolEnum Enum with underlying type: string +type UpdatePingMonitorDetailsProtocolEnum string + +// Set of constants representing the allowable values for UpdatePingMonitorDetailsProtocolEnum +const ( + UpdatePingMonitorDetailsProtocolIcmp UpdatePingMonitorDetailsProtocolEnum = "ICMP" + UpdatePingMonitorDetailsProtocolTcp UpdatePingMonitorDetailsProtocolEnum = "TCP" +) + +var mappingUpdatePingMonitorDetailsProtocol = map[string]UpdatePingMonitorDetailsProtocolEnum{ + "ICMP": UpdatePingMonitorDetailsProtocolIcmp, + "TCP": UpdatePingMonitorDetailsProtocolTcp, +} + +// GetUpdatePingMonitorDetailsProtocolEnumValues Enumerates the set of values for UpdatePingMonitorDetailsProtocolEnum +func GetUpdatePingMonitorDetailsProtocolEnumValues() []UpdatePingMonitorDetailsProtocolEnum { + values := make([]UpdatePingMonitorDetailsProtocolEnum, 0) + for _, v := range mappingUpdatePingMonitorDetailsProtocol { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/healthchecks/update_ping_monitor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package healthchecks + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdatePingMonitorRequest wrapper for the UpdatePingMonitor operation +type UpdatePingMonitorRequest struct { + + // The OCID of a monitor. + MonitorId *string `mandatory:"true" contributesTo:"path" name:"monitorId"` + + // Details for updating a Ping monitor. + UpdatePingMonitorDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, + // set the `if-match` parameter to the value of the etag from a previous GET + // or POST response for that resource. The resource will be updated or deleted + // only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdatePingMonitorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdatePingMonitorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePingMonitorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdatePingMonitorResponse wrapper for the UpdatePingMonitor operation +type UpdatePingMonitorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PingMonitor instance + PingMonitor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to + // contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // An entity tag that uniquely identifies a version of the resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdatePingMonitorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePingMonitorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/activate_mfa_totp_device_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/activate_mfa_totp_device_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/activate_mfa_totp_device_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/activate_mfa_totp_device_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ActivateMfaTotpDeviceRequest wrapper for the ActivateMfaTotpDevice operation +type ActivateMfaTotpDeviceRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the MFA TOTP device. + MfaTotpDeviceId *string `mandatory:"true" contributesTo:"path" name:"mfaTotpDeviceId"` + + // MFA TOTP token + MfaTotpToken `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ActivateMfaTotpDeviceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ActivateMfaTotpDeviceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ActivateMfaTotpDeviceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ActivateMfaTotpDeviceResponse wrapper for the ActivateMfaTotpDevice operation +type ActivateMfaTotpDeviceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MfaTotpDeviceSummary instance + MfaTotpDeviceSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response ActivateMfaTotpDeviceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ActivateMfaTotpDeviceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/add_user_to_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request AddUserToGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request AddUserToGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddUserToGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // AddUserToGroupResponse wrapper for the AddUserToGroup operation type AddUserToGroupResponse struct { @@ -46,3 +64,8 @@ func (response AddUserToGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response AddUserToGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/api_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/api_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/api_key.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/api_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -15,10 +15,10 @@ // ApiKey A PEM-format RSA credential for securing requests to the Oracle Cloud Infrastructure REST API. Also known // as an *API signing key*. Specifically, this is the public key from the key pair. The private key remains with // the user calling the API. For information about generating a key pair -// in the required PEM format, see Required Keys and OCIDs (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm). +// in the required PEM format, see Required Keys and OCIDs (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm). // **Important:** This is **not** the SSH key for accessing compute instances. // Each user can have a maximum of three API signing keys. -// For more information about user credentials, see User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/usercredentials.htm). +// For more information about user credentials, see User Credentials (https://docs.cloud.oracle.com/Content/Identity/Concepts/usercredentials.htm). type ApiKey struct { // An Oracle-assigned identifier for the key, in this format: @@ -43,7 +43,7 @@ LifecycleState ApiKeyLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m ApiKey) String() string { @@ -53,7 +53,7 @@ // ApiKeyLifecycleStateEnum Enum with underlying type: string type ApiKeyLifecycleStateEnum string -// Set of constants representing the allowable values for ApiKeyLifecycleState +// Set of constants representing the allowable values for ApiKeyLifecycleStateEnum const ( ApiKeyLifecycleStateCreating ApiKeyLifecycleStateEnum = "CREATING" ApiKeyLifecycleStateActive ApiKeyLifecycleStateEnum = "ACTIVE" @@ -70,7 +70,7 @@ "DELETED": ApiKeyLifecycleStateDeleted, } -// GetApiKeyLifecycleStateEnumValues Enumerates the set of values for ApiKeyLifecycleState +// GetApiKeyLifecycleStateEnumValues Enumerates the set of values for ApiKeyLifecycleStateEnum func GetApiKeyLifecycleStateEnumValues() []ApiKeyLifecycleStateEnum { values := make([]ApiKeyLifecycleStateEnum, 0) for _, v := range mappingApiKeyLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/authentication_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/authentication_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/authentication_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/authentication_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AuthenticationPolicy Authentication policy, currently set for the given compartment +type AuthenticationPolicy struct { + + // Password policy. + PasswordPolicy *PasswordPolicy `mandatory:"false" json:"passwordPolicy"` + + // Compartment OCID. + CompartmentId *string `mandatory:"false" json:"compartmentId"` +} + +func (m AuthenticationPolicy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/auth_token.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/auth_token.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/auth_token.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/auth_token.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AuthToken An `AuthToken` is an Oracle-generated token string that you can use to authenticate with third-party APIs +// that do not support Oracle Cloud Infrastructure's signature-based authentication. For example, use an `AuthToken` +// to authenticate with a Swift client with the Object Storage Service. +// The auth token is associated with the user's Console login. Auth tokens never expire. A user can have up to two +// auth tokens at a time. +// **Note:** The token is always an Oracle-generated string; you can't change it to a string of your choice. +// For more information, see Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). +type AuthToken struct { + + // The auth token. The value is available only in the response for `CreateAuthToken`, and not + // for `ListAuthTokens` or `UpdateAuthToken`. + Token *string `mandatory:"false" json:"token"` + + // The OCID of the auth token. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the user the auth token belongs to. + UserId *string `mandatory:"false" json:"userId"` + + // The description you assign to the auth token. Does not have to be unique, and it's changeable. + Description *string `mandatory:"false" json:"description"` + + // Date and time the `AuthToken` object was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Date and time when this auth token will expire, in the format defined by RFC3339. + // Null if it never expires. + // Example: `2016-08-25T21:10:29.600Z` + TimeExpires *common.SDKTime `mandatory:"false" json:"timeExpires"` + + // The token's current state. After creating an auth token, make sure its `lifecycleState` changes from + // CREATING to ACTIVE before using it. + LifecycleState AuthTokenLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The detailed status of INACTIVE lifecycleState. + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` +} + +func (m AuthToken) String() string { + return common.PointerString(m) +} + +// AuthTokenLifecycleStateEnum Enum with underlying type: string +type AuthTokenLifecycleStateEnum string + +// Set of constants representing the allowable values for AuthTokenLifecycleStateEnum +const ( + AuthTokenLifecycleStateCreating AuthTokenLifecycleStateEnum = "CREATING" + AuthTokenLifecycleStateActive AuthTokenLifecycleStateEnum = "ACTIVE" + AuthTokenLifecycleStateInactive AuthTokenLifecycleStateEnum = "INACTIVE" + AuthTokenLifecycleStateDeleting AuthTokenLifecycleStateEnum = "DELETING" + AuthTokenLifecycleStateDeleted AuthTokenLifecycleStateEnum = "DELETED" +) + +var mappingAuthTokenLifecycleState = map[string]AuthTokenLifecycleStateEnum{ + "CREATING": AuthTokenLifecycleStateCreating, + "ACTIVE": AuthTokenLifecycleStateActive, + "INACTIVE": AuthTokenLifecycleStateInactive, + "DELETING": AuthTokenLifecycleStateDeleting, + "DELETED": AuthTokenLifecycleStateDeleted, +} + +// GetAuthTokenLifecycleStateEnumValues Enumerates the set of values for AuthTokenLifecycleStateEnum +func GetAuthTokenLifecycleStateEnumValues() []AuthTokenLifecycleStateEnum { + values := make([]AuthTokenLifecycleStateEnum, 0) + for _, v := range mappingAuthTokenLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/availability_domain.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/availability_domain.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/availability_domain.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/availability_domain.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,12 +14,15 @@ // AvailabilityDomain One or more isolated, fault-tolerant Oracle data centers that host cloud resources such as instances, volumes, // and subnets. A region contains several Availability Domains. For more information, see -// Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). +// Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). type AvailabilityDomain struct { // The name of the Availability Domain. Name *string `mandatory:"false" json:"name"` + // The OCID of the Availability Domain. + Id *string `mandatory:"false" json:"id"` + // The OCID of the tenancy. CompartmentId *string `mandatory:"false" json:"compartmentId"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_detail.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_detail.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_detail.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_detail.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ChangeTagNamespaceCompartmentDetail Details of the compartment the resource is being moved to. +type ChangeTagNamespaceCompartmentDetail struct { + + // The Oracle Cloud ID (OCID) of the destination compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeTagNamespaceCompartmentDetail) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/change_tag_namespace_compartment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ChangeTagNamespaceCompartmentRequest wrapper for the ChangeTagNamespaceCompartment operation +type ChangeTagNamespaceCompartmentRequest struct { + + // The OCID of the tag namespace. + TagNamespaceId *string `mandatory:"true" contributesTo:"path" name:"tagNamespaceId"` + + // Request object for changing the compartment of a tag namespace. + ChangeTagNamespaceCompartmentDetail `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeTagNamespaceCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeTagNamespaceCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeTagNamespaceCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ChangeTagNamespaceCompartmentResponse wrapper for the ChangeTagNamespaceCompartment operation +type ChangeTagNamespaceCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeTagNamespaceCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeTagNamespaceCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/compartment.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/compartment.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/compartment.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/compartment.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -17,25 +17,25 @@ // of measuring usage and billing, access (through the use of IAM Service policies), and isolation (separating the // resources for one project or business unit from another). A common approach is to create a compartment for each // major part of your organization. For more information, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm) and also -// Setting Up Your Tenancy (https://docs.us-phoenix-1.oraclecloud.com/Content/GSG/Concepts/settinguptenancy.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm) and also +// Setting Up Your Tenancy (https://docs.cloud.oracle.com/Content/GSG/Concepts/settinguptenancy.htm). // To place a resource in a compartment, simply specify the compartment ID in the "Create" request object when // initially creating the resource. For example, to launch an instance into a particular compartment, specify // that compartment's OCID in the `LaunchInstance` request. You can't move an existing resource from one // compartment to another. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type Compartment struct { // The OCID of the compartment. Id *string `mandatory:"true" json:"id"` - // The OCID of the tenancy containing the compartment. + // The OCID of the parent compartment containing the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The name you assign to the compartment during creation. The name must be unique across all - // compartments in the tenancy. Avoid entering confidential information. + // compartments in the parent. Avoid entering confidential information. Name *string `mandatory:"true" json:"name"` // The description you assign to the compartment. Does not have to be unique, and it's changeable. @@ -50,15 +50,20 @@ LifecycleState CompartmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` + + // Indicates whether or not the compartment is accessible for the user making the request. + // Returns true when the user has INSPECT permissions directly on a resource in the + // compartment or indirectly (permissions can be on a resource in a subcompartment). + IsAccessible *bool `mandatory:"false" json:"isAccessible"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -70,7 +75,7 @@ // CompartmentLifecycleStateEnum Enum with underlying type: string type CompartmentLifecycleStateEnum string -// Set of constants representing the allowable values for CompartmentLifecycleState +// Set of constants representing the allowable values for CompartmentLifecycleStateEnum const ( CompartmentLifecycleStateCreating CompartmentLifecycleStateEnum = "CREATING" CompartmentLifecycleStateActive CompartmentLifecycleStateEnum = "ACTIVE" @@ -87,7 +92,7 @@ "DELETED": CompartmentLifecycleStateDeleted, } -// GetCompartmentLifecycleStateEnumValues Enumerates the set of values for CompartmentLifecycleState +// GetCompartmentLifecycleStateEnumValues Enumerates the set of values for CompartmentLifecycleStateEnum func GetCompartmentLifecycleStateEnumValues() []CompartmentLifecycleStateEnum { values := make([]CompartmentLifecycleStateEnum, 0) for _, v := range mappingCompartmentLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_api_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_api_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_api_key_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_api_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAuthTokenDetails The representation of CreateAuthTokenDetails +type CreateAuthTokenDetails struct { + + // The description you assign to the auth token during creation. Does not have to be unique, and it's changeable. + Description *string `mandatory:"true" json:"description"` +} + +func (m CreateAuthTokenDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_auth_token_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAuthTokenRequest wrapper for the CreateAuthToken operation +type CreateAuthTokenRequest struct { + + // Request object for creating a new auth token. + CreateAuthTokenDetails `contributesTo:"body"` + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAuthTokenRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAuthTokenRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAuthTokenRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAuthTokenResponse wrapper for the CreateAuthToken operation +type CreateAuthTokenResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AuthToken instance + AuthToken `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateAuthTokenResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAuthTokenResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -15,23 +15,23 @@ // CreateCompartmentDetails The representation of CreateCompartmentDetails type CreateCompartmentDetails struct { - // The OCID of the tenancy containing the compartment. + // The OCID of the parent compartment containing the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The name you assign to the compartment during creation. The name must be unique across all compartments - // in the tenancy. Avoid entering confidential information. + // in the parent compartment. Avoid entering confidential information. Name *string `mandatory:"true" json:"name"` // The description you assign to the compartment during creation. Does not have to be unique, and it's changeable. Description *string `mandatory:"true" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_compartment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCompartmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCompartmentResponse wrapper for the CreateCompartment operation type CreateCompartmentResponse struct { @@ -46,3 +64,8 @@ func (response CreateCompartmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_customer_secret_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCustomerSecretKeyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCustomerSecretKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCustomerSecretKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCustomerSecretKeyResponse wrapper for the CreateCustomerSecretKey operation type CreateCustomerSecretKeyResponse struct { @@ -49,3 +67,8 @@ func (response CreateCustomerSecretKeyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCustomerSecretKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -23,11 +23,21 @@ Name *string `mandatory:"true" json:"name"` // The matching rule to dynamically match an instance certificate to this dynamic group. - // For rule syntax, see Managing Dynamic Groups (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingdynamicgroups.htm). + // For rule syntax, see Managing Dynamic Groups (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingdynamicgroups.htm). MatchingRule *string `mandatory:"true" json:"matchingRule"` // The description you assign to the group during creation. Does not have to be unique, and it's changeable. Description *string `mandatory:"true" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateDynamicGroupDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_dynamic_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateDynamicGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateDynamicGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDynamicGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateDynamicGroupResponse wrapper for the CreateDynamicGroup operation type CreateDynamicGroupResponse struct { @@ -46,3 +64,8 @@ func (response CreateDynamicGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateDynamicGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -26,12 +26,12 @@ Description *string `mandatory:"true" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateGroupResponse wrapper for the CreateGroup operation type CreateGroupResponse struct { @@ -46,3 +64,8 @@ func (response CreateGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -35,12 +35,12 @@ GetProductType() CreateIdentityProviderDetailsProductTypeEnum // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} } @@ -80,6 +80,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *createidentityproviderdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Protocol { case "SAML2": @@ -87,7 +92,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -128,7 +133,7 @@ // CreateIdentityProviderDetailsProductTypeEnum Enum with underlying type: string type CreateIdentityProviderDetailsProductTypeEnum string -// Set of constants representing the allowable values for CreateIdentityProviderDetailsProductType +// Set of constants representing the allowable values for CreateIdentityProviderDetailsProductTypeEnum const ( CreateIdentityProviderDetailsProductTypeIdcs CreateIdentityProviderDetailsProductTypeEnum = "IDCS" CreateIdentityProviderDetailsProductTypeAdfs CreateIdentityProviderDetailsProductTypeEnum = "ADFS" @@ -139,7 +144,7 @@ "ADFS": CreateIdentityProviderDetailsProductTypeAdfs, } -// GetCreateIdentityProviderDetailsProductTypeEnumValues Enumerates the set of values for CreateIdentityProviderDetailsProductType +// GetCreateIdentityProviderDetailsProductTypeEnumValues Enumerates the set of values for CreateIdentityProviderDetailsProductTypeEnum func GetCreateIdentityProviderDetailsProductTypeEnumValues() []CreateIdentityProviderDetailsProductTypeEnum { values := make([]CreateIdentityProviderDetailsProductTypeEnum, 0) for _, v := range mappingCreateIdentityProviderDetailsProductType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_identity_provider_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateIdentityProviderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateIdentityProviderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateIdentityProviderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateIdentityProviderResponse wrapper for the CreateIdentityProvider operation type CreateIdentityProviderResponse struct { @@ -46,3 +64,8 @@ func (response CreateIdentityProviderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateIdentityProviderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_idp_group_mapping_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateIdpGroupMappingRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateIdpGroupMappingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateIdpGroupMappingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateIdpGroupMappingResponse wrapper for the CreateIdpGroupMapping operation type CreateIdpGroupMappingResponse struct { @@ -49,3 +67,8 @@ func (response CreateIdpGroupMappingResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateIdpGroupMappingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_mfa_totp_device_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_mfa_totp_device_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_mfa_totp_device_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_mfa_totp_device_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateMfaTotpDeviceRequest wrapper for the CreateMfaTotpDevice operation +type CreateMfaTotpDeviceRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateMfaTotpDeviceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateMfaTotpDeviceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateMfaTotpDeviceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateMfaTotpDeviceResponse wrapper for the CreateMfaTotpDevice operation +type CreateMfaTotpDeviceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MfaTotpDevice instance + MfaTotpDevice `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateMfaTotpDeviceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateMfaTotpDeviceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_or_reset_u_i_password_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_or_reset_u_i_password_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_or_reset_u_i_password_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_or_reset_u_i_password_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateOrResetUIPasswordRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateOrResetUIPasswordRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateOrResetUIPasswordRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateOrResetUIPasswordResponse wrapper for the CreateOrResetUIPassword operation type CreateOrResetUIPasswordResponse struct { @@ -46,3 +64,8 @@ func (response CreateOrResetUIPasswordResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateOrResetUIPasswordResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -23,8 +23,8 @@ Name *string `mandatory:"true" json:"name"` // An array of policy statements written in the policy language. See - // How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm) and - // Common Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm). + // How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm) and + // Common Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm). Statements []string `mandatory:"true" json:"statements"` // The description you assign to the policy during creation. Does not have to be unique, and it's changeable. @@ -33,15 +33,15 @@ // The version of the policy. If null or set to an empty string, when a request comes in for authorization, the // policy will be evaluated according to the current behavior of the services at that moment. If set to a particular // date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date. - VersionDate *common.SDKTime `mandatory:"false" json:"versionDate"` + VersionDate *common.SDKDate `mandatory:"false" json:"versionDate"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreatePolicyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreatePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreatePolicyResponse wrapper for the CreatePolicy operation type CreatePolicyResponse struct { @@ -46,3 +64,8 @@ func (response CreatePolicyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreatePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_region_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateRegionSubscriptionRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateRegionSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRegionSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateRegionSubscriptionResponse wrapper for the CreateRegionSubscription operation type CreateRegionSubscriptionResponse struct { @@ -46,3 +64,8 @@ func (response CreateRegionSubscriptionResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateRegionSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_saml2_identity_provider_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_saml2_identity_provider_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_saml2_identity_provider_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_saml2_identity_provider_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -36,15 +36,19 @@ Metadata *string `mandatory:"true" json:"metadata"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // Extra name value pairs associated with this identity provider. + // Example: `{"clientId": "app_sf3kdjf3"}` + FreeformAttributes map[string]string `mandatory:"false" json:"freeformAttributes"` + // The identity provider service or product. // Supported identity providers are Oracle Identity Cloud Service (IDCS) and Microsoft // Active Directory Federation Services (ADFS). diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_smtp_credential_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSmtpCredentialRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSmtpCredentialRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSmtpCredentialRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSmtpCredentialResponse wrapper for the CreateSmtpCredential operation type CreateSmtpCredentialResponse struct { @@ -49,3 +67,8 @@ func (response CreateSmtpCredentialResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSmtpCredentialResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_swift_password_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateSwiftPasswordRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateSwiftPasswordRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSwiftPasswordRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateSwiftPasswordResponse wrapper for the CreateSwiftPassword operation type CreateSwiftPasswordResponse struct { @@ -49,3 +67,8 @@ func (response CreateSwiftPasswordResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateSwiftPasswordResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateTagDefaultDetails The representation of CreateTagDefaultDetails +type CreateTagDefaultDetails struct { + + // The OCID of the compartment. The tag default will be applied to all new resources created in this compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the tag definition. The tag default will always assign a default value for this tag definition. + TagDefinitionId *string `mandatory:"true" json:"tagDefinitionId"` + + // The default value for the tag definition. This will be applied to all new resources created in the compartment. + Value *string `mandatory:"true" json:"value"` +} + +func (m CreateTagDefaultDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_default_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateTagDefaultRequest wrapper for the CreateTagDefault operation +type CreateTagDefaultRequest struct { + + // Request object for creating a new tag default. + CreateTagDefaultDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateTagDefaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateTagDefaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTagDefaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateTagDefaultResponse wrapper for the CreateTagDefault operation +type CreateTagDefaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TagDefault instance + TagDefault `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateTagDefaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateTagDefaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -22,14 +22,17 @@ Description *string `mandatory:"true" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Indicates whether the tag is enabled for cost tracking. + IsCostTracking *bool `mandatory:"false" json:"isCostTracking"` } func (m CreateTagDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -25,12 +25,12 @@ Description *string `mandatory:"true" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_namespace_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateTagNamespaceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateTagNamespaceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTagNamespaceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateTagNamespaceResponse wrapper for the CreateTagNamespace operation type CreateTagNamespaceResponse struct { @@ -43,3 +61,8 @@ func (response CreateTagNamespaceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateTagNamespaceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_tag_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateTagRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateTagRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTagRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateTagResponse wrapper for the CreateTag operation type CreateTagResponse struct { @@ -46,3 +64,8 @@ func (response CreateTagResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateTagResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -25,13 +25,16 @@ // The description you assign to the user during creation. Does not have to be unique, and it's changeable. Description *string `mandatory:"true" json:"description"` + // The email you assign to the user. Has to be unique across the tenancy. + Email *string `mandatory:"false" json:"email"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/create_user_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -20,12 +20,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateUserRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateUserRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateUserRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateUserResponse wrapper for the CreateUser operation type CreateUserResponse struct { @@ -46,3 +64,8 @@ func (response CreateUserResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateUserResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -13,10 +13,10 @@ ) // CustomerSecretKey A `CustomerSecretKey` is an Oracle-provided key for using the Object Storage Service's -// Amazon S3 compatible API (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/s3compatibleapi.htm). +// Amazon S3 compatible API (https://docs.cloud.oracle.com/Content/Object/Tasks/s3compatibleapi.htm). // A user can have up to two secret keys at a time. // **Note:** The secret key is always an Oracle-generated string; you can't change it to a string of your choice. -// For more information, see Managing User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm). +// For more information, see Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). type CustomerSecretKey struct { // The secret key. @@ -45,7 +45,7 @@ LifecycleState CustomerSecretKeyLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m CustomerSecretKey) String() string { @@ -55,7 +55,7 @@ // CustomerSecretKeyLifecycleStateEnum Enum with underlying type: string type CustomerSecretKeyLifecycleStateEnum string -// Set of constants representing the allowable values for CustomerSecretKeyLifecycleState +// Set of constants representing the allowable values for CustomerSecretKeyLifecycleStateEnum const ( CustomerSecretKeyLifecycleStateCreating CustomerSecretKeyLifecycleStateEnum = "CREATING" CustomerSecretKeyLifecycleStateActive CustomerSecretKeyLifecycleStateEnum = "ACTIVE" @@ -72,7 +72,7 @@ "DELETED": CustomerSecretKeyLifecycleStateDeleted, } -// GetCustomerSecretKeyLifecycleStateEnumValues Enumerates the set of values for CustomerSecretKeyLifecycleState +// GetCustomerSecretKeyLifecycleStateEnumValues Enumerates the set of values for CustomerSecretKeyLifecycleStateEnum func GetCustomerSecretKeyLifecycleStateEnumValues() []CustomerSecretKeyLifecycleStateEnum { values := make([]CustomerSecretKeyLifecycleStateEnum, 0) for _, v := range mappingCustomerSecretKeyLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/customer_secret_key_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -39,7 +39,7 @@ LifecycleState CustomerSecretKeySummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m CustomerSecretKeySummary) String() string { @@ -49,7 +49,7 @@ // CustomerSecretKeySummaryLifecycleStateEnum Enum with underlying type: string type CustomerSecretKeySummaryLifecycleStateEnum string -// Set of constants representing the allowable values for CustomerSecretKeySummaryLifecycleState +// Set of constants representing the allowable values for CustomerSecretKeySummaryLifecycleStateEnum const ( CustomerSecretKeySummaryLifecycleStateCreating CustomerSecretKeySummaryLifecycleStateEnum = "CREATING" CustomerSecretKeySummaryLifecycleStateActive CustomerSecretKeySummaryLifecycleStateEnum = "ACTIVE" @@ -66,7 +66,7 @@ "DELETED": CustomerSecretKeySummaryLifecycleStateDeleted, } -// GetCustomerSecretKeySummaryLifecycleStateEnumValues Enumerates the set of values for CustomerSecretKeySummaryLifecycleState +// GetCustomerSecretKeySummaryLifecycleStateEnumValues Enumerates the set of values for CustomerSecretKeySummaryLifecycleStateEnum func GetCustomerSecretKeySummaryLifecycleStateEnumValues() []CustomerSecretKeySummaryLifecycleStateEnum { values := make([]CustomerSecretKeySummaryLifecycleStateEnum, 0) for _, v := range mappingCustomerSecretKeySummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_api_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_api_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_api_key_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_api_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteApiKeyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteApiKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteApiKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteApiKeyResponse wrapper for the DeleteApiKey operation type DeleteApiKeyResponse struct { @@ -41,3 +59,8 @@ func (response DeleteApiKeyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteApiKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_auth_token_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_auth_token_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_auth_token_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_auth_token_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAuthTokenRequest wrapper for the DeleteAuthToken operation +type DeleteAuthTokenRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the auth token. + AuthTokenId *string `mandatory:"true" contributesTo:"path" name:"authTokenId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAuthTokenRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAuthTokenRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAuthTokenRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAuthTokenResponse wrapper for the DeleteAuthToken operation +type DeleteAuthTokenResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAuthTokenResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAuthTokenResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_compartment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_compartment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_compartment_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_compartment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteCompartmentRequest wrapper for the DeleteCompartment operation +type DeleteCompartmentRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"path" name:"compartmentId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteCompartmentResponse wrapper for the DeleteCompartment operation +type DeleteCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_customer_secret_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_customer_secret_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_customer_secret_key_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_customer_secret_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteCustomerSecretKeyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteCustomerSecretKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCustomerSecretKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteCustomerSecretKeyResponse wrapper for the DeleteCustomerSecretKey operation type DeleteCustomerSecretKeyResponse struct { @@ -41,3 +59,8 @@ func (response DeleteCustomerSecretKeyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCustomerSecretKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_dynamic_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_dynamic_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_dynamic_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_dynamic_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteDynamicGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteDynamicGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDynamicGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteDynamicGroupResponse wrapper for the DeleteDynamicGroup operation type DeleteDynamicGroupResponse struct { @@ -38,3 +56,8 @@ func (response DeleteDynamicGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDynamicGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteGroupResponse wrapper for the DeleteGroup operation type DeleteGroupResponse struct { @@ -38,3 +56,8 @@ func (response DeleteGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_identity_provider_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_identity_provider_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_identity_provider_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_identity_provider_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteIdentityProviderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteIdentityProviderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteIdentityProviderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteIdentityProviderResponse wrapper for the DeleteIdentityProvider operation type DeleteIdentityProviderResponse struct { @@ -38,3 +56,8 @@ func (response DeleteIdentityProviderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteIdentityProviderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_idp_group_mapping_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_idp_group_mapping_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_idp_group_mapping_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_idp_group_mapping_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteIdpGroupMappingRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteIdpGroupMappingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteIdpGroupMappingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteIdpGroupMappingResponse wrapper for the DeleteIdpGroupMapping operation type DeleteIdpGroupMappingResponse struct { @@ -41,3 +59,8 @@ func (response DeleteIdpGroupMappingResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteIdpGroupMappingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_mfa_totp_device_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_mfa_totp_device_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_mfa_totp_device_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_mfa_totp_device_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteMfaTotpDeviceRequest wrapper for the DeleteMfaTotpDevice operation +type DeleteMfaTotpDeviceRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the MFA TOTP device. + MfaTotpDeviceId *string `mandatory:"true" contributesTo:"path" name:"mfaTotpDeviceId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteMfaTotpDeviceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteMfaTotpDeviceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteMfaTotpDeviceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteMfaTotpDeviceResponse wrapper for the DeleteMfaTotpDevice operation +type DeleteMfaTotpDeviceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteMfaTotpDeviceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteMfaTotpDeviceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_policy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeletePolicyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeletePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeletePolicyResponse wrapper for the DeletePolicy operation type DeletePolicyResponse struct { @@ -38,3 +56,8 @@ func (response DeletePolicyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeletePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_smtp_credential_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_smtp_credential_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_smtp_credential_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_smtp_credential_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSmtpCredentialRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSmtpCredentialRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSmtpCredentialRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSmtpCredentialResponse wrapper for the DeleteSmtpCredential operation type DeleteSmtpCredentialResponse struct { @@ -41,3 +59,8 @@ func (response DeleteSmtpCredentialResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSmtpCredentialResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_swift_password_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_swift_password_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_swift_password_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_swift_password_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteSwiftPasswordRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteSwiftPasswordRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSwiftPasswordRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteSwiftPasswordResponse wrapper for the DeleteSwiftPassword operation type DeleteSwiftPasswordResponse struct { @@ -41,3 +59,8 @@ func (response DeleteSwiftPasswordResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSwiftPasswordResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_tag_default_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_tag_default_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_tag_default_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_tag_default_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteTagDefaultRequest wrapper for the DeleteTagDefault operation +type DeleteTagDefaultRequest struct { + + // The OCID of the tag default. + TagDefaultId *string `mandatory:"true" contributesTo:"path" name:"tagDefaultId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteTagDefaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteTagDefaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteTagDefaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteTagDefaultResponse wrapper for the DeleteTagDefault operation +type DeleteTagDefaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteTagDefaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteTagDefaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_user_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_user_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_user_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/delete_user_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteUserRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteUserRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteUserRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteUserResponse wrapper for the DeleteUser operation type DeleteUserResponse struct { @@ -38,3 +56,8 @@ func (response DeleteUserResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteUserResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/dynamic_group.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/dynamic_group.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/dynamic_group.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/dynamic_group.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,7 +19,7 @@ // based on the permissions granted in policies written for the dynamic groups. // This works like regular user/group membership. But in that case, the membership is a static relationship, whereas // in a dynamic group, the membership of an instance certificate to a dynamic group is determined during runtime. -// For more information, see Managing Dynamic Groups (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingdynamicgroups.htm). +// For more information, see Managing Dynamic Groups (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingdynamicgroups.htm). type DynamicGroup struct { // The OCID of the group. @@ -36,7 +36,7 @@ Description *string `mandatory:"true" json:"description"` // A rule string that defines which instance certificates will be matched. - // For syntax, see Managing Dynamic Groups (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingdynamicgroups.htm). + // For syntax, see Managing Dynamic Groups (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingdynamicgroups.htm). MatchingRule *string `mandatory:"true" json:"matchingRule"` // Date and time the group was created, in the format defined by RFC3339. @@ -48,7 +48,17 @@ LifecycleState DynamicGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m DynamicGroup) String() string { @@ -58,7 +68,7 @@ // DynamicGroupLifecycleStateEnum Enum with underlying type: string type DynamicGroupLifecycleStateEnum string -// Set of constants representing the allowable values for DynamicGroupLifecycleState +// Set of constants representing the allowable values for DynamicGroupLifecycleStateEnum const ( DynamicGroupLifecycleStateCreating DynamicGroupLifecycleStateEnum = "CREATING" DynamicGroupLifecycleStateActive DynamicGroupLifecycleStateEnum = "ACTIVE" @@ -75,7 +85,7 @@ "DELETED": DynamicGroupLifecycleStateDeleted, } -// GetDynamicGroupLifecycleStateEnumValues Enumerates the set of values for DynamicGroupLifecycleState +// GetDynamicGroupLifecycleStateEnumValues Enumerates the set of values for DynamicGroupLifecycleStateEnum func GetDynamicGroupLifecycleStateEnumValues() []DynamicGroupLifecycleStateEnum { values := make([]DynamicGroupLifecycleStateEnum, 0) for _, v := range mappingDynamicGroupLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/fault_domain.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/fault_domain.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/fault_domain.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/fault_domain.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// FaultDomain A Fault Domain is a logical grouping of hardware and infrastructure within an Availability Domain that can become +// unavailable in its entirety either due to hardware failure such as Top-of-rack (TOR) switch failure or due to +// planned software maintenance such as security updates that reboot your instances. +type FaultDomain struct { + + // The name of the Fault Domain. + Name *string `mandatory:"false" json:"name"` + + // The OCID of the Fault Domain. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the compartment. Currently only tenancy (root) compartment can be provided. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The name of the availabilityDomain where the Fault Domain belongs. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` +} + +func (m FaultDomain) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/generate_totp_seed_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/generate_totp_seed_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/generate_totp_seed_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/generate_totp_seed_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GenerateTotpSeedRequest wrapper for the GenerateTotpSeed operation +type GenerateTotpSeedRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the MFA TOTP device. + MfaTotpDeviceId *string `mandatory:"true" contributesTo:"path" name:"mfaTotpDeviceId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateTotpSeedRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateTotpSeedRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateTotpSeedRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GenerateTotpSeedResponse wrapper for the GenerateTotpSeed operation +type GenerateTotpSeedResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MfaTotpDevice instance + MfaTotpDevice `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GenerateTotpSeedResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateTotpSeedResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_authentication_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_authentication_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_authentication_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_authentication_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAuthenticationPolicyRequest wrapper for the GetAuthenticationPolicy operation +type GetAuthenticationPolicyRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"path" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAuthenticationPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAuthenticationPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAuthenticationPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAuthenticationPolicyResponse wrapper for the GetAuthenticationPolicy operation +type GetAuthenticationPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AuthenticationPolicy instance + AuthenticationPolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetAuthenticationPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAuthenticationPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_compartment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_compartment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_compartment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_compartment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"path" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetCompartmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetCompartmentResponse wrapper for the GetCompartment operation type GetCompartmentResponse struct { @@ -39,3 +57,8 @@ func (response GetCompartmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_dynamic_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_dynamic_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_dynamic_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_dynamic_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the dynamic group. DynamicGroupId *string `mandatory:"true" contributesTo:"path" name:"dynamicGroupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetDynamicGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetDynamicGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDynamicGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetDynamicGroupResponse wrapper for the GetDynamicGroup operation type GetDynamicGroupResponse struct { @@ -39,3 +57,8 @@ func (response GetDynamicGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetDynamicGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the group. GroupId *string `mandatory:"true" contributesTo:"path" name:"groupId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetGroupResponse wrapper for the GetGroup operation type GetGroupResponse struct { @@ -39,3 +57,8 @@ func (response GetGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_identity_provider_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_identity_provider_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_identity_provider_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_identity_provider_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the identity provider. IdentityProviderId *string `mandatory:"true" contributesTo:"path" name:"identityProviderId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetIdentityProviderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetIdentityProviderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIdentityProviderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetIdentityProviderResponse wrapper for the GetIdentityProvider operation type GetIdentityProviderResponse struct { @@ -39,3 +57,8 @@ func (response GetIdentityProviderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetIdentityProviderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_idp_group_mapping_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_idp_group_mapping_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_idp_group_mapping_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_idp_group_mapping_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -16,12 +16,30 @@ // The OCID of the group mapping. MappingId *string `mandatory:"true" contributesTo:"path" name:"mappingId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetIdpGroupMappingRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetIdpGroupMappingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetIdpGroupMappingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetIdpGroupMappingResponse wrapper for the GetIdpGroupMapping operation type GetIdpGroupMappingResponse struct { @@ -42,3 +60,8 @@ func (response GetIdpGroupMappingResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetIdpGroupMappingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_mfa_totp_device_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_mfa_totp_device_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_mfa_totp_device_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_mfa_totp_device_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetMfaTotpDeviceRequest wrapper for the GetMfaTotpDevice operation +type GetMfaTotpDeviceRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the MFA TOTP device. + MfaTotpDeviceId *string `mandatory:"true" contributesTo:"path" name:"mfaTotpDeviceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetMfaTotpDeviceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMfaTotpDeviceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMfaTotpDeviceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetMfaTotpDeviceResponse wrapper for the GetMfaTotpDevice operation +type GetMfaTotpDeviceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MfaTotpDeviceSummary instance + MfaTotpDeviceSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetMfaTotpDeviceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMfaTotpDeviceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_policy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the policy. PolicyId *string `mandatory:"true" contributesTo:"path" name:"policyId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPolicyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPolicyResponse wrapper for the GetPolicy operation type GetPolicyResponse struct { @@ -39,3 +57,8 @@ func (response GetPolicyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_default_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_default_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_default_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_default_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetTagDefaultRequest wrapper for the GetTagDefault operation +type GetTagDefaultRequest struct { + + // The OCID of the tag default. + TagDefaultId *string `mandatory:"true" contributesTo:"path" name:"tagDefaultId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetTagDefaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetTagDefaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTagDefaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetTagDefaultResponse wrapper for the GetTagDefault operation +type GetTagDefaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TagDefault instance + TagDefault `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetTagDefaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetTagDefaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_namespace_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_namespace_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_namespace_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_namespace_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the tag namespace. TagNamespaceId *string `mandatory:"true" contributesTo:"path" name:"tagNamespaceId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetTagNamespaceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetTagNamespaceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTagNamespaceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetTagNamespaceResponse wrapper for the GetTagNamespace operation type GetTagNamespaceResponse struct { @@ -36,3 +54,8 @@ func (response GetTagNamespaceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetTagNamespaceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tag_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -16,12 +16,30 @@ // The name of the tag. TagName *string `mandatory:"true" contributesTo:"path" name:"tagName"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetTagRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetTagRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTagRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetTagResponse wrapper for the GetTag operation type GetTagResponse struct { @@ -39,3 +57,8 @@ func (response GetTagResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetTagResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tenancy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tenancy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tenancy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_tenancy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the tenancy. TenancyId *string `mandatory:"true" contributesTo:"path" name:"tenancyId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetTenancyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetTenancyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTenancyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetTenancyResponse wrapper for the GetTenancy operation type GetTenancyResponse struct { @@ -36,3 +54,8 @@ func (response GetTenancyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetTenancyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_group_membership_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_group_membership_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_group_membership_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_group_membership_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the userGroupMembership. UserGroupMembershipId *string `mandatory:"true" contributesTo:"path" name:"userGroupMembershipId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetUserGroupMembershipRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetUserGroupMembershipRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetUserGroupMembershipRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetUserGroupMembershipResponse wrapper for the GetUserGroupMembership operation type GetUserGroupMembershipResponse struct { @@ -39,3 +57,8 @@ func (response GetUserGroupMembershipResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetUserGroupMembershipResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_user_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the user. UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetUserRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetUserRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetUserRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetUserResponse wrapper for the GetUser operation type GetUserResponse struct { @@ -39,3 +57,8 @@ func (response GetUserResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetUserResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/get_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +type GetWorkRequestRequest struct { + + // The OCID of the work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The number of seconds that the client should wait before polling again. + RetryAfter *float32 `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/group.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/group.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/group.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/group.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,15 +14,15 @@ // Group A collection of users who all need the same type of access to a particular set of resources or compartment. // For conceptual information about groups and other IAM Service components, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // If you're federating with an identity provider (IdP), you need to create mappings between the groups // defined in the IdP and groups you define in the IAM service. For more information, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). Also see +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). Also see // IdentityProvider and // IdpGroupMapping. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type Group struct { // The OCID of the group. @@ -47,15 +47,15 @@ LifecycleState GroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -67,7 +67,7 @@ // GroupLifecycleStateEnum Enum with underlying type: string type GroupLifecycleStateEnum string -// Set of constants representing the allowable values for GroupLifecycleState +// Set of constants representing the allowable values for GroupLifecycleStateEnum const ( GroupLifecycleStateCreating GroupLifecycleStateEnum = "CREATING" GroupLifecycleStateActive GroupLifecycleStateEnum = "ACTIVE" @@ -84,7 +84,7 @@ "DELETED": GroupLifecycleStateDeleted, } -// GetGroupLifecycleStateEnumValues Enumerates the set of values for GroupLifecycleState +// GetGroupLifecycleStateEnumValues Enumerates the set of values for GroupLifecycleStateEnum func GetGroupLifecycleStateEnumValues() []GroupLifecycleStateEnum { values := make([]GroupLifecycleStateEnum, 0) for _, v := range mappingGroupLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -37,7 +37,7 @@ // SetRegion overrides the region of this client. func (client *IdentityClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "identity", region) + client.Host = common.StringToRegion(region).Endpoint("identity") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +48,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -58,60 +58,269 @@ return client.config } +// ActivateMfaTotpDevice Activates the specified MFA TOTP device for the user. Activation requires manual interaction with the Console. +func (client IdentityClient) ActivateMfaTotpDevice(ctx context.Context, request ActivateMfaTotpDeviceRequest) (response ActivateMfaTotpDeviceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.activateMfaTotpDevice, policy) + if err != nil { + if ociResponse != nil { + response = ActivateMfaTotpDeviceResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ActivateMfaTotpDeviceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ActivateMfaTotpDeviceResponse") + } + return +} + +// activateMfaTotpDevice implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) activateMfaTotpDevice(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}/actions/activate") + if err != nil { + return nil, err + } + + var response ActivateMfaTotpDeviceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // AddUserToGroup Adds the specified user to the specified group and returns a `UserGroupMembership` object with its own OCID. // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the // object, first make sure its `lifecycleState` has changed to ACTIVE. func (client IdentityClient) AddUserToGroup(ctx context.Context, request AddUserToGroupRequest) (response AddUserToGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/userGroupMemberships/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.addUserToGroup, policy) if err != nil { + if ociResponse != nil { + response = AddUserToGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(AddUserToGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddUserToGroupResponse") + } + return +} + +// addUserToGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) addUserToGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/userGroupMemberships/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response AddUserToGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeTagNamespaceCompartment Moves the specified tag namespace to the specified compartment within the same tenancy. +// To move the tag namespace, you must have the manage tag-namespaces permission on both compartments. +// For more information about IAM policies, see Details for IAM (https://docs.cloud.oracle.com/Content/Identity/Reference/iampolicyreference.htm). +// Moving a tag namespace moves all the tag key definitions contained in the tag namespace. +func (client IdentityClient) ChangeTagNamespaceCompartment(ctx context.Context, request ChangeTagNamespaceCompartmentRequest) (response ChangeTagNamespaceCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.changeTagNamespaceCompartment, policy) + if err != nil { + if ociResponse != nil { + response = ChangeTagNamespaceCompartmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ChangeTagNamespaceCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeTagNamespaceCompartmentResponse") + } + return +} + +// changeTagNamespaceCompartment implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) changeTagNamespaceCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tagNamespaces/{tagNamespaceId}/actions/changeCompartment") + if err != nil { + return nil, err + } + + var response ChangeTagNamespaceCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateAuthToken Creates a new auth token for the specified user. For information about what auth tokens are for, see +// Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). +// You must specify a *description* for the auth token (although it can be an empty string). It does not +// have to be unique, and you can change it anytime with +// UpdateAuthToken. +// Every user has permission to create an auth token for *their own user ID*. An administrator in your organization +// does not need to write a policy to give users this ability. To compare, administrators who have permission to the +// tenancy can use this operation to create an auth token for any user, including themselves. +func (client IdentityClient) CreateAuthToken(ctx context.Context, request CreateAuthTokenRequest) (response CreateAuthTokenResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAuthToken, policy) + if err != nil { + if ociResponse != nil { + response = CreateAuthTokenResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAuthTokenResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAuthTokenResponse") + } return } -// CreateCompartment Creates a new compartment in your tenancy. +// createAuthToken implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createAuthToken(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/authTokens/") + if err != nil { + return nil, err + } + + var response CreateAuthTokenResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCompartment Creates a new compartment in the specified compartment. // **Important:** Compartments cannot be deleted. -// You must specify your tenancy's OCID as the compartment ID in the request object. Remember that the tenancy +// Specify the parent compartment's OCID as the compartment ID in the request object. Remember that the tenancy // is simply the root compartment. For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must also specify a *name* for the compartment, which must be unique across all compartments in // your tenancy. You can use this name or the OCID when writing policies that apply // to the compartment. For more information about policies, see -// How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm). +// How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm). // You must also specify a *description* for the compartment (although it can be an empty string). It does // not have to be unique, and you can change it anytime with // UpdateCompartment. // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the // object, first make sure its `lifecycleState` has changed to ACTIVE. func (client IdentityClient) CreateCompartment(ctx context.Context, request CreateCompartmentRequest) (response CreateCompartmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/compartments/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCompartment, policy) if err != nil { + if ociResponse != nil { + response = CreateCompartmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCompartmentResponse") + } + return +} + +// createCompartment implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/compartments/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateCustomerSecretKey Creates a new secret key for the specified user. Secret keys are used for authentication with the Object Storage Service's Amazon S3 // compatible API. For information, see -// Managing User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm). +// Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). // You must specify a *description* for the secret key (although it can be an empty string). It does not // have to be unique, and you can change it anytime with // UpdateCustomerSecretKey. @@ -119,20 +328,49 @@ // does not need to write a policy to give users this ability. To compare, administrators who have permission to the // tenancy can use this operation to create a secret key for any user, including themselves. func (client IdentityClient) CreateCustomerSecretKey(ctx context.Context, request CreateCustomerSecretKeyRequest) (response CreateCustomerSecretKeyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/{userId}/customerSecretKeys/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCustomerSecretKey, policy) if err != nil { + if ociResponse != nil { + response = CreateCustomerSecretKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCustomerSecretKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCustomerSecretKeyResponse") + } + return +} + +// createCustomerSecretKey implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createCustomerSecretKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/customerSecretKeys/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCustomerSecretKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateDynamicGroup Creates a new dynamic group in your tenancy. @@ -140,30 +378,59 @@ // is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies) // reside within the tenancy itself, unlike cloud resources such as compute instances, which typically // reside within compartments inside the tenancy. For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must also specify a *name* for the dynamic group, which must be unique across all dynamic groups in your -// tenancy, and cannot be changed. Note that this name has to be also unique accross all groups in your tenancy. +// tenancy, and cannot be changed. Note that this name has to be also unique across all groups in your tenancy. // You can use this name or the OCID when writing policies that apply to the dynamic group. For more information -// about policies, see How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm). +// about policies, see How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm). // You must also specify a *description* for the dynamic group (although it can be an empty string). It does not // have to be unique, and you can change it anytime with UpdateDynamicGroup. // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the // object, first make sure its `lifecycleState` has changed to ACTIVE. func (client IdentityClient) CreateDynamicGroup(ctx context.Context, request CreateDynamicGroupRequest) (response CreateDynamicGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/dynamicGroups/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDynamicGroup, policy) if err != nil { + if ociResponse != nil { + response = CreateDynamicGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateDynamicGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDynamicGroupResponse") + } + return +} + +// createDynamicGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createDynamicGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dynamicGroups/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateDynamicGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateGroup Creates a new group in your tenancy. @@ -171,10 +438,10 @@ // is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies) // reside within the tenancy itself, unlike cloud resources such as compute instances, which typically // reside within compartments inside the tenancy. For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must also specify a *name* for the group, which must be unique across all groups in your tenancy and // cannot be changed. You can use this name or the OCID when writing policies that apply to the group. For more -// information about policies, see How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm). +// information about policies, see How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm). // You must also specify a *description* for the group (although it can be an empty string). It does not // have to be unique, and you can change it anytime with UpdateGroup. // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the @@ -183,27 +450,56 @@ // See AddUserToGroup and // CreatePolicy. func (client IdentityClient) CreateGroup(ctx context.Context, request CreateGroupRequest) (response CreateGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/groups/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createGroup, policy) if err != nil { + if ociResponse != nil { + response = CreateGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateGroupResponse") + } + return +} + +// createGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/groups/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateIdentityProvider Creates a new identity provider in your tenancy. For more information, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). // You must specify your tenancy's OCID as the compartment ID in the request object. // Remember that the tenancy is simply the root compartment. For information about -// OCIDs, see Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must also specify a *name* for the `IdentityProvider`, which must be unique // across all `IdentityProvider` objects in your tenancy and cannot be changed. // You must also specify a *description* for the `IdentityProvider` (although @@ -214,43 +510,148 @@ // be CREATING. Before using the object, first make sure its `lifecycleState` has // changed to ACTIVE. func (client IdentityClient) CreateIdentityProvider(ctx context.Context, request CreateIdentityProviderRequest) (response CreateIdentityProviderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/identityProviders/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createIdentityProvider, policy) if err != nil { + if ociResponse != nil { + response = CreateIdentityProviderResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateIdentityProviderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateIdentityProviderResponse") + } + return +} + +// createIdentityProvider implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createIdentityProvider(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/identityProviders/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateIdentityProviderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &identityprovider{}) - return + return response, err } // CreateIdpGroupMapping Creates a single mapping between an IdP group and an IAM Service // Group. func (client IdentityClient) CreateIdpGroupMapping(ctx context.Context, request CreateIdpGroupMappingRequest) (response CreateIdpGroupMappingResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/identityProviders/{identityProviderId}/groupMappings/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createIdpGroupMapping, policy) if err != nil { + if ociResponse != nil { + response = CreateIdpGroupMappingResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateIdpGroupMappingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateIdpGroupMappingResponse") + } + return +} + +// createIdpGroupMapping implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createIdpGroupMapping(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/identityProviders/{identityProviderId}/groupMappings/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateIdpGroupMappingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMfaTotpDevice Creates a new MFA TOTP device for the user. A user can have one MFA TOTP device. +func (client IdentityClient) CreateMfaTotpDevice(ctx context.Context, request CreateMfaTotpDeviceRequest) (response CreateMfaTotpDeviceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createMfaTotpDevice, policy) + if err != nil { + if ociResponse != nil { + response = CreateMfaTotpDeviceResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateMfaTotpDeviceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMfaTotpDeviceResponse") + } return } +// createMfaTotpDevice implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createMfaTotpDevice(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/mfaTotpDevices") + if err != nil { + return nil, err + } + + var response CreateMfaTotpDeviceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateOrResetUIPassword Creates a new Console one-time password for the specified user. For more information about user -// credentials, see User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/usercredentials.htm). +// credentials, see User Credentials (https://docs.cloud.oracle.com/Content/Identity/Concepts/usercredentials.htm). // Use this operation after creating a new user, or if a user forgets their password. The new one-time // password is returned to you in the response, and you must securely deliver it to the user. They'll // be prompted to change this password the next time they sign in to the Console. If they don't change @@ -259,67 +660,154 @@ // **Note:** The user's Console login is the unique name you specified when you created the user // (see CreateUser). func (client IdentityClient) CreateOrResetUIPassword(ctx context.Context, request CreateOrResetUIPasswordRequest) (response CreateOrResetUIPasswordResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/{userId}/uiPassword", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createOrResetUIPassword, policy) if err != nil { + if ociResponse != nil { + response = CreateOrResetUIPasswordResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateOrResetUIPasswordResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateOrResetUIPasswordResponse") + } + return +} + +// createOrResetUIPassword implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createOrResetUIPassword(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/uiPassword") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateOrResetUIPasswordResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreatePolicy Creates a new policy in the specified compartment (either the tenancy or another of your compartments). -// If you're new to policies, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// If you're new to policies, see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // You must specify a *name* for the policy, which must be unique across all policies in your tenancy // and cannot be changed. // You must also specify a *description* for the policy (although it can be an empty string). It does not // have to be unique, and you can change it anytime with UpdatePolicy. // You must specify one or more policy statements in the statements array. For information about writing -// policies, see How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm) and -// Common Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm). +// policies, see How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm) and +// Common Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm). // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the // object, first make sure its `lifecycleState` has changed to ACTIVE. // New policies take effect typically within 10 seconds. func (client IdentityClient) CreatePolicy(ctx context.Context, request CreatePolicyRequest) (response CreatePolicyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/policies/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createPolicy, policy) if err != nil { + if ociResponse != nil { + response = CreatePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreatePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePolicyResponse") + } + return +} + +// createPolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/policies/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreatePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateRegionSubscription Creates a subscription to a region for a tenancy. func (client IdentityClient) CreateRegionSubscription(ctx context.Context, request CreateRegionSubscriptionRequest) (response CreateRegionSubscriptionResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/tenancies/{tenancyId}/regionSubscriptions", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createRegionSubscription, policy) if err != nil { + if ociResponse != nil { + response = CreateRegionSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateRegionSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRegionSubscriptionResponse") + } + return +} + +// createRegionSubscription implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createRegionSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tenancies/{tenancyId}/regionSubscriptions") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateRegionSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateSmtpCredential Creates a new SMTP credential for the specified user. An SMTP credential has an SMTP user name and an SMTP password. @@ -327,24 +815,54 @@ // have to be unique, and you can change it anytime with // UpdateSmtpCredential. func (client IdentityClient) CreateSmtpCredential(ctx context.Context, request CreateSmtpCredentialRequest) (response CreateSmtpCredentialResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/{userId}/smtpCredentials/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSmtpCredential, policy) if err != nil { + if ociResponse != nil { + response = CreateSmtpCredentialResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateSmtpCredentialResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSmtpCredentialResponse") + } + return +} + +// createSmtpCredential implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createSmtpCredential(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/smtpCredentials/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSmtpCredentialResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateSwiftPassword Creates a new Swift password for the specified user. For information about what Swift passwords are for, see -// Managing User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm). +// CreateSwiftPassword **Deprecated. Use CreateAuthToken instead.** +// Creates a new Swift password for the specified user. For information about what Swift passwords are for, see +// Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). // You must specify a *description* for the Swift password (although it can be an empty string). It does not // have to be unique, and you can change it anytime with // UpdateSwiftPassword. @@ -352,20 +870,49 @@ // does not need to write a policy to give users this ability. To compare, administrators who have permission to the // tenancy can use this operation to create a Swift password for any user, including themselves. func (client IdentityClient) CreateSwiftPassword(ctx context.Context, request CreateSwiftPasswordRequest) (response CreateSwiftPasswordResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/{userId}/swiftPasswords/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSwiftPassword, policy) if err != nil { + if ociResponse != nil { + response = CreateSwiftPasswordResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateSwiftPasswordResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSwiftPasswordResponse") + } + return +} + +// createSwiftPassword implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createSwiftPassword(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/swiftPasswords/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateSwiftPasswordResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateTag Creates a new tag in the specified tag namespace. @@ -378,22 +925,98 @@ // It does not have to be unique, and you can change it with // UpdateTag. func (client IdentityClient) CreateTag(ctx context.Context, request CreateTagRequest) (response CreateTagResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/tagNamespaces/{tagNamespaceId}/tags", request) - if err != nil { - return + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createTag, policy) if err != nil { + if ociResponse != nil { + response = CreateTagResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(CreateTagResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTagResponse") + } return } +// createTag implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createTag(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tagNamespaces/{tagNamespaceId}/tags") + if err != nil { + return nil, err + } + + var response CreateTagResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateTagDefault Creates a new tag default in the specified compartment for the specified tag definition. +func (client IdentityClient) CreateTagDefault(ctx context.Context, request CreateTagDefaultRequest) (response CreateTagDefaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createTagDefault, policy) + if err != nil { + if ociResponse != nil { + response = CreateTagDefaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateTagDefaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTagDefaultResponse") + } + return +} + +// createTagDefault implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createTagDefault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tagDefaults") + if err != nil { + return nil, err + } + + var response CreateTagDefaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateTagNamespace Creates a new tag namespace in the specified compartment. // You must specify the compartment ID in the request object (remember that the tenancy is simply the root // compartment). @@ -406,31 +1029,60 @@ // It does not have to be unique, and you can change it with // UpdateTagNamespace. // Tag namespaces cannot be deleted, but they can be retired. -// See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring) for more information. +// See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring) for more information. func (client IdentityClient) CreateTagNamespace(ctx context.Context, request CreateTagNamespaceRequest) (response CreateTagNamespaceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/tagNamespaces", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createTagNamespace, policy) if err != nil { + if ociResponse != nil { + response = CreateTagNamespaceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateTagNamespaceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTagNamespaceResponse") + } + return +} + +// createTagNamespace implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createTagNamespace(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tagNamespaces") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateTagNamespaceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateUser Creates a new user in your tenancy. For conceptual information about users, your tenancy, and other -// IAM Service components, see Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// IAM Service components, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // You must specify your tenancy's OCID as the compartment ID in the request object (remember that the // tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and // some policies) reside within the tenancy itself, unlike cloud resources such as compute instances, // which typically reside within compartments inside the tenancy. For information about OCIDs, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must also specify a *name* for the user, which must be unique across all users in your tenancy // and cannot be changed. Allowed characters: No spaces. Only letters, numerals, hyphens, periods, // underscores, +, and @. If you specify a name that's already in use, you'll get a 409 error. @@ -450,24 +1102,53 @@ // CreateOrResetUIPassword). // If the user needs to access the Oracle Cloud Infrastructure REST API, you need to upload a // public API signing key for that user (see -// Required Keys and OCIDs (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm) and also +// Required Keys and OCIDs (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm) and also // UploadApiKey). // **Important:** Make sure to inform the new user which compartment(s) they have access to. func (client IdentityClient) CreateUser(ctx context.Context, request CreateUserRequest) (response CreateUserResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createUser, policy) if err != nil { + if ociResponse != nil { + response = CreateUserResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateUserResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateUserResponse") + } + return +} + +// createUser implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) createUser(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateUserResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteApiKey Deletes the specified API signing key for the specified user. @@ -476,997 +1157,3147 @@ // To compare, administrators who have permission to the tenancy can use this operation to delete // a key for any user, including themselves. func (client IdentityClient) DeleteApiKey(ctx context.Context, request DeleteApiKeyRequest) (response DeleteApiKeyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/users/{userId}/apiKeys/{fingerprint}", request) - if err != nil { - return + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteApiKey, policy) if err != nil { + if ociResponse != nil { + response = DeleteApiKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteApiKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteApiKeyResponse") + } return } -// DeleteCustomerSecretKey Deletes the specified secret key for the specified user. -func (client IdentityClient) DeleteCustomerSecretKey(ctx context.Context, request DeleteCustomerSecretKeyRequest) (response DeleteCustomerSecretKeyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/users/{userId}/customerSecretKeys/{customerSecretKeyId}", request) +// deleteApiKey implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteApiKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/apiKeys/{fingerprint}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteApiKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteDynamicGroup Deletes the specified dynamic group. -func (client IdentityClient) DeleteDynamicGroup(ctx context.Context, request DeleteDynamicGroupRequest) (response DeleteDynamicGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/dynamicGroups/{dynamicGroupId}", request) - if err != nil { - return +// DeleteAuthToken Deletes the specified auth token for the specified user. +func (client IdentityClient) DeleteAuthToken(ctx context.Context, request DeleteAuthTokenRequest) (response DeleteAuthTokenResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteAuthToken, policy) if err != nil { + if ociResponse != nil { + response = DeleteAuthTokenResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteAuthTokenResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAuthTokenResponse") + } return } -// DeleteGroup Deletes the specified group. The group must be empty. -func (client IdentityClient) DeleteGroup(ctx context.Context, request DeleteGroupRequest) (response DeleteGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/groups/{groupId}", request) +// deleteAuthToken implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteAuthToken(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/authTokens/{authTokenId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteAuthTokenResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteIdentityProvider Deletes the specified identity provider. The identity provider must not have -// any group mappings (see IdpGroupMapping). -func (client IdentityClient) DeleteIdentityProvider(ctx context.Context, request DeleteIdentityProviderRequest) (response DeleteIdentityProviderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/identityProviders/{identityProviderId}", request) - if err != nil { - return +// DeleteCompartment Deletes the specified compartment. The compartment must be empty. +func (client IdentityClient) DeleteCompartment(ctx context.Context, request DeleteCompartmentRequest) (response DeleteCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteCompartment, policy) if err != nil { + if ociResponse != nil { + response = DeleteCompartmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCompartmentResponse") + } return } -// DeleteIdpGroupMapping Deletes the specified group mapping. -func (client IdentityClient) DeleteIdpGroupMapping(ctx context.Context, request DeleteIdpGroupMappingRequest) (response DeleteIdpGroupMappingResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}", request) +// deleteCompartment implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/compartments/{compartmentId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeletePolicy Deletes the specified policy. The deletion takes effect typically within 10 seconds. -func (client IdentityClient) DeletePolicy(ctx context.Context, request DeletePolicyRequest) (response DeletePolicyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/policies/{policyId}", request) - if err != nil { - return +// DeleteCustomerSecretKey Deletes the specified secret key for the specified user. +func (client IdentityClient) DeleteCustomerSecretKey(ctx context.Context, request DeleteCustomerSecretKeyRequest) (response DeleteCustomerSecretKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteCustomerSecretKey, policy) if err != nil { + if ociResponse != nil { + response = DeleteCustomerSecretKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteCustomerSecretKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCustomerSecretKeyResponse") + } return } -// DeleteSmtpCredential Deletes the specified SMTP credential for the specified user. -func (client IdentityClient) DeleteSmtpCredential(ctx context.Context, request DeleteSmtpCredentialRequest) (response DeleteSmtpCredentialResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/users/{userId}/smtpCredentials/{smtpCredentialId}", request) +// deleteCustomerSecretKey implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteCustomerSecretKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/customerSecretKeys/{customerSecretKeyId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCustomerSecretKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteSwiftPassword Deletes the specified Swift password for the specified user. -func (client IdentityClient) DeleteSwiftPassword(ctx context.Context, request DeleteSwiftPasswordRequest) (response DeleteSwiftPasswordResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/users/{userId}/swiftPasswords/{swiftPasswordId}", request) - if err != nil { - return +// DeleteDynamicGroup Deletes the specified dynamic group. +func (client IdentityClient) DeleteDynamicGroup(ctx context.Context, request DeleteDynamicGroupRequest) (response DeleteDynamicGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteDynamicGroup, policy) if err != nil { + if ociResponse != nil { + response = DeleteDynamicGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteDynamicGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDynamicGroupResponse") + } return } -// DeleteUser Deletes the specified user. The user must not be in any groups. -func (client IdentityClient) DeleteUser(ctx context.Context, request DeleteUserRequest) (response DeleteUserResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/users/{userId}", request) +// deleteDynamicGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteDynamicGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dynamicGroups/{dynamicGroupId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteDynamicGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetCompartment Gets the specified compartment's information. -// This operation does not return a list of all the resources inside the compartment. There is no single -// API operation that does that. Compartments can contain multiple types of resources (instances, block -// storage volumes, etc.). To find out what's in a compartment, you must call the "List" operation for -// each resource type and specify the compartment's OCID as a query parameter in the request. For example, -// call the ListInstances operation in the Cloud Compute -// Service or the ListVolumes operation in Cloud Block Storage. -func (client IdentityClient) GetCompartment(ctx context.Context, request GetCompartmentRequest) (response GetCompartmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/compartments/{compartmentId}", request) - if err != nil { - return +// DeleteGroup Deletes the specified group. The group must be empty. +func (client IdentityClient) DeleteGroup(ctx context.Context, request DeleteGroupRequest) (response DeleteGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteGroup, policy) if err != nil { + if ociResponse != nil { + response = DeleteGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteGroupResponse") + } return } -// GetDynamicGroup Gets the specified dynamic group's information. -func (client IdentityClient) GetDynamicGroup(ctx context.Context, request GetDynamicGroupRequest) (response GetDynamicGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dynamicGroups/{dynamicGroupId}", request) +// deleteGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/groups/{groupId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetGroup Gets the specified group's information. -// This operation does not return a list of all the users in the group. To do that, use -// ListUserGroupMemberships and -// provide the group's OCID as a query parameter in the request. -func (client IdentityClient) GetGroup(ctx context.Context, request GetGroupRequest) (response GetGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/groups/{groupId}", request) +// DeleteIdentityProvider Deletes the specified identity provider. The identity provider must not have +// any group mappings (see IdpGroupMapping). +func (client IdentityClient) DeleteIdentityProvider(ctx context.Context, request DeleteIdentityProviderRequest) (response DeleteIdentityProviderResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteIdentityProvider, policy) if err != nil { + if ociResponse != nil { + response = DeleteIdentityProviderResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteIdentityProviderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteIdentityProviderResponse") + } + return +} + +// deleteIdentityProvider implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteIdentityProvider(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/identityProviders/{identityProviderId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteIdentityProviderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetIdentityProvider Gets the specified identity provider's information. -func (client IdentityClient) GetIdentityProvider(ctx context.Context, request GetIdentityProviderRequest) (response GetIdentityProviderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/identityProviders/{identityProviderId}", request) - if err != nil { - return +// DeleteIdpGroupMapping Deletes the specified group mapping. +func (client IdentityClient) DeleteIdpGroupMapping(ctx context.Context, request DeleteIdpGroupMappingRequest) (response DeleteIdpGroupMappingResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteIdpGroupMapping, policy) if err != nil { + if ociResponse != nil { + response = DeleteIdpGroupMappingResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &identityprovider{}) + if convertedResponse, ok := ociResponse.(DeleteIdpGroupMappingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteIdpGroupMappingResponse") + } return } -// GetIdpGroupMapping Gets the specified group mapping. -func (client IdentityClient) GetIdpGroupMapping(ctx context.Context, request GetIdpGroupMappingRequest) (response GetIdpGroupMappingResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}", request) +// deleteIdpGroupMapping implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteIdpGroupMapping(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteIdpGroupMappingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetPolicy Gets the specified policy's information. -func (client IdentityClient) GetPolicy(ctx context.Context, request GetPolicyRequest) (response GetPolicyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/policies/{policyId}", request) - if err != nil { - return +// DeleteMfaTotpDevice Deletes the specified MFA TOTP device for the specified user. +func (client IdentityClient) DeleteMfaTotpDevice(ctx context.Context, request DeleteMfaTotpDeviceRequest) (response DeleteMfaTotpDeviceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteMfaTotpDevice, policy) if err != nil { + if ociResponse != nil { + response = DeleteMfaTotpDeviceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteMfaTotpDeviceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMfaTotpDeviceResponse") + } return } -// GetTag Gets the specified tag's information. -func (client IdentityClient) GetTag(ctx context.Context, request GetTagRequest) (response GetTagResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tagNamespaces/{tagNamespaceId}/tags/{tagName}", request) +// deleteMfaTotpDevice implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteMfaTotpDevice(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteMfaTotpDeviceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetTagNamespace Gets the specified tag namespace's information. -func (client IdentityClient) GetTagNamespace(ctx context.Context, request GetTagNamespaceRequest) (response GetTagNamespaceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tagNamespaces/{tagNamespaceId}", request) - if err != nil { - return +// DeletePolicy Deletes the specified policy. The deletion takes effect typically within 10 seconds. +func (client IdentityClient) DeletePolicy(ctx context.Context, request DeletePolicyRequest) (response DeletePolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deletePolicy, policy) if err != nil { + if ociResponse != nil { + response = DeletePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeletePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePolicyResponse") + } return } -// GetTenancy Get the specified tenancy's information. -func (client IdentityClient) GetTenancy(ctx context.Context, request GetTenancyRequest) (response GetTenancyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tenancies/{tenancyId}", request) +// deletePolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deletePolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/policies/{policyId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeletePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetUser Gets the specified user's information. -func (client IdentityClient) GetUser(ctx context.Context, request GetUserRequest) (response GetUserResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/{userId}", request) - if err != nil { - return +// DeleteSmtpCredential Deletes the specified SMTP credential for the specified user. +func (client IdentityClient) DeleteSmtpCredential(ctx context.Context, request DeleteSmtpCredentialRequest) (response DeleteSmtpCredentialResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteSmtpCredential, policy) if err != nil { + if ociResponse != nil { + response = DeleteSmtpCredentialResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteSmtpCredentialResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSmtpCredentialResponse") + } return } -// GetUserGroupMembership Gets the specified UserGroupMembership's information. -func (client IdentityClient) GetUserGroupMembership(ctx context.Context, request GetUserGroupMembershipRequest) (response GetUserGroupMembershipResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/userGroupMemberships/{userGroupMembershipId}", request) +// deleteSmtpCredential implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteSmtpCredential(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/smtpCredentials/{smtpCredentialId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSmtpCredentialResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListApiKeys Lists the API signing keys for the specified user. A user can have a maximum of three keys. -// Every user has permission to use this API call for *their own user ID*. An administrator in your -// organization does not need to write a policy to give users this ability. -func (client IdentityClient) ListApiKeys(ctx context.Context, request ListApiKeysRequest) (response ListApiKeysResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/{userId}/apiKeys/", request) +// DeleteSwiftPassword **Deprecated. Use DeleteAuthToken instead.** +// Deletes the specified Swift password for the specified user. +func (client IdentityClient) DeleteSwiftPassword(ctx context.Context, request DeleteSwiftPasswordRequest) (response DeleteSwiftPasswordResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSwiftPassword, policy) if err != nil { + if ociResponse != nil { + response = DeleteSwiftPasswordResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteSwiftPasswordResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSwiftPasswordResponse") + } + return +} + +// deleteSwiftPassword implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteSwiftPassword(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}/swiftPasswords/{swiftPasswordId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteSwiftPasswordResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListAvailabilityDomains Lists the Availability Domains in your tenancy. Specify the OCID of either the tenancy or another -// of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListAvailabilityDomains(ctx context.Context, request ListAvailabilityDomainsRequest) (response ListAvailabilityDomainsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/availabilityDomains/", request) +// DeleteTagDefault Deletes the the specified tag default. +func (client IdentityClient) DeleteTagDefault(ctx context.Context, request DeleteTagDefaultRequest) (response DeleteTagDefaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteTagDefault, policy) if err != nil { + if ociResponse != nil { + response = DeleteTagDefaultResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteTagDefaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteTagDefaultResponse") + } + return +} + +// deleteTagDefault implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteTagDefault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/tagDefaults/{tagDefaultId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteTagDefaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListCompartments Lists the compartments in your tenancy. You must specify your tenancy's OCID as the value -// for the compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListCompartments(ctx context.Context, request ListCompartmentsRequest) (response ListCompartmentsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/compartments/", request) +// DeleteUser Deletes the specified user. The user must not be in any groups. +func (client IdentityClient) DeleteUser(ctx context.Context, request DeleteUserRequest) (response DeleteUserResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteUser, policy) if err != nil { + if ociResponse != nil { + response = DeleteUserResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteUserResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteUserResponse") + } + return +} + +// deleteUser implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) deleteUser(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/users/{userId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteUserResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListCustomerSecretKeys Lists the secret keys for the specified user. The returned object contains the secret key's OCID, but not -// the secret key itself. The actual secret key is returned only upon creation. -func (client IdentityClient) ListCustomerSecretKeys(ctx context.Context, request ListCustomerSecretKeysRequest) (response ListCustomerSecretKeysResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/{userId}/customerSecretKeys/", request) +// GenerateTotpSeed Generate seed for the MFA TOTP device. +func (client IdentityClient) GenerateTotpSeed(ctx context.Context, request GenerateTotpSeedRequest) (response GenerateTotpSeedResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.generateTotpSeed, policy) if err != nil { + if ociResponse != nil { + response = GenerateTotpSeedResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GenerateTotpSeedResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateTotpSeedResponse") + } + return +} + +// generateTotpSeed implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) generateTotpSeed(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}/actions/generateSeed") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GenerateTotpSeedResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListDynamicGroups Lists the dynamic groups in your tenancy. You must specify your tenancy's OCID as the value for +// GetAuthenticationPolicy Gets the authentication policy for the given tenancy. You must specify your tenant’s OCID as the value for // the compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/dynamicGroups/", request) +func (client IdentityClient) GetAuthenticationPolicy(ctx context.Context, request GetAuthenticationPolicyRequest) (response GetAuthenticationPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAuthenticationPolicy, policy) if err != nil { + if ociResponse != nil { + response = GetAuthenticationPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetAuthenticationPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAuthenticationPolicyResponse") + } + return +} + +// getAuthenticationPolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getAuthenticationPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/authenticationPolicies/{compartmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetAuthenticationPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListGroups Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for -// the compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/groups/", request) +// GetCompartment Gets the specified compartment's information. +// This operation does not return a list of all the resources inside the compartment. There is no single +// API operation that does that. Compartments can contain multiple types of resources (instances, block +// storage volumes, etc.). To find out what's in a compartment, you must call the "List" operation for +// each resource type and specify the compartment's OCID as a query parameter in the request. For example, +// call the ListInstances operation in the Cloud Compute +// Service or the ListVolumes operation in Cloud Block Storage. +func (client IdentityClient) GetCompartment(ctx context.Context, request GetCompartmentRequest) (response GetCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCompartment, policy) if err != nil { + if ociResponse != nil { + response = GetCompartmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCompartmentResponse") + } + return +} + +// getCompartment implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/compartments/{compartmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDynamicGroup Gets the specified dynamic group's information. +func (client IdentityClient) GetDynamicGroup(ctx context.Context, request GetDynamicGroupRequest) (response GetDynamicGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDynamicGroup, policy) + if err != nil { + if ociResponse != nil { + response = GetDynamicGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDynamicGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDynamicGroupResponse") + } return } -//listidentityprovider allows to unmarshal list of polymorphic IdentityProvider -type listidentityprovider []identityprovider +// getDynamicGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getDynamicGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dynamicGroups/{dynamicGroupId}") + if err != nil { + return nil, err + } -//UnmarshalPolymorphicJSON unmarshals polymorphic json list of items -func (m *listidentityprovider) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { - res := make([]IdentityProvider, len(*m)) - for i, v := range *m { - nn, err := v.UnmarshalPolymorphicJSON(v.JsonData) - if err != nil { - return nil, err - } - res[i] = nn.(IdentityProvider) + var response GetDynamicGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err } - return res, nil + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err } -// ListIdentityProviders Lists all the identity providers in your tenancy. You must specify the identity provider type (e.g., `SAML2` for -// identity providers using the SAML2.0 protocol). You must specify your tenancy's OCID as the value for the -// compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListIdentityProviders(ctx context.Context, request ListIdentityProvidersRequest) (response ListIdentityProvidersResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/identityProviders/", request) +// GetGroup Gets the specified group's information. +// This operation does not return a list of all the users in the group. To do that, use +// ListUserGroupMemberships and +// provide the group's OCID as a query parameter in the request. +func (client IdentityClient) GetGroup(ctx context.Context, request GetGroupRequest) (response GetGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getGroup, policy) if err != nil { + if ociResponse != nil { + response = GetGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetGroupResponse") + } + return +} + +// getGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/groups/{groupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listidentityprovider{}) - return + err = common.UnmarshalResponse(httpResponse, &response) + return response, err } -// ListIdpGroupMappings Lists the group mappings for the specified identity provider. -func (client IdentityClient) ListIdpGroupMappings(ctx context.Context, request ListIdpGroupMappingsRequest) (response ListIdpGroupMappingsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/identityProviders/{identityProviderId}/groupMappings/", request) +// GetIdentityProvider Gets the specified identity provider's information. +func (client IdentityClient) GetIdentityProvider(ctx context.Context, request GetIdentityProviderRequest) (response GetIdentityProviderResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIdentityProvider, policy) if err != nil { + if ociResponse != nil { + response = GetIdentityProviderResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIdentityProviderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIdentityProviderResponse") + } + return +} + +// getIdentityProvider implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getIdentityProvider(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/identityProviders/{identityProviderId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetIdentityProviderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &identityprovider{}) + return response, err +} + +// GetIdpGroupMapping Gets the specified group mapping. +func (client IdentityClient) GetIdpGroupMapping(ctx context.Context, request GetIdpGroupMappingRequest) (response GetIdpGroupMappingResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getIdpGroupMapping, policy) + if err != nil { + if ociResponse != nil { + response = GetIdpGroupMappingResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetIdpGroupMappingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetIdpGroupMappingResponse") + } + return +} + +// getIdpGroupMapping implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getIdpGroupMapping(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}") + if err != nil { + return nil, err + } + + var response GetIdpGroupMappingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetMfaTotpDevice Get the specified MFA TOTP device for the specified user. +func (client IdentityClient) GetMfaTotpDevice(ctx context.Context, request GetMfaTotpDeviceRequest) (response GetMfaTotpDeviceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getMfaTotpDevice, policy) + if err != nil { + if ociResponse != nil { + response = GetMfaTotpDeviceResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetMfaTotpDeviceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMfaTotpDeviceResponse") + } return } -// ListPolicies Lists the policies in the specified compartment (either the tenancy or another of your compartments). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -// To determine which policies apply to a particular group or compartment, you must view the individual -// statements inside all your policies. There isn't a way to automatically obtain that information via the API. -func (client IdentityClient) ListPolicies(ctx context.Context, request ListPoliciesRequest) (response ListPoliciesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/policies/", request) +// getMfaTotpDevice implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getMfaTotpDevice(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}") + if err != nil { + return nil, err + } + + var response GetMfaTotpDeviceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPolicy Gets the specified policy's information. +func (client IdentityClient) GetPolicy(ctx context.Context, request GetPolicyRequest) (response GetPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPolicy, policy) if err != nil { + if ociResponse != nil { + response = GetPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPolicyResponse") + } + return +} + +// getPolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/policies/{policyId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTag Gets the specified tag's information. +func (client IdentityClient) GetTag(ctx context.Context, request GetTagRequest) (response GetTagResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getTag, policy) + if err != nil { + if ociResponse != nil { + response = GetTagResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetTagResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTagResponse") + } + return +} + +// getTag implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getTag(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagNamespaces/{tagNamespaceId}/tags/{tagName}") + if err != nil { + return nil, err + } + + var response GetTagResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTagDefault Retrieves the specified tag default. +func (client IdentityClient) GetTagDefault(ctx context.Context, request GetTagDefaultRequest) (response GetTagDefaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getTagDefault, policy) + if err != nil { + if ociResponse != nil { + response = GetTagDefaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetTagDefaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTagDefaultResponse") + } return } -// ListRegionSubscriptions Lists the region subscriptions for the specified tenancy. -func (client IdentityClient) ListRegionSubscriptions(ctx context.Context, request ListRegionSubscriptionsRequest) (response ListRegionSubscriptionsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tenancies/{tenancyId}/regionSubscriptions", request) +// getTagDefault implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getTagDefault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagDefaults/{tagDefaultId}") + if err != nil { + return nil, err + } + + var response GetTagDefaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTagNamespace Gets the specified tag namespace's information. +func (client IdentityClient) GetTagNamespace(ctx context.Context, request GetTagNamespaceRequest) (response GetTagNamespaceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getTagNamespace, policy) if err != nil { + if ociResponse != nil { + response = GetTagNamespaceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetTagNamespaceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTagNamespaceResponse") + } + return +} + +// getTagNamespace implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getTagNamespace(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagNamespaces/{tagNamespaceId}") + if err != nil { + return nil, err + } + + var response GetTagNamespaceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTenancy Get the specified tenancy's information. +func (client IdentityClient) GetTenancy(ctx context.Context, request GetTenancyRequest) (response GetTenancyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getTenancy, policy) + if err != nil { + if ociResponse != nil { + response = GetTenancyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetTenancyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTenancyResponse") + } + return +} + +// getTenancy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getTenancy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tenancies/{tenancyId}") + if err != nil { + return nil, err + } + + var response GetTenancyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetUser Gets the specified user's information. +func (client IdentityClient) GetUser(ctx context.Context, request GetUserRequest) (response GetUserResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getUser, policy) + if err != nil { + if ociResponse != nil { + response = GetUserResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetUserResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetUserResponse") + } + return +} + +// getUser implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getUser(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}") + if err != nil { + return nil, err + } + + var response GetUserResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetUserGroupMembership Gets the specified UserGroupMembership's information. +func (client IdentityClient) GetUserGroupMembership(ctx context.Context, request GetUserGroupMembershipRequest) (response GetUserGroupMembershipResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getUserGroupMembership, policy) + if err != nil { + if ociResponse != nil { + response = GetUserGroupMembershipResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetUserGroupMembershipResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetUserGroupMembershipResponse") + } + return +} + +// getUserGroupMembership implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getUserGroupMembership(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/userGroupMemberships/{userGroupMembershipId}") + if err != nil { + return nil, err + } + + var response GetUserGroupMembershipResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets details on a specified work request. The workRequestID is returned in the opc-workrequest-id header +// for any asynchronous operation in the Identity and Access Management service. +func (client IdentityClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = GetWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) getWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListApiKeys Lists the API signing keys for the specified user. A user can have a maximum of three keys. +// Every user has permission to use this API call for *their own user ID*. An administrator in your +// organization does not need to write a policy to give users this ability. +func (client IdentityClient) ListApiKeys(ctx context.Context, request ListApiKeysRequest) (response ListApiKeysResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listApiKeys, policy) + if err != nil { + if ociResponse != nil { + response = ListApiKeysResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListApiKeysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListApiKeysResponse") + } + return +} + +// listApiKeys implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listApiKeys(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/apiKeys/") + if err != nil { + return nil, err + } + + var response ListApiKeysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAuthTokens Lists the auth tokens for the specified user. The returned object contains the token's OCID, but not +// the token itself. The actual token is returned only upon creation. +func (client IdentityClient) ListAuthTokens(ctx context.Context, request ListAuthTokensRequest) (response ListAuthTokensResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAuthTokens, policy) + if err != nil { + if ociResponse != nil { + response = ListAuthTokensResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAuthTokensResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAuthTokensResponse") + } + return +} + +// listAuthTokens implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listAuthTokens(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/authTokens/") + if err != nil { + return nil, err + } + + var response ListAuthTokensResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAvailabilityDomains Lists the availability domains in your tenancy. Specify the OCID of either the tenancy or another +// of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +// Note that the order of the results returned can change if availability domains are added or removed; therefore, do not +// create a dependency on the list order. +func (client IdentityClient) ListAvailabilityDomains(ctx context.Context, request ListAvailabilityDomainsRequest) (response ListAvailabilityDomainsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAvailabilityDomains, policy) + if err != nil { + if ociResponse != nil { + response = ListAvailabilityDomainsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAvailabilityDomainsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAvailabilityDomainsResponse") + } + return +} + +// listAvailabilityDomains implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listAvailabilityDomains(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/availabilityDomains/") + if err != nil { + return nil, err + } + + var response ListAvailabilityDomainsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCompartments Lists the compartments in a specified compartment. The members of the list +// returned depends on the values set for several parameters. +// With the exception of the tenancy (root compartment), the ListCompartments operation +// returns only the first-level child compartments in the parent compartment specified in +// `compartmentId`. The list does not include any subcompartments of the child +// compartments (grandchildren). +// The parameter `accessLevel` specifies whether to return only those compartments for which the +// requestor has INSPECT permissions on at least one resource directly +// or indirectly (the resource can be in a subcompartment). +// The parameter `compartmentIdInSubtree` applies only when you perform ListCompartments on the +// tenancy (root compartment). When set to true, the entire hierarchy of compartments can be returned. +// To get a full list of all compartments and subcompartments in the tenancy (root compartment), +// set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ANY. +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListCompartments(ctx context.Context, request ListCompartmentsRequest) (response ListCompartmentsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCompartments, policy) + if err != nil { + if ociResponse != nil { + response = ListCompartmentsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCompartmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCompartmentsResponse") + } + return +} + +// listCompartments implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listCompartments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/compartments/") + if err != nil { + return nil, err + } + + var response ListCompartmentsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCostTrackingTags Lists all the tags enabled for cost-tracking in the specified tenancy. For information about +// cost-tracking tags, see Using Cost-tracking Tags (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#costs). +func (client IdentityClient) ListCostTrackingTags(ctx context.Context, request ListCostTrackingTagsRequest) (response ListCostTrackingTagsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCostTrackingTags, policy) + if err != nil { + if ociResponse != nil { + response = ListCostTrackingTagsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCostTrackingTagsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCostTrackingTagsResponse") + } + return +} + +// listCostTrackingTags implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listCostTrackingTags(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagNamespaces/actions/listCostTrackingTags") + if err != nil { + return nil, err + } + + var response ListCostTrackingTagsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCustomerSecretKeys Lists the secret keys for the specified user. The returned object contains the secret key's OCID, but not +// the secret key itself. The actual secret key is returned only upon creation. +func (client IdentityClient) ListCustomerSecretKeys(ctx context.Context, request ListCustomerSecretKeysRequest) (response ListCustomerSecretKeysResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCustomerSecretKeys, policy) + if err != nil { + if ociResponse != nil { + response = ListCustomerSecretKeysResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCustomerSecretKeysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCustomerSecretKeysResponse") + } + return +} + +// listCustomerSecretKeys implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listCustomerSecretKeys(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/customerSecretKeys/") + if err != nil { + return nil, err + } + + var response ListCustomerSecretKeysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDynamicGroups Lists the dynamic groups in your tenancy. You must specify your tenancy's OCID as the value for +// the compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListDynamicGroups(ctx context.Context, request ListDynamicGroupsRequest) (response ListDynamicGroupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listDynamicGroups, policy) + if err != nil { + if ociResponse != nil { + response = ListDynamicGroupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListDynamicGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDynamicGroupsResponse") + } + return +} + +// listDynamicGroups implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listDynamicGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dynamicGroups/") + if err != nil { + return nil, err + } + + var response ListDynamicGroupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListFaultDomains Lists the Fault Domains in your tenancy. Specify the OCID of either the tenancy or another +// of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListFaultDomains(ctx context.Context, request ListFaultDomainsRequest) (response ListFaultDomainsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listFaultDomains, policy) + if err != nil { + if ociResponse != nil { + response = ListFaultDomainsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListFaultDomainsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListFaultDomainsResponse") + } + return +} + +// listFaultDomains implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listFaultDomains(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/faultDomains/") + if err != nil { + return nil, err + } + + var response ListFaultDomainsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListGroups Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for +// the compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listGroups, policy) + if err != nil { + if ociResponse != nil { + response = ListGroupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListGroupsResponse") + } + return +} + +// listGroups implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/groups/") + if err != nil { + return nil, err + } + + var response ListGroupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListIdentityProviderGroups Lists the identity provider groups. +func (client IdentityClient) ListIdentityProviderGroups(ctx context.Context, request ListIdentityProviderGroupsRequest) (response ListIdentityProviderGroupsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listIdentityProviderGroups, policy) + if err != nil { + if ociResponse != nil { + response = ListIdentityProviderGroupsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListIdentityProviderGroupsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListIdentityProviderGroupsResponse") + } + return +} + +// listIdentityProviderGroups implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listIdentityProviderGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/identityProviders/{identityProviderId}/groups/") + if err != nil { + return nil, err + } + + var response ListIdentityProviderGroupsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +//listidentityprovider allows to unmarshal list of polymorphic IdentityProvider +type listidentityprovider []identityprovider + +//UnmarshalPolymorphicJSON unmarshals polymorphic json list of items +func (m *listidentityprovider) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + res := make([]IdentityProvider, len(*m)) + for i, v := range *m { + nn, err := v.UnmarshalPolymorphicJSON(v.JsonData) + if err != nil { + return nil, err + } + res[i] = nn.(IdentityProvider) + } + return res, nil +} + +// ListIdentityProviders Lists all the identity providers in your tenancy. You must specify the identity provider type (e.g., `SAML2` for +// identity providers using the SAML2.0 protocol). You must specify your tenancy's OCID as the value for the +// compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListIdentityProviders(ctx context.Context, request ListIdentityProvidersRequest) (response ListIdentityProvidersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listIdentityProviders, policy) + if err != nil { + if ociResponse != nil { + response = ListIdentityProvidersResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListIdentityProvidersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListIdentityProvidersResponse") + } + return +} + +// listIdentityProviders implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listIdentityProviders(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/identityProviders/") + if err != nil { + return nil, err + } + + var response ListIdentityProvidersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listidentityprovider{}) + return response, err +} + +// ListIdpGroupMappings Lists the group mappings for the specified identity provider. +func (client IdentityClient) ListIdpGroupMappings(ctx context.Context, request ListIdpGroupMappingsRequest) (response ListIdpGroupMappingsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listIdpGroupMappings, policy) + if err != nil { + if ociResponse != nil { + response = ListIdpGroupMappingsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListIdpGroupMappingsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListIdpGroupMappingsResponse") + } + return +} + +// listIdpGroupMappings implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listIdpGroupMappings(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/identityProviders/{identityProviderId}/groupMappings/") + if err != nil { + return nil, err + } + + var response ListIdpGroupMappingsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMfaTotpDevices Lists the MFA TOTP devices for the specified user. The returned object contains the device's OCID, but not +// the seed. The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device. +func (client IdentityClient) ListMfaTotpDevices(ctx context.Context, request ListMfaTotpDevicesRequest) (response ListMfaTotpDevicesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listMfaTotpDevices, policy) + if err != nil { + if ociResponse != nil { + response = ListMfaTotpDevicesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListMfaTotpDevicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMfaTotpDevicesResponse") + } + return +} + +// listMfaTotpDevices implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listMfaTotpDevices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/mfaTotpDevices") + if err != nil { + return nil, err + } + + var response ListMfaTotpDevicesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPolicies Lists the policies in the specified compartment (either the tenancy or another of your compartments). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +// To determine which policies apply to a particular group or compartment, you must view the individual +// statements inside all your policies. There isn't a way to automatically obtain that information via the API. +func (client IdentityClient) ListPolicies(ctx context.Context, request ListPoliciesRequest) (response ListPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPolicies, policy) + if err != nil { + if ociResponse != nil { + response = ListPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPoliciesResponse") + } + return +} + +// listPolicies implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/policies/") + if err != nil { + return nil, err + } + + var response ListPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListRegionSubscriptions Lists the region subscriptions for the specified tenancy. +func (client IdentityClient) ListRegionSubscriptions(ctx context.Context, request ListRegionSubscriptionsRequest) (response ListRegionSubscriptionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listRegionSubscriptions, policy) + if err != nil { + if ociResponse != nil { + response = ListRegionSubscriptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListRegionSubscriptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRegionSubscriptionsResponse") + } + return +} + +// listRegionSubscriptions implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listRegionSubscriptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tenancies/{tenancyId}/regionSubscriptions") + if err != nil { + return nil, err + } + + var response ListRegionSubscriptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListRegions Lists all the regions offered by Oracle Cloud Infrastructure. +func (client IdentityClient) ListRegions(ctx context.Context) (response ListRegionsResponse, err error) { + var ociResponse common.OCIResponse + ociResponse, err = client.listRegions(ctx) + if err != nil { + if ociResponse != nil { + response = ListRegionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListRegionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRegionsResponse") + } + return +} + +// listRegions performs the request (retry policy is not enabled without a request object) +func (client IdentityClient) listRegions(ctx context.Context) (common.OCIResponse, error) { + httpRequest := common.MakeDefaultHTTPRequest(http.MethodGet, "/regions") + var err error + + var response ListRegionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSmtpCredentials Lists the SMTP credentials for the specified user. The returned object contains the credential's OCID, +// the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation. +func (client IdentityClient) ListSmtpCredentials(ctx context.Context, request ListSmtpCredentialsRequest) (response ListSmtpCredentialsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSmtpCredentials, policy) + if err != nil { + if ociResponse != nil { + response = ListSmtpCredentialsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSmtpCredentialsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSmtpCredentialsResponse") + } + return +} + +// listSmtpCredentials implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listSmtpCredentials(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/smtpCredentials/") + if err != nil { + return nil, err + } + + var response ListSmtpCredentialsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSwiftPasswords **Deprecated. Use ListAuthTokens instead.** +// Lists the Swift passwords for the specified user. The returned object contains the password's OCID, but not +// the password itself. The actual password is returned only upon creation. +func (client IdentityClient) ListSwiftPasswords(ctx context.Context, request ListSwiftPasswordsRequest) (response ListSwiftPasswordsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSwiftPasswords, policy) + if err != nil { + if ociResponse != nil { + response = ListSwiftPasswordsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSwiftPasswordsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSwiftPasswordsResponse") + } + return +} + +// listSwiftPasswords implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listSwiftPasswords(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/{userId}/swiftPasswords/") + if err != nil { + return nil, err + } + + var response ListSwiftPasswordsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTagDefaults Lists the tag defaults for tag definitions in the specified compartment. +func (client IdentityClient) ListTagDefaults(ctx context.Context, request ListTagDefaultsRequest) (response ListTagDefaultsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listTagDefaults, policy) + if err != nil { + if ociResponse != nil { + response = ListTagDefaultsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListTagDefaultsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTagDefaultsResponse") + } + return +} + +// listTagDefaults implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listTagDefaults(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagDefaults") + if err != nil { + return nil, err + } + + var response ListTagDefaultsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTagNamespaces Lists the tag namespaces in the specified compartment. +func (client IdentityClient) ListTagNamespaces(ctx context.Context, request ListTagNamespacesRequest) (response ListTagNamespacesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listTagNamespaces, policy) + if err != nil { + if ociResponse != nil { + response = ListTagNamespacesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListTagNamespacesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTagNamespacesResponse") + } + return +} + +// listTagNamespaces implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listTagNamespaces(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagNamespaces") + if err != nil { + return nil, err + } + + var response ListTagNamespacesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTags Lists the tag definitions in the specified tag namespace. +func (client IdentityClient) ListTags(ctx context.Context, request ListTagsRequest) (response ListTagsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listTags, policy) + if err != nil { + if ociResponse != nil { + response = ListTagsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListTagsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTagsResponse") + } + return +} + +// listTags implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listTags(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tagNamespaces/{tagNamespaceId}/tags") + if err != nil { + return nil, err + } + + var response ListTagsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListUserGroupMemberships Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID +// as the value for the compartment ID +// (see Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five)). +// You must also then filter the list in one of these ways: +// - You can limit the results to just the memberships for a given user by specifying a `userId`. +// - Similarly, you can limit the results to just the memberships for a given group by specifying a `groupId`. +// - You can set both the `userId` and `groupId` to determine if the specified user is in the specified group. +// If the answer is no, the response is an empty list. +// - Although`userId` and `groupId` are not indvidually required, you must set one of them. +func (client IdentityClient) ListUserGroupMemberships(ctx context.Context, request ListUserGroupMembershipsRequest) (response ListUserGroupMembershipsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listUserGroupMemberships, policy) + if err != nil { + if ociResponse != nil { + response = ListUserGroupMembershipsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListUserGroupMembershipsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListUserGroupMembershipsResponse") + } + return +} + +// listUserGroupMemberships implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listUserGroupMemberships(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/userGroupMemberships/") + if err != nil { + return nil, err + } + + var response ListUserGroupMembershipsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListUsers Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the +// compartment ID (remember that the tenancy is simply the root compartment). +// See Where to Get the Tenancy's OCID and User's OCID (https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five). +func (client IdentityClient) ListUsers(ctx context.Context, request ListUsersRequest) (response ListUsersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listUsers, policy) + if err != nil { + if ociResponse != nil { + response = ListUsersResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListUsersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListUsersResponse") + } + return +} + +// listUsers implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listUsers(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/users/") + if err != nil { + return nil, err + } + + var response ListUsersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in compartment. +func (client IdentityClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) listWorkRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListRegions Lists all the regions offered by Oracle Cloud Infrastructure. -func (client IdentityClient) ListRegions(ctx context.Context) (response ListRegionsResponse, err error) { - httpRequest := common.MakeDefaultHTTPRequest(http.MethodGet, "/regions") - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse +// RemoveUserFromGroup Removes a user from a group by deleting the corresponding `UserGroupMembership`. +func (client IdentityClient) RemoveUserFromGroup(ctx context.Context, request RemoveUserFromGroupRequest) (response RemoveUserFromGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.removeUserFromGroup, policy) if err != nil { + if ociResponse != nil { + response = RemoveUserFromGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(RemoveUserFromGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveUserFromGroupResponse") + } return } -// ListSmtpCredentials Lists the SMTP credentials for the specified user. The returned object contains the credential's OCID, -// the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation. -func (client IdentityClient) ListSmtpCredentials(ctx context.Context, request ListSmtpCredentialsRequest) (response ListSmtpCredentialsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/{userId}/smtpCredentials/", request) +// removeUserFromGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) removeUserFromGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/userGroupMemberships/{userGroupMembershipId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response RemoveUserFromGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListSwiftPasswords Lists the Swift passwords for the specified user. The returned object contains the password's OCID, but not -// the password itself. The actual password is returned only upon creation. -func (client IdentityClient) ListSwiftPasswords(ctx context.Context, request ListSwiftPasswordsRequest) (response ListSwiftPasswordsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/{userId}/swiftPasswords/", request) - if err != nil { - return +// ResetIdpScimClient Resets the OAuth2 client credentials for the SCIM client associated with this identity provider. +func (client IdentityClient) ResetIdpScimClient(ctx context.Context, request ResetIdpScimClientRequest) (response ResetIdpScimClientResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.resetIdpScimClient, policy) if err != nil { + if ociResponse != nil { + response = ResetIdpScimClientResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(ResetIdpScimClientResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResetIdpScimClientResponse") + } return } -// ListTagNamespaces Lists the tag namespaces in the specified compartment. -func (client IdentityClient) ListTagNamespaces(ctx context.Context, request ListTagNamespacesRequest) (response ListTagNamespacesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tagNamespaces", request) +// resetIdpScimClient implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) resetIdpScimClient(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/identityProviders/{identityProviderId}/actions/resetScimClient/") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ResetIdpScimClientResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListTags Lists the tag definitions in the specified tag namespace. -func (client IdentityClient) ListTags(ctx context.Context, request ListTagsRequest) (response ListTagsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/tagNamespaces/{tagNamespaceId}/tags", request) - if err != nil { - return +// UpdateAuthToken Updates the specified auth token's description. +func (client IdentityClient) UpdateAuthToken(ctx context.Context, request UpdateAuthTokenRequest) (response UpdateAuthTokenResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateAuthToken, policy) if err != nil { + if ociResponse != nil { + response = UpdateAuthTokenResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateAuthTokenResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAuthTokenResponse") + } return } -// ListUserGroupMemberships Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID -// as the value for the compartment ID -// (see Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five)). -// You must also then filter the list in one of these ways: -// - You can limit the results to just the memberships for a given user by specifying a `userId`. -// - Similarly, you can limit the results to just the memberships for a given group by specifying a `groupId`. -// - You can set both the `userId` and `groupId` to determine if the specified user is in the specified group. -// If the answer is no, the response is an empty list. -// - Although`userId` and `groupId` are not indvidually required, you must set one of them. -func (client IdentityClient) ListUserGroupMemberships(ctx context.Context, request ListUserGroupMembershipsRequest) (response ListUserGroupMembershipsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/userGroupMemberships/", request) +// updateAuthToken implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateAuthToken(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/authTokens/{authTokenId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateAuthTokenResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListUsers Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the -// compartment ID (remember that the tenancy is simply the root compartment). -// See Where to Get the Tenancy's OCID and User's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five). -func (client IdentityClient) ListUsers(ctx context.Context, request ListUsersRequest) (response ListUsersResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/users/", request) - if err != nil { - return +// UpdateAuthenticationPolicy Updates authentication policy for the specified tenancy +func (client IdentityClient) UpdateAuthenticationPolicy(ctx context.Context, request UpdateAuthenticationPolicyRequest) (response UpdateAuthenticationPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.updateAuthenticationPolicy, policy) if err != nil { + if ociResponse != nil { + response = UpdateAuthenticationPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(UpdateAuthenticationPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAuthenticationPolicyResponse") + } return } -// RemoveUserFromGroup Removes a user from a group by deleting the corresponding `UserGroupMembership`. -func (client IdentityClient) RemoveUserFromGroup(ctx context.Context, request RemoveUserFromGroupRequest) (response RemoveUserFromGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/userGroupMemberships/{userGroupMembershipId}", request) +// updateAuthenticationPolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateAuthenticationPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/authenticationPolicies/{compartmentId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateAuthenticationPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateCompartment Updates the specified compartment's description or name. You can't update the root compartment. func (client IdentityClient) UpdateCompartment(ctx context.Context, request UpdateCompartmentRequest) (response UpdateCompartmentResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/compartments/{compartmentId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCompartment, policy) if err != nil { + if ociResponse != nil { + response = UpdateCompartmentResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCompartmentResponse") + } + return +} + +// updateCompartment implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/compartments/{compartmentId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateCustomerSecretKey Updates the specified secret key's description. func (client IdentityClient) UpdateCustomerSecretKey(ctx context.Context, request UpdateCustomerSecretKeyRequest) (response UpdateCustomerSecretKeyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/users/{userId}/customerSecretKeys/{customerSecretKeyId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCustomerSecretKey, policy) if err != nil { + if ociResponse != nil { + response = UpdateCustomerSecretKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateCustomerSecretKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCustomerSecretKeyResponse") + } + return +} + +// updateCustomerSecretKey implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateCustomerSecretKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/customerSecretKeys/{customerSecretKeyId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateCustomerSecretKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateDynamicGroup Updates the specified dynamic group. func (client IdentityClient) UpdateDynamicGroup(ctx context.Context, request UpdateDynamicGroupRequest) (response UpdateDynamicGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/dynamicGroups/{dynamicGroupId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateDynamicGroup, policy) if err != nil { + if ociResponse != nil { + response = UpdateDynamicGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateDynamicGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDynamicGroupResponse") + } + return +} + +// updateDynamicGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateDynamicGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dynamicGroups/{dynamicGroupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateDynamicGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateGroup Updates the specified group. func (client IdentityClient) UpdateGroup(ctx context.Context, request UpdateGroupRequest) (response UpdateGroupResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/groups/{groupId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateGroup, policy) if err != nil { + if ociResponse != nil { + response = UpdateGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateGroupResponse") + } + return +} + +// updateGroup implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/groups/{groupId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateIdentityProvider Updates the specified identity provider. func (client IdentityClient) UpdateIdentityProvider(ctx context.Context, request UpdateIdentityProviderRequest) (response UpdateIdentityProviderResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/identityProviders/{identityProviderId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateIdentityProvider, policy) if err != nil { + if ociResponse != nil { + response = UpdateIdentityProviderResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateIdentityProviderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateIdentityProviderResponse") + } + return +} + +// updateIdentityProvider implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateIdentityProvider(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/identityProviders/{identityProviderId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateIdentityProviderResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &identityprovider{}) - return + return response, err } // UpdateIdpGroupMapping Updates the specified group mapping. func (client IdentityClient) UpdateIdpGroupMapping(ctx context.Context, request UpdateIdpGroupMappingRequest) (response UpdateIdpGroupMappingResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateIdpGroupMapping, policy) if err != nil { + if ociResponse != nil { + response = UpdateIdpGroupMappingResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateIdpGroupMappingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateIdpGroupMappingResponse") + } + return +} + +// updateIdpGroupMapping implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateIdpGroupMapping(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/identityProviders/{identityProviderId}/groupMappings/{mappingId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateIdpGroupMappingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdatePolicy Updates the specified policy. You can update the description or the policy statements themselves. // Policy changes take effect typically within 10 seconds. func (client IdentityClient) UpdatePolicy(ctx context.Context, request UpdatePolicyRequest) (response UpdatePolicyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/policies/{policyId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updatePolicy, policy) if err != nil { + if ociResponse != nil { + response = UpdatePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdatePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePolicyResponse") + } + return +} + +// updatePolicy implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updatePolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/policies/{policyId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdatePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateSmtpCredential Updates the specified SMTP credential's description. func (client IdentityClient) UpdateSmtpCredential(ctx context.Context, request UpdateSmtpCredentialRequest) (response UpdateSmtpCredentialResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/users/{userId}/smtpCredentials/{smtpCredentialId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSmtpCredential, policy) if err != nil { + if ociResponse != nil { + response = UpdateSmtpCredentialResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateSmtpCredentialResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSmtpCredentialResponse") + } + return +} + +// updateSmtpCredential implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateSmtpCredential(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/smtpCredentials/{smtpCredentialId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateSmtpCredentialResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateSwiftPassword Updates the specified Swift password's description. +// UpdateSwiftPassword **Deprecated. Use UpdateAuthToken instead.** +// Updates the specified Swift password's description. func (client IdentityClient) UpdateSwiftPassword(ctx context.Context, request UpdateSwiftPasswordRequest) (response UpdateSwiftPasswordResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/users/{userId}/swiftPasswords/{swiftPasswordId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSwiftPassword, policy) if err != nil { + if ociResponse != nil { + response = UpdateSwiftPasswordResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateSwiftPasswordResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSwiftPasswordResponse") + } + return +} + +// updateSwiftPassword implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateSwiftPassword(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/swiftPasswords/{swiftPasswordId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateSwiftPasswordResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateTag Updates the the specified tag definition. You can update `description`, and `isRetired`. func (client IdentityClient) UpdateTag(ctx context.Context, request UpdateTagRequest) (response UpdateTagResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/tagNamespaces/{tagNamespaceId}/tags/{tagName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateTag, policy) if err != nil { + if ociResponse != nil { + response = UpdateTagResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateTagResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTagResponse") + } + return +} + +// updateTag implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateTag(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/tagNamespaces/{tagNamespaceId}/tags/{tagName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateTagResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateTagDefault Updates the the specified tag default. You can update the following field: `value`. +func (client IdentityClient) UpdateTagDefault(ctx context.Context, request UpdateTagDefaultRequest) (response UpdateTagDefaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateTagDefault, policy) + if err != nil { + if ociResponse != nil { + response = UpdateTagDefaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTagDefaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTagDefaultResponse") + } return } +// updateTagDefault implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateTagDefault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/tagDefaults/{tagDefaultId}") + if err != nil { + return nil, err + } + + var response UpdateTagDefaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateTagNamespace Updates the the specified tag namespace. You can't update the namespace name. // Updating `isRetired` to 'true' retires the namespace and all the tag definitions in the namespace. Reactivating a // namespace (changing `isRetired` from 'true' to 'false') does not reactivate tag definitions. // To reactivate the tag definitions, you must reactivate each one indvidually *after* you reactivate the namespace, // using UpdateTag. For more information about retiring tag namespaces, see -// Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). +// Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). // You can't add a namespace with the same name as a retired namespace in the same tenancy. func (client IdentityClient) UpdateTagNamespace(ctx context.Context, request UpdateTagNamespaceRequest) (response UpdateTagNamespaceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/tagNamespaces/{tagNamespaceId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateTagNamespace, policy) if err != nil { + if ociResponse != nil { + response = UpdateTagNamespaceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateTagNamespaceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTagNamespaceResponse") + } + return +} + +// updateTagNamespace implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateTagNamespace(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/tagNamespaces/{tagNamespaceId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateTagNamespaceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateUser Updates the description of the specified user. func (client IdentityClient) UpdateUser(ctx context.Context, request UpdateUserRequest) (response UpdateUserResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/users/{userId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateUser, policy) if err != nil { + if ociResponse != nil { + response = UpdateUserResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateUserResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateUserResponse") + } + return +} + +// updateUser implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateUser(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateUserResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateUserCapabilities Updates the capabilities of the specified user. +func (client IdentityClient) UpdateUserCapabilities(ctx context.Context, request UpdateUserCapabilitiesRequest) (response UpdateUserCapabilitiesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateUserCapabilities, policy) + if err != nil { + if ociResponse != nil { + response = UpdateUserCapabilitiesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateUserCapabilitiesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateUserCapabilitiesResponse") + } return } +// updateUserCapabilities implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateUserCapabilities(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/capabilities/") + if err != nil { + return nil, err + } + + var response UpdateUserCapabilitiesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateUserState Updates the state of the specified user. func (client IdentityClient) UpdateUserState(ctx context.Context, request UpdateUserStateRequest) (response UpdateUserStateResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/users/{userId}/state/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateUserState, policy) if err != nil { + if ociResponse != nil { + response = UpdateUserStateResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateUserStateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateUserStateResponse") + } + return +} + +// updateUserState implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) updateUserState(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/users/{userId}/state/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateUserStateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UploadApiKey Uploads an API signing key for the specified user. @@ -1482,18 +4313,47 @@ // After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using // the object, first make sure its `lifecycleState` has changed to ACTIVE. func (client IdentityClient) UploadApiKey(ctx context.Context, request UploadApiKeyRequest) (response UploadApiKeyResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/users/{userId}/apiKeys/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.uploadApiKey, policy) if err != nil { + if ociResponse != nil { + response = UploadApiKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UploadApiKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadApiKeyResponse") + } + return +} + +// uploadApiKey implements the OCIOperation interface (enables retrying operations) +func (client IdentityClient) uploadApiKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/users/{userId}/apiKeys/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UploadApiKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -17,10 +17,10 @@ // Saml2IdentityProvider // is a specific type of `IdentityProvider` that supports the SAML 2.0 protocol. Each // `IdentityProvider` object has its own OCID. For more information, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type IdentityProvider interface { // The OCID of the `IdentityProvider`. @@ -58,15 +58,15 @@ GetLifecycleState() IdentityProviderLifecycleStateEnum // The detailed status of INACTIVE lifecycleState. - GetInactiveStatus() *int + GetInactiveStatus() *int64 // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} } @@ -80,7 +80,7 @@ ProductType *string `mandatory:"true" json:"productType"` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` LifecycleState IdentityProviderLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` Protocol string `json:"protocol"` @@ -114,6 +114,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *identityprovider) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Protocol { case "SAML2": @@ -121,7 +126,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } @@ -161,7 +166,7 @@ } //GetInactiveStatus returns InactiveStatus -func (m identityprovider) GetInactiveStatus() *int { +func (m identityprovider) GetInactiveStatus() *int64 { return m.InactiveStatus } @@ -182,7 +187,7 @@ // IdentityProviderLifecycleStateEnum Enum with underlying type: string type IdentityProviderLifecycleStateEnum string -// Set of constants representing the allowable values for IdentityProviderLifecycleState +// Set of constants representing the allowable values for IdentityProviderLifecycleStateEnum const ( IdentityProviderLifecycleStateCreating IdentityProviderLifecycleStateEnum = "CREATING" IdentityProviderLifecycleStateActive IdentityProviderLifecycleStateEnum = "ACTIVE" @@ -199,7 +204,7 @@ "DELETED": IdentityProviderLifecycleStateDeleted, } -// GetIdentityProviderLifecycleStateEnumValues Enumerates the set of values for IdentityProviderLifecycleState +// GetIdentityProviderLifecycleStateEnumValues Enumerates the set of values for IdentityProviderLifecycleStateEnum func GetIdentityProviderLifecycleStateEnumValues() []IdentityProviderLifecycleStateEnum { values := make([]IdentityProviderLifecycleStateEnum, 0) for _, v := range mappingIdentityProviderLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider_group_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider_group_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider_group_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/identity_provider_group_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// IdentityProviderGroupSummary A group created in an identity provider that can be mapped to a group in OCI +type IdentityProviderGroupSummary struct { + + // The OCID of the `IdentityProviderGroup`. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the `IdentityProvider` this group belongs to. + IdentityProviderId *string `mandatory:"false" json:"identityProviderId"` + + // Display name of the group + DisplayName *string `mandatory:"false" json:"displayName"` + + // Identifier of the group in the identity provider + ExternalIdentifier *string `mandatory:"false" json:"externalIdentifier"` + + // Date and time the `IdentityProviderGroup` was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Date and time the `IdentityProviderGroup` was last modified, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` +} + +func (m IdentityProviderGroupSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/idp_group_mapping.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/idp_group_mapping.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/idp_group_mapping.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/idp_group_mapping.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -15,7 +15,7 @@ // IdpGroupMapping A mapping between a single group defined by the identity provider (IdP) you're federating with // and a single IAM Service Group in Oracle Cloud Infrastructure. // For more information about group mappings and what they're for, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). // A given IdP group can be mapped to zero, one, or multiple IAM Service groups, and vice versa. // But each `IdPGroupMapping` object is between only a single IdP group and IAM Service group. // Each `IdPGroupMapping` object has its own OCID. @@ -47,7 +47,7 @@ LifecycleState IdpGroupMappingLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m IdpGroupMapping) String() string { @@ -57,7 +57,7 @@ // IdpGroupMappingLifecycleStateEnum Enum with underlying type: string type IdpGroupMappingLifecycleStateEnum string -// Set of constants representing the allowable values for IdpGroupMappingLifecycleState +// Set of constants representing the allowable values for IdpGroupMappingLifecycleStateEnum const ( IdpGroupMappingLifecycleStateCreating IdpGroupMappingLifecycleStateEnum = "CREATING" IdpGroupMappingLifecycleStateActive IdpGroupMappingLifecycleStateEnum = "ACTIVE" @@ -74,7 +74,7 @@ "DELETED": IdpGroupMappingLifecycleStateDeleted, } -// GetIdpGroupMappingLifecycleStateEnumValues Enumerates the set of values for IdpGroupMappingLifecycleState +// GetIdpGroupMappingLifecycleStateEnumValues Enumerates the set of values for IdpGroupMappingLifecycleStateEnum func GetIdpGroupMappingLifecycleStateEnumValues() []IdpGroupMappingLifecycleStateEnum { values := make([]IdpGroupMappingLifecycleStateEnum, 0) for _, v := range mappingIdpGroupMappingLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_api_keys_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_api_keys_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_api_keys_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_api_keys_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the user. UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListApiKeysRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListApiKeysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListApiKeysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListApiKeysResponse wrapper for the ListApiKeys operation type ListApiKeysResponse struct { @@ -41,3 +59,8 @@ func (response ListApiKeysResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListApiKeysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_auth_tokens_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_auth_tokens_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_auth_tokens_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_auth_tokens_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAuthTokensRequest wrapper for the ListAuthTokens operation +type ListAuthTokensRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAuthTokensRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAuthTokensRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAuthTokensRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAuthTokensResponse wrapper for the ListAuthTokens operation +type ListAuthTokensResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []AuthToken instance + Items []AuthToken `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAuthTokensResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAuthTokensResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_availability_domains_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_availability_domains_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_availability_domains_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_availability_domains_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the compartment (remember that the tenancy is simply the root compartment). CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListAvailabilityDomainsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListAvailabilityDomainsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAvailabilityDomainsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListAvailabilityDomainsResponse wrapper for the ListAvailabilityDomains operation type ListAvailabilityDomainsResponse struct { @@ -41,3 +59,8 @@ func (response ListAvailabilityDomainsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListAvailabilityDomainsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_compartments_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_compartments_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_compartments_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_compartments_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,52 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Valid values are `ANY` and `ACCESSIBLE`. Default is `ANY`. + // Setting this to `ACCESSIBLE` returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). For the compartments on which the user indirectly has + // INSPECT permissions, a restricted set of fields is returned. + // When set to `ANY` permissions are not checked. + AccessLevel ListCompartmentsAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // Default is false. Can only be set to true when performing + // ListCompartments on the tenancy (root compartment). + // When set to true, the hierarchy of compartments is traversed + // and all compartments and subcompartments in the tenancy are + // returned depending on the the setting of `accessLevel`. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCompartmentsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCompartmentsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCompartmentsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCompartmentsResponse wrapper for the ListCompartments operation type ListCompartmentsResponse struct { // The underlying http response RawResponse *http.Response - // The []Compartment instance + // A list of []Compartment instances Items []Compartment `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +80,31 @@ func (response ListCompartmentsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCompartmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCompartmentsAccessLevelEnum Enum with underlying type: string +type ListCompartmentsAccessLevelEnum string + +// Set of constants representing the allowable values for ListCompartmentsAccessLevelEnum +const ( + ListCompartmentsAccessLevelAny ListCompartmentsAccessLevelEnum = "ANY" + ListCompartmentsAccessLevelAccessible ListCompartmentsAccessLevelEnum = "ACCESSIBLE" +) + +var mappingListCompartmentsAccessLevel = map[string]ListCompartmentsAccessLevelEnum{ + "ANY": ListCompartmentsAccessLevelAny, + "ACCESSIBLE": ListCompartmentsAccessLevelAccessible, +} + +// GetListCompartmentsAccessLevelEnumValues Enumerates the set of values for ListCompartmentsAccessLevelEnum +func GetListCompartmentsAccessLevelEnumValues() []ListCompartmentsAccessLevelEnum { + values := make([]ListCompartmentsAccessLevelEnum, 0) + for _, v := range mappingListCompartmentsAccessLevel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_cost_tracking_tags_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_cost_tracking_tags_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_cost_tracking_tags_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_cost_tracking_tags_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListCostTrackingTagsRequest wrapper for the ListCostTrackingTags operation +type ListCostTrackingTagsRequest struct { + + // The OCID of the compartment (remember that the tenancy is simply the root compartment). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCostTrackingTagsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCostTrackingTagsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCostTrackingTagsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListCostTrackingTagsResponse wrapper for the ListCostTrackingTags operation +type ListCostTrackingTagsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Tag instances + Items []Tag `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListCostTrackingTagsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCostTrackingTagsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_customer_secret_keys_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_customer_secret_keys_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_customer_secret_keys_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_customer_secret_keys_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the user. UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCustomerSecretKeysRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCustomerSecretKeysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCustomerSecretKeysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCustomerSecretKeysResponse wrapper for the ListCustomerSecretKeys operation type ListCustomerSecretKeysResponse struct { @@ -41,3 +59,8 @@ func (response ListCustomerSecretKeysResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCustomerSecretKeysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_dynamic_groups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_dynamic_groups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_dynamic_groups_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_dynamic_groups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListDynamicGroupsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListDynamicGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDynamicGroupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListDynamicGroupsResponse wrapper for the ListDynamicGroups operation type ListDynamicGroupsResponse struct { // The underlying http response RawResponse *http.Response - // The []DynamicGroup instance + // A list of []DynamicGroup instances Items []DynamicGroup `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +65,8 @@ func (response ListDynamicGroupsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListDynamicGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_fault_domains_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_fault_domains_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_fault_domains_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_fault_domains_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListFaultDomainsRequest wrapper for the ListFaultDomains operation +type ListFaultDomainsRequest struct { + + // The OCID of the compartment (remember that the tenancy is simply the root compartment). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The name of the availibilityDomain. + AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListFaultDomainsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListFaultDomainsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListFaultDomainsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListFaultDomainsResponse wrapper for the ListFaultDomains operation +type ListFaultDomainsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []FaultDomain instance + Items []FaultDomain `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListFaultDomainsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListFaultDomainsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_groups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_groups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_groups_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_groups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListGroupsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListGroupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListGroupsResponse wrapper for the ListGroups operation type ListGroupsResponse struct { // The underlying http response RawResponse *http.Response - // The []Group instance + // A list of []Group instances Items []Group `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +65,8 @@ func (response ListGroupsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_provider_groups_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_provider_groups_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_provider_groups_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_provider_groups_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListIdentityProviderGroupsRequest wrapper for the ListIdentityProviderGroups operation +type ListIdentityProviderGroupsRequest struct { + + // The OCID of the identity provider. + IdentityProviderId *string `mandatory:"true" contributesTo:"path" name:"identityProviderId"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListIdentityProviderGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListIdentityProviderGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListIdentityProviderGroupsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListIdentityProviderGroupsResponse wrapper for the ListIdentityProviderGroups operation +type ListIdentityProviderGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []IdentityProviderGroupSummary instances + Items []IdentityProviderGroupSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListIdentityProviderGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListIdentityProviderGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_providers_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_providers_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_providers_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_identity_providers_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -22,19 +22,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListIdentityProvidersRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListIdentityProvidersRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListIdentityProvidersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListIdentityProvidersResponse wrapper for the ListIdentityProviders operation type ListIdentityProvidersResponse struct { // The underlying http response RawResponse *http.Response - // The []IdentityProvider instance + // A list of []IdentityProvider instances Items []IdentityProvider `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -51,10 +69,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListIdentityProvidersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListIdentityProvidersProtocolEnum Enum with underlying type: string type ListIdentityProvidersProtocolEnum string -// Set of constants representing the allowable values for ListIdentityProvidersProtocol +// Set of constants representing the allowable values for ListIdentityProvidersProtocolEnum const ( ListIdentityProvidersProtocolSaml2 ListIdentityProvidersProtocolEnum = "SAML2" ) @@ -63,7 +86,7 @@ "SAML2": ListIdentityProvidersProtocolSaml2, } -// GetListIdentityProvidersProtocolEnumValues Enumerates the set of values for ListIdentityProvidersProtocol +// GetListIdentityProvidersProtocolEnumValues Enumerates the set of values for ListIdentityProvidersProtocolEnum func GetListIdentityProvidersProtocolEnumValues() []ListIdentityProvidersProtocolEnum { values := make([]ListIdentityProvidersProtocolEnum, 0) for _, v := range mappingListIdentityProvidersProtocol { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_idp_group_mappings_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_idp_group_mappings_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_idp_group_mappings_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_idp_group_mappings_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListIdpGroupMappingsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListIdpGroupMappingsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListIdpGroupMappingsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListIdpGroupMappingsResponse wrapper for the ListIdpGroupMappings operation type ListIdpGroupMappingsResponse struct { // The underlying http response RawResponse *http.Response - // The []IdpGroupMapping instance + // A list of []IdpGroupMapping instances Items []IdpGroupMapping `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +65,8 @@ func (response ListIdpGroupMappingsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListIdpGroupMappingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_mfa_totp_devices_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_mfa_totp_devices_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_mfa_totp_devices_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_mfa_totp_devices_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListMfaTotpDevicesRequest wrapper for the ListMfaTotpDevices operation +type ListMfaTotpDevicesRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for NAME is ascending. The NAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by Availability Domain if the scope of the resource type is within a + // single Availability Domain. If you call one of these "List" operations without specifying + // an Availability Domain, the resources are grouped by Availability Domain, then sorted. + SortBy ListMfaTotpDevicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The NAME sort order + // is case sensitive. + SortOrder ListMfaTotpDevicesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListMfaTotpDevicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMfaTotpDevicesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMfaTotpDevicesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListMfaTotpDevicesResponse wrapper for the ListMfaTotpDevices operation +type ListMfaTotpDevicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []MfaTotpDeviceSummary instances + Items []MfaTotpDeviceSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListMfaTotpDevicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMfaTotpDevicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMfaTotpDevicesSortByEnum Enum with underlying type: string +type ListMfaTotpDevicesSortByEnum string + +// Set of constants representing the allowable values for ListMfaTotpDevicesSortByEnum +const ( + ListMfaTotpDevicesSortByTimecreated ListMfaTotpDevicesSortByEnum = "TIMECREATED" + ListMfaTotpDevicesSortByName ListMfaTotpDevicesSortByEnum = "NAME" +) + +var mappingListMfaTotpDevicesSortBy = map[string]ListMfaTotpDevicesSortByEnum{ + "TIMECREATED": ListMfaTotpDevicesSortByTimecreated, + "NAME": ListMfaTotpDevicesSortByName, +} + +// GetListMfaTotpDevicesSortByEnumValues Enumerates the set of values for ListMfaTotpDevicesSortByEnum +func GetListMfaTotpDevicesSortByEnumValues() []ListMfaTotpDevicesSortByEnum { + values := make([]ListMfaTotpDevicesSortByEnum, 0) + for _, v := range mappingListMfaTotpDevicesSortBy { + values = append(values, v) + } + return values +} + +// ListMfaTotpDevicesSortOrderEnum Enum with underlying type: string +type ListMfaTotpDevicesSortOrderEnum string + +// Set of constants representing the allowable values for ListMfaTotpDevicesSortOrderEnum +const ( + ListMfaTotpDevicesSortOrderAsc ListMfaTotpDevicesSortOrderEnum = "ASC" + ListMfaTotpDevicesSortOrderDesc ListMfaTotpDevicesSortOrderEnum = "DESC" +) + +var mappingListMfaTotpDevicesSortOrder = map[string]ListMfaTotpDevicesSortOrderEnum{ + "ASC": ListMfaTotpDevicesSortOrderAsc, + "DESC": ListMfaTotpDevicesSortOrderDesc, +} + +// GetListMfaTotpDevicesSortOrderEnumValues Enumerates the set of values for ListMfaTotpDevicesSortOrderEnum +func GetListMfaTotpDevicesSortOrderEnumValues() []ListMfaTotpDevicesSortOrderEnum { + values := make([]ListMfaTotpDevicesSortOrderEnum, 0) + for _, v := range mappingListMfaTotpDevicesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_policies_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPoliciesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPoliciesResponse wrapper for the ListPolicies operation type ListPoliciesResponse struct { // The underlying http response RawResponse *http.Response - // The []Policy instance + // A list of []Policy instances Items []Policy `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +65,8 @@ func (response ListPoliciesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_regions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_regions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_regions_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_regions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -10,12 +10,30 @@ // ListRegionsRequest wrapper for the ListRegions operation type ListRegionsRequest struct { + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListRegionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListRegionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRegionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListRegionsResponse wrapper for the ListRegions operation type ListRegionsResponse struct { @@ -33,3 +51,8 @@ func (response ListRegionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListRegionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_region_subscriptions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_region_subscriptions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_region_subscriptions_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_region_subscriptions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the tenancy. TenancyId *string `mandatory:"true" contributesTo:"path" name:"tenancyId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListRegionSubscriptionsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListRegionSubscriptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRegionSubscriptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListRegionSubscriptionsResponse wrapper for the ListRegionSubscriptions operation type ListRegionSubscriptionsResponse struct { @@ -36,3 +54,8 @@ func (response ListRegionSubscriptionsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListRegionSubscriptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_smtp_credentials_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_smtp_credentials_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_smtp_credentials_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_smtp_credentials_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the user. UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSmtpCredentialsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSmtpCredentialsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSmtpCredentialsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSmtpCredentialsResponse wrapper for the ListSmtpCredentials operation type ListSmtpCredentialsResponse struct { @@ -41,3 +59,8 @@ func (response ListSmtpCredentialsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListSmtpCredentialsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_swift_passwords_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_swift_passwords_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_swift_passwords_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_swift_passwords_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -13,12 +13,30 @@ // The OCID of the user. UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListSwiftPasswordsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListSwiftPasswordsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSwiftPasswordsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListSwiftPasswordsResponse wrapper for the ListSwiftPasswords operation type ListSwiftPasswordsResponse struct { @@ -41,3 +59,8 @@ func (response ListSwiftPasswordsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListSwiftPasswordsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_defaults_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_defaults_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_defaults_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_defaults_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListTagDefaultsRequest wrapper for the ListTagDefaults operation +type ListTagDefaultsRequest struct { + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A filter to only return resources that match the specified OCID exactly. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The OCID of the compartment (remember that the tenancy is simply the root compartment). + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID of the tag definition. + TagDefinitionId *string `mandatory:"false" contributesTo:"query" name:"tagDefinitionId"` + + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState TagDefaultSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListTagDefaultsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListTagDefaultsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTagDefaultsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListTagDefaultsResponse wrapper for the ListTagDefaults operation +type ListTagDefaultsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []TagDefaultSummary instances + Items []TagDefaultSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of tag default values. When paging through a list, if this header appears in + // the response, then a partial list might have been returned. Include this value as the `page` parameter + // for the subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListTagDefaultsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListTagDefaultsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_namespaces_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_namespaces_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_namespaces_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tag_namespaces_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,19 +23,37 @@ // An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this // parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved. IncludeSubcompartments *bool `mandatory:"false" contributesTo:"query" name:"includeSubcompartments"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListTagNamespacesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListTagNamespacesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTagNamespacesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListTagNamespacesResponse wrapper for the ListTagNamespaces operation type ListTagNamespacesResponse struct { // The underlying http response RawResponse *http.Response - // The []TagNamespaceSummary instance + // A list of []TagNamespaceSummary instances Items []TagNamespaceSummary `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -51,3 +69,8 @@ func (response ListTagNamespacesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListTagNamespacesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tags_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tags_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tags_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_tags_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListTagsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListTagsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTagsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListTagsResponse wrapper for the ListTags operation type ListTagsResponse struct { // The underlying http response RawResponse *http.Response - // The []TagSummary instance + // A list of []TagSummary instances Items []TagSummary `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +65,8 @@ func (response ListTagsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListTagsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_user_group_memberships_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_user_group_memberships_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_user_group_memberships_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_user_group_memberships_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -25,19 +25,37 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListUserGroupMembershipsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListUserGroupMembershipsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListUserGroupMembershipsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListUserGroupMembershipsResponse wrapper for the ListUserGroupMemberships operation type ListUserGroupMembershipsResponse struct { // The underlying http response RawResponse *http.Response - // The []UserGroupMembership instance + // A list of []UserGroupMembership instances Items []UserGroupMembership `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -53,3 +71,8 @@ func (response ListUserGroupMembershipsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListUserGroupMembershipsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_users_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_users_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_users_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_users_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,19 +19,43 @@ // The maximum number of items to return in a paginated "List" call. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The id of the identity provider. + IdentityProviderId *string `mandatory:"false" contributesTo:"query" name:"identityProviderId"` + + // The id of a user in the identity provider. + ExternalIdentifier *string `mandatory:"false" contributesTo:"query" name:"externalIdentifier"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListUsersRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListUsersRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListUsersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListUsersResponse wrapper for the ListUsers operation type ListUsersResponse struct { // The underlying http response RawResponse *http.Response - // The []User instance + // A list of []User instances Items []User `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -47,3 +71,8 @@ func (response ListUsersResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListUsersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_work_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_work_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_work_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/list_work_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +type ListWorkRequestsRequest struct { + + // The OCID of the compartment (remember that the tenancy is simply the root compartment). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The identifier of the resource the work request affects. + ResourceIdentifier *string `mandatory:"false" contributesTo:"query" name:"resourceIdentifier"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestSummary instances + Items []WorkRequestSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MfaTotpDevice Users can enable multi-factor authentication (MFA) for their own user accounts. After MFA is enabled, the +// user is prompted for a time-based one-time password (TOTP) to authenticate before they can sign in to the +// Console. To enable multi-factor authentication, the user must register a mobile device with a TOTP authenticator app +// installed. The registration process creates the `MfaTotpDevice` object. The registration process requires +// interaction with the Console and cannot be completed programmatically. For more information, see +// Managing Multi-Factor Authentication (https://docs.cloud.oracle.com/Content/Identity/Tasks/usingmfa.htm). +type MfaTotpDevice struct { + + // The OCID of the MFA TOTP device. + Id *string `mandatory:"true" json:"id"` + + // The seed for the MFA TOTP device (Base32 encoded). + Seed *string `mandatory:"true" json:"seed"` + + // The OCID of the user the MFA TOTP device belongs to. + UserId *string `mandatory:"true" json:"userId"` + + // Date and time the `MfaTotpDevice` object was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The MFA TOTP device's current state. After creating the MFA TOTP device, make sure its `lifecycleState` changes from + // CREATING to ACTIVE before using it. + LifecycleState MfaTotpDeviceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Flag to indicate if the MFA TOTP device has been activated. + IsActivated *bool `mandatory:"true" json:"isActivated"` + + // Date and time when this MFA TOTP device will expire, in the format defined by RFC3339. + // Null if it never expires. + // Example: `2016-08-25T21:10:29.600Z` + TimeExpires *common.SDKTime `mandatory:"false" json:"timeExpires"` + + // The detailed status of INACTIVE lifecycleState. + // Allowed values are: + // - 1 - SUSPENDED + // - 2 - DISABLED + // - 4 - BLOCKED + // - 8 - LOCKED + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` +} + +func (m MfaTotpDevice) String() string { + return common.PointerString(m) +} + +// MfaTotpDeviceLifecycleStateEnum Enum with underlying type: string +type MfaTotpDeviceLifecycleStateEnum string + +// Set of constants representing the allowable values for MfaTotpDeviceLifecycleStateEnum +const ( + MfaTotpDeviceLifecycleStateCreating MfaTotpDeviceLifecycleStateEnum = "CREATING" + MfaTotpDeviceLifecycleStateActive MfaTotpDeviceLifecycleStateEnum = "ACTIVE" + MfaTotpDeviceLifecycleStateInactive MfaTotpDeviceLifecycleStateEnum = "INACTIVE" + MfaTotpDeviceLifecycleStateDeleting MfaTotpDeviceLifecycleStateEnum = "DELETING" + MfaTotpDeviceLifecycleStateDeleted MfaTotpDeviceLifecycleStateEnum = "DELETED" +) + +var mappingMfaTotpDeviceLifecycleState = map[string]MfaTotpDeviceLifecycleStateEnum{ + "CREATING": MfaTotpDeviceLifecycleStateCreating, + "ACTIVE": MfaTotpDeviceLifecycleStateActive, + "INACTIVE": MfaTotpDeviceLifecycleStateInactive, + "DELETING": MfaTotpDeviceLifecycleStateDeleting, + "DELETED": MfaTotpDeviceLifecycleStateDeleted, +} + +// GetMfaTotpDeviceLifecycleStateEnumValues Enumerates the set of values for MfaTotpDeviceLifecycleStateEnum +func GetMfaTotpDeviceLifecycleStateEnumValues() []MfaTotpDeviceLifecycleStateEnum { + values := make([]MfaTotpDeviceLifecycleStateEnum, 0) + for _, v := range mappingMfaTotpDeviceLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_device_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MfaTotpDeviceSummary As the name suggests, a `MfaTotpDeviceSummary` object contains information about a `MfaTotpDevice`. +type MfaTotpDeviceSummary struct { + + // The OCID of the MFA TOTP Device. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the user the MFA TOTP device belongs to. + UserId *string `mandatory:"true" json:"userId"` + + // Date and time the `MfaTotpDevice` object was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The MFA TOTP device's current state. + LifecycleState MfaTotpDeviceSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Flag to indicate if the MFA TOTP device has been activated + IsActivated *bool `mandatory:"true" json:"isActivated"` + + // Date and time when this MFA TOTP device will expire, in the format defined by RFC3339. + // Null if it never expires. + // Example: `2016-08-25T21:10:29.600Z` + TimeExpires *common.SDKTime `mandatory:"false" json:"timeExpires"` + + // The detailed status of INACTIVE lifecycleState. + // Allowed values are: + // - 1 - SUSPENDED + // - 2 - DISABLED + // - 4 - BLOCKED + // - 8 - LOCKED + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` +} + +func (m MfaTotpDeviceSummary) String() string { + return common.PointerString(m) +} + +// MfaTotpDeviceSummaryLifecycleStateEnum Enum with underlying type: string +type MfaTotpDeviceSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for MfaTotpDeviceSummaryLifecycleStateEnum +const ( + MfaTotpDeviceSummaryLifecycleStateCreating MfaTotpDeviceSummaryLifecycleStateEnum = "CREATING" + MfaTotpDeviceSummaryLifecycleStateActive MfaTotpDeviceSummaryLifecycleStateEnum = "ACTIVE" + MfaTotpDeviceSummaryLifecycleStateInactive MfaTotpDeviceSummaryLifecycleStateEnum = "INACTIVE" + MfaTotpDeviceSummaryLifecycleStateDeleting MfaTotpDeviceSummaryLifecycleStateEnum = "DELETING" + MfaTotpDeviceSummaryLifecycleStateDeleted MfaTotpDeviceSummaryLifecycleStateEnum = "DELETED" +) + +var mappingMfaTotpDeviceSummaryLifecycleState = map[string]MfaTotpDeviceSummaryLifecycleStateEnum{ + "CREATING": MfaTotpDeviceSummaryLifecycleStateCreating, + "ACTIVE": MfaTotpDeviceSummaryLifecycleStateActive, + "INACTIVE": MfaTotpDeviceSummaryLifecycleStateInactive, + "DELETING": MfaTotpDeviceSummaryLifecycleStateDeleting, + "DELETED": MfaTotpDeviceSummaryLifecycleStateDeleted, +} + +// GetMfaTotpDeviceSummaryLifecycleStateEnumValues Enumerates the set of values for MfaTotpDeviceSummaryLifecycleStateEnum +func GetMfaTotpDeviceSummaryLifecycleStateEnumValues() []MfaTotpDeviceSummaryLifecycleStateEnum { + values := make([]MfaTotpDeviceSummaryLifecycleStateEnum, 0) + for _, v := range mappingMfaTotpDeviceSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_token.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_token.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_token.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/mfa_totp_token.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MfaTotpToken Totp token for MFA +type MfaTotpToken struct { + + // The Totp token for MFA. + TotpToken *string `mandatory:"false" json:"totpToken"` +} + +func (m MfaTotpToken) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/password_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/password_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/password_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/password_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PasswordPolicy Password policy, currently set for the given compartment. +type PasswordPolicy struct { + + // Minimum password length required. + MinimumPasswordLength *int `mandatory:"false" json:"minimumPasswordLength"` + + // At least one uppercase character required. + IsUppercaseCharactersRequired *bool `mandatory:"false" json:"isUppercaseCharactersRequired"` + + // At least one lower case character required. + IsLowercaseCharactersRequired *bool `mandatory:"false" json:"isLowercaseCharactersRequired"` + + // At least one numeric character required. + IsNumericCharactersRequired *bool `mandatory:"false" json:"isNumericCharactersRequired"` + + // At least one special character required. + IsSpecialCharactersRequired *bool `mandatory:"false" json:"isSpecialCharactersRequired"` + + // User name is allowed to be part of the password. + IsUsernameContainmentAllowed *bool `mandatory:"false" json:"isUsernameContainmentAllowed"` +} + +func (m PasswordPolicy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/policy.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,8 +14,8 @@ // Policy A document that specifies the type of access a group has to the resources in a compartment. For information about // policies and other IAM Service components, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). If you're new to policies, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). If you're new to policies, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // The word "policy" is used by people in different ways: // * An individual statement written in the policy language // * A collection of statements in a single, named "policy" document (which has an Oracle Cloud ID (OCID) assigned to it) @@ -49,20 +49,20 @@ LifecycleState PolicyLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` // The version of the policy. If null or set to an empty string, when a request comes in for authorization, the // policy will be evaluated according to the current behavior of the services at that moment. If set to a particular // date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date. - VersionDate *common.SDKTime `mandatory:"false" json:"versionDate"` + VersionDate *common.SDKDate `mandatory:"false" json:"versionDate"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -74,7 +74,7 @@ // PolicyLifecycleStateEnum Enum with underlying type: string type PolicyLifecycleStateEnum string -// Set of constants representing the allowable values for PolicyLifecycleState +// Set of constants representing the allowable values for PolicyLifecycleStateEnum const ( PolicyLifecycleStateCreating PolicyLifecycleStateEnum = "CREATING" PolicyLifecycleStateActive PolicyLifecycleStateEnum = "ACTIVE" @@ -91,7 +91,7 @@ "DELETED": PolicyLifecycleStateDeleted, } -// GetPolicyLifecycleStateEnumValues Enumerates the set of values for PolicyLifecycleState +// GetPolicyLifecycleStateEnumValues Enumerates the set of values for PolicyLifecycleStateEnum func GetPolicyLifecycleStateEnumValues() []PolicyLifecycleStateEnum { values := make([]PolicyLifecycleStateEnum, 0) for _, v := range mappingPolicyLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,10 +14,10 @@ // Region A localized geographic area, such as Phoenix, AZ. Oracle Cloud Infrastructure is hosted in regions and Availability // Domains. A region is composed of several Availability Domains. An Availability Domain is one or more data centers -// located within a region. For more information, see Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). +// located within a region. For more information, see Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type Region struct { // The key of the region. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region_subscription.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region_subscription.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region_subscription.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/region_subscription.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -13,10 +13,10 @@ ) // RegionSubscription An object that represents your tenancy's access to a particular region (i.e., a subscription), the status of that -// access, and whether that region is the home region. For more information, see Managing Regions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingregions.htm). +// access, and whether that region is the home region. For more information, see Managing Regions (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingregions.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type RegionSubscription struct { // The region's key. @@ -49,7 +49,7 @@ // RegionSubscriptionStatusEnum Enum with underlying type: string type RegionSubscriptionStatusEnum string -// Set of constants representing the allowable values for RegionSubscriptionStatus +// Set of constants representing the allowable values for RegionSubscriptionStatusEnum const ( RegionSubscriptionStatusReady RegionSubscriptionStatusEnum = "READY" RegionSubscriptionStatusInProgress RegionSubscriptionStatusEnum = "IN_PROGRESS" @@ -60,7 +60,7 @@ "IN_PROGRESS": RegionSubscriptionStatusInProgress, } -// GetRegionSubscriptionStatusEnumValues Enumerates the set of values for RegionSubscriptionStatus +// GetRegionSubscriptionStatusEnumValues Enumerates the set of values for RegionSubscriptionStatusEnum func GetRegionSubscriptionStatusEnumValues() []RegionSubscriptionStatusEnum { values := make([]RegionSubscriptionStatusEnum, 0) for _, v := range mappingRegionSubscriptionStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/remove_user_from_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/remove_user_from_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/remove_user_from_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/remove_user_from_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -18,12 +18,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request RemoveUserFromGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request RemoveUserFromGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveUserFromGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // RemoveUserFromGroupResponse wrapper for the RemoveUserFromGroup operation type RemoveUserFromGroupResponse struct { @@ -38,3 +56,8 @@ func (response RemoveUserFromGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response RemoveUserFromGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/reset_idp_scim_client_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/reset_idp_scim_client_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/reset_idp_scim_client_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/reset_idp_scim_client_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ResetIdpScimClientRequest wrapper for the ResetIdpScimClient operation +type ResetIdpScimClientRequest struct { + + // The OCID of the identity provider. + IdentityProviderId *string `mandatory:"true" contributesTo:"path" name:"identityProviderId"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ResetIdpScimClientRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResetIdpScimClientRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResetIdpScimClientRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ResetIdpScimClientResponse wrapper for the ResetIdpScimClient operation +type ResetIdpScimClientResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScimClientCredentials instance + ScimClientCredentials `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ResetIdpScimClientResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResetIdpScimClientResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/saml2_identity_provider.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/saml2_identity_provider.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/saml2_identity_provider.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/saml2_identity_provider.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -15,7 +15,7 @@ // Saml2IdentityProvider A special type of IdentityProvider that // supports the SAML 2.0 protocol. For more information, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). type Saml2IdentityProvider struct { // The OCID of the `IdentityProvider`. @@ -61,18 +61,22 @@ RedirectUrl *string `mandatory:"true" json:"redirectUrl"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // Extra name value pairs associated with this identity provider. + // Example: `{"clientId": "app_sf3kdjf3"}` + FreeformAttributes map[string]string `mandatory:"false" json:"freeformAttributes"` + // The current state. After creating an `IdentityProvider`, make sure its // `lifecycleState` changes from CREATING to ACTIVE before using it. LifecycleState IdentityProviderLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` @@ -114,7 +118,7 @@ } //GetInactiveStatus returns InactiveStatus -func (m Saml2IdentityProvider) GetInactiveStatus() *int { +func (m Saml2IdentityProvider) GetInactiveStatus() *int64 { return m.InactiveStatus } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/scim_client_credentials.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/scim_client_credentials.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/scim_client_credentials.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/scim_client_credentials.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ScimClientCredentials The OAuth2 client credentials. +type ScimClientCredentials struct { + + // The client identifier. + ClientId *string `mandatory:"false" json:"clientId"` + + // The client secret. + ClientSecret *string `mandatory:"false" json:"clientSecret"` +} + +func (m ScimClientCredentials) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -17,7 +17,7 @@ // A user can have up to 2 SMTP credentials at a time. // **Note:** The credential set is always an Oracle-generated SMTP user name and password pair; // you cannot designate the SMTP user name or the SMTP password. -// For more information, see Managing User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm#SMTP). +// For more information, see Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm#SMTP). type SmtpCredential struct { // The SMTP user name. @@ -49,7 +49,7 @@ LifecycleState SmtpCredentialLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m SmtpCredential) String() string { @@ -59,7 +59,7 @@ // SmtpCredentialLifecycleStateEnum Enum with underlying type: string type SmtpCredentialLifecycleStateEnum string -// Set of constants representing the allowable values for SmtpCredentialLifecycleState +// Set of constants representing the allowable values for SmtpCredentialLifecycleStateEnum const ( SmtpCredentialLifecycleStateCreating SmtpCredentialLifecycleStateEnum = "CREATING" SmtpCredentialLifecycleStateActive SmtpCredentialLifecycleStateEnum = "ACTIVE" @@ -76,7 +76,7 @@ "DELETED": SmtpCredentialLifecycleStateDeleted, } -// GetSmtpCredentialLifecycleStateEnumValues Enumerates the set of values for SmtpCredentialLifecycleState +// GetSmtpCredentialLifecycleStateEnumValues Enumerates the set of values for SmtpCredentialLifecycleStateEnum func GetSmtpCredentialLifecycleStateEnumValues() []SmtpCredentialLifecycleStateEnum { values := make([]SmtpCredentialLifecycleStateEnum, 0) for _, v := range mappingSmtpCredentialLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/smtp_credential_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,7 +14,7 @@ // SmtpCredentialSummary As the name suggests, an `SmtpCredentialSummary` object contains information about an `SmtpCredential`. // The SMTP credential is used for SMTP authentication with -// the Email Delivery Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Email/Concepts/overview.htm). +// the Email Delivery Service (https://docs.cloud.oracle.com/Content/Email/Concepts/overview.htm). type SmtpCredentialSummary struct { // The SMTP user name. @@ -43,7 +43,7 @@ LifecycleState SmtpCredentialSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m SmtpCredentialSummary) String() string { @@ -53,7 +53,7 @@ // SmtpCredentialSummaryLifecycleStateEnum Enum with underlying type: string type SmtpCredentialSummaryLifecycleStateEnum string -// Set of constants representing the allowable values for SmtpCredentialSummaryLifecycleState +// Set of constants representing the allowable values for SmtpCredentialSummaryLifecycleStateEnum const ( SmtpCredentialSummaryLifecycleStateCreating SmtpCredentialSummaryLifecycleStateEnum = "CREATING" SmtpCredentialSummaryLifecycleStateActive SmtpCredentialSummaryLifecycleStateEnum = "ACTIVE" @@ -70,7 +70,7 @@ "DELETED": SmtpCredentialSummaryLifecycleStateDeleted, } -// GetSmtpCredentialSummaryLifecycleStateEnumValues Enumerates the set of values for SmtpCredentialSummaryLifecycleState +// GetSmtpCredentialSummaryLifecycleStateEnumValues Enumerates the set of values for SmtpCredentialSummaryLifecycleStateEnum func GetSmtpCredentialSummaryLifecycleStateEnumValues() []SmtpCredentialSummaryLifecycleStateEnum { values := make([]SmtpCredentialSummaryLifecycleStateEnum, 0) for _, v := range mappingSmtpCredentialSummaryLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/swift_password.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/swift_password.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/swift_password.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/swift_password.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -12,11 +12,12 @@ "github.com/oracle/oci-go-sdk/common" ) -// SwiftPassword Swift is the OpenStack object storage service. A `SwiftPassword` is an Oracle-provided password for using a -// Swift client with the Oracle Cloud Infrastructure Object Storage Service. This password is associated with +// SwiftPassword **Deprecated. Use AuthToken instead.** +// Swift is the OpenStack object storage service. A `SwiftPassword` is an Oracle-provided password for using a +// Swift client with the Object Storage Service. This password is associated with // the user's Console login. Swift passwords never expire. A user can have up to two Swift passwords at a time. // **Note:** The password is always an Oracle-generated string; you can't change it to a string of your choice. -// For more information, see Managing User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm). +// For more information, see Managing User Credentials (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcredentials.htm). type SwiftPassword struct { // The Swift password. The value is available only in the response for `CreateSwiftPassword`, and not @@ -46,7 +47,7 @@ LifecycleState SwiftPasswordLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m SwiftPassword) String() string { @@ -56,7 +57,7 @@ // SwiftPasswordLifecycleStateEnum Enum with underlying type: string type SwiftPasswordLifecycleStateEnum string -// Set of constants representing the allowable values for SwiftPasswordLifecycleState +// Set of constants representing the allowable values for SwiftPasswordLifecycleStateEnum const ( SwiftPasswordLifecycleStateCreating SwiftPasswordLifecycleStateEnum = "CREATING" SwiftPasswordLifecycleStateActive SwiftPasswordLifecycleStateEnum = "ACTIVE" @@ -73,7 +74,7 @@ "DELETED": SwiftPasswordLifecycleStateDeleted, } -// GetSwiftPasswordLifecycleStateEnumValues Enumerates the set of values for SwiftPasswordLifecycleState +// GetSwiftPasswordLifecycleStateEnumValues Enumerates the set of values for SwiftPasswordLifecycleStateEnum func GetSwiftPasswordLifecycleStateEnumValues() []SwiftPasswordLifecycleStateEnum { values := make([]SwiftPasswordLifecycleStateEnum, 0) for _, v := range mappingSwiftPasswordLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// TagDefault Tag defaults let you specify a default tag (tagnamespace.tag="value") to apply to all resource types +// in a specified compartment. The tag default is applied at the time the resource is created. Resources +// that exist in the compartment before you create the tag default are not tagged. The `TagDefault` object +// specifies the tag and compartment details. +// Tag defaults are inherited by child compartments. This means that if you set a tag default on the root compartment +// for a tenancy, all resources that are created in the tenancy are tagged. For more information about +// using tag defaults, see Managing Tag Defaults (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingtagdefaults.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. +type TagDefault struct { + + // The OCID of the tag default. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment. The tag default applies to all new resources that get created in the + // compartment. Resources that existed before the tag default was created are not tagged. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the tag namespace that contains the tag definition. + TagNamespaceId *string `mandatory:"true" json:"tagNamespaceId"` + + // The OCID of the tag definition. The tag default will always assign a default value for this tag definition. + TagDefinitionId *string `mandatory:"true" json:"tagDefinitionId"` + + // The name used in the tag definition. This field is informational in the context of the tag default. + TagDefinitionName *string `mandatory:"true" json:"tagDefinitionName"` + + // The default value for the tag definition. This will be applied to all resources created in the compartment. + Value *string `mandatory:"true" json:"value"` + + // Date and time the `TagDefault` object was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The tag default's current state. After creating a `TagDefault`, make sure its `lifecycleState` is ACTIVE before using it. + LifecycleState TagDefaultLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m TagDefault) String() string { + return common.PointerString(m) +} + +// TagDefaultLifecycleStateEnum Enum with underlying type: string +type TagDefaultLifecycleStateEnum string + +// Set of constants representing the allowable values for TagDefaultLifecycleStateEnum +const ( + TagDefaultLifecycleStateActive TagDefaultLifecycleStateEnum = "ACTIVE" +) + +var mappingTagDefaultLifecycleState = map[string]TagDefaultLifecycleStateEnum{ + "ACTIVE": TagDefaultLifecycleStateActive, +} + +// GetTagDefaultLifecycleStateEnumValues Enumerates the set of values for TagDefaultLifecycleStateEnum +func GetTagDefaultLifecycleStateEnumValues() []TagDefaultLifecycleStateEnum { + values := make([]TagDefaultLifecycleStateEnum, 0) + for _, v := range mappingTagDefaultLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_default_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// TagDefaultSummary Summary information for the specified tag default. +type TagDefaultSummary struct { + + // The OCID of the tag default. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment. The tag default will apply to all new resources that are created in the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the tag namespace that contains the tag definition. + TagNamespaceId *string `mandatory:"true" json:"tagNamespaceId"` + + // The OCID of the tag definition. The tag default will always assign a default value for this tag definition. + TagDefinitionId *string `mandatory:"true" json:"tagDefinitionId"` + + // The name used in the tag definition. This field is informational in the context of the tag default. + TagDefinitionName *string `mandatory:"true" json:"tagDefinitionName"` + + // The default value for the tag definition. This will be applied to all new resources created in the compartment. + Value *string `mandatory:"true" json:"value"` + + // Date and time the `TagDefault` object was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The tag default's current state. After creating a `TagDefault`, make sure its `lifecycleState` is ACTIVE before using it. + LifecycleState TagDefaultSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +func (m TagDefaultSummary) String() string { + return common.PointerString(m) +} + +// TagDefaultSummaryLifecycleStateEnum Enum with underlying type: string +type TagDefaultSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for TagDefaultSummaryLifecycleStateEnum +const ( + TagDefaultSummaryLifecycleStateActive TagDefaultSummaryLifecycleStateEnum = "ACTIVE" +) + +var mappingTagDefaultSummaryLifecycleState = map[string]TagDefaultSummaryLifecycleStateEnum{ + "ACTIVE": TagDefaultSummaryLifecycleStateActive, +} + +// GetTagDefaultSummaryLifecycleStateEnumValues Enumerates the set of values for TagDefaultSummaryLifecycleStateEnum +func GetTagDefaultSummaryLifecycleStateEnumValues() []TagDefaultSummaryLifecycleStateEnum { + values := make([]TagDefaultSummaryLifecycleStateEnum, 0) + for _, v := range mappingTagDefaultSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,7 +14,7 @@ // Tag A tag definition that belongs to a specific tag namespace. "Defined tags" must be set up in your tenancy before // you can apply them to resources. -// For more information, see Managing Tags and Tag Namespaces (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm). +// For more information, see Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm). type Tag struct { // The OCID of the compartment that contains the tag definition. @@ -36,7 +36,7 @@ Description *string `mandatory:"true" json:"description"` // Indicates whether the tag is retired. - // See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"true" json:"isRetired"` // Date and time the tag was created, in the format defined by RFC3339. @@ -44,14 +44,17 @@ TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}`` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Indicates whether the tag is enabled for cost tracking. + IsCostTracking *bool `mandatory:"false" json:"isCostTracking"` } func (m Tag) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -13,7 +13,7 @@ ) // TagNamespace A managed container for defined tags. A tag namespace is unique in a tenancy. A tag namespace can't be deleted. -// For more information, see Managing Tags and Tag Namespaces (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm). +// For more information, see Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm). type TagNamespace struct { // The OCID of the tag namespace. @@ -29,7 +29,7 @@ Description *string `mandatory:"true" json:"description"` // Whether the tag namespace is retired. - // See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"true" json:"isRetired"` // Date and time the tagNamespace was created, in the format defined by RFC3339. @@ -37,12 +37,12 @@ TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_namespace_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -28,20 +28,20 @@ Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Whether the tag namespace is retired. - // For more information, see Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // For more information, see Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"false" json:"isRetired"` - // Date and time the tagNamespace was created, in the format defined by RFC3339. + // Date and time the tag namespace was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tag_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -28,22 +28,25 @@ Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Whether the tag is retired. - // See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"false" json:"isRetired"` // Date and time the tag was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Indicates whether the tag is enabled for cost tracking. + IsCostTracking *bool `mandatory:"false" json:"isCostTracking"` } func (m TagSummary) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tenancy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tenancy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tenancy.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/tenancy.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -18,7 +18,7 @@ // where you can create, organize, and administer your cloud resources. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type Tenancy struct { // The OCID of the tenancy. @@ -31,7 +31,7 @@ Description *string `mandatory:"false" json:"description"` // The region key for the tenancy's home region. For more information about regions, see - // Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). + // Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // Allowed values are: // - `IAD` // - `PHX` @@ -40,12 +40,12 @@ HomeRegionKey *string `mandatory:"false" json:"homeRegionKey"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/ui_password.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/ui_password.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/ui_password.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/ui_password.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -14,7 +14,7 @@ // UiPassword A text password that enables a user to sign in to the Console, the user interface for interacting with Oracle // Cloud Infrastructure. -// For more information about user credentials, see User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/usercredentials.htm). +// For more information about user credentials, see User Credentials (https://docs.cloud.oracle.com/Content/Identity/Concepts/usercredentials.htm). type UiPassword struct { // The user's password for the Console. @@ -32,7 +32,7 @@ LifecycleState UiPasswordLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m UiPassword) String() string { @@ -42,7 +42,7 @@ // UiPasswordLifecycleStateEnum Enum with underlying type: string type UiPasswordLifecycleStateEnum string -// Set of constants representing the allowable values for UiPasswordLifecycleState +// Set of constants representing the allowable values for UiPasswordLifecycleStateEnum const ( UiPasswordLifecycleStateCreating UiPasswordLifecycleStateEnum = "CREATING" UiPasswordLifecycleStateActive UiPasswordLifecycleStateEnum = "ACTIVE" @@ -59,7 +59,7 @@ "DELETED": UiPasswordLifecycleStateDeleted, } -// GetUiPasswordLifecycleStateEnumValues Enumerates the set of values for UiPasswordLifecycleState +// GetUiPasswordLifecycleStateEnumValues Enumerates the set of values for UiPasswordLifecycleStateEnum func GetUiPasswordLifecycleStateEnumValues() []UiPasswordLifecycleStateEnum { values := make([]UiPasswordLifecycleStateEnum, 0) for _, v := range mappingUiPasswordLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAuthenticationPolicyDetails Update request for authentication policy, describes set of validation rules and their parameters to be updated. +type UpdateAuthenticationPolicyDetails struct { + + // Password policy. + PasswordPolicy *PasswordPolicy `mandatory:"false" json:"passwordPolicy"` +} + +func (m UpdateAuthenticationPolicyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_authentication_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAuthenticationPolicyRequest wrapper for the UpdateAuthenticationPolicy operation +type UpdateAuthenticationPolicyRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"path" name:"compartmentId"` + + // Request object for updating the authentication policy. + UpdateAuthenticationPolicyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAuthenticationPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAuthenticationPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAuthenticationPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAuthenticationPolicyResponse wrapper for the UpdateAuthenticationPolicy operation +type UpdateAuthenticationPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AuthenticationPolicy instance + AuthenticationPolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateAuthenticationPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAuthenticationPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAuthTokenDetails The representation of UpdateAuthTokenDetails +type UpdateAuthTokenDetails struct { + + // The description you assign to the auth token. Does not have to be unique, and it's changeable. + Description *string `mandatory:"false" json:"description"` +} + +func (m UpdateAuthTokenDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_auth_token_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAuthTokenRequest wrapper for the UpdateAuthToken operation +type UpdateAuthTokenRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // The OCID of the auth token. + AuthTokenId *string `mandatory:"true" contributesTo:"path" name:"authTokenId"` + + // Request object for updating an auth token. + UpdateAuthTokenDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAuthTokenRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAuthTokenRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAuthTokenRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAuthTokenResponse wrapper for the UpdateAuthToken operation +type UpdateAuthTokenResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AuthToken instance + AuthToken `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateAuthTokenResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAuthTokenResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -18,17 +18,17 @@ // The description you assign to the compartment. Does not have to be unique, and it's changeable. Description *string `mandatory:"false" json:"description"` - // The new name you assign to the compartment. The name must be unique across all compartments in the tenancy. + // The new name you assign to the compartment. The name must be unique across all compartments in the parent compartment. // Avoid entering confidential information. Name *string `mandatory:"false" json:"name"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_compartment_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateCompartmentRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateCompartmentResponse wrapper for the UpdateCompartment operation type UpdateCompartmentResponse struct { @@ -47,3 +65,8 @@ func (response UpdateCompartmentResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_customer_secret_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateCustomerSecretKeyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateCustomerSecretKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCustomerSecretKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateCustomerSecretKeyResponse wrapper for the UpdateCustomerSecretKey operation type UpdateCustomerSecretKeyResponse struct { @@ -50,3 +68,8 @@ func (response UpdateCustomerSecretKeyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCustomerSecretKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,8 +19,18 @@ Description *string `mandatory:"false" json:"description"` // The matching rule to dynamically match an instance certificate to this dynamic group. - // For rule syntax, see Managing Dynamic Groups (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingdynamicgroups.htm). + // For rule syntax, see Managing Dynamic Groups (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingdynamicgroups.htm). MatchingRule *string `mandatory:"false" json:"matchingRule"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateDynamicGroupDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_dynamic_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateDynamicGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateDynamicGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDynamicGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateDynamicGroupResponse wrapper for the UpdateDynamicGroup operation type UpdateDynamicGroupResponse struct { @@ -47,3 +65,8 @@ func (response UpdateDynamicGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDynamicGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,12 +19,12 @@ Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateGroupRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateGroupResponse wrapper for the UpdateGroup operation type UpdateGroupResponse struct { @@ -47,3 +65,8 @@ func (response UpdateGroupResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -21,12 +21,12 @@ GetDescription() *string // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} } @@ -60,6 +60,11 @@ // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *updateidentityproviderdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + var err error switch m.Protocol { case "SAML2": @@ -67,7 +72,7 @@ err = json.Unmarshal(data, &mm) return mm, err default: - return m, nil + return *m, nil } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_identity_provider_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateIdentityProviderRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateIdentityProviderRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateIdentityProviderRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateIdentityProviderResponse wrapper for the UpdateIdentityProvider operation type UpdateIdentityProviderResponse struct { @@ -47,3 +65,8 @@ func (response UpdateIdentityProviderResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateIdentityProviderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_idp_group_mapping_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateIdpGroupMappingRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateIdpGroupMappingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateIdpGroupMappingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateIdpGroupMappingResponse wrapper for the UpdateIdpGroupMapping operation type UpdateIdpGroupMappingResponse struct { @@ -50,3 +68,8 @@ func (response UpdateIdpGroupMappingResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateIdpGroupMappingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,22 +19,22 @@ Description *string `mandatory:"false" json:"description"` // An array of policy statements written in the policy language. See - // How Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm) and - // Common Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm). + // How Policies Work (https://docs.cloud.oracle.com/Content/Identity/Concepts/policies.htm) and + // Common Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm). Statements []string `mandatory:"false" json:"statements"` // The version of the policy. If null or set to an empty string, when a request comes in for authorization, the // policy will be evaluated according to the current behavior of the services at that moment. If set to a particular // date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date. - VersionDate *common.SDKTime `mandatory:"false" json:"versionDate"` + VersionDate *common.SDKDate `mandatory:"false" json:"versionDate"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdatePolicyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdatePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdatePolicyResponse wrapper for the UpdatePolicy operation type UpdatePolicyResponse struct { @@ -47,3 +65,8 @@ func (response UpdatePolicyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_saml2_identity_provider_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_saml2_identity_provider_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_saml2_identity_provider_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_saml2_identity_provider_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -21,12 +21,12 @@ Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -36,6 +36,10 @@ // The XML that contains the information required for federating. Metadata *string `mandatory:"false" json:"metadata"` + + // Extra name value pairs associated with this identity provider. + // Example: `{"clientId": "app_sf3kdjf3"}` + FreeformAttributes map[string]string `mandatory:"false" json:"freeformAttributes"` } //GetDescription returns Description diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_smtp_credential_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateSmtpCredentialRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateSmtpCredentialRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSmtpCredentialRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateSmtpCredentialResponse wrapper for the UpdateSmtpCredential operation type UpdateSmtpCredentialResponse struct { @@ -50,3 +68,8 @@ func (response UpdateSmtpCredentialResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSmtpCredentialResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_state_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_state_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_state_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_state_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_swift_password_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -24,12 +24,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateSwiftPasswordRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateSwiftPasswordRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSwiftPasswordRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateSwiftPasswordResponse wrapper for the UpdateSwiftPassword operation type UpdateSwiftPasswordResponse struct { @@ -50,3 +68,8 @@ func (response UpdateSwiftPasswordResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSwiftPasswordResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateTagDefaultDetails The representation of UpdateTagDefaultDetails +type UpdateTagDefaultDetails struct { + + // The default value for the tag definition. This will be applied to all resources created in the Compartment. + Value *string `mandatory:"true" json:"value"` +} + +func (m UpdateTagDefaultDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_default_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateTagDefaultRequest wrapper for the UpdateTagDefault operation +type UpdateTagDefaultRequest struct { + + // The OCID of the tag default. + TagDefaultId *string `mandatory:"true" contributesTo:"path" name:"tagDefaultId"` + + // Request object for updating a tag default. + UpdateTagDefaultDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateTagDefaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTagDefaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTagDefaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateTagDefaultResponse wrapper for the UpdateTagDefault operation +type UpdateTagDefaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TagDefault instance + TagDefault `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateTagDefaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTagDefaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,18 +19,21 @@ Description *string `mandatory:"false" json:"description"` // Whether the tag is retired. - // See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"false" json:"isRetired"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Indicates whether the tag is enabled for cost tracking. + IsCostTracking *bool `mandatory:"false" json:"isCostTracking"` } func (m UpdateTagDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -19,16 +19,16 @@ Description *string `mandatory:"false" json:"description"` // Whether the tag namespace is retired. - // See Retiring Key Definitions and Namespace Definitions (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). + // See Retiring Key Definitions and Namespace Definitions (https://docs.cloud.oracle.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). IsRetired *bool `mandatory:"false" json:"isRetired"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_namespace_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -16,12 +16,30 @@ // Request object for updating a namespace. UpdateTagNamespaceDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateTagNamespaceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateTagNamespaceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTagNamespaceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateTagNamespaceResponse wrapper for the UpdateTagNamespace operation type UpdateTagNamespaceResponse struct { @@ -39,3 +57,8 @@ func (response UpdateTagNamespaceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTagNamespaceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_tag_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -19,12 +19,30 @@ // Request object for updating a tag. UpdateTagDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateTagRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateTagRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTagRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateTagResponse wrapper for the UpdateTag operation type UpdateTagResponse struct { @@ -42,3 +60,8 @@ func (response UpdateTagResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTagResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateUserCapabilitiesDetails The representation of UpdateUserCapabilitiesDetails +type UpdateUserCapabilitiesDetails struct { + + // Indicates if the user can log in to the console. + CanUseConsolePassword *bool `mandatory:"false" json:"canUseConsolePassword"` + + // Indicates if the user can use API keys. + CanUseApiKeys *bool `mandatory:"false" json:"canUseApiKeys"` + + // Indicates if the user can use SWIFT passwords / auth tokens. + CanUseAuthTokens *bool `mandatory:"false" json:"canUseAuthTokens"` + + // Indicates if the user can use SMTP passwords. + CanUseSmtpCredentials *bool `mandatory:"false" json:"canUseSmtpCredentials"` + + // Indicates if the user can use SigV4 symmetric keys. + CanUseCustomerSecretKeys *bool `mandatory:"false" json:"canUseCustomerSecretKeys"` +} + +func (m UpdateUserCapabilitiesDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_capabilities_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateUserCapabilitiesRequest wrapper for the UpdateUserCapabilities operation +type UpdateUserCapabilitiesRequest struct { + + // The OCID of the user. + UserId *string `mandatory:"true" contributesTo:"path" name:"userId"` + + // Request object for updating user capabilities. + UpdateUserCapabilitiesDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateUserCapabilitiesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateUserCapabilitiesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateUserCapabilitiesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateUserCapabilitiesResponse wrapper for the UpdateUserCapabilities operation +type UpdateUserCapabilitiesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The User instance + User `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateUserCapabilitiesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateUserCapabilitiesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -18,13 +18,16 @@ // The description you assign to the user. Does not have to be unique, and it's changeable. Description *string `mandatory:"false" json:"description"` + // The email address you assign to the user. Has to be unique across the tenancy. + Email *string `mandatory:"false" json:"email"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateUserRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateUserRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateUserRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateUserResponse wrapper for the UpdateUser operation type UpdateUserResponse struct { @@ -47,3 +65,8 @@ func (response UpdateUserResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateUserResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_state_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_state_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_state_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/update_user_state_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -21,12 +21,30 @@ // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateUserStateRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateUserStateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateUserStateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateUserStateResponse wrapper for the UpdateUserState operation type UpdateUserStateResponse struct { @@ -47,3 +65,8 @@ func (response UpdateUserStateResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateUserStateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/upload_api_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/upload_api_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/upload_api_key_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/upload_api_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package identity @@ -23,12 +23,30 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UploadApiKeyRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UploadApiKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadApiKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UploadApiKeyResponse wrapper for the UploadApiKey operation type UploadApiKeyResponse struct { @@ -49,3 +67,8 @@ func (response UploadApiKeyResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UploadApiKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_capabilities.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_capabilities.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_capabilities.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_capabilities.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UserCapabilities Properties indicating how the user is allowed to authenticate. +type UserCapabilities struct { + + // Indicates if the user can log in to the console. + CanUseConsolePassword *bool `mandatory:"false" json:"canUseConsolePassword"` + + // Indicates if the user can use API keys. + CanUseApiKeys *bool `mandatory:"false" json:"canUseApiKeys"` + + // Indicates if the user can use SWIFT passwords / auth tokens. + CanUseAuthTokens *bool `mandatory:"false" json:"canUseAuthTokens"` + + // Indicates if the user can use SMTP passwords. + CanUseSmtpCredentials *bool `mandatory:"false" json:"canUseSmtpCredentials"` + + // Indicates if the user can use SigV4 symmetric keys. + CanUseCustomerSecretKeys *bool `mandatory:"false" json:"canUseCustomerSecretKeys"` +} + +func (m UserCapabilities) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -15,17 +15,18 @@ // User An individual employee or system that needs to manage or use your company's Oracle Cloud Infrastructure // resources. Users might need to launch instances, manage remote disks, work with your cloud network, etc. Users // have one or more IAM Service credentials (ApiKey, -// UIPassword, and SwiftPassword). -// For more information, see User Credentials (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usercredentials.htm)). End users of your +// UIPassword, SwiftPassword and +// AuthToken). +// For more information, see User Credentials (https://docs.cloud.oracle.com/Content/API/Concepts/usercredentials.htm)). End users of your // application are not typically IAM Service users. For conceptual information about users and other IAM Service -// components, see Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// components, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // These users are created directly within the Oracle Cloud Infrastructure system, via the IAM service. // They are different from *federated users*, who authenticate themselves to the Oracle Cloud Infrastructure // Console via an identity provider. For more information, see -// Identity Providers and Federation (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm). +// Identity Providers and Federation (https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type User struct { // The OCID of the user. @@ -49,22 +50,38 @@ // ACTIVE before using it. LifecycleState UserLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // Flag indicates if MFA has been activated for the user. + IsMfaActivated *bool `mandatory:"true" json:"isMfaActivated"` + + // The email address you assign to the user. + // The email address must be unique across all users in the tenancy. + Email *string `mandatory:"false" json:"email"` + + // The OCID of the `IdentityProvider` this user belongs to. + IdentityProviderId *string `mandatory:"false" json:"identityProviderId"` + + // Identifier of the user in the identity provider + ExternalIdentifier *string `mandatory:"false" json:"externalIdentifier"` + // Returned only if the user's `lifecycleState` is INACTIVE. A 16-bit value showing the reason why the user // is inactive: // - bit 0: SUSPENDED (reserved for future use) // - bit 1: DISABLED (reserved for future use) // - bit 2: BLOCKED (the user has exceeded the maximum number of failed login attempts for the Console) - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Properties indicating how the user is allowed to authenticate. + Capabilities *UserCapabilities `mandatory:"false" json:"capabilities"` } func (m User) String() string { @@ -74,7 +91,7 @@ // UserLifecycleStateEnum Enum with underlying type: string type UserLifecycleStateEnum string -// Set of constants representing the allowable values for UserLifecycleState +// Set of constants representing the allowable values for UserLifecycleStateEnum const ( UserLifecycleStateCreating UserLifecycleStateEnum = "CREATING" UserLifecycleStateActive UserLifecycleStateEnum = "ACTIVE" @@ -91,7 +108,7 @@ "DELETED": UserLifecycleStateDeleted, } -// GetUserLifecycleStateEnumValues Enumerates the set of values for UserLifecycleState +// GetUserLifecycleStateEnumValues Enumerates the set of values for UserLifecycleStateEnum func GetUserLifecycleStateEnumValues() []UserLifecycleStateEnum { values := make([]UserLifecycleStateEnum, 0) for _, v := range mappingUserLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_group_membership.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_group_membership.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_group_membership.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/user_group_membership.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Identity and Access Management Service API @@ -37,7 +37,7 @@ LifecycleState UserGroupMembershipLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The detailed status of INACTIVE lifecycleState. - InactiveStatus *int `mandatory:"false" json:"inactiveStatus"` + InactiveStatus *int64 `mandatory:"false" json:"inactiveStatus"` } func (m UserGroupMembership) String() string { @@ -47,7 +47,7 @@ // UserGroupMembershipLifecycleStateEnum Enum with underlying type: string type UserGroupMembershipLifecycleStateEnum string -// Set of constants representing the allowable values for UserGroupMembershipLifecycleState +// Set of constants representing the allowable values for UserGroupMembershipLifecycleStateEnum const ( UserGroupMembershipLifecycleStateCreating UserGroupMembershipLifecycleStateEnum = "CREATING" UserGroupMembershipLifecycleStateActive UserGroupMembershipLifecycleStateEnum = "ACTIVE" @@ -64,7 +64,7 @@ "DELETED": UserGroupMembershipLifecycleStateDeleted, } -// GetUserGroupMembershipLifecycleStateEnumValues Enumerates the set of values for UserGroupMembershipLifecycleState +// GetUserGroupMembershipLifecycleStateEnumValues Enumerates the set of values for UserGroupMembershipLifecycleStateEnum func GetUserGroupMembershipLifecycleStateEnumValues() []UserGroupMembershipLifecycleStateEnum { values := make([]UserGroupMembershipLifecycleStateEnum, 0) for _, v := range mappingUserGroupMembershipLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestError The error entity. +type WorkRequestError struct { + + // A machine-usable code for the error that occured. + Code *string `mandatory:"true" json:"code"` + + // A human-readable error string. + Message *string `mandatory:"true" json:"message"` + + // Date and time the error happened, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequest The asynchronous API request does not take effect immediately. This request spawns an asynchronous +// workflow to fulfill the request. WorkRequest objects provide visibility for in-progress workflows. +type WorkRequest struct { + + // The OCID of the work request. + Id *string `mandatory:"true" json:"id"` + + // An enum-like description of the type of work the work request is doing. + OperationType WorkRequestOperationTypeEnum `mandatory:"true" json:"operationType"` + + // The current status of the work request. + Status WorkRequestStatusEnum `mandatory:"true" json:"status"` + + // The OCID of the compartment that contains the work request. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The resources this work request affects. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The errors for work request. + Errors []WorkRequestError `mandatory:"false" json:"errors"` + + // The logs for work request. + Logs []WorkRequestLogEntry `mandatory:"false" json:"logs"` + + // Date and time the work was accepted, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // Date and time the work started, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // Date and time the work completed, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // How much progress the operation has made. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// WorkRequestOperationTypeEnum Enum with underlying type: string +type WorkRequestOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestOperationTypeEnum +const ( + WorkRequestOperationTypeCompartment WorkRequestOperationTypeEnum = "DELETE_COMPARTMENT" +) + +var mappingWorkRequestOperationType = map[string]WorkRequestOperationTypeEnum{ + "DELETE_COMPARTMENT": WorkRequestOperationTypeCompartment, +} + +// GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum { + values := make([]WorkRequestOperationTypeEnum, 0) + for _, v := range mappingWorkRequestOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestStatusEnum Enum with underlying type: string +type WorkRequestStatusEnum string + +// Set of constants representing the allowable values for WorkRequestStatusEnum +const ( + WorkRequestStatusAccepted WorkRequestStatusEnum = "ACCEPTED" + WorkRequestStatusInProgress WorkRequestStatusEnum = "IN_PROGRESS" + WorkRequestStatusFailed WorkRequestStatusEnum = "FAILED" + WorkRequestStatusSucceeded WorkRequestStatusEnum = "SUCCEEDED" + WorkRequestStatusCanceling WorkRequestStatusEnum = "CANCELING" + WorkRequestStatusCanceled WorkRequestStatusEnum = "CANCELED" +) + +var mappingWorkRequestStatus = map[string]WorkRequestStatusEnum{ + "ACCEPTED": WorkRequestStatusAccepted, + "IN_PROGRESS": WorkRequestStatusInProgress, + "FAILED": WorkRequestStatusFailed, + "SUCCEEDED": WorkRequestStatusSucceeded, + "CANCELING": WorkRequestStatusCanceling, + "CANCELED": WorkRequestStatusCanceled, +} + +// GetWorkRequestStatusEnumValues Enumerates the set of values for WorkRequestStatusEnum +func GetWorkRequestStatusEnumValues() []WorkRequestStatusEnum { + values := make([]WorkRequestStatusEnum, 0) + for _, v := range mappingWorkRequestStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_log_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_log_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_log_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_log_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestLogEntry The log entity. +type WorkRequestLogEntry struct { + + // A human-readable error string. + Message *string `mandatory:"true" json:"message"` + + // Date and time the log was written, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestResource The resource entity. +type WorkRequestResource struct { + + // The resource identifier the work request affects. + Identifier *string `mandatory:"true" json:"identifier"` + + // The resource type the work request is affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource was affected by the work tracked by the work request. + ActionType WorkRequestResourceActionTypeEnum `mandatory:"true" json:"actionType"` + + // The URI path that the user can do a GET on to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// WorkRequestResourceActionTypeEnum Enum with underlying type: string +type WorkRequestResourceActionTypeEnum string + +// Set of constants representing the allowable values for WorkRequestResourceActionTypeEnum +const ( + WorkRequestResourceActionTypeCreated WorkRequestResourceActionTypeEnum = "CREATED" + WorkRequestResourceActionTypeUpdated WorkRequestResourceActionTypeEnum = "UPDATED" + WorkRequestResourceActionTypeDeleted WorkRequestResourceActionTypeEnum = "DELETED" + WorkRequestResourceActionTypeRelated WorkRequestResourceActionTypeEnum = "RELATED" + WorkRequestResourceActionTypeInProgress WorkRequestResourceActionTypeEnum = "IN_PROGRESS" +) + +var mappingWorkRequestResourceActionType = map[string]WorkRequestResourceActionTypeEnum{ + "CREATED": WorkRequestResourceActionTypeCreated, + "UPDATED": WorkRequestResourceActionTypeUpdated, + "DELETED": WorkRequestResourceActionTypeDeleted, + "RELATED": WorkRequestResourceActionTypeRelated, + "IN_PROGRESS": WorkRequestResourceActionTypeInProgress, +} + +// GetWorkRequestResourceActionTypeEnumValues Enumerates the set of values for WorkRequestResourceActionTypeEnum +func GetWorkRequestResourceActionTypeEnumValues() []WorkRequestResourceActionTypeEnum { + values := make([]WorkRequestResourceActionTypeEnum, 0) + for _, v := range mappingWorkRequestResourceActionType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/identity/work_request_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Identity and Access Management Service API +// +// APIs for managing users, groups, compartments, and policies. +// + +package identity + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestSummary The work request summary. Tracks the status of the asynchronous operation. +type WorkRequestSummary struct { + + // The OCID of the work request. + Id *string `mandatory:"true" json:"id"` + + // An enum-like description of the type of work the work request is doing. + OperationType WorkRequestSummaryOperationTypeEnum `mandatory:"true" json:"operationType"` + + // The current status of the work request. + Status WorkRequestSummaryStatusEnum `mandatory:"true" json:"status"` + + // The OCID of the compartment that contains the work request. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The resources this work request affects. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The errors for work request. + Errors []WorkRequestError `mandatory:"false" json:"errors"` + + // Date and time the work was accepted, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // Date and time the work started, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // Date and time the work completed, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // How much progress the operation has made. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// WorkRequestSummaryOperationTypeEnum Enum with underlying type: string +type WorkRequestSummaryOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryOperationTypeEnum +const ( + WorkRequestSummaryOperationTypeCompartment WorkRequestSummaryOperationTypeEnum = "DELETE_COMPARTMENT" +) + +var mappingWorkRequestSummaryOperationType = map[string]WorkRequestSummaryOperationTypeEnum{ + "DELETE_COMPARTMENT": WorkRequestSummaryOperationTypeCompartment, +} + +// GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum +func GetWorkRequestSummaryOperationTypeEnumValues() []WorkRequestSummaryOperationTypeEnum { + values := make([]WorkRequestSummaryOperationTypeEnum, 0) + for _, v := range mappingWorkRequestSummaryOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestSummaryStatusEnum Enum with underlying type: string +type WorkRequestSummaryStatusEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryStatusEnum +const ( + WorkRequestSummaryStatusAccepted WorkRequestSummaryStatusEnum = "ACCEPTED" + WorkRequestSummaryStatusInProgress WorkRequestSummaryStatusEnum = "IN_PROGRESS" + WorkRequestSummaryStatusFailed WorkRequestSummaryStatusEnum = "FAILED" + WorkRequestSummaryStatusSucceeded WorkRequestSummaryStatusEnum = "SUCCEEDED" + WorkRequestSummaryStatusCanceling WorkRequestSummaryStatusEnum = "CANCELING" + WorkRequestSummaryStatusCanceled WorkRequestSummaryStatusEnum = "CANCELED" +) + +var mappingWorkRequestSummaryStatus = map[string]WorkRequestSummaryStatusEnum{ + "ACCEPTED": WorkRequestSummaryStatusAccepted, + "IN_PROGRESS": WorkRequestSummaryStatusInProgress, + "FAILED": WorkRequestSummaryStatusFailed, + "SUCCEEDED": WorkRequestSummaryStatusSucceeded, + "CANCELING": WorkRequestSummaryStatusCanceling, + "CANCELED": WorkRequestSummaryStatusCanceled, +} + +// GetWorkRequestSummaryStatusEnumValues Enumerates the set of values for WorkRequestSummaryStatusEnum +func GetWorkRequestSummaryStatusEnumValues() []WorkRequestSummaryStatusEnum { + values := make([]WorkRequestSummaryStatusEnum, 0) + for _, v := range mappingWorkRequestSummaryStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/cancel_vault_deletion_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/cancel_vault_deletion_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/cancel_vault_deletion_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/cancel_vault_deletion_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CancelVaultDeletionRequest wrapper for the CancelVaultDeletion operation +type CancelVaultDeletionRequest struct { + + // The OCID of the vault. + VaultId *string `mandatory:"true" contributesTo:"path" name:"vaultId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelVaultDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelVaultDeletionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelVaultDeletionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CancelVaultDeletionResponse wrapper for the CancelVaultDeletion operation +type CancelVaultDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Vault instance + Vault `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CancelVaultDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelVaultDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateKeyDetails The representation of CreateKeyDetails +type CreateKeyDetails struct { + + // The OCID of the compartment that contains this key. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the key. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + KeyShape *KeyShape `mandatory:"true" json:"keyShape"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateKeyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateKeyRequest wrapper for the CreateKey operation +type CreateKeyRequest struct { + + // CreateKeyDetails + CreateKeyDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateKeyResponse wrapper for the CreateKey operation +type CreateKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Key instance + Key `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_version_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_version_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_version_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_key_version_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateKeyVersionRequest wrapper for the CreateKeyVersion operation +type CreateKeyVersionRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateKeyVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateKeyVersionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateKeyVersionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateKeyVersionResponse wrapper for the CreateKeyVersion operation +type CreateKeyVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The KeyVersion instance + KeyVersion `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateKeyVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateKeyVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateVaultDetails The representation of CreateVaultDetails +type CreateVaultDetails struct { + + // The OCID of the compartment where you want to create this vault. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the vault. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The type of vault to create. Each type of vault stores the key with different degrees of isolation and has different options and pricing. + VaultType CreateVaultDetailsVaultTypeEnum `mandatory:"true" json:"vaultType"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateVaultDetails) String() string { + return common.PointerString(m) +} + +// CreateVaultDetailsVaultTypeEnum Enum with underlying type: string +type CreateVaultDetailsVaultTypeEnum string + +// Set of constants representing the allowable values for CreateVaultDetailsVaultTypeEnum +const ( + CreateVaultDetailsVaultTypePrivate CreateVaultDetailsVaultTypeEnum = "VIRTUAL_PRIVATE" +) + +var mappingCreateVaultDetailsVaultType = map[string]CreateVaultDetailsVaultTypeEnum{ + "VIRTUAL_PRIVATE": CreateVaultDetailsVaultTypePrivate, +} + +// GetCreateVaultDetailsVaultTypeEnumValues Enumerates the set of values for CreateVaultDetailsVaultTypeEnum +func GetCreateVaultDetailsVaultTypeEnumValues() []CreateVaultDetailsVaultTypeEnum { + values := make([]CreateVaultDetailsVaultTypeEnum, 0) + for _, v := range mappingCreateVaultDetailsVaultType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/create_vault_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateVaultRequest wrapper for the CreateVault operation +type CreateVaultRequest struct { + + // CreateVaultDetails + CreateVaultDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateVaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateVaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateVaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateVaultResponse wrapper for the CreateVault operation +type CreateVaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Vault instance + Vault `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateVaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateVaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_data_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_data_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_data_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_data_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DecryptDataDetails The representation of DecryptDataDetails +type DecryptDataDetails struct { + + // The encrypted data to decrypt. + Ciphertext *string `mandatory:"true" json:"ciphertext"` + + // The OCID of the key used to encrypt the ciphertext. + KeyId *string `mandatory:"true" json:"keyId"` + + // Information that can be used to provide an encryption context for the + // encrypted data. The length of the string representation of the associatedData + // must be fewer than 4096 characters. + AssociatedData map[string]string `mandatory:"false" json:"associatedData"` + + // Information that can be used to provide context for audit logging. It is a map that contains any addtional + // data the users may have and will be added to the audit logs (if audit logging is enabled) + LoggingContext map[string]string `mandatory:"false" json:"loggingContext"` +} + +func (m DecryptDataDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypted_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypted_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypted_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypted_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DecryptedData The representation of DecryptedData +type DecryptedData struct { + + // The decrypted data, expressed as a base64-encoded value. + Plaintext *string `mandatory:"true" json:"plaintext"` + + // Checksum of the decrypted data. + PlaintextChecksum *string `mandatory:"true" json:"plaintextChecksum"` +} + +func (m DecryptedData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/decrypt_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DecryptRequest wrapper for the Decrypt operation +type DecryptRequest struct { + + // DecryptDataDetails + DecryptDataDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DecryptRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DecryptRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DecryptRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DecryptResponse wrapper for the Decrypt operation +type DecryptResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DecryptedData instance + DecryptedData `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DecryptResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DecryptResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/disable_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/disable_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/disable_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/disable_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DisableKeyRequest wrapper for the DisableKey operation +type DisableKeyRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DisableKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DisableKeyResponse wrapper for the DisableKey operation +type DisableKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Key instance + Key `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DisableKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/enable_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/enable_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/enable_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/enable_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// EnableKeyRequest wrapper for the EnableKey operation +type EnableKeyRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EnableKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// EnableKeyResponse wrapper for the EnableKey operation +type EnableKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Key instance + Key `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response EnableKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_data_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_data_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_data_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_data_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// EncryptDataDetails The representation of EncryptDataDetails +type EncryptDataDetails struct { + + // The OCID of the key to encrypt with. + KeyId *string `mandatory:"true" json:"keyId"` + + // The plaintext data to encrypt. + Plaintext *string `mandatory:"true" json:"plaintext"` + + // Information that can be used to provide an encryption context for the + // encrypted data. The length of the string representation of the associatedData + // must be fewer than 4096 characters. + AssociatedData map[string]string `mandatory:"false" json:"associatedData"` + + // Information that can be used to provide context for audit logging. It is a map that contains any addtional + // data the users may have and will be added to the audit logs (if audit logging is enabled) + LoggingContext map[string]string `mandatory:"false" json:"loggingContext"` +} + +func (m EncryptDataDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypted_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypted_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypted_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypted_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// EncryptedData The representation of EncryptedData +type EncryptedData struct { + + // The encrypted data. + Ciphertext *string `mandatory:"true" json:"ciphertext"` +} + +func (m EncryptedData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/encrypt_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// EncryptRequest wrapper for the Encrypt operation +type EncryptRequest struct { + + // EncryptDataDetails + EncryptDataDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request EncryptRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EncryptRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EncryptRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// EncryptResponse wrapper for the Encrypt operation +type EncryptResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The EncryptedData instance + EncryptedData `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response EncryptResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EncryptResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_data_encryption_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_data_encryption_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_data_encryption_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_data_encryption_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GenerateDataEncryptionKeyRequest wrapper for the GenerateDataEncryptionKey operation +type GenerateDataEncryptionKeyRequest struct { + + // GenerateKeyDetails + GenerateKeyDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateDataEncryptionKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateDataEncryptionKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateDataEncryptionKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GenerateDataEncryptionKeyResponse wrapper for the GenerateDataEncryptionKey operation +type GenerateDataEncryptionKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The GeneratedKey instance + GeneratedKey `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GenerateDataEncryptionKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateDataEncryptionKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generated_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generated_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generated_key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generated_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// GeneratedKey The representation of GeneratedKey +type GeneratedKey struct { + + // The encrypted generated data encryption key. + Ciphertext *string `mandatory:"true" json:"ciphertext"` + + // The plaintext generated data encryption key, a base64-encoded + // sequence of random bytes, which is included if the + // GenerateDataEncryptionKey request includes the "includePlaintextKey" + // parameter and sets its value to 'true'. + Plaintext *string `mandatory:"false" json:"plaintext"` + + // The checksum of the plaintext generated data encryption key, which + // is included if the GenerateDataEncryptionKey request includes the + // "includePlaintextKey parameter and sets its value to 'true'. + PlaintextChecksum *string `mandatory:"false" json:"plaintextChecksum"` +} + +func (m GeneratedKey) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_key_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/generate_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// GenerateKeyDetails The representation of GenerateKeyDetails +type GenerateKeyDetails struct { + + // If true, the generated key is also returned unencrypted. + IncludePlaintextKey *bool `mandatory:"true" json:"includePlaintextKey"` + + // The OCID of the master encryption key to encrypt the generated data encryption key with. + KeyId *string `mandatory:"true" json:"keyId"` + + KeyShape *KeyShape `mandatory:"true" json:"keyShape"` + + // Information that can be used to provide an encryption context for the + // encrypted data. The length of the string representation of the associatedData + // must be fewer than 4096 characters. + AssociatedData map[string]string `mandatory:"false" json:"associatedData"` + + // Information that can be used to provide context for audit logging. It is a map that contains any addtional + // data the users may have and will be added to the audit logs (if audit logging is enabled) + LoggingContext map[string]string `mandatory:"false" json:"loggingContext"` +} + +func (m GenerateKeyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetKeyRequest wrapper for the GetKey operation +type GetKeyRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetKeyResponse wrapper for the GetKey operation +type GetKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Key instance + Key `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_version_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_version_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_version_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_key_version_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetKeyVersionRequest wrapper for the GetKeyVersion operation +type GetKeyVersionRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // The OCID of the key version. + KeyVersionId *string `mandatory:"true" contributesTo:"path" name:"keyVersionId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetKeyVersionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetKeyVersionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetKeyVersionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetKeyVersionResponse wrapper for the GetKeyVersion operation +type GetKeyVersionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The KeyVersion instance + KeyVersion `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetKeyVersionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetKeyVersionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_vault_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_vault_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_vault_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/get_vault_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetVaultRequest wrapper for the GetVault operation +type GetVaultRequest struct { + + // The OCID of the vault. + VaultId *string `mandatory:"true" contributesTo:"path" name:"vaultId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetVaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetVaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetVaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetVaultResponse wrapper for the GetVault operation +type GetVaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Vault instance + Vault `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetVaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetVaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Key The representation of Key +type Key struct { + + // The OCID of the compartment that contains this key. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the KeyVersion resource used in cryptographic operations. During key rotation, service might be in a transitional state + // where this or a newer KeyVersion are used intermittently. The currentKeyVersion field is updated when the service is guaranteed to + // use the new KeyVersion for all subsequent encryption operations. + CurrentKeyVersion *string `mandatory:"true" json:"currentKeyVersion"` + + // A user-friendly name for the key. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the key. + Id *string `mandatory:"true" json:"id"` + + KeyShape *KeyShape `mandatory:"true" json:"keyShape"` + + // The key's current state. + // Example: `ENABLED` + LifecycleState KeyLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the key was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID of the vault that contains this key. + VaultId *string `mandatory:"true" json:"vaultId"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m Key) String() string { + return common.PointerString(m) +} + +// KeyLifecycleStateEnum Enum with underlying type: string +type KeyLifecycleStateEnum string + +// Set of constants representing the allowable values for KeyLifecycleStateEnum +const ( + KeyLifecycleStateCreating KeyLifecycleStateEnum = "CREATING" + KeyLifecycleStateEnabling KeyLifecycleStateEnum = "ENABLING" + KeyLifecycleStateEnabled KeyLifecycleStateEnum = "ENABLED" + KeyLifecycleStateDisabling KeyLifecycleStateEnum = "DISABLING" + KeyLifecycleStateDisabled KeyLifecycleStateEnum = "DISABLED" + KeyLifecycleStateDeleting KeyLifecycleStateEnum = "DELETING" + KeyLifecycleStateDeleted KeyLifecycleStateEnum = "DELETED" + KeyLifecycleStatePendingDeletion KeyLifecycleStateEnum = "PENDING_DELETION" + KeyLifecycleStateSchedulingDeletion KeyLifecycleStateEnum = "SCHEDULING_DELETION" + KeyLifecycleStateCancellingDeletion KeyLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingKeyLifecycleState = map[string]KeyLifecycleStateEnum{ + "CREATING": KeyLifecycleStateCreating, + "ENABLING": KeyLifecycleStateEnabling, + "ENABLED": KeyLifecycleStateEnabled, + "DISABLING": KeyLifecycleStateDisabling, + "DISABLED": KeyLifecycleStateDisabled, + "DELETING": KeyLifecycleStateDeleting, + "DELETED": KeyLifecycleStateDeleted, + "PENDING_DELETION": KeyLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": KeyLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": KeyLifecycleStateCancellingDeletion, +} + +// GetKeyLifecycleStateEnumValues Enumerates the set of values for KeyLifecycleStateEnum +func GetKeyLifecycleStateEnumValues() []KeyLifecycleStateEnum { + values := make([]KeyLifecycleStateEnum, 0) + for _, v := range mappingKeyLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmscrypto_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmscrypto_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmscrypto_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmscrypto_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,180 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//KmsCryptoClient a client for KmsCrypto +type KmsCryptoClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewKmsCryptoClientWithConfigurationProvider Creates a new default KmsCrypto client with the given configuration provider. +// the configuration provider will be used for the default signer +func NewKmsCryptoClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client KmsCryptoClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = KmsCryptoClient{BaseClient: baseClient} + client.BasePath = "20180608" + client.Host = endpoint + err = client.setConfigurationProvider(configProvider) + return +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *KmsCryptoClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *KmsCryptoClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// Decrypt Decrypts data using the given DecryptDataDetails resource. +func (client KmsCryptoClient) Decrypt(ctx context.Context, request DecryptRequest) (response DecryptResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.decrypt, policy) + if err != nil { + if ociResponse != nil { + response = DecryptResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DecryptResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DecryptResponse") + } + return +} + +// decrypt implements the OCIOperation interface (enables retrying operations) +func (client KmsCryptoClient) decrypt(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/decrypt") + if err != nil { + return nil, err + } + + var response DecryptResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// Encrypt Encrypts data using the given EncryptDataDetails resource. +// Plaintext included in the example request is a base64-encoded value +// of a UTF-8 string. +func (client KmsCryptoClient) Encrypt(ctx context.Context, request EncryptRequest) (response EncryptResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.encrypt, policy) + if err != nil { + if ociResponse != nil { + response = EncryptResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(EncryptResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EncryptResponse") + } + return +} + +// encrypt implements the OCIOperation interface (enables retrying operations) +func (client KmsCryptoClient) encrypt(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/encrypt") + if err != nil { + return nil, err + } + + var response EncryptResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GenerateDataEncryptionKey Generates a key that you can use to encrypt or decrypt data. +func (client KmsCryptoClient) GenerateDataEncryptionKey(ctx context.Context, request GenerateDataEncryptionKeyRequest) (response GenerateDataEncryptionKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.generateDataEncryptionKey, policy) + if err != nil { + if ociResponse != nil { + response = GenerateDataEncryptionKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GenerateDataEncryptionKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateDataEncryptionKeyResponse") + } + return +} + +// generateDataEncryptionKey implements the OCIOperation interface (enables retrying operations) +func (client KmsCryptoClient) generateDataEncryptionKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/generateDataEncryptionKey") + if err != nil { + return nil, err + } + + var response GenerateDataEncryptionKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsmanagement_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsmanagement_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsmanagement_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsmanagement_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,455 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//KmsManagementClient a client for KmsManagement +type KmsManagementClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewKmsManagementClientWithConfigurationProvider Creates a new default KmsManagement client with the given configuration provider. +// the configuration provider will be used for the default signer +func NewKmsManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client KmsManagementClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = KmsManagementClient{BaseClient: baseClient} + client.BasePath = "20180608" + client.Host = endpoint + err = client.setConfigurationProvider(configProvider) + return +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *KmsManagementClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *KmsManagementClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateKey Creates a new key. +func (client KmsManagementClient) CreateKey(ctx context.Context, request CreateKeyRequest) (response CreateKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createKey, policy) + if err != nil { + if ociResponse != nil { + response = CreateKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateKeyResponse") + } + return +} + +// createKey implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) createKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/keys") + if err != nil { + return nil, err + } + + var response CreateKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateKeyVersion Generates new cryptographic material for a key. The key must be in an `ENABLED` state to be +// rotated. +func (client KmsManagementClient) CreateKeyVersion(ctx context.Context, request CreateKeyVersionRequest) (response CreateKeyVersionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createKeyVersion, policy) + if err != nil { + if ociResponse != nil { + response = CreateKeyVersionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateKeyVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateKeyVersionResponse") + } + return +} + +// createKeyVersion implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) createKeyVersion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/keys/{keyId}/keyVersions") + if err != nil { + return nil, err + } + + var response CreateKeyVersionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableKey Disables a key to make it unavailable for encryption +// or decryption. +func (client KmsManagementClient) DisableKey(ctx context.Context, request DisableKeyRequest) (response DisableKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.disableKey, policy) + if err != nil { + if ociResponse != nil { + response = DisableKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DisableKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableKeyResponse") + } + return +} + +// disableKey implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) disableKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/keys/{keyId}/actions/disable") + if err != nil { + return nil, err + } + + var response DisableKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// EnableKey Enables a key to make it available for encryption or +// decryption. +func (client KmsManagementClient) EnableKey(ctx context.Context, request EnableKeyRequest) (response EnableKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.enableKey, policy) + if err != nil { + if ociResponse != nil { + response = EnableKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(EnableKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableKeyResponse") + } + return +} + +// enableKey implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) enableKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/keys/{keyId}/actions/enable") + if err != nil { + return nil, err + } + + var response EnableKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetKey Gets information about the specified key. +func (client KmsManagementClient) GetKey(ctx context.Context, request GetKeyRequest) (response GetKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getKey, policy) + if err != nil { + if ociResponse != nil { + response = GetKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetKeyResponse") + } + return +} + +// getKey implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) getKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/keys/{keyId}") + if err != nil { + return nil, err + } + + var response GetKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetKeyVersion Gets information about the specified key version. +func (client KmsManagementClient) GetKeyVersion(ctx context.Context, request GetKeyVersionRequest) (response GetKeyVersionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getKeyVersion, policy) + if err != nil { + if ociResponse != nil { + response = GetKeyVersionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetKeyVersionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetKeyVersionResponse") + } + return +} + +// getKeyVersion implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) getKeyVersion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/keys/{keyId}/keyVersions/{keyVersionId}") + if err != nil { + return nil, err + } + + var response GetKeyVersionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListKeyVersions Lists all key versions for the specified key. +func (client KmsManagementClient) ListKeyVersions(ctx context.Context, request ListKeyVersionsRequest) (response ListKeyVersionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listKeyVersions, policy) + if err != nil { + if ociResponse != nil { + response = ListKeyVersionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListKeyVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListKeyVersionsResponse") + } + return +} + +// listKeyVersions implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) listKeyVersions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/keys/{keyId}/keyVersions") + if err != nil { + return nil, err + } + + var response ListKeyVersionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListKeys Lists the keys in the specified vault and compartment. +func (client KmsManagementClient) ListKeys(ctx context.Context, request ListKeysRequest) (response ListKeysResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listKeys, policy) + if err != nil { + if ociResponse != nil { + response = ListKeysResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListKeysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListKeysResponse") + } + return +} + +// listKeys implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) listKeys(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/keys") + if err != nil { + return nil, err + } + + var response ListKeysResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateKey Updates the properties of a key. Specifically, you can update the +// `displayName`, `freeformTags`, and `definedTags` properties. Furthermore, +// the key must in an `ACTIVE` or `CREATING` state to be updated. +func (client KmsManagementClient) UpdateKey(ctx context.Context, request UpdateKeyRequest) (response UpdateKeyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateKey, policy) + if err != nil { + if ociResponse != nil { + response = UpdateKeyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateKeyResponse") + } + return +} + +// updateKey implements the OCIOperation interface (enables retrying operations) +func (client KmsManagementClient) updateKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/keys/{keyId}") + if err != nil { + return nil, err + } + + var response UpdateKeyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsvault_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsvault_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsvault_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/keymanagement_kmsvault_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,334 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//KmsVaultClient a client for KmsVault +type KmsVaultClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewKmsVaultClientWithConfigurationProvider Creates a new default KmsVault client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewKmsVaultClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client KmsVaultClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = KmsVaultClient{BaseClient: baseClient} + client.BasePath = "20180608" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *KmsVaultClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("kms") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *KmsVaultClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *KmsVaultClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelVaultDeletion Cancels the scheduled deletion of the specified vault. Canceling a scheduled deletion +// restores the vault and all keys in it to the respective states they were in before +// the deletion was scheduled. +func (client KmsVaultClient) CancelVaultDeletion(ctx context.Context, request CancelVaultDeletionRequest) (response CancelVaultDeletionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.cancelVaultDeletion, policy) + if err != nil { + if ociResponse != nil { + response = CancelVaultDeletionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CancelVaultDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelVaultDeletionResponse") + } + return +} + +// cancelVaultDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) cancelVaultDeletion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vaults/{vaultId}/actions/cancelDeletion") + if err != nil { + return nil, err + } + + var response CancelVaultDeletionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateVault Creates a new vault. The type of vault you create determines key +// placement, pricing, and available options. Options include storage +// isolation, a dedicated service endpoint instead of a shared service +// endpoint for API calls, and a dedicated hardware security module (HSM) or a multitenant HSM. +func (client KmsVaultClient) CreateVault(ctx context.Context, request CreateVaultRequest) (response CreateVaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVault, policy) + if err != nil { + if ociResponse != nil { + response = CreateVaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateVaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateVaultResponse") + } + return +} + +// createVault implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) createVault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vaults") + if err != nil { + return nil, err + } + + var response CreateVaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVault Gets the specified vault's configuration information. +func (client KmsVaultClient) GetVault(ctx context.Context, request GetVaultRequest) (response GetVaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getVault, policy) + if err != nil { + if ociResponse != nil { + response = GetVaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetVaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVaultResponse") + } + return +} + +// getVault implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) getVault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vaults/{vaultId}") + if err != nil { + return nil, err + } + + var response GetVaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListVaults Lists the vaults in the specified compartment. +func (client KmsVaultClient) ListVaults(ctx context.Context, request ListVaultsRequest) (response ListVaultsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listVaults, policy) + if err != nil { + if ociResponse != nil { + response = ListVaultsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListVaultsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListVaultsResponse") + } + return +} + +// listVaults implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) listVaults(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vaults") + if err != nil { + return nil, err + } + + var response ListVaultsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ScheduleVaultDeletion Schedules the deletion of the specified vault. This sets the state of the vault and all keys in it +// to `PENDING_DELETION` and then deletes them after the retention period ends. +func (client KmsVaultClient) ScheduleVaultDeletion(ctx context.Context, request ScheduleVaultDeletionRequest) (response ScheduleVaultDeletionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.scheduleVaultDeletion, policy) + if err != nil { + if ociResponse != nil { + response = ScheduleVaultDeletionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ScheduleVaultDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ScheduleVaultDeletionResponse") + } + return +} + +// scheduleVaultDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) scheduleVaultDeletion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vaults/{vaultId}/actions/scheduleDeletion") + if err != nil { + return nil, err + } + + var response ScheduleVaultDeletionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateVault Updates the properties of a vault. Specifically, you can update the +// `displayName`, `freeformTags`, and `definedTags` properties. Furthermore, +// the vault must be in an `ACTIVE` or `CREATING` state to be updated. +func (client KmsVaultClient) UpdateVault(ctx context.Context, request UpdateVaultRequest) (response UpdateVaultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateVault, policy) + if err != nil { + if ociResponse != nil { + response = UpdateVaultResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateVaultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateVaultResponse") + } + return +} + +// updateVault implements the OCIOperation interface (enables retrying operations) +func (client KmsVaultClient) updateVault(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/vaults/{vaultId}") + if err != nil { + return nil, err + } + + var response UpdateVaultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_shape.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_shape.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_shape.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_shape.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KeyShape The cryptographic properties of a key. +type KeyShape struct { + + // The algorithm used by a key's KeyVersions to encrypt or decrypt. + Algorithm KeyShapeAlgorithmEnum `mandatory:"true" json:"algorithm"` + + // The length of the key, expressed as an integer. Values of 16, 24, or 32 are supported. + Length *int `mandatory:"true" json:"length"` +} + +func (m KeyShape) String() string { + return common.PointerString(m) +} + +// KeyShapeAlgorithmEnum Enum with underlying type: string +type KeyShapeAlgorithmEnum string + +// Set of constants representing the allowable values for KeyShapeAlgorithmEnum +const ( + KeyShapeAlgorithmAes KeyShapeAlgorithmEnum = "AES" +) + +var mappingKeyShapeAlgorithm = map[string]KeyShapeAlgorithmEnum{ + "AES": KeyShapeAlgorithmAes, +} + +// GetKeyShapeAlgorithmEnumValues Enumerates the set of values for KeyShapeAlgorithmEnum +func GetKeyShapeAlgorithmEnumValues() []KeyShapeAlgorithmEnum { + values := make([]KeyShapeAlgorithmEnum, 0) + for _, v := range mappingKeyShapeAlgorithm { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KeySummary The representation of KeySummary +type KeySummary struct { + + // The OCID of the compartment that contains the key. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name for the key. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the key. + Id *string `mandatory:"true" json:"id"` + + // The key's current state. + // Example: `ENABLED` + LifecycleState KeySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the key was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID of the vault that contains the key. + VaultId *string `mandatory:"true" json:"vaultId"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m KeySummary) String() string { + return common.PointerString(m) +} + +// KeySummaryLifecycleStateEnum Enum with underlying type: string +type KeySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for KeySummaryLifecycleStateEnum +const ( + KeySummaryLifecycleStateCreating KeySummaryLifecycleStateEnum = "CREATING" + KeySummaryLifecycleStateEnabling KeySummaryLifecycleStateEnum = "ENABLING" + KeySummaryLifecycleStateEnabled KeySummaryLifecycleStateEnum = "ENABLED" + KeySummaryLifecycleStateDisabling KeySummaryLifecycleStateEnum = "DISABLING" + KeySummaryLifecycleStateDisabled KeySummaryLifecycleStateEnum = "DISABLED" + KeySummaryLifecycleStateDeleting KeySummaryLifecycleStateEnum = "DELETING" + KeySummaryLifecycleStateDeleted KeySummaryLifecycleStateEnum = "DELETED" + KeySummaryLifecycleStatePendingDeletion KeySummaryLifecycleStateEnum = "PENDING_DELETION" + KeySummaryLifecycleStateSchedulingDeletion KeySummaryLifecycleStateEnum = "SCHEDULING_DELETION" + KeySummaryLifecycleStateCancellingDeletion KeySummaryLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingKeySummaryLifecycleState = map[string]KeySummaryLifecycleStateEnum{ + "CREATING": KeySummaryLifecycleStateCreating, + "ENABLING": KeySummaryLifecycleStateEnabling, + "ENABLED": KeySummaryLifecycleStateEnabled, + "DISABLING": KeySummaryLifecycleStateDisabling, + "DISABLED": KeySummaryLifecycleStateDisabled, + "DELETING": KeySummaryLifecycleStateDeleting, + "DELETED": KeySummaryLifecycleStateDeleted, + "PENDING_DELETION": KeySummaryLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": KeySummaryLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": KeySummaryLifecycleStateCancellingDeletion, +} + +// GetKeySummaryLifecycleStateEnumValues Enumerates the set of values for KeySummaryLifecycleStateEnum +func GetKeySummaryLifecycleStateEnumValues() []KeySummaryLifecycleStateEnum { + values := make([]KeySummaryLifecycleStateEnum, 0) + for _, v := range mappingKeySummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KeyVersion The representation of KeyVersion +type KeyVersion struct { + + // The OCID of the compartment that contains this key version. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the key version. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the key associated with this key version. + KeyId *string `mandatory:"true" json:"keyId"` + + // The date and time this key version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: "2018-04-03T21:10:29.600Z" + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID of the vault that contains this key version. + VaultId *string `mandatory:"true" json:"vaultId"` +} + +func (m KeyVersion) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/key_version_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// KeyVersionSummary The representation of KeyVersionSummary +type KeyVersionSummary struct { + + // The OCID of the compartment that contains this key version. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the key version. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the key associated with this key version. + KeyId *string `mandatory:"true" json:"keyId"` + + // The date and time this key version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID of the vault that contains this key version. + VaultId *string `mandatory:"true" json:"vaultId"` +} + +func (m KeyVersionSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_keys_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_keys_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_keys_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_keys_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListKeysRequest wrapper for the ListKeys operation +type ListKeysRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for TIMECREATED is descending. The default order for DISPLAYNAME + // is ascending. + SortBy ListKeysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListKeysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListKeysRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListKeysRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListKeysRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListKeysResponse wrapper for the ListKeys operation +type ListKeysResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []KeySummary instances + Items []KeySummary `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListKeysResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListKeysResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListKeysSortByEnum Enum with underlying type: string +type ListKeysSortByEnum string + +// Set of constants representing the allowable values for ListKeysSortByEnum +const ( + ListKeysSortByTimecreated ListKeysSortByEnum = "TIMECREATED" + ListKeysSortByDisplayname ListKeysSortByEnum = "DISPLAYNAME" +) + +var mappingListKeysSortBy = map[string]ListKeysSortByEnum{ + "TIMECREATED": ListKeysSortByTimecreated, + "DISPLAYNAME": ListKeysSortByDisplayname, +} + +// GetListKeysSortByEnumValues Enumerates the set of values for ListKeysSortByEnum +func GetListKeysSortByEnumValues() []ListKeysSortByEnum { + values := make([]ListKeysSortByEnum, 0) + for _, v := range mappingListKeysSortBy { + values = append(values, v) + } + return values +} + +// ListKeysSortOrderEnum Enum with underlying type: string +type ListKeysSortOrderEnum string + +// Set of constants representing the allowable values for ListKeysSortOrderEnum +const ( + ListKeysSortOrderAsc ListKeysSortOrderEnum = "ASC" + ListKeysSortOrderDesc ListKeysSortOrderEnum = "DESC" +) + +var mappingListKeysSortOrder = map[string]ListKeysSortOrderEnum{ + "ASC": ListKeysSortOrderAsc, + "DESC": ListKeysSortOrderDesc, +} + +// GetListKeysSortOrderEnumValues Enumerates the set of values for ListKeysSortOrderEnum +func GetListKeysSortOrderEnumValues() []ListKeysSortOrderEnum { + values := make([]ListKeysSortOrderEnum, 0) + for _, v := range mappingListKeysSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_key_versions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_key_versions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_key_versions_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_key_versions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListKeyVersionsRequest wrapper for the ListKeyVersions operation +type ListKeyVersionsRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for TIMECREATED is descending. The default order for DISPLAYNAME + // is ascending. + SortBy ListKeyVersionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListKeyVersionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListKeyVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListKeyVersionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListKeyVersionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListKeyVersionsResponse wrapper for the ListKeyVersions operation +type ListKeyVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []KeyVersionSummary instances + Items []KeyVersionSummary `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListKeyVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListKeyVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListKeyVersionsSortByEnum Enum with underlying type: string +type ListKeyVersionsSortByEnum string + +// Set of constants representing the allowable values for ListKeyVersionsSortByEnum +const ( + ListKeyVersionsSortByTimecreated ListKeyVersionsSortByEnum = "TIMECREATED" + ListKeyVersionsSortByDisplayname ListKeyVersionsSortByEnum = "DISPLAYNAME" +) + +var mappingListKeyVersionsSortBy = map[string]ListKeyVersionsSortByEnum{ + "TIMECREATED": ListKeyVersionsSortByTimecreated, + "DISPLAYNAME": ListKeyVersionsSortByDisplayname, +} + +// GetListKeyVersionsSortByEnumValues Enumerates the set of values for ListKeyVersionsSortByEnum +func GetListKeyVersionsSortByEnumValues() []ListKeyVersionsSortByEnum { + values := make([]ListKeyVersionsSortByEnum, 0) + for _, v := range mappingListKeyVersionsSortBy { + values = append(values, v) + } + return values +} + +// ListKeyVersionsSortOrderEnum Enum with underlying type: string +type ListKeyVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListKeyVersionsSortOrderEnum +const ( + ListKeyVersionsSortOrderAsc ListKeyVersionsSortOrderEnum = "ASC" + ListKeyVersionsSortOrderDesc ListKeyVersionsSortOrderEnum = "DESC" +) + +var mappingListKeyVersionsSortOrder = map[string]ListKeyVersionsSortOrderEnum{ + "ASC": ListKeyVersionsSortOrderAsc, + "DESC": ListKeyVersionsSortOrderDesc, +} + +// GetListKeyVersionsSortOrderEnumValues Enumerates the set of values for ListKeyVersionsSortOrderEnum +func GetListKeyVersionsSortOrderEnumValues() []ListKeyVersionsSortOrderEnum { + values := make([]ListKeyVersionsSortOrderEnum, 0) + for _, v := range mappingListKeyVersionsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_vaults_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_vaults_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_vaults_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/list_vaults_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListVaultsRequest wrapper for the ListVaults operation +type ListVaultsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for TIMECREATED is descending. The default order for DISPLAYNAME + // is ascending. + SortBy ListVaultsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListVaultsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListVaultsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListVaultsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListVaultsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListVaultsResponse wrapper for the ListVaults operation +type ListVaultsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []VaultSummary instances + Items []VaultSummary `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListVaultsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListVaultsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListVaultsSortByEnum Enum with underlying type: string +type ListVaultsSortByEnum string + +// Set of constants representing the allowable values for ListVaultsSortByEnum +const ( + ListVaultsSortByTimecreated ListVaultsSortByEnum = "TIMECREATED" + ListVaultsSortByDisplayname ListVaultsSortByEnum = "DISPLAYNAME" +) + +var mappingListVaultsSortBy = map[string]ListVaultsSortByEnum{ + "TIMECREATED": ListVaultsSortByTimecreated, + "DISPLAYNAME": ListVaultsSortByDisplayname, +} + +// GetListVaultsSortByEnumValues Enumerates the set of values for ListVaultsSortByEnum +func GetListVaultsSortByEnumValues() []ListVaultsSortByEnum { + values := make([]ListVaultsSortByEnum, 0) + for _, v := range mappingListVaultsSortBy { + values = append(values, v) + } + return values +} + +// ListVaultsSortOrderEnum Enum with underlying type: string +type ListVaultsSortOrderEnum string + +// Set of constants representing the allowable values for ListVaultsSortOrderEnum +const ( + ListVaultsSortOrderAsc ListVaultsSortOrderEnum = "ASC" + ListVaultsSortOrderDesc ListVaultsSortOrderEnum = "DESC" +) + +var mappingListVaultsSortOrder = map[string]ListVaultsSortOrderEnum{ + "ASC": ListVaultsSortOrderAsc, + "DESC": ListVaultsSortOrderDesc, +} + +// GetListVaultsSortOrderEnumValues Enumerates the set of values for ListVaultsSortOrderEnum +func GetListVaultsSortOrderEnumValues() []ListVaultsSortOrderEnum { + values := make([]ListVaultsSortOrderEnum, 0) + for _, v := range mappingListVaultsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ScheduleVaultDeletionDetails Details for scheduling vault deletion +type ScheduleVaultDeletionDetails struct { + + // An optional property to indicate the deletion time of the vault, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. The specified time must be between 7 and 30 days from the time + // when the request is received. If this property is missing, it will be set to 30 days from the time of the request by default. + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` +} + +func (m ScheduleVaultDeletionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/schedule_vault_deletion_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ScheduleVaultDeletionRequest wrapper for the ScheduleVaultDeletion operation +type ScheduleVaultDeletionRequest struct { + + // The OCID of the vault. + VaultId *string `mandatory:"true" contributesTo:"path" name:"vaultId"` + + // ScheduleVaultDeletionDetails + ScheduleVaultDeletionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ScheduleVaultDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScheduleVaultDeletionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScheduleVaultDeletionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ScheduleVaultDeletionResponse wrapper for the ScheduleVaultDeletion operation +type ScheduleVaultDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Vault instance + Vault `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ScheduleVaultDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScheduleVaultDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateKeyDetails The representation of UpdateKeyDetails +type UpdateKeyDetails struct { + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the key. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateKeyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_key_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateKeyRequest wrapper for the UpdateKey operation +type UpdateKeyRequest struct { + + // The OCID of the key. + KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + + // UpdateKeyDetails + UpdateKeyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateKeyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateKeyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateKeyResponse wrapper for the UpdateKey operation +type UpdateKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Key instance + Key `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateVaultDetails The representation of UpdateVaultDetails +type UpdateVaultDetails struct { + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the vault. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateVaultDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/update_vault_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateVaultRequest wrapper for the UpdateVault operation +type UpdateVaultRequest struct { + + // The OCID of the vault. + VaultId *string `mandatory:"true" contributesTo:"path" name:"vaultId"` + + // UpdateVaultDetails + UpdateVaultDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateVaultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateVaultRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateVaultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateVaultResponse wrapper for the UpdateVault operation +type UpdateVaultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Vault instance + Vault `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateVaultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateVaultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Vault The representation of Vault +type Vault struct { + + // The OCID of the compartment that contains this vault. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. + CryptoEndpoint *string `mandatory:"true" json:"cryptoEndpoint"` + + // A user-friendly name for the vault. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the vault. + Id *string `mandatory:"true" json:"id"` + + // The vault's current state. + // Example: `DELETED` + LifecycleState VaultLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. + ManagementEndpoint *string `mandatory:"true" json:"managementEndpoint"` + + // The date and time this vault was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The type of vault. Each type of vault stores the key with different degrees of isolation and has different options and pricing. + VaultType VaultVaultTypeEnum `mandatory:"true" json:"vaultType"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // An optional property for the deletion time of the vault, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` +} + +func (m Vault) String() string { + return common.PointerString(m) +} + +// VaultLifecycleStateEnum Enum with underlying type: string +type VaultLifecycleStateEnum string + +// Set of constants representing the allowable values for VaultLifecycleStateEnum +const ( + VaultLifecycleStateCreating VaultLifecycleStateEnum = "CREATING" + VaultLifecycleStateActive VaultLifecycleStateEnum = "ACTIVE" + VaultLifecycleStateDeleting VaultLifecycleStateEnum = "DELETING" + VaultLifecycleStateDeleted VaultLifecycleStateEnum = "DELETED" + VaultLifecycleStatePendingDeletion VaultLifecycleStateEnum = "PENDING_DELETION" + VaultLifecycleStateSchedulingDeletion VaultLifecycleStateEnum = "SCHEDULING_DELETION" + VaultLifecycleStateCancellingDeletion VaultLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingVaultLifecycleState = map[string]VaultLifecycleStateEnum{ + "CREATING": VaultLifecycleStateCreating, + "ACTIVE": VaultLifecycleStateActive, + "DELETING": VaultLifecycleStateDeleting, + "DELETED": VaultLifecycleStateDeleted, + "PENDING_DELETION": VaultLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": VaultLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": VaultLifecycleStateCancellingDeletion, +} + +// GetVaultLifecycleStateEnumValues Enumerates the set of values for VaultLifecycleStateEnum +func GetVaultLifecycleStateEnumValues() []VaultLifecycleStateEnum { + values := make([]VaultLifecycleStateEnum, 0) + for _, v := range mappingVaultLifecycleState { + values = append(values, v) + } + return values +} + +// VaultVaultTypeEnum Enum with underlying type: string +type VaultVaultTypeEnum string + +// Set of constants representing the allowable values for VaultVaultTypeEnum +const ( + VaultVaultTypePrivate VaultVaultTypeEnum = "VIRTUAL_PRIVATE" +) + +var mappingVaultVaultType = map[string]VaultVaultTypeEnum{ + "VIRTUAL_PRIVATE": VaultVaultTypePrivate, +} + +// GetVaultVaultTypeEnumValues Enumerates the set of values for VaultVaultTypeEnum +func GetVaultVaultTypeEnumValues() []VaultVaultTypeEnum { + values := make([]VaultVaultTypeEnum, 0) + for _, v := range mappingVaultVaultType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/keymanagement/vault_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Key Management Service API +// +// API for managing and performing operations with keys and vaults. +// + +package keymanagement + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// VaultSummary The representation of VaultSummary +type VaultSummary struct { + + // The OCID of the compartment that contains a particular vault. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. + CryptoEndpoint *string `mandatory:"true" json:"cryptoEndpoint"` + + // A user-friendly name for a vault. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of a vault. + Id *string `mandatory:"true" json:"id"` + + // A vault's current state. + // Example: `ACTIVE` + LifecycleState VaultSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. + ManagementEndpoint *string `mandatory:"true" json:"managementEndpoint"` + + // The date and time a vault was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The type of vault. Each type of vault stores keys with different degrees of isolation and has different options and pricing. + VaultType VaultSummaryVaultTypeEnum `mandatory:"true" json:"vaultType"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. + // Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m VaultSummary) String() string { + return common.PointerString(m) +} + +// VaultSummaryLifecycleStateEnum Enum with underlying type: string +type VaultSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for VaultSummaryLifecycleStateEnum +const ( + VaultSummaryLifecycleStateCreating VaultSummaryLifecycleStateEnum = "CREATING" + VaultSummaryLifecycleStateActive VaultSummaryLifecycleStateEnum = "ACTIVE" + VaultSummaryLifecycleStateDeleting VaultSummaryLifecycleStateEnum = "DELETING" + VaultSummaryLifecycleStateDeleted VaultSummaryLifecycleStateEnum = "DELETED" + VaultSummaryLifecycleStatePendingDeletion VaultSummaryLifecycleStateEnum = "PENDING_DELETION" + VaultSummaryLifecycleStateSchedulingDeletion VaultSummaryLifecycleStateEnum = "SCHEDULING_DELETION" + VaultSummaryLifecycleStateCancellingDeletion VaultSummaryLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingVaultSummaryLifecycleState = map[string]VaultSummaryLifecycleStateEnum{ + "CREATING": VaultSummaryLifecycleStateCreating, + "ACTIVE": VaultSummaryLifecycleStateActive, + "DELETING": VaultSummaryLifecycleStateDeleting, + "DELETED": VaultSummaryLifecycleStateDeleted, + "PENDING_DELETION": VaultSummaryLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": VaultSummaryLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": VaultSummaryLifecycleStateCancellingDeletion, +} + +// GetVaultSummaryLifecycleStateEnumValues Enumerates the set of values for VaultSummaryLifecycleStateEnum +func GetVaultSummaryLifecycleStateEnumValues() []VaultSummaryLifecycleStateEnum { + values := make([]VaultSummaryLifecycleStateEnum, 0) + for _, v := range mappingVaultSummaryLifecycleState { + values = append(values, v) + } + return values +} + +// VaultSummaryVaultTypeEnum Enum with underlying type: string +type VaultSummaryVaultTypeEnum string + +// Set of constants representing the allowable values for VaultSummaryVaultTypeEnum +const ( + VaultSummaryVaultTypePrivate VaultSummaryVaultTypeEnum = "VIRTUAL_PRIVATE" +) + +var mappingVaultSummaryVaultType = map[string]VaultSummaryVaultTypeEnum{ + "VIRTUAL_PRIVATE": VaultSummaryVaultTypePrivate, +} + +// GetVaultSummaryVaultTypeEnumValues Enumerates the set of values for VaultSummaryVaultTypeEnum +func GetVaultSummaryVaultTypeEnumValues() []VaultSummaryVaultTypeEnum { + values := make([]VaultSummaryVaultTypeEnum, 0) + for _, v := range mappingVaultSummaryVaultType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/LICENSE.txt juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/LICENSE.txt --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/LICENSE.txt 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/LICENSE.txt 2019-06-28 17:13:01.000000000 +0000 @@ -1,6 +1,6 @@ Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. -This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0.  See below for license terms.  You may choose either license, or both. +This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 or Apache License 2.0. See below for license terms. You may choose either license.  ____________________________ The Universal Permissive License (UPL), Version 1.0 Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. @@ -27,7 +27,7 @@ Version 2.0, January 2004 -http://www.apache.org/licenses/ +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. @@ -46,9 +46,9 @@ You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. -You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_request_header_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_request_header_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_request_header_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_request_header_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AddHttpRequestHeaderRule An object that represents the action of adding a header to a request. +// This rule applies only to HTTP listeners. +// **NOTES:** +// * If a matching header already exists in the request, the system removes all of its occurrences, and then adds the +// new header. +// * The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore +// or dash characters to uniquely distinguish header names. +type AddHttpRequestHeaderRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` + + // A header value that conforms to RFC 7230. + // Example: `example_value` + Value *string `mandatory:"true" json:"value"` +} + +func (m AddHttpRequestHeaderRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m AddHttpRequestHeaderRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAddHttpRequestHeaderRule AddHttpRequestHeaderRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeAddHttpRequestHeaderRule + }{ + "ADD_HTTP_REQUEST_HEADER", + (MarshalTypeAddHttpRequestHeaderRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_response_header_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_response_header_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_response_header_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/add_http_response_header_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// AddHttpResponseHeaderRule An object that represents the action of adding a header to a response. +// This rule applies only to HTTP listeners. +// **NOTES:** +// * If a matching header already exists in the response, the system removes all of its occurrences, and then adds the +// new header. +// * The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore +// or dash characters to uniquely distinguish header names. +type AddHttpResponseHeaderRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` + + // A header value that conforms to RFC 7230. + // Example: `example_value` + Value *string `mandatory:"true" json:"value"` +} + +func (m AddHttpResponseHeaderRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m AddHttpResponseHeaderRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAddHttpResponseHeaderRule AddHttpResponseHeaderRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeAddHttpResponseHeaderRule + }{ + "ADD_HTTP_RESPONSE_HEADER", + (MarshalTypeAddHttpResponseHeaderRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -16,35 +17,35 @@ type BackendDetails struct { // The IP address of the backend server. - // Example: `10.10.10.4` + // Example: `10.0.0.3` IpAddress *string `mandatory:"true" json:"ipAddress"` // The communication port for the backend server. // Example: `8080` Port *int `mandatory:"true" json:"port"` + // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + // as a server weighted '1'. + // For more information on load balancing policies, see + // How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // Example: `3` + Weight *int `mandatory:"false" json:"weight"` + // Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress // traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. - // Example: `true` + // Example: `false` Backup *bool `mandatory:"false" json:"backup"` // Whether the load balancer should drain this server. Servers marked "drain" receive no new // incoming traffic. - // Example: `true` + // Example: `false` Drain *bool `mandatory:"false" json:"drain"` // Whether the load balancer should treat this server as offline. Offline servers receive no incoming // traffic. - // Example: `true` + // Example: `false` Offline *bool `mandatory:"false" json:"offline"` - - // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger - // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections - // as a server weighted '1'. - // For more information on load balancing policies, see - // How Load Balancing Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). - // Example: `3` - Weight *int `mandatory:"false" json:"weight"` } func (m BackendDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,31 +14,16 @@ ) // Backend The configuration of a backend server that is a member of a load balancer backend set. -// For more information, see Managing Backend Servers (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingbackendservers.htm). +// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendservers.htm). type Backend struct { - // Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress - // traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. - // Example: `true` - Backup *bool `mandatory:"true" json:"backup"` - - // Whether the load balancer should drain this server. Servers marked "drain" receive no new - // incoming traffic. - // Example: `true` - Drain *bool `mandatory:"true" json:"drain"` - - // The IP address of the backend server. - // Example: `10.10.10.4` - IpAddress *string `mandatory:"true" json:"ipAddress"` - // A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. - // Example: `10.10.10.4:8080` + // Example: `10.0.0.3:8080` Name *string `mandatory:"true" json:"name"` - // Whether the load balancer should treat this server as offline. Offline servers receive no incoming - // traffic. - // Example: `true` - Offline *bool `mandatory:"true" json:"offline"` + // The IP address of the backend server. + // Example: `10.0.0.3` + IpAddress *string `mandatory:"true" json:"ipAddress"` // The communication port for the backend server. // Example: `8080` @@ -47,9 +33,24 @@ // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections // as a server weighted '1'. // For more information on load balancing policies, see - // How Load Balancing Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + // How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). // Example: `3` Weight *int `mandatory:"true" json:"weight"` + + // Whether the load balancer should drain this server. Servers marked "drain" receive no new + // incoming traffic. + // Example: `false` + Drain *bool `mandatory:"true" json:"drain"` + + // Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress + // traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. + // Example: `false` + Backup *bool `mandatory:"true" json:"backup"` + + // Whether the load balancer should treat this server as offline. Offline servers receive no incoming + // traffic. + // Example: `false` + Offline *bool `mandatory:"true" json:"offline"` } func (m Backend) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_health.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_health.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_health.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_health.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,15 +16,15 @@ // BackendHealth The health status of the specified backend server as reported by the primary and standby load balancers. type BackendHealth struct { - // A list of the most recent health check results returned for the specified backend server. - HealthCheckResults []HealthCheckResult `mandatory:"true" json:"healthCheckResults"` - // The general health status of the specified backend server as reported by the primary and standby load balancers. // * **OK:** Both health checks returned `OK`. // * **WARNING:** One health check returned `OK` and one did not. // * **CRITICAL:** Neither health check returned `OK`. // * **UNKNOWN:** One or both health checks returned `UNKNOWN`, or the system was unable to retrieve metrics at this time. Status BackendHealthStatusEnum `mandatory:"true" json:"status"` + + // A list of the most recent health check results returned for the specified backend server. + HealthCheckResults []HealthCheckResult `mandatory:"true" json:"healthCheckResults"` } func (m BackendHealth) String() string { @@ -33,7 +34,7 @@ // BackendHealthStatusEnum Enum with underlying type: string type BackendHealthStatusEnum string -// Set of constants representing the allowable values for BackendHealthStatus +// Set of constants representing the allowable values for BackendHealthStatusEnum const ( BackendHealthStatusOk BackendHealthStatusEnum = "OK" BackendHealthStatusWarning BackendHealthStatusEnum = "WARNING" @@ -48,7 +49,7 @@ "UNKNOWN": BackendHealthStatusUnknown, } -// GetBackendHealthStatusEnumValues Enumerates the set of values for BackendHealthStatus +// GetBackendHealthStatusEnumValues Enumerates the set of values for BackendHealthStatusEnum func GetBackendHealthStatusEnumValues() []BackendHealthStatusEnum { values := make([]BackendHealthStatusEnum, 0) for _, v := range mappingBackendHealthStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,20 +15,21 @@ // BackendSetDetails The configuration details for a load balancer backend set. // For more information on backend set configuration, see -// Managing Backend Sets (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). type BackendSetDetails struct { - HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` // The load balancer policy for the backend set. To get a list of available policies, use the // ListPolicies operation. // Example: `LEAST_CONNECTIONS` Policy *string `mandatory:"true" json:"policy"` - Backends []BackendDetails `mandatory:"false" json:"backends"` + HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` - SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` + Backends []BackendDetails `mandatory:"false" json:"backends"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` } func (m BackendSetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,16 +15,14 @@ // BackendSet The configuration of a load balancer backend set. // For more information on backend set configuration, see -// Managing Backend Sets (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type BackendSet struct { - Backends []Backend `mandatory:"true" json:"backends"` - - HealthChecker *HealthChecker `mandatory:"true" json:"healthChecker"` // A friendly name for the backend set. It must be unique and it cannot be changed. // Valid backend set names include only alphanumeric characters, dashes, and underscores. Backend set names cannot // contain spaces. Avoid entering confidential information. - // Example: `My_backend_set` + // Example: `example_backend_set` Name *string `mandatory:"true" json:"name"` // The load balancer policy for the backend set. To get a list of available policies, use the @@ -31,9 +30,13 @@ // Example: `LEAST_CONNECTIONS` Policy *string `mandatory:"true" json:"policy"` - SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` + Backends []Backend `mandatory:"true" json:"backends"` + + HealthChecker *HealthChecker `mandatory:"true" json:"healthChecker"` SslConfiguration *SslConfiguration `mandatory:"false" json:"sslConfiguration"` + + SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` } func (m BackendSet) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_health.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_health.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_health.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/backend_set_health.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -17,11 +18,6 @@ // `totalBackendCount` sum. type BackendSetHealth struct { - // A list of backend servers that are currently in the `CRITICAL` health state. The list identifies each backend server by - // IP address and port. - // Example: `1.1.1.1:80` - CriticalStateBackendNames []string `mandatory:"true" json:"criticalStateBackendNames"` - // Overall health status of the backend set. // * **OK:** All backend servers in the backend set return a status of `OK`. // * **WARNING:** Half or more of the backend set's backend servers return a status of `OK` and at least one backend @@ -31,19 +27,24 @@ // unable to retrieve metrics, or the backend set does not have a listener attached. Status BackendSetHealthStatusEnum `mandatory:"true" json:"status"` - // The total number of backend servers in this backend set. - // Example: `5` - TotalBackendCount *int `mandatory:"true" json:"totalBackendCount"` + // A list of backend servers that are currently in the `WARNING` health state. The list identifies each backend server by + // IP address and port. + // Example: `10.0.0.3:8080` + WarningStateBackendNames []string `mandatory:"true" json:"warningStateBackendNames"` + + // A list of backend servers that are currently in the `CRITICAL` health state. The list identifies each backend server by + // IP address and port. + // Example: `10.0.0.4:8080` + CriticalStateBackendNames []string `mandatory:"true" json:"criticalStateBackendNames"` // A list of backend servers that are currently in the `UNKNOWN` health state. The list identifies each backend server by // IP address and port. - // Example: `1.1.1.5:80` + // Example: `10.0.0.5:8080` UnknownStateBackendNames []string `mandatory:"true" json:"unknownStateBackendNames"` - // A list of backend servers that are currently in the `WARNING` health state. The list identifies each backend server by - // IP address and port. - // Example: `1.1.1.7:42` - WarningStateBackendNames []string `mandatory:"true" json:"warningStateBackendNames"` + // The total number of backend servers in this backend set. + // Example: `7` + TotalBackendCount *int `mandatory:"true" json:"totalBackendCount"` } func (m BackendSetHealth) String() string { @@ -53,7 +54,7 @@ // BackendSetHealthStatusEnum Enum with underlying type: string type BackendSetHealthStatusEnum string -// Set of constants representing the allowable values for BackendSetHealthStatus +// Set of constants representing the allowable values for BackendSetHealthStatusEnum const ( BackendSetHealthStatusOk BackendSetHealthStatusEnum = "OK" BackendSetHealthStatusWarning BackendSetHealthStatusEnum = "WARNING" @@ -68,7 +69,7 @@ "UNKNOWN": BackendSetHealthStatusUnknown, } -// GetBackendSetHealthStatusEnumValues Enumerates the set of values for BackendSetHealthStatus +// GetBackendSetHealthStatusEnumValues Enumerates the set of values for BackendSetHealthStatusEnum func GetBackendSetHealthStatusEnumValues() []BackendSetHealthStatusEnum { values := make([]BackendSetHealthStatusEnum, 0) for _, v := range mappingBackendSetHealthStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -12,30 +13,19 @@ "github.com/oracle/oci-go-sdk/common" ) -// CertificateDetails The configuration details for a listener certificate bundle. +// CertificateDetails The configuration details for a certificate bundle. // For more information on SSL certficate configuration, see -// Managing SSL Certificates (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). +// Managing SSL Certificates (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingcertificates.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CertificateDetails struct { // A friendly name for the certificate bundle. It must be unique and it cannot be changed. // Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. // Certificate bundle names cannot contain spaces. Avoid entering confidential information. - // Example: `My_certificate_bundle` + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" json:"certificateName"` - // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. - // Example: - // -----BEGIN CERTIFICATE----- - // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix - // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD - // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y - // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy - // ... - // -----END CERTIFICATE----- - CaCertificate *string `mandatory:"false" json:"caCertificate"` - // A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. - // Example: `Mysecretunlockingcode42!1!` Passphrase *string `mandatory:"false" json:"passphrase"` // The SSL private key for your certificate, in PEM format. @@ -59,6 +49,17 @@ // ... // -----END CERTIFICATE----- PublicCertificate *string `mandatory:"false" json:"publicCertificate"` + + // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + // Example: + // -----BEGIN CERTIFICATE----- + // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + // ... + // -----END CERTIFICATE----- + CaCertificate *string `mandatory:"false" json:"caCertificate"` } func (m CertificateDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/certificate.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -12,26 +13,16 @@ "github.com/oracle/oci-go-sdk/common" ) -// Certificate The configuration details of a listener certificate bundle. +// Certificate The configuration details of a certificate bundle. // For more information on SSL certficate configuration, see -// Managing SSL Certificates (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). +// Managing SSL Certificates (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingcertificates.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type Certificate struct { - // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. - // Example: - // -----BEGIN CERTIFICATE----- - // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix - // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD - // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y - // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy - // ... - // -----END CERTIFICATE----- - CaCertificate *string `mandatory:"true" json:"caCertificate"` - // A friendly name for the certificate bundle. It must be unique and it cannot be changed. // Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. // Certificate bundle names cannot contain spaces. Avoid entering confidential information. - // Example: `My_certificate_bundle` + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" json:"certificateName"` // The public certificate, in PEM format, that you received from your SSL certificate provider. @@ -44,6 +35,17 @@ // ... // -----END CERTIFICATE----- PublicCertificate *string `mandatory:"true" json:"publicCertificate"` + + // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + // Example: + // -----BEGIN CERTIFICATE----- + // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + // ... + // -----END CERTIFICATE----- + CaCertificate *string `mandatory:"true" json:"caCertificate"` } func (m Certificate) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/connection_configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/connection_configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/connection_configuration.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/connection_configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -18,26 +19,9 @@ // The maximum idle time, in seconds, allowed between two successive receive or two successive send operations // between the client and backend servers. A send operation does not reset the timer for receive operations. A // receive operation does not reset the timer for send operations. - // The default values are: - // * 300 seconds for TCP - // * 60 seconds for HTTP and WebSocket protocols. - // Note: The protocol is set at the listener. - // Modify this parameter if the client or backend server stops transmitting data for more than the default time. - // Some examples include: - // * The client sends a database query to the backend server and the database takes over 300 seconds to execute. - // Therefore, the backend server does not transmit any data within 300 seconds. - // * The client uploads data using the HTTP protocol. During the upload, the backend does not transmit any data - // to the client for more than 60 seconds. - // * The client downloads data using the HTTP protocol. After the initial request, it stops transmitting data to - // the backend server for more than 60 seconds. - // * The client starts transmitting data after establishing a WebSocket connection, but the backend server does - // not transmit data for more than 60 seconds. - // * The backend server starts transmitting data after establishing a WebSocket connection, but the client does - // not transmit data for more than 60 seconds. - // The maximum value is 7200 seconds. Contact My Oracle Support to file a service request if you want to increase - // this limit for your tenancy. For more information, see Service Limits (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/servicelimits.htm). + // For more information, see Connection Configuration (https://docs.cloud.oracle.com/Content/Balance/Reference/connectionreuse.htm#ConnectionConfiguration). // Example: `1200` - IdleTimeout *int `mandatory:"true" json:"idleTimeout"` + IdleTimeout *int64 `mandatory:"true" json:"idleTimeout"` } func (m ConnectionConfiguration) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,39 +15,39 @@ // CreateBackendDetails The configuration details for creating a backend server in a backend set. // For more information on backend server configuration, see -// Managing Backend Servers (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendservers.htm). +// Managing Backend Servers (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendservers.htm). type CreateBackendDetails struct { // The IP address of the backend server. - // Example: `10.10.10.4` + // Example: `10.0.0.3` IpAddress *string `mandatory:"true" json:"ipAddress"` // The communication port for the backend server. // Example: `8080` Port *int `mandatory:"true" json:"port"` + // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + // as a server weighted '1'. + // For more information on load balancing policies, see + // How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // Example: `3` + Weight *int `mandatory:"false" json:"weight"` + // Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress // traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. - // Example: `true` + // Example: `false` Backup *bool `mandatory:"false" json:"backup"` // Whether the load balancer should drain this server. Servers marked "drain" receive no new // incoming traffic. - // Example: `true` + // Example: `false` Drain *bool `mandatory:"false" json:"drain"` // Whether the load balancer should treat this server as offline. Offline servers receive no incoming // traffic. - // Example: `true` + // Example: `false` Offline *bool `mandatory:"false" json:"offline"` - - // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger - // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections - // as a server weighted '1'. - // For more information on load balancing policies, see - // How Load Balancing Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). - // Example: `3` - Weight *int `mandatory:"false" json:"weight"` } func (m CreateBackendDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,11 +14,11 @@ // The details to add a backend server to a backend set. CreateBackendDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set to add the backend server to. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -31,26 +31,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateBackendRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateBackendRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBackendRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateBackendResponse wrapper for the CreateBackend operation type CreateBackendResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateBackendResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateBackendResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,14 +15,14 @@ // CreateBackendSetDetails The configuration details for creating a backend set in a load balancer. // For more information on backend set configuration, see -// Managing Backend Sets (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateBackendSetDetails struct { - HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` // A friendly name for the backend set. It must be unique and it cannot be changed. // Valid backend set names include only alphanumeric characters, dashes, and underscores. Backend set names cannot // contain spaces. Avoid entering confidential information. - // Example: `My_backend_set` + // Example: `example_backend_set` Name *string `mandatory:"true" json:"name"` // The load balancer policy for the backend set. To get a list of available policies, use the @@ -29,11 +30,13 @@ // Example: `LEAST_CONNECTIONS` Policy *string `mandatory:"true" json:"policy"` - Backends []BackendDetails `mandatory:"false" json:"backends"` + HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` - SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` + Backends []BackendDetails `mandatory:"false" json:"backends"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` } func (m CreateBackendSetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_backend_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,7 +14,7 @@ // The details for adding a backend set. CreateBackendSetDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a backend set. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a backend set. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -27,26 +27,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateBackendSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateBackendSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBackendSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateBackendSetResponse wrapper for the CreateBackendSet operation type CreateBackendSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateBackendSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateBackendSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,28 +15,17 @@ // CreateCertificateDetails The configuration details for adding a certificate bundle to a listener. // For more information on SSL certficate configuration, see -// Managing SSL Certificates (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). +// Managing SSL Certificates (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingcertificates.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateCertificateDetails struct { // A friendly name for the certificate bundle. It must be unique and it cannot be changed. // Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. // Certificate bundle names cannot contain spaces. Avoid entering confidential information. - // Example: `My_certificate_bundle` + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" json:"certificateName"` - // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. - // Example: - // -----BEGIN CERTIFICATE----- - // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix - // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD - // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y - // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy - // ... - // -----END CERTIFICATE----- - CaCertificate *string `mandatory:"false" json:"caCertificate"` - // A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. - // Example: `Mysecretunlockingcode42!1!` Passphrase *string `mandatory:"false" json:"passphrase"` // The SSL private key for your certificate, in PEM format. @@ -52,13 +42,24 @@ // The public certificate, in PEM format, that you received from your SSL certificate provider. // Example: // -----BEGIN CERTIFICATE----- - // MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG - // A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE - // MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl - // YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + // MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbM..QswCQYDVQQGEwJKU + // A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxE..TAPBgNVBAoTCEZyY + // MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWB..gNVBAMTD0ZyYW5rN + // YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmc..mFuazRkZC5jb20wH // ... // -----END CERTIFICATE----- PublicCertificate *string `mandatory:"false" json:"publicCertificate"` + + // The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + // Example: + // -----BEGIN CERTIFICATE----- + // MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + // EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + // VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + // aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + // ... + // -----END CERTIFICATE----- + CaCertificate *string `mandatory:"false" json:"caCertificate"` } func (m CreateCertificateDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,10 +11,10 @@ // CreateCertificateRequest wrapper for the CreateCertificate operation type CreateCertificateRequest struct { - // The details of the certificate to add. + // The details of the certificate bundle to add. CreateCertificateDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add the certificate. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add the certificate bundle. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -27,26 +27,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateCertificateRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateCertificateResponse wrapper for the CreateCertificate operation type CreateCertificateResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateCertificateResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateHostnameDetails The details of the hostname resource to add to a load balancer. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateHostnameDetails struct { + + // A friendly name for the hostname resource. It must be unique and it cannot be changed. Avoid entering confidential + // information. + // Example: `example_hostname_001` + Name *string `mandatory:"true" json:"name"` + + // A virtual hostname. For more information about virtual hostname string construction, see + // Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm#routing). + // Example: `app.example.com` + Hostname *string `mandatory:"true" json:"hostname"` +} + +func (m CreateHostnameDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_hostname_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateHostnameRequest wrapper for the CreateHostname operation +type CreateHostnameRequest struct { + + // The details of the hostname resource to add to the specified load balancer. + CreateHostnameDetails `contributesTo:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to add the hostname to. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateHostnameRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateHostnameRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateHostnameRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateHostnameResponse wrapper for the CreateHostname operation +type CreateHostnameResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateHostnameResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateHostnameResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,18 +15,14 @@ // CreateListenerDetails The configuration details for adding a listener to a backend set. // For more information on listener configuration, see -// Managing Load Balancer Listeners (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). +// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateListenerDetails struct { // The name of the associated backend set. - // Example: `My_backend_set` + // Example: `example_backend_set` DefaultBackendSetName *string `mandatory:"true" json:"defaultBackendSetName"` - // A friendly name for the listener. It must be unique and it cannot be changed. - // Avoid entering confidential information. - // Example: `My listener` - Name *string `mandatory:"true" json:"name"` - // The communication port for the listener. // Example: `80` Port *int `mandatory:"true" json:"port"` @@ -36,14 +33,26 @@ // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + // A friendly name for the listener. It must be unique and it cannot be changed. + // Avoid entering confidential information. + // Example: `example_listener` + Name *string `mandatory:"true" json:"name"` + + // An array of hostname resource names. + HostnameNames []string `mandatory:"false" json:"hostnameNames"` // The name of the set of path-based routing rules, PathRouteSet, // applied to this listener's traffic. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"false" json:"pathRouteSetName"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + + // The names of the RuleSet to apply to the listener. + // Example: ["example_rule_set"] + RuleSetNames []string `mandatory:"false" json:"ruleSetNames"` } func (m CreateListenerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_listener_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,7 +14,7 @@ // Details to add a listener. CreateListenerDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a listener. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a listener. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -27,26 +27,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateListenerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateListenerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateListenerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateListenerResponse wrapper for the CreateListener operation type CreateListenerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateListenerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateListenerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,14 +14,15 @@ ) // CreateLoadBalancerDetails The configuration details for creating a load balancer. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateLoadBalancerDetails struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the load balancer. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the load balancer. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. It does not have to be unique, and it is changeable. // Avoid entering confidential information. - // Example: `My load balancer` + // Example: `example_load_balancer` DisplayName *string `mandatory:"true" json:"displayName"` // A template that determines the total pre-provisioned bandwidth (ingress plus egress). @@ -29,29 +31,39 @@ // Example: `100Mbps` ShapeName *string `mandatory:"true" json:"shapeName"` - // An array of subnet OCIDs (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + // An array of subnet OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). SubnetIds []string `mandatory:"true" json:"subnetIds"` - BackendSets map[string]BackendSetDetails `mandatory:"false" json:"backendSets"` - - Certificates map[string]CertificateDetails `mandatory:"false" json:"certificates"` - // Whether the load balancer has a VCN-local (private) IP address. - // If "true", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet - // to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer - // is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security - // list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. - // For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. - // If "false", the service assigns a public IP address to the load balancer. A load balancer with a public IP address - // requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other - // hosts the secondary (standby) load balancer. A public load balancer is accessible from the internet, depending on your - // VCN's security list rules (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). - // Example: `false` + // If "true", the service assigns a private IP address to the load balancer. + // If "false", the service assigns a public IP address to the load balancer. + // A public load balancer is accessible from the internet, depending on your VCN's + // security list rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). For more information about public and + // private load balancers, see How Load Balancing Works (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm#how-load-balancing-works). + // Example: `true` IsPrivate *bool `mandatory:"false" json:"isPrivate"` Listeners map[string]ListenerDetails `mandatory:"false" json:"listeners"` + Hostnames map[string]HostnameDetails `mandatory:"false" json:"hostnames"` + + BackendSets map[string]BackendSetDetails `mandatory:"false" json:"backendSets"` + + Certificates map[string]CertificateDetails `mandatory:"false" json:"certificates"` + PathRouteSets map[string]PathRouteSetDetails `mandatory:"false" json:"pathRouteSets"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + RuleSets map[string]RuleSetDetails `mandatory:"false" json:"ruleSets"` } func (m CreateLoadBalancerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -24,26 +24,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateLoadBalancerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateLoadBalancerResponse wrapper for the CreateLoadBalancer operation type CreateLoadBalancerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateLoadBalancerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,11 +14,12 @@ ) // CreatePathRouteSetDetails A named set of path route rules to add to the load balancer. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreatePathRouteSetDetails struct { // The name for this set of path route rules. It must be unique and it cannot be changed. Avoid entering // confidential information. - // Example: `path-route-set-001` + // Example: `example_path_route_set` Name *string `mandatory:"true" json:"name"` // The set of path route rules. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_path_route_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,7 +14,7 @@ // The details of the path route set to add. CreatePathRouteSetDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to add the path route set to. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to add the path route set to. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -27,26 +27,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreatePathRouteSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreatePathRouteSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePathRouteSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreatePathRouteSetResponse wrapper for the CreatePathRouteSet operation type CreatePathRouteSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreatePathRouteSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreatePathRouteSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateRuleSetDetails A named set of rules to add to the load balancer. +type CreateRuleSetDetails struct { + + // The name for this set of rules. It must be unique and it cannot be changed. Avoid entering + // confidential information. + // Example: `example_rule_set` + Name *string `mandatory:"true" json:"name"` + + // An array of rules that compose the rule set. + Items []Rule `mandatory:"true" json:"items"` +} + +func (m CreateRuleSetDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateRuleSetDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Items []rule `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Name = model.Name + m.Items = make([]Rule, len(model.Items)) + for i, n := range model.Items { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Items[i] = nn.(Rule) + } else { + m.Items[i] = nil + } + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/create_rule_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateRuleSetRequest wrapper for the CreateRuleSet operation +type CreateRuleSetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The configuration details for the rule set to create. + CreateRuleSetDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateRuleSetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateRuleSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateRuleSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateRuleSetResponse wrapper for the CreateRuleSet operation +type CreateRuleSetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateRuleSetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateRuleSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,40 +11,59 @@ // DeleteBackendRequest wrapper for the DeleteBackend operation type DeleteBackendRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the backend server. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The IP address and port of the backend server to remove. - // Example: `1.1.1.7:42` + // Example: `10.0.0.3:8080` BackendName *string `mandatory:"true" contributesTo:"path" name:"backendName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteBackendRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteBackendRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBackendRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteBackendResponse wrapper for the DeleteBackend operation type DeleteBackendResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteBackendResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBackendResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_backend_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,36 +11,55 @@ // DeleteBackendSetRequest wrapper for the DeleteBackendSet operation type DeleteBackendSetRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set to delete. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteBackendSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteBackendSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBackendSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteBackendSetResponse wrapper for the DeleteBackendSet operation type DeleteBackendSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteBackendSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBackendSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_certificate_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,36 +11,56 @@ // DeleteCertificateRequest wrapper for the DeleteCertificate operation type DeleteCertificateRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate to be deleted. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate bundle + // to be deleted. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` - // The name of the certificate to delete. - // Example: `My_certificate_bundle` + // The name of the certificate bundle to delete. + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" contributesTo:"path" name:"certificateName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteCertificateRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteCertificateResponse wrapper for the DeleteCertificate operation type DeleteCertificateResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteCertificateResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_hostname_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_hostname_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_hostname_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_hostname_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteHostnameRequest wrapper for the DeleteHostname operation +type DeleteHostnameRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the hostname to delete. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the hostname resource to delete. + // Example: `example_hostname_001` + Name *string `mandatory:"true" contributesTo:"path" name:"name"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteHostnameRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteHostnameRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteHostnameRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteHostnameResponse wrapper for the DeleteHostname operation +type DeleteHostnameResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteHostnameResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteHostnameResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_listener_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_listener_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_listener_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_listener_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,36 +11,55 @@ // DeleteListenerRequest wrapper for the DeleteListener operation type DeleteListenerRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to delete. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to delete. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the listener to delete. - // Example: `My listener` + // Example: `example_listener` ListenerName *string `mandatory:"true" contributesTo:"path" name:"listenerName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteListenerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteListenerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteListenerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteListenerResponse wrapper for the DeleteListener operation type DeleteListenerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteListenerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteListenerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_load_balancer_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,32 +11,51 @@ // DeleteLoadBalancerRequest wrapper for the DeleteLoadBalancer operation type DeleteLoadBalancerRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to delete. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to delete. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteLoadBalancerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteLoadBalancerResponse wrapper for the DeleteLoadBalancer operation type DeleteLoadBalancerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteLoadBalancerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_path_route_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_path_route_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_path_route_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_path_route_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,36 +11,55 @@ // DeletePathRouteSetRequest wrapper for the DeletePathRouteSet operation type DeletePathRouteSetRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route set to delete. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route set to delete. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the path route set to delete. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"true" contributesTo:"path" name:"pathRouteSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeletePathRouteSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeletePathRouteSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePathRouteSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeletePathRouteSetResponse wrapper for the DeletePathRouteSet operation type DeletePathRouteSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeletePathRouteSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeletePathRouteSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_rule_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_rule_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_rule_set_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/delete_rule_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteRuleSetRequest wrapper for the DeleteRuleSet operation +type DeleteRuleSetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the rule set to delete. + // Example: `example_rule_set` + RuleSetName *string `mandatory:"true" contributesTo:"path" name:"ruleSetName"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteRuleSetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteRuleSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteRuleSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteRuleSetResponse wrapper for the DeleteRuleSet operation +type DeleteRuleSetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteRuleSetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteRuleSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_request_header_value_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_request_header_value_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_request_header_value_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_request_header_value_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ExtendHttpRequestHeaderValueRule An object that represents the action of modifying a request header value. This rule applies only to HTTP listeners. +// This rule adds a prefix, a suffix, or both to the header value. +// **NOTES:** +// * This rule requires a value for a prefix, suffix, or both. +// * The system does not support this rule for headers with multiple values. +// * The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. If two such headers appear in a request, the system +// applies the action to the first header it finds. The affected header cannot be determined in advance. Oracle +// recommends that you do not rely on underscore or dash characters to uniquely distinguish header names. +type ExtendHttpRequestHeaderValueRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` + + // A string to prepend to the header value. The resulting header value must conform to RFC 7230. + // Example: `example_prefix_value` + Prefix *string `mandatory:"false" json:"prefix"` + + // A string to append to the header value. The resulting header value must conform to RFC 7230. + // Example: `example_suffix_value` + Suffix *string `mandatory:"false" json:"suffix"` +} + +func (m ExtendHttpRequestHeaderValueRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m ExtendHttpRequestHeaderValueRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExtendHttpRequestHeaderValueRule ExtendHttpRequestHeaderValueRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeExtendHttpRequestHeaderValueRule + }{ + "EXTEND_HTTP_REQUEST_HEADER_VALUE", + (MarshalTypeExtendHttpRequestHeaderValueRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_response_header_value_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_response_header_value_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_response_header_value_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/extend_http_response_header_value_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ExtendHttpResponseHeaderValueRule An object that represents the action of modifying a response header value. This rule applies only to HTTP listeners. +// This rule adds a prefix, a suffix, or both to the header value. +// **NOTES:** +// * This rule requires a value for a prefix, suffix, or both. +// * The system does not support this rule for headers with multiple values. +// * The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. If two such headers appear in a request, the system +// applies the action to the first header it finds. The affected header cannot be determined in advance. Oracle +// recommends that you do not rely on underscore or dash characters to uniquely distinguish header names. +type ExtendHttpResponseHeaderValueRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` + + // A string to prepend to the header value. The resulting header value must still conform to RFC 7230. + // Example: `example_prefix_value` + Prefix *string `mandatory:"false" json:"prefix"` + + // A string to append to the header value. The resulting header value must still conform to RFC 7230. + // Example: `example_suffix_value` + Suffix *string `mandatory:"false" json:"suffix"` +} + +func (m ExtendHttpResponseHeaderValueRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m ExtendHttpResponseHeaderValueRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExtendHttpResponseHeaderValueRule ExtendHttpResponseHeaderValueRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeExtendHttpResponseHeaderValueRule + }{ + "EXTEND_HTTP_RESPONSE_HEADER_VALUE", + (MarshalTypeExtendHttpResponseHeaderValueRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_health_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_health_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_health_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_health_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,26 +11,40 @@ // GetBackendHealthRequest wrapper for the GetBackendHealth operation type GetBackendHealthRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend server health status to be retrieved. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend server health status to be retrieved. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the backend server to retrieve the health status for. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The IP address and port of the backend server to retrieve the health status for. - // Example: `1.1.1.7:42` + // Example: `10.0.0.3:8080` BackendName *string `mandatory:"true" contributesTo:"path" name:"backendName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBackendHealthRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBackendHealthRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBackendHealthRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBackendHealthResponse wrapper for the GetBackendHealth operation type GetBackendHealthResponse struct { @@ -48,3 +62,8 @@ func (response GetBackendHealthResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBackendHealthResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,26 +11,40 @@ // GetBackendRequest wrapper for the GetBackend operation type GetBackendRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set that includes the backend server. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The IP address and port of the backend server to retrieve. - // Example: `1.1.1.7:42` + // Example: `10.0.0.3:8080` BackendName *string `mandatory:"true" contributesTo:"path" name:"backendName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBackendRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBackendRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBackendRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBackendResponse wrapper for the GetBackend operation type GetBackendResponse struct { @@ -48,3 +62,8 @@ func (response GetBackendResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBackendResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_health_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_health_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_health_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_health_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,22 +11,36 @@ // GetBackendSetHealthRequest wrapper for the GetBackendSetHealth operation type GetBackendSetHealthRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set health status to be retrieved. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set health status to be retrieved. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set to retrieve the health status for. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBackendSetHealthRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBackendSetHealthRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBackendSetHealthRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBackendSetHealthResponse wrapper for the GetBackendSetHealth operation type GetBackendSetHealthResponse struct { @@ -44,3 +58,8 @@ func (response GetBackendSetHealthResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBackendSetHealthResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_backend_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,22 +11,36 @@ // GetBackendSetRequest wrapper for the GetBackendSet operation type GetBackendSetRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set to retrieve. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBackendSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBackendSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBackendSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBackendSetResponse wrapper for the GetBackendSet operation type GetBackendSetResponse struct { @@ -44,3 +58,8 @@ func (response GetBackendSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBackendSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_health_checker_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_health_checker_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_health_checker_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_health_checker_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,22 +11,36 @@ // GetHealthCheckerRequest wrapper for the GetHealthChecker operation type GetHealthCheckerRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be retrieved. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be retrieved. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the health check policy to be retrieved. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetHealthCheckerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetHealthCheckerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHealthCheckerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetHealthCheckerResponse wrapper for the GetHealthChecker operation type GetHealthCheckerResponse struct { @@ -44,3 +58,8 @@ func (response GetHealthCheckerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetHealthCheckerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_hostname_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_hostname_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_hostname_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_hostname_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetHostnameRequest wrapper for the GetHostname operation +type GetHostnameRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the hostname resource to retrieve. + // Example: `example_hostname_001` + Name *string `mandatory:"true" contributesTo:"path" name:"name"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetHostnameRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHostnameRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHostnameRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetHostnameResponse wrapper for the GetHostname operation +type GetHostnameResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Hostname instance + Hostname `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetHostnameResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHostnameResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_health_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_health_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_health_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_health_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,32 @@ // GetLoadBalancerHealthRequest wrapper for the GetLoadBalancerHealth operation type GetLoadBalancerHealthRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to return health status for. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to return health status for. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetLoadBalancerHealthRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetLoadBalancerHealthRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetLoadBalancerHealthRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetLoadBalancerHealthResponse wrapper for the GetLoadBalancerHealth operation type GetLoadBalancerHealthResponse struct { @@ -40,3 +54,8 @@ func (response GetLoadBalancerHealthResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetLoadBalancerHealthResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,32 @@ // GetLoadBalancerRequest wrapper for the GetLoadBalancer operation type GetLoadBalancerRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to retrieve. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to retrieve. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetLoadBalancerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetLoadBalancerResponse wrapper for the GetLoadBalancer operation type GetLoadBalancerResponse struct { @@ -40,3 +54,8 @@ func (response GetLoadBalancerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_path_route_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_path_route_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_path_route_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_path_route_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,22 +11,36 @@ // GetPathRouteSetRequest wrapper for the GetPathRouteSet operation type GetPathRouteSetRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the path route set to retrieve. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"true" contributesTo:"path" name:"pathRouteSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPathRouteSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPathRouteSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPathRouteSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPathRouteSetResponse wrapper for the GetPathRouteSet operation type GetPathRouteSetResponse struct { @@ -44,3 +58,8 @@ func (response GetPathRouteSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPathRouteSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_rule_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_rule_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_rule_set_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_rule_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetRuleSetRequest wrapper for the GetRuleSet operation +type GetRuleSetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the rule set to retrieve. + // Example: `example_rule_set` + RuleSetName *string `mandatory:"true" contributesTo:"path" name:"ruleSetName"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetRuleSetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetRuleSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRuleSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetRuleSetResponse wrapper for the GetRuleSet operation +type GetRuleSetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RuleSet instance + RuleSet `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetRuleSetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetRuleSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_work_request_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/get_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,32 @@ // GetWorkRequestRequest wrapper for the GetWorkRequest operation type GetWorkRequestRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request to retrieve. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request to retrieve. WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetWorkRequestRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetWorkRequestResponse wrapper for the GetWorkRequest operation type GetWorkRequestResponse struct { @@ -40,3 +54,8 @@ func (response GetWorkRequestResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -19,35 +20,35 @@ // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - // The interval between health checks, in milliseconds. - // Example: `30000` - IntervalInMillis *int `mandatory:"false" json:"intervalInMillis"` + // The path against which to run the health check. + // Example: `/healthcheck` + UrlPath *string `mandatory:"false" json:"urlPath"` // The backend server port against which to run the health check. If the port is not specified, the load balancer uses the // port information from the `Backend` object. // Example: `8080` Port *int `mandatory:"false" json:"port"` - // A regular expression for parsing the response body from the backend server. - // Example: `^(500|40[1348])$` - ResponseBodyRegex *string `mandatory:"false" json:"responseBodyRegex"` + // The status code a healthy backend server should return. + // Example: `200` + ReturnCode *int `mandatory:"false" json:"returnCode"` // The number of retries to attempt before a backend server is considered "unhealthy". // Example: `3` Retries *int `mandatory:"false" json:"retries"` - // The status code a healthy backend server should return. - // Example: `200` - ReturnCode *int `mandatory:"false" json:"returnCode"` - // The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply // returns within this timeout period. - // Example: `6000` + // Example: `3000` TimeoutInMillis *int `mandatory:"false" json:"timeoutInMillis"` - // The path against which to run the health check. - // Example: `/healthcheck` - UrlPath *string `mandatory:"false" json:"urlPath"` + // The interval between health checks, in milliseconds. + // Example: `10000` + IntervalInMillis *int `mandatory:"false" json:"intervalInMillis"` + + // A regular expression for parsing the response body from the backend server. + // Example: `^((?!false).|\s)*$` + ResponseBodyRegex *string `mandatory:"false" json:"responseBodyRegex"` } func (m HealthCheckerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,30 +14,30 @@ ) // HealthChecker The health check policy configuration. -// For more information, see Editing Health Check Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/editinghealthcheck.htm). +// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/Balance/Tasks/editinghealthcheck.htm). type HealthChecker struct { - // The backend server port against which to run the health check. If the port is not specified, the load balancer uses the - // port information from the `Backend` object. - // Example: `8080` - Port *int `mandatory:"true" json:"port"` - // The protocol the health check must use; either HTTP or TCP. // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - // A regular expression for parsing the response body from the backend server. - // Example: `^(500|40[1348])$` - ResponseBodyRegex *string `mandatory:"true" json:"responseBodyRegex"` + // The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + // port information from the `Backend` object. + // Example: `8080` + Port *int `mandatory:"true" json:"port"` // The status code a healthy backend server should return. If you configure the health check policy to use the HTTP protocol, // you can use common HTTP status codes such as "200". // Example: `200` ReturnCode *int `mandatory:"true" json:"returnCode"` - // The interval between health checks, in milliseconds. The default is 10000 (10 seconds). - // Example: `30000` - IntervalInMillis *int `mandatory:"false" json:"intervalInMillis"` + // A regular expression for parsing the response body from the backend server. + // Example: `^((?!false).|\s)*$` + ResponseBodyRegex *string `mandatory:"true" json:"responseBodyRegex"` + + // The path against which to run the health check. + // Example: `/healthcheck` + UrlPath *string `mandatory:"false" json:"urlPath"` // The number of retries to attempt before a backend server is considered "unhealthy". Defaults to 3. // Example: `3` @@ -44,12 +45,12 @@ // The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply // returns within this timeout period. Defaults to 3000 (3 seconds). - // Example: `6000` + // Example: `3000` TimeoutInMillis *int `mandatory:"false" json:"timeoutInMillis"` - // The path against which to run the health check. - // Example: `/healthcheck` - UrlPath *string `mandatory:"false" json:"urlPath"` + // The interval between health checks, in milliseconds. The default is 10000 (10 seconds). + // Example: `10000` + IntervalInMillis *int `mandatory:"false" json:"intervalInMillis"` } func (m HealthChecker) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_check_result.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_check_result.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_check_result.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_check_result.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,20 +16,20 @@ // HealthCheckResult Information about a single backend server health check result reported by a load balancer. type HealthCheckResult struct { - // The result of the most recent health check. - HealthCheckStatus HealthCheckResultHealthCheckStatusEnum `mandatory:"true" json:"healthCheckStatus"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet hosting the load balancer that reported this health check status. + SubnetId *string `mandatory:"true" json:"subnetId"` // The IP address of the health check status report provider. This identifier helps you differentiate same-subnet - // (private) load balancers that report health check status. - // Example: `10.2.0.1` + // load balancers that report health check status. + // Example: `10.0.0.7` SourceIpAddress *string `mandatory:"true" json:"sourceIpAddress"` - // The OCID of the subnet hosting the load balancer that reported this health check status. - SubnetId *string `mandatory:"true" json:"subnetId"` - // The date and time the data was retrieved, in the format defined by RFC3339. // Example: `2017-06-02T18:28:11+00:00` Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` + + // The result of the most recent health check. + HealthCheckStatus HealthCheckResultHealthCheckStatusEnum `mandatory:"true" json:"healthCheckStatus"` } func (m HealthCheckResult) String() string { @@ -38,7 +39,7 @@ // HealthCheckResultHealthCheckStatusEnum Enum with underlying type: string type HealthCheckResultHealthCheckStatusEnum string -// Set of constants representing the allowable values for HealthCheckResultHealthCheckStatus +// Set of constants representing the allowable values for HealthCheckResultHealthCheckStatusEnum const ( HealthCheckResultHealthCheckStatusOk HealthCheckResultHealthCheckStatusEnum = "OK" HealthCheckResultHealthCheckStatusInvalidStatusCode HealthCheckResultHealthCheckStatusEnum = "INVALID_STATUS_CODE" @@ -61,7 +62,7 @@ "UNKNOWN": HealthCheckResultHealthCheckStatusUnknown, } -// GetHealthCheckResultHealthCheckStatusEnumValues Enumerates the set of values for HealthCheckResultHealthCheckStatus +// GetHealthCheckResultHealthCheckStatusEnumValues Enumerates the set of values for HealthCheckResultHealthCheckStatusEnum func GetHealthCheckResultHealthCheckStatusEnumValues() []HealthCheckResultHealthCheckStatusEnum { values := make([]HealthCheckResultHealthCheckStatusEnum, 0) for _, v := range mappingHealthCheckResultHealthCheckStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HostnameDetails The details of a hostname resource associated with a load balancer. +type HostnameDetails struct { + + // The name of the hostname resource. + // Example: `example_hostname_001` + Name *string `mandatory:"true" json:"name"` + + // A virtual hostname. For more information about virtual hostname string construction, see + // Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm#routing). + // Example: `app.example.com` + Hostname *string `mandatory:"true" json:"hostname"` +} + +func (m HostnameDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/hostname.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Hostname A hostname resource associated with a load balancer for use by one or more listeners. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type Hostname struct { + + // A friendly name for the hostname resource. It must be unique and it cannot be changed. Avoid entering confidential + // information. + // Example: `example_hostname_001` + Name *string `mandatory:"true" json:"name"` + + // A virtual hostname. For more information about virtual hostname string construction, see + // Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm#routing). + // Example: `app.example.com` + Hostname *string `mandatory:"true" json:"hostname"` +} + +func (m Hostname) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ip_address.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ip_address.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ip_address.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ip_address.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -16,7 +17,7 @@ type IpAddress struct { // An IP address. - // Example: `128.148.10.20` + // Example: `192.168.0.3` IpAddress *string `mandatory:"true" json:"ipAddress"` // Whether the IP address is public or private. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backend_sets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backend_sets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backend_sets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backend_sets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,32 @@ // ListBackendSetsRequest wrapper for the ListBackendSets operation type ListBackendSetsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend sets to retrieve. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend sets to retrieve. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBackendSetsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBackendSetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBackendSetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBackendSetsResponse wrapper for the ListBackendSets operation type ListBackendSetsResponse struct { @@ -40,3 +54,8 @@ func (response ListBackendSetsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListBackendSetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backends_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backends_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backends_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_backends_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,22 +11,36 @@ // ListBackendsRequest wrapper for the ListBackends operation type ListBackendsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the backend servers. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBackendsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBackendsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBackendsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBackendsResponse wrapper for the ListBackends operation type ListBackendsResponse struct { @@ -44,3 +58,8 @@ func (response ListBackendsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListBackendsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_certificates_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_certificates_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_certificates_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_certificates_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,33 @@ // ListCertificatesRequest wrapper for the ListCertificates operation type ListCertificatesRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificates to be listed. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate bundles + // to be listed. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListCertificatesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListCertificatesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCertificatesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListCertificatesResponse wrapper for the ListCertificates operation type ListCertificatesResponse struct { @@ -40,3 +55,8 @@ func (response ListCertificatesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListCertificatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -16,7 +17,7 @@ type ListenerDetails struct { // The name of the associated backend set. - // Example: `My_backend_set` + // Example: `example_backend_set` DefaultBackendSetName *string `mandatory:"true" json:"defaultBackendSetName"` // The communication port for the listener. @@ -29,14 +30,21 @@ // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + // An array of hostname resource names. + HostnameNames []string `mandatory:"false" json:"hostnameNames"` // The name of the set of path-based routing rules, PathRouteSet, // applied to this listener's traffic. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"false" json:"pathRouteSetName"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + + // The names of the RuleSet to apply to the listener. + // Example: ["example_rule_set"] + RuleSetNames []string `mandatory:"false" json:"ruleSetNames"` } func (m ListenerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/listener.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,17 +15,17 @@ // Listener The listener's configuration. // For more information on backend set configuration, see -// Managing Load Balancer Listeners (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). +// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). type Listener struct { - // The name of the associated backend set. - // Example: `My_backend_set` - DefaultBackendSetName *string `mandatory:"true" json:"defaultBackendSetName"` - // A friendly name for the listener. It must be unique and it cannot be changed. - // Example: `My listener` + // Example: `example_listener` Name *string `mandatory:"true" json:"name"` + // The name of the associated backend set. + // Example: `example_backend_set` + DefaultBackendSetName *string `mandatory:"true" json:"defaultBackendSetName"` + // The communication port for the listener. // Example: `80` Port *int `mandatory:"true" json:"port"` @@ -35,14 +36,21 @@ // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + // An array of hostname resource names. + HostnameNames []string `mandatory:"false" json:"hostnameNames"` // The name of the set of path-based routing rules, PathRouteSet, // applied to this listener's traffic. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"false" json:"pathRouteSetName"` SslConfiguration *SslConfiguration `mandatory:"false" json:"sslConfiguration"` + + ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + + // The names of the RuleSet to apply to the listener. + // Example: ["example_rule_set"] + RuleSetNames []string `mandatory:"false" json:"ruleSetNames"` } func (m Listener) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_hostnames_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_hostnames_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_hostnames_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_hostnames_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListHostnamesRequest wrapper for the ListHostnames operation +type ListHostnamesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the hostnames + // to retrieve. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHostnamesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHostnamesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHostnamesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListHostnamesResponse wrapper for the ListHostnames operation +type ListHostnamesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []Hostname instance + Items []Hostname `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListHostnamesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHostnamesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancer_healths_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancer_healths_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancer_healths_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancer_healths_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,38 +11,53 @@ // ListLoadBalancerHealthsRequest wrapper for the ListLoadBalancerHealths operation type ListLoadBalancerHealthsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to return health status information for. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to return health status information for. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListLoadBalancerHealthsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListLoadBalancerHealthsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLoadBalancerHealthsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListLoadBalancerHealthsResponse wrapper for the ListLoadBalancerHealths operation type ListLoadBalancerHealthsResponse struct { // The underlying http response RawResponse *http.Response - // The []LoadBalancerHealthSummary instance + // A list of []LoadBalancerHealthSummary instances Items []LoadBalancerHealthSummary `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -53,3 +68,8 @@ func (response ListLoadBalancerHealthsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListLoadBalancerHealthsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancers_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancers_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancers_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_load_balancers_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,18 +11,20 @@ // ListLoadBalancersRequest wrapper for the ListLoadBalancers operation type ListLoadBalancersRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to list. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to list. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` @@ -38,28 +40,43 @@ SortOrder ListLoadBalancersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the given display name exactly. + // Example: `example_load_balancer` DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // A filter to return only resources that match the given lifecycle state. + // Example: `SUCCEEDED` LifecycleState LoadBalancerLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListLoadBalancersRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListLoadBalancersRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListLoadBalancersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListLoadBalancersResponse wrapper for the ListLoadBalancers operation type ListLoadBalancersResponse struct { // The underlying http response RawResponse *http.Response - // The []LoadBalancer instance + // A list of []LoadBalancer instances Items []LoadBalancer `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -71,10 +88,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListLoadBalancersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListLoadBalancersSortByEnum Enum with underlying type: string type ListLoadBalancersSortByEnum string -// Set of constants representing the allowable values for ListLoadBalancersSortBy +// Set of constants representing the allowable values for ListLoadBalancersSortByEnum const ( ListLoadBalancersSortByTimecreated ListLoadBalancersSortByEnum = "TIMECREATED" ListLoadBalancersSortByDisplayname ListLoadBalancersSortByEnum = "DISPLAYNAME" @@ -85,7 +107,7 @@ "DISPLAYNAME": ListLoadBalancersSortByDisplayname, } -// GetListLoadBalancersSortByEnumValues Enumerates the set of values for ListLoadBalancersSortBy +// GetListLoadBalancersSortByEnumValues Enumerates the set of values for ListLoadBalancersSortByEnum func GetListLoadBalancersSortByEnumValues() []ListLoadBalancersSortByEnum { values := make([]ListLoadBalancersSortByEnum, 0) for _, v := range mappingListLoadBalancersSortBy { @@ -97,7 +119,7 @@ // ListLoadBalancersSortOrderEnum Enum with underlying type: string type ListLoadBalancersSortOrderEnum string -// Set of constants representing the allowable values for ListLoadBalancersSortOrder +// Set of constants representing the allowable values for ListLoadBalancersSortOrderEnum const ( ListLoadBalancersSortOrderAsc ListLoadBalancersSortOrderEnum = "ASC" ListLoadBalancersSortOrderDesc ListLoadBalancersSortOrderEnum = "DESC" @@ -108,7 +130,7 @@ "DESC": ListLoadBalancersSortOrderDesc, } -// GetListLoadBalancersSortOrderEnumValues Enumerates the set of values for ListLoadBalancersSortOrder +// GetListLoadBalancersSortOrderEnumValues Enumerates the set of values for ListLoadBalancersSortOrderEnum func GetListLoadBalancersSortOrderEnumValues() []ListLoadBalancersSortOrderEnum { values := make([]ListLoadBalancersSortOrderEnum, 0) for _, v := range mappingListLoadBalancersSortOrder { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_path_route_sets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_path_route_sets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_path_route_sets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_path_route_sets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,19 +11,33 @@ // ListPathRouteSetsRequest wrapper for the ListPathRouteSets operation type ListPathRouteSetsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route sets + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route sets // to retrieve. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPathRouteSetsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPathRouteSetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPathRouteSetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPathRouteSetsResponse wrapper for the ListPathRouteSets operation type ListPathRouteSetsResponse struct { @@ -41,3 +55,8 @@ func (response ListPathRouteSetsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListPathRouteSetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_policies_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,38 +11,53 @@ // ListPoliciesRequest wrapper for the ListPolicies operation type ListPoliciesRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer policies to list. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer policies to list. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPoliciesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPoliciesResponse wrapper for the ListPolicies operation type ListPoliciesResponse struct { // The underlying http response RawResponse *http.Response - // The []LoadBalancerPolicy instance + // A list of []LoadBalancerPolicy instances Items []LoadBalancerPolicy `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -53,3 +68,8 @@ func (response ListPoliciesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_protocols_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_protocols_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_protocols_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_protocols_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,38 +11,53 @@ // ListProtocolsRequest wrapper for the ListProtocols operation type ListProtocolsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer protocols to list. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer protocols to list. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListProtocolsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListProtocolsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListProtocolsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListProtocolsResponse wrapper for the ListProtocols operation type ListProtocolsResponse struct { // The underlying http response RawResponse *http.Response - // The []LoadBalancerProtocol instance + // A list of []LoadBalancerProtocol instances Items []LoadBalancerProtocol `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -53,3 +68,8 @@ func (response ListProtocolsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListProtocolsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_rule_sets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_rule_sets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_rule_sets_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_rule_sets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListRuleSetsRequest wrapper for the ListRuleSets operation +type ListRuleSetsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListRuleSetsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListRuleSetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRuleSetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListRuleSetsResponse wrapper for the ListRuleSets operation +type ListRuleSetsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []RuleSet instance + Items []RuleSet `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListRuleSetsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListRuleSetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_shapes_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_shapes_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_shapes_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_shapes_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,38 +11,53 @@ // ListShapesRequest wrapper for the ListShapes operation type ListShapesRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer shapes to list. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer shapes to list. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListShapesRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListShapesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListShapesResponse wrapper for the ListShapes operation type ListShapesResponse struct { // The underlying http response RawResponse *http.Response - // The []LoadBalancerShape instance + // A list of []LoadBalancerShape instances Items []LoadBalancerShape `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -53,3 +68,8 @@ func (response ListShapesResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_work_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_work_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_work_requests_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/list_work_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -11,38 +11,53 @@ // ListWorkRequestsRequest wrapper for the ListWorkRequests operation type ListWorkRequestsRequest struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the work requests to retrieve. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the work requests to retrieve. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The maximum number of items to return in a paginated "List" call. - // Example: `500` - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int64 `mandatory:"false" contributesTo:"query" name:"limit"` - // The value of the `opc-next-page` response header from the previous "List" call. + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `3` Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListWorkRequestsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListWorkRequestsResponse wrapper for the ListWorkRequests operation type ListWorkRequestsResponse struct { // The underlying http response RawResponse *http.Response - // The []WorkRequest instance + // A list of []WorkRequest instances Items []WorkRequest `presentIn:"body"` - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -53,3 +68,8 @@ func (response ListWorkRequestsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/loadbalancer_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/loadbalancer_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/loadbalancer_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/loadbalancer_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -37,7 +38,7 @@ // SetRegion overrides the region of this client. func (client *LoadBalancerClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "iaas", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.oraclecloud.com") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -48,8 +49,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -60,674 +61,1981 @@ // CreateBackend Adds a backend server to a backend set. func (client LoadBalancerClient) CreateBackend(ctx context.Context, request CreateBackendRequest) (response CreateBackendResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBackend, policy) if err != nil { + if ociResponse != nil { + response = CreateBackendResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateBackendResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBackendResponse") + } + return +} + +// createBackend implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createBackend(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateBackendResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateBackendSet Adds a backend set to a load balancer. func (client LoadBalancerClient) CreateBackendSet(ctx context.Context, request CreateBackendSetRequest) (response CreateBackendSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers/{loadBalancerId}/backendSets", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createBackendSet, policy) if err != nil { + if ociResponse != nil { + response = CreateBackendSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateBackendSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBackendSetResponse") + } + return +} + +// createBackendSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createBackendSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/backendSets") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateBackendSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// CreateCertificate Creates an asynchronous request to add an SSL certificate. +// CreateCertificate Creates an asynchronous request to add an SSL certificate bundle. func (client LoadBalancerClient) CreateCertificate(ctx context.Context, request CreateCertificateRequest) (response CreateCertificateResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers/{loadBalancerId}/certificates", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCertificate, policy) if err != nil { + if ociResponse != nil { + response = CreateCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCertificateResponse") + } + return +} + +// createCertificate implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/certificates") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateHostname Adds a hostname resource to the specified load balancer. For more information, see +// Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm). +func (client LoadBalancerClient) CreateHostname(ctx context.Context, request CreateHostnameRequest) (response CreateHostnameResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createHostname, policy) + if err != nil { + if ociResponse != nil { + response = CreateHostnameResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateHostnameResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateHostnameResponse") + } return } +// createHostname implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createHostname(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/hostnames") + if err != nil { + return nil, err + } + + var response CreateHostnameResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateListener Adds a listener to a load balancer. func (client LoadBalancerClient) CreateListener(ctx context.Context, request CreateListenerRequest) (response CreateListenerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers/{loadBalancerId}/listeners", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createListener, policy) if err != nil { + if ociResponse != nil { + response = CreateListenerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateListenerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateListenerResponse") + } + return +} + +// createListener implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createListener(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/listeners") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateListenerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateLoadBalancer Creates a new load balancer in the specified compartment. For general information about load balancers, -// see Overview of the Load Balancing Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Concepts/balanceoverview.htm). +// see Overview of the Load Balancing Service (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want // the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN // or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN. // For information about access control and compartments, see -// Overview of the IAM Service (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). +// Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // You must specify a display name for the load balancer. It does not have to be unique, and you can change it. // For information about Availability Domains, see -// Regions and Availability Domains (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). +// Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To get a list of Availability Domains, use the `ListAvailabilityDomains` operation // in the Identity and Access Management Service API. // All Oracle Cloud Infrastructure resources, including load balancers, get an Oracle-assigned, // unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID // in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, // or by viewing the resource in the Console. Fore more information, see -// Resource Identifiers (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). +// Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // After you send your request, the new object's state will temporarily be PROVISIONING. Before using the // object, first make sure its state has changed to RUNNING. // When you create a load balancer, the system assigns an IP address. // To get the IP address, use the GetLoadBalancer operation. func (client LoadBalancerClient) CreateLoadBalancer(ctx context.Context, request CreateLoadBalancerRequest) (response CreateLoadBalancerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createLoadBalancer, policy) if err != nil { + if ociResponse != nil { + response = CreateLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateLoadBalancerResponse") + } + return +} + +// createLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreatePathRouteSet Adds a path route set to a load balancer. For more information, see -// Managing Request Routing (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). +// Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm). func (client LoadBalancerClient) CreatePathRouteSet(ctx context.Context, request CreatePathRouteSetRequest) (response CreatePathRouteSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/loadBalancers/{loadBalancerId}/pathRouteSets", request) - if err != nil { - return + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createPathRouteSet, policy) if err != nil { + if ociResponse != nil { + response = CreatePathRouteSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(CreatePathRouteSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePathRouteSetResponse") + } return } -// DeleteBackend Removes a backend server from a given load balancer and backend set. -func (client LoadBalancerClient) DeleteBackend(ctx context.Context, request DeleteBackendRequest) (response DeleteBackendResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}", request) +// createPathRouteSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createPathRouteSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/pathRouteSets") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreatePathRouteSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteBackendSet Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer. -// Before you can delete a backend set, you must remove it from any active listeners. -func (client LoadBalancerClient) DeleteBackendSet(ctx context.Context, request DeleteBackendSetRequest) (response DeleteBackendSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}", request) - if err != nil { - return +// CreateRuleSet Creates a new rule set associated with the specified load balancer. For more information, see +// Managing Rule Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrulesets.htm). +func (client LoadBalancerClient) CreateRuleSet(ctx context.Context, request CreateRuleSetRequest) (response CreateRuleSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.createRuleSet, policy) if err != nil { + if ociResponse != nil { + response = CreateRuleSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(CreateRuleSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateRuleSetResponse") + } return } -// DeleteCertificate Deletes an SSL certificate from a load balancer. -func (client LoadBalancerClient) DeleteCertificate(ctx context.Context, request DeleteCertificateRequest) (response DeleteCertificateResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}/certificates/{certificateName}", request) +// createRuleSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) createRuleSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/loadBalancers/{loadBalancerId}/ruleSets") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateRuleSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteListener Deletes a listener from a load balancer. -func (client LoadBalancerClient) DeleteListener(ctx context.Context, request DeleteListenerRequest) (response DeleteListenerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}/listeners/{listenerName}", request) - if err != nil { - return +// DeleteBackend Removes a backend server from a given load balancer and backend set. +func (client LoadBalancerClient) DeleteBackend(ctx context.Context, request DeleteBackendRequest) (response DeleteBackendResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteBackend, policy) if err != nil { + if ociResponse != nil { + response = DeleteBackendResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteBackendResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBackendResponse") + } return } -// DeleteLoadBalancer Stops a load balancer and removes it from service. -func (client LoadBalancerClient) DeleteLoadBalancer(ctx context.Context, request DeleteLoadBalancerRequest) (response DeleteLoadBalancerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}", request) +// deleteBackend implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteBackend(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteBackendResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeletePathRouteSet Deletes a path route set from the specified load balancer. -// To delete a path route rule from a path route set, use the -// UpdatePathRouteSet operation. -func (client LoadBalancerClient) DeletePathRouteSet(ctx context.Context, request DeletePathRouteSetRequest) (response DeletePathRouteSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}", request) - if err != nil { - return +// DeleteBackendSet Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer. +// Before you can delete a backend set, you must remove it from any active listeners. +func (client LoadBalancerClient) DeleteBackendSet(ctx context.Context, request DeleteBackendSetRequest) (response DeleteBackendSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteBackendSet, policy) if err != nil { + if ociResponse != nil { + response = DeleteBackendSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteBackendSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBackendSetResponse") + } return } -// GetBackend Gets the specified backend server's configuration information. -func (client LoadBalancerClient) GetBackend(ctx context.Context, request GetBackendRequest) (response GetBackendResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}", request) +// deleteBackendSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteBackendSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteBackendSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetBackendHealth Gets the current health status of the specified backend server. -func (client LoadBalancerClient) GetBackendHealth(ctx context.Context, request GetBackendHealthRequest) (response GetBackendHealthResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}/health", request) - if err != nil { - return +// DeleteCertificate Deletes an SSL certificate bundle from a load balancer. +func (client LoadBalancerClient) DeleteCertificate(ctx context.Context, request DeleteCertificateRequest) (response DeleteCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteCertificate, policy) if err != nil { + if ociResponse != nil { + response = DeleteCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCertificateResponse") + } return } -// GetBackendSet Gets the specified backend set's configuration information. -func (client LoadBalancerClient) GetBackendSet(ctx context.Context, request GetBackendSetRequest) (response GetBackendSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}", request) +// deleteCertificate implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/certificates/{certificateName}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetBackendSetHealth Gets the health status for the specified backend set. -func (client LoadBalancerClient) GetBackendSetHealth(ctx context.Context, request GetBackendSetHealthRequest) (response GetBackendSetHealthResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/health", request) - if err != nil { - return +// DeleteHostname Deletes a hostname resource from the specified load balancer. +func (client LoadBalancerClient) DeleteHostname(ctx context.Context, request DeleteHostnameRequest) (response DeleteHostnameResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteHostname, policy) if err != nil { + if ociResponse != nil { + response = DeleteHostnameResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteHostnameResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteHostnameResponse") + } return } -// GetHealthChecker Gets the health check policy information for a given load balancer and backend set. -func (client LoadBalancerClient) GetHealthChecker(ctx context.Context, request GetHealthCheckerRequest) (response GetHealthCheckerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker", request) +// deleteHostname implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteHostname(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/hostnames/{name}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteHostnameResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetLoadBalancer Gets the specified load balancer's configuration information. -func (client LoadBalancerClient) GetLoadBalancer(ctx context.Context, request GetLoadBalancerRequest) (response GetLoadBalancerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}", request) - if err != nil { - return +// DeleteListener Deletes a listener from a load balancer. +func (client LoadBalancerClient) DeleteListener(ctx context.Context, request DeleteListenerRequest) (response DeleteListenerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteListener, policy) if err != nil { + if ociResponse != nil { + response = DeleteListenerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteListenerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteListenerResponse") + } return } -// GetLoadBalancerHealth Gets the health status for the specified load balancer. -func (client LoadBalancerClient) GetLoadBalancerHealth(ctx context.Context, request GetLoadBalancerHealthRequest) (response GetLoadBalancerHealthResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/health", request) +// deleteListener implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteListener(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/listeners/{listenerName}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteListenerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetPathRouteSet Gets the specified path route set's configuration information. -func (client LoadBalancerClient) GetPathRouteSet(ctx context.Context, request GetPathRouteSetRequest) (response GetPathRouteSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}", request) - if err != nil { - return +// DeleteLoadBalancer Stops a load balancer and removes it from service. +func (client LoadBalancerClient) DeleteLoadBalancer(ctx context.Context, request DeleteLoadBalancerRequest) (response DeleteLoadBalancerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deleteLoadBalancer, policy) if err != nil { + if ociResponse != nil { + response = DeleteLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeleteLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteLoadBalancerResponse") + } return } -// GetWorkRequest Gets the details of a work request. -func (client LoadBalancerClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancerWorkRequests/{workRequestId}", request) +// deleteLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListBackendSets Lists all backend sets associated with a given load balancer. -func (client LoadBalancerClient) ListBackendSets(ctx context.Context, request ListBackendSetsRequest) (response ListBackendSetsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets", request) - if err != nil { - return +// DeletePathRouteSet Deletes a path route set from the specified load balancer. +// To delete a path route rule from a path route set, use the +// UpdatePathRouteSet operation. +func (client LoadBalancerClient) DeletePathRouteSet(ctx context.Context, request DeletePathRouteSetRequest) (response DeletePathRouteSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() } - - httpResponse, err := client.Call(ctx, &httpRequest) - defer common.CloseBodyIfValid(httpResponse) - response.RawResponse = httpResponse + ociResponse, err = common.Retry(ctx, request, client.deletePathRouteSet, policy) if err != nil { + if ociResponse != nil { + response = DeletePathRouteSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } - - err = common.UnmarshalResponse(httpResponse, &response) + if convertedResponse, ok := ociResponse.(DeletePathRouteSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePathRouteSetResponse") + } return } -// ListBackends Lists the backend servers for a given load balancer and backend set. -func (client LoadBalancerClient) ListBackends(ctx context.Context, request ListBackendsRequest) (response ListBackendsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends", request) +// deletePathRouteSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deletePathRouteSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}") if err != nil { - return + return nil, err } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeletePathRouteSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListCertificates Lists all SSL certificates associated with a given load balancer. -func (client LoadBalancerClient) ListCertificates(ctx context.Context, request ListCertificatesRequest) (response ListCertificatesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/certificates", request) +// DeleteRuleSet Deletes a rule set from the specified load balancer. +// To delete a rule from a rule set, use the +// UpdateRuleSet operation. +func (client LoadBalancerClient) DeleteRuleSet(ctx context.Context, request DeleteRuleSetRequest) (response DeleteRuleSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteRuleSet, policy) if err != nil { + if ociResponse != nil { + response = DeleteRuleSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteRuleSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteRuleSetResponse") + } + return +} + +// deleteRuleSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) deleteRuleSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/loadBalancers/{loadBalancerId}/ruleSets/{ruleSetName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteRuleSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListLoadBalancerHealths Lists the summary health statuses for all load balancers in the specified compartment. -func (client LoadBalancerClient) ListLoadBalancerHealths(ctx context.Context, request ListLoadBalancerHealthsRequest) (response ListLoadBalancerHealthsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancerHealths", request) +// GetBackend Gets the specified backend server's configuration information. +func (client LoadBalancerClient) GetBackend(ctx context.Context, request GetBackendRequest) (response GetBackendResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBackend, policy) if err != nil { + if ociResponse != nil { + response = GetBackendResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetBackendResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBackendResponse") + } + return +} + +// getBackend implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getBackend(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetBackendResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListLoadBalancers Lists all load balancers in the specified compartment. -func (client LoadBalancerClient) ListLoadBalancers(ctx context.Context, request ListLoadBalancersRequest) (response ListLoadBalancersResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers", request) +// GetBackendHealth Gets the current health status of the specified backend server. +func (client LoadBalancerClient) GetBackendHealth(ctx context.Context, request GetBackendHealthRequest) (response GetBackendHealthResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBackendHealth, policy) if err != nil { + if ociResponse != nil { + response = GetBackendHealthResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetBackendHealthResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBackendHealthResponse") + } + return +} + +// getBackendHealth implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getBackendHealth(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}/health") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetBackendHealthResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBackendSet Gets the specified backend set's configuration information. +func (client LoadBalancerClient) GetBackendSet(ctx context.Context, request GetBackendSetRequest) (response GetBackendSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBackendSet, policy) + if err != nil { + if ociResponse != nil { + response = GetBackendSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetBackendSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBackendSetResponse") + } + return +} + +// getBackendSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getBackendSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}") + if err != nil { + return nil, err + } + + var response GetBackendSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetBackendSetHealth Gets the health status for the specified backend set. +func (client LoadBalancerClient) GetBackendSetHealth(ctx context.Context, request GetBackendSetHealthRequest) (response GetBackendSetHealthResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBackendSetHealth, policy) + if err != nil { + if ociResponse != nil { + response = GetBackendSetHealthResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetBackendSetHealthResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBackendSetHealthResponse") + } return } -// ListPathRouteSets Lists all path route sets associated with the specified load balancer. -func (client LoadBalancerClient) ListPathRouteSets(ctx context.Context, request ListPathRouteSetsRequest) (response ListPathRouteSetsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/pathRouteSets", request) +// getBackendSetHealth implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getBackendSetHealth(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/health") + if err != nil { + return nil, err + } + + var response GetBackendSetHealthResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHealthChecker Gets the health check policy information for a given load balancer and backend set. +func (client LoadBalancerClient) GetHealthChecker(ctx context.Context, request GetHealthCheckerRequest) (response GetHealthCheckerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHealthChecker, policy) + if err != nil { + if ociResponse != nil { + response = GetHealthCheckerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetHealthCheckerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHealthCheckerResponse") + } + return +} + +// getHealthChecker implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getHealthChecker(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetHealthCheckerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHostname Gets the specified hostname resource's configuration information. +func (client LoadBalancerClient) GetHostname(ctx context.Context, request GetHostnameRequest) (response GetHostnameResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHostname, policy) + if err != nil { + if ociResponse != nil { + response = GetHostnameResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetHostnameResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHostnameResponse") + } + return +} + +// getHostname implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getHostname(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/hostnames/{name}") + if err != nil { + return nil, err + } + + var response GetHostnameResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetLoadBalancer Gets the specified load balancer's configuration information. +func (client LoadBalancerClient) GetLoadBalancer(ctx context.Context, request GetLoadBalancerRequest) (response GetLoadBalancerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getLoadBalancer, policy) + if err != nil { + if ociResponse != nil { + response = GetLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetLoadBalancerResponse") + } return } -// ListPolicies Lists the available load balancer policies. -func (client LoadBalancerClient) ListPolicies(ctx context.Context, request ListPoliciesRequest) (response ListPoliciesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancerPolicies", request) +// getLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}") + if err != nil { + return nil, err + } + + var response GetLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetLoadBalancerHealth Gets the health status for the specified load balancer. +func (client LoadBalancerClient) GetLoadBalancerHealth(ctx context.Context, request GetLoadBalancerHealthRequest) (response GetLoadBalancerHealthResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getLoadBalancerHealth, policy) + if err != nil { + if ociResponse != nil { + response = GetLoadBalancerHealthResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetLoadBalancerHealthResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetLoadBalancerHealthResponse") + } + return +} + +// getLoadBalancerHealth implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getLoadBalancerHealth(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/health") + if err != nil { + return nil, err + } + + var response GetLoadBalancerHealthResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPathRouteSet Gets the specified path route set's configuration information. +func (client LoadBalancerClient) GetPathRouteSet(ctx context.Context, request GetPathRouteSetRequest) (response GetPathRouteSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPathRouteSet, policy) + if err != nil { + if ociResponse != nil { + response = GetPathRouteSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetPathRouteSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPathRouteSetResponse") + } + return +} + +// getPathRouteSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getPathRouteSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}") + if err != nil { + return nil, err + } + + var response GetPathRouteSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetRuleSet Gets the specified set of rules. +func (client LoadBalancerClient) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (response GetRuleSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getRuleSet, policy) + if err != nil { + if ociResponse != nil { + response = GetRuleSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetRuleSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRuleSetResponse") + } + return +} + +// getRuleSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getRuleSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/ruleSets/{ruleSetName}") + if err != nil { + return nil, err + } + + var response GetRuleSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the details of a work request. +func (client LoadBalancerClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = GetWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) getWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancerWorkRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBackendSets Lists all backend sets associated with a given load balancer. +func (client LoadBalancerClient) ListBackendSets(ctx context.Context, request ListBackendSetsRequest) (response ListBackendSetsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBackendSets, policy) + if err != nil { + if ociResponse != nil { + response = ListBackendSetsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListBackendSetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBackendSetsResponse") + } + return +} + +// listBackendSets implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listBackendSets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets") + if err != nil { + return nil, err + } + + var response ListBackendSetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBackends Lists the backend servers for a given load balancer and backend set. +func (client LoadBalancerClient) ListBackends(ctx context.Context, request ListBackendsRequest) (response ListBackendsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBackends, policy) + if err != nil { + if ociResponse != nil { + response = ListBackendsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListBackendsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBackendsResponse") + } + return +} + +// listBackends implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listBackends(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends") + if err != nil { + return nil, err + } + + var response ListBackendsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCertificates Lists all SSL certificates bundles associated with a given load balancer. +func (client LoadBalancerClient) ListCertificates(ctx context.Context, request ListCertificatesRequest) (response ListCertificatesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCertificates, policy) + if err != nil { + if ociResponse != nil { + response = ListCertificatesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCertificatesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCertificatesResponse") + } + return +} + +// listCertificates implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listCertificates(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/certificates") + if err != nil { + return nil, err + } + + var response ListCertificatesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHostnames Lists all hostname resources associated with the specified load balancer. +func (client LoadBalancerClient) ListHostnames(ctx context.Context, request ListHostnamesRequest) (response ListHostnamesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHostnames, policy) if err != nil { + if ociResponse != nil { + response = ListHostnamesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListHostnamesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHostnamesResponse") + } + return +} + +// listHostnames implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listHostnames(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/hostnames") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListHostnamesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListLoadBalancerHealths Lists the summary health statuses for all load balancers in the specified compartment. +func (client LoadBalancerClient) ListLoadBalancerHealths(ctx context.Context, request ListLoadBalancerHealthsRequest) (response ListLoadBalancerHealthsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listLoadBalancerHealths, policy) + if err != nil { + if ociResponse != nil { + response = ListLoadBalancerHealthsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListLoadBalancerHealthsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLoadBalancerHealthsResponse") + } + return +} + +// listLoadBalancerHealths implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listLoadBalancerHealths(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancerHealths") + if err != nil { + return nil, err + } + + var response ListLoadBalancerHealthsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListLoadBalancers Lists all load balancers in the specified compartment. +func (client LoadBalancerClient) ListLoadBalancers(ctx context.Context, request ListLoadBalancersRequest) (response ListLoadBalancersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listLoadBalancers, policy) + if err != nil { + if ociResponse != nil { + response = ListLoadBalancersResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListLoadBalancersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListLoadBalancersResponse") + } + return +} + +// listLoadBalancers implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listLoadBalancers(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers") + if err != nil { + return nil, err + } + + var response ListLoadBalancersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPathRouteSets Lists all path route sets associated with the specified load balancer. +func (client LoadBalancerClient) ListPathRouteSets(ctx context.Context, request ListPathRouteSetsRequest) (response ListPathRouteSetsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPathRouteSets, policy) + if err != nil { + if ociResponse != nil { + response = ListPathRouteSetsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListPathRouteSetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPathRouteSetsResponse") + } return } +// listPathRouteSets implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listPathRouteSets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/pathRouteSets") + if err != nil { + return nil, err + } + + var response ListPathRouteSetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPolicies Lists the available load balancer policies. +func (client LoadBalancerClient) ListPolicies(ctx context.Context, request ListPoliciesRequest) (response ListPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPolicies, policy) + if err != nil { + if ociResponse != nil { + response = ListPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPoliciesResponse") + } + return +} + +// listPolicies implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancerPolicies") + if err != nil { + return nil, err + } + + var response ListPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListProtocols Lists all supported traffic protocols. func (client LoadBalancerClient) ListProtocols(ctx context.Context, request ListProtocolsRequest) (response ListProtocolsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancerProtocols", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listProtocols, policy) if err != nil { + if ociResponse != nil { + response = ListProtocolsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListProtocolsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListProtocolsResponse") + } + return +} + +// listProtocols implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listProtocols(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancerProtocols") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListProtocolsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListRuleSets Lists all rule sets associated with the specified load balancer. +func (client LoadBalancerClient) ListRuleSets(ctx context.Context, request ListRuleSetsRequest) (response ListRuleSetsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listRuleSets, policy) + if err != nil { + if ociResponse != nil { + response = ListRuleSetsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListRuleSetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRuleSetsResponse") + } return } +// listRuleSets implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listRuleSets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/ruleSets") + if err != nil { + return nil, err + } + + var response ListRuleSetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListShapes Lists the valid load balancer shapes. func (client LoadBalancerClient) ListShapes(ctx context.Context, request ListShapesRequest) (response ListShapesResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancerShapes", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listShapes, policy) if err != nil { + if ociResponse != nil { + response = ListShapesResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListShapesResponse") + } + return +} + +// listShapes implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancerShapes") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListWorkRequests Lists the work requests for a given load balancer. func (client LoadBalancerClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/loadBalancers/{loadBalancerId}/workRequests", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) if err != nil { + if ociResponse != nil { + response = ListWorkRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) listWorkRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/loadBalancers/{loadBalancerId}/workRequests") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateBackend Updates the configuration of a backend server within the specified backend set. func (client LoadBalancerClient) UpdateBackend(ctx context.Context, request UpdateBackendRequest) (response UpdateBackendResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateBackend, policy) if err != nil { + if ociResponse != nil { + response = UpdateBackendResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBackendResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBackendResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateBackend implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateBackend(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}") + if err != nil { + return nil, err + } + + var response UpdateBackendResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateBackendSet Updates a backend set. func (client LoadBalancerClient) UpdateBackendSet(ctx context.Context, request UpdateBackendSetRequest) (response UpdateBackendSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateBackendSet, policy) if err != nil { + if ociResponse != nil { + response = UpdateBackendSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBackendSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBackendSetResponse") + } + return +} + +// updateBackendSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateBackendSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateBackendSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateHealthChecker Updates the health check policy for a given load balancer and backend set. func (client LoadBalancerClient) UpdateHealthChecker(ctx context.Context, request UpdateHealthCheckerRequest) (response UpdateHealthCheckerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateHealthChecker, policy) if err != nil { + if ociResponse != nil { + response = UpdateHealthCheckerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateHealthCheckerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHealthCheckerResponse") + } + return +} + +// updateHealthChecker implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateHealthChecker(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateHealthCheckerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateHostname Overwrites an existing hostname resource on the specified load balancer. Use this operation to change a +// virtual hostname. +func (client LoadBalancerClient) UpdateHostname(ctx context.Context, request UpdateHostnameRequest) (response UpdateHostnameResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateHostname, policy) + if err != nil { + if ociResponse != nil { + response = UpdateHostnameResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateHostnameResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHostnameResponse") + } return } +// updateHostname implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateHostname(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/hostnames/{name}") + if err != nil { + return nil, err + } + + var response UpdateHostnameResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateListener Updates a listener for a given load balancer. func (client LoadBalancerClient) UpdateListener(ctx context.Context, request UpdateListenerRequest) (response UpdateListenerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}/listeners/{listenerName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateListener, policy) if err != nil { + if ociResponse != nil { + response = UpdateListenerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateListenerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateListenerResponse") + } + return +} + +// updateListener implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateListener(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/listeners/{listenerName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateListenerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateLoadBalancer Updates a load balancer's configuration. func (client LoadBalancerClient) UpdateLoadBalancer(ctx context.Context, request UpdateLoadBalancerRequest) (response UpdateLoadBalancerResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateLoadBalancer, policy) if err != nil { + if ociResponse != nil { + response = UpdateLoadBalancerResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateLoadBalancerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateLoadBalancerResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateLoadBalancer implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}") + if err != nil { + return nil, err + } + + var response UpdateLoadBalancerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdatePathRouteSet Overwrites an existing path route set on the specified load balancer. Use this operation to add, delete, or alter @@ -736,18 +2044,91 @@ // UpdatePathRouteSetDetails object must include // both the new path route rule to add and the existing path route rules to retain. func (client LoadBalancerClient) UpdatePathRouteSet(ctx context.Context, request UpdatePathRouteSetRequest) (response UpdatePathRouteSetResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updatePathRouteSet, policy) if err != nil { + if ociResponse != nil { + response = UpdatePathRouteSetResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdatePathRouteSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePathRouteSetResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updatePathRouteSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updatePathRouteSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/pathRouteSets/{pathRouteSetName}") + if err != nil { + return nil, err + } + + var response UpdatePathRouteSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateRuleSet Overwrites an existing set of rules on the specified load balancer. Use this operation to add or alter +// the rules in a rule set. +// To add a new rule to a set, the body must include both the new rule to add and the existing rules to retain. +func (client LoadBalancerClient) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (response UpdateRuleSetResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateRuleSet, policy) + if err != nil { + if ociResponse != nil { + response = UpdateRuleSetResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateRuleSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateRuleSetResponse") + } return } + +// updateRuleSet implements the OCIOperation interface (enables retrying operations) +func (client LoadBalancerClient) updateRuleSet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/loadBalancers/{loadBalancerId}/ruleSets/{ruleSetName}") + if err != nil { + return nil, err + } + + var response UpdateRuleSetResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,63 +14,74 @@ ) // LoadBalancer The properties that define a load balancer. For more information, see -// Managing a Load Balancer (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingloadbalancer.htm). +// Managing a Load Balancer (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingloadbalancer.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // For information about endpoints and signing API requests, see -// About the API (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see -// SDKS and Other Tools (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm). +// About the API (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see +// SDKS and Other Tools (https://docs.cloud.oracle.com/Content/API/Concepts/sdks.htm). type LoadBalancer struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. It does not have to be unique, and it is changeable. - // Example: `My load balancer` + // Example: `example_load_balancer` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer. - Id *string `mandatory:"true" json:"id"` - // The current state of the load balancer. LifecycleState LoadBalancerLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // The date and time the load balancer was created, in the format defined by RFC3339. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + // A template that determines the total pre-provisioned bandwidth (ingress plus egress). // To get a list of available shapes, use the ListShapes // operation. // Example: `100Mbps` ShapeName *string `mandatory:"true" json:"shapeName"` - // The date and time the load balancer was created, in the format defined by RFC3339. - // Example: `2016-08-25T21:10:29.600Z` - TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - - BackendSets map[string]BackendSet `mandatory:"false" json:"backendSets"` - - Certificates map[string]Certificate `mandatory:"false" json:"certificates"` - // An array of IP addresses. IpAddresses []IpAddress `mandatory:"false" json:"ipAddresses"` // Whether the load balancer has a VCN-local (private) IP address. - // If "true", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet - // to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer - // is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security - // list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. - // For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. - // If "false", the service assigns a public IP address to the load balancer. A load balancer with a public IP address - // requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other - // hosts the secondary (standby) load balancer. A public load balancer is accessible from the internet, depending on your - // VCN's security list rules (https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). + // If "true", the service assigns a private IP address to the load balancer. + // If "false", the service assigns a public IP address to the load balancer. + // A public load balancer is accessible from the internet, depending on your VCN's + // security list rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). For more information about public and + // private load balancers, see How Load Balancing Works (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm#how-load-balancing-works). + // Example: `true` IsPrivate *bool `mandatory:"false" json:"isPrivate"` + // An array of subnet OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SubnetIds []string `mandatory:"false" json:"subnetIds"` + Listeners map[string]Listener `mandatory:"false" json:"listeners"` + Hostnames map[string]Hostname `mandatory:"false" json:"hostnames"` + + Certificates map[string]Certificate `mandatory:"false" json:"certificates"` + + BackendSets map[string]BackendSet `mandatory:"false" json:"backendSets"` + PathRouteSets map[string]PathRouteSet `mandatory:"false" json:"pathRouteSets"` - // An array of subnet OCIDs (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). - SubnetIds []string `mandatory:"false" json:"subnetIds"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + RuleSets map[string]RuleSet `mandatory:"false" json:"ruleSets"` } func (m LoadBalancer) String() string { @@ -79,7 +91,7 @@ // LoadBalancerLifecycleStateEnum Enum with underlying type: string type LoadBalancerLifecycleStateEnum string -// Set of constants representing the allowable values for LoadBalancerLifecycleState +// Set of constants representing the allowable values for LoadBalancerLifecycleStateEnum const ( LoadBalancerLifecycleStateCreating LoadBalancerLifecycleStateEnum = "CREATING" LoadBalancerLifecycleStateFailed LoadBalancerLifecycleStateEnum = "FAILED" @@ -96,7 +108,7 @@ "DELETED": LoadBalancerLifecycleStateDeleted, } -// GetLoadBalancerLifecycleStateEnumValues Enumerates the set of values for LoadBalancerLifecycleState +// GetLoadBalancerLifecycleStateEnumValues Enumerates the set of values for LoadBalancerLifecycleStateEnum func GetLoadBalancerLifecycleStateEnumValues() []LoadBalancerLifecycleStateEnum { values := make([]LoadBalancerLifecycleStateEnum, 0) for _, v := range mappingLoadBalancerLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -17,11 +18,6 @@ // `totalBackendSetCount` sum. type LoadBalancerHealth struct { - // A list of backend sets that are currently in the `CRITICAL` health state. The list identifies each backend set by the - // friendly name you assigned when you created it. - // Example: `My_backend_set` - CriticalStateBackendSetNames []string `mandatory:"true" json:"criticalStateBackendSetNames"` - // The overall health status of the load balancer. // * **OK:** All backend sets associated with the load balancer return a status of `OK`. // * **WARNING:** At least one of the backend sets associated with the load balancer returns a status of `WARNING`, @@ -35,19 +31,24 @@ // * The system could not retrieve metrics for any reason. Status LoadBalancerHealthStatusEnum `mandatory:"true" json:"status"` - // The total number of backend sets associated with this load balancer. - // Example: `4` - TotalBackendSetCount *int `mandatory:"true" json:"totalBackendSetCount"` + // A list of backend sets that are currently in the `WARNING` health state. The list identifies each backend set by the + // friendly name you assigned when you created it. + // Example: `example_backend_set3` + WarningStateBackendSetNames []string `mandatory:"true" json:"warningStateBackendSetNames"` + + // A list of backend sets that are currently in the `CRITICAL` health state. The list identifies each backend set by the + // friendly name you assigned when you created it. + // Example: `example_backend_set` + CriticalStateBackendSetNames []string `mandatory:"true" json:"criticalStateBackendSetNames"` // A list of backend sets that are currently in the `UNKNOWN` health state. The list identifies each backend set by the // friendly name you assigned when you created it. - // Example: `Backend_set2` + // Example: `example_backend_set2` UnknownStateBackendSetNames []string `mandatory:"true" json:"unknownStateBackendSetNames"` - // A list of backend sets that are currently in the `WARNING` health state. The list identifies each backend set by the - // friendly name you assigned when you created it. - // Example: `Backend_set3` - WarningStateBackendSetNames []string `mandatory:"true" json:"warningStateBackendSetNames"` + // The total number of backend sets associated with this load balancer. + // Example: `4` + TotalBackendSetCount *int `mandatory:"true" json:"totalBackendSetCount"` } func (m LoadBalancerHealth) String() string { @@ -57,7 +58,7 @@ // LoadBalancerHealthStatusEnum Enum with underlying type: string type LoadBalancerHealthStatusEnum string -// Set of constants representing the allowable values for LoadBalancerHealthStatus +// Set of constants representing the allowable values for LoadBalancerHealthStatusEnum const ( LoadBalancerHealthStatusOk LoadBalancerHealthStatusEnum = "OK" LoadBalancerHealthStatusWarning LoadBalancerHealthStatusEnum = "WARNING" @@ -72,7 +73,7 @@ "UNKNOWN": LoadBalancerHealthStatusUnknown, } -// GetLoadBalancerHealthStatusEnumValues Enumerates the set of values for LoadBalancerHealthStatus +// GetLoadBalancerHealthStatusEnumValues Enumerates the set of values for LoadBalancerHealthStatusEnum func GetLoadBalancerHealthStatusEnumValues() []LoadBalancerHealthStatusEnum { values := make([]LoadBalancerHealthStatusEnum, 0) for _, v := range mappingLoadBalancerHealthStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_health_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,7 +16,7 @@ // LoadBalancerHealthSummary A health status summary for the specified load balancer. type LoadBalancerHealthSummary struct { - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer the health status is associated with. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer the health status is associated with. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` // The overall health status of the load balancer. @@ -39,7 +40,7 @@ // LoadBalancerHealthSummaryStatusEnum Enum with underlying type: string type LoadBalancerHealthSummaryStatusEnum string -// Set of constants representing the allowable values for LoadBalancerHealthSummaryStatus +// Set of constants representing the allowable values for LoadBalancerHealthSummaryStatusEnum const ( LoadBalancerHealthSummaryStatusOk LoadBalancerHealthSummaryStatusEnum = "OK" LoadBalancerHealthSummaryStatusWarning LoadBalancerHealthSummaryStatusEnum = "WARNING" @@ -54,7 +55,7 @@ "UNKNOWN": LoadBalancerHealthSummaryStatusUnknown, } -// GetLoadBalancerHealthSummaryStatusEnumValues Enumerates the set of values for LoadBalancerHealthSummaryStatus +// GetLoadBalancerHealthSummaryStatusEnumValues Enumerates the set of values for LoadBalancerHealthSummaryStatusEnum func GetLoadBalancerHealthSummaryStatusEnumValues() []LoadBalancerHealthSummaryStatusEnum { values := make([]LoadBalancerHealthSummaryStatusEnum, 0) for _, v := range mappingLoadBalancerHealthSummaryStatus { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_policy.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,10 +15,11 @@ // LoadBalancerPolicy A policy that determines how traffic is distributed among backend servers. // For more information on load balancing policies, see -// How Load Balancing Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). +// How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). type LoadBalancerPolicy struct { - // The name of the load balancing policy. + // The name of a load balancing policy. + // Example: 'LEAST_CONNECTIONS' Name *string `mandatory:"true" json:"name"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_protocol.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_protocol.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_protocol.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_protocol.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -12,10 +13,11 @@ "github.com/oracle/oci-go-sdk/common" ) -// LoadBalancerProtocol The protocol that defines the type of traffic accepted by a listener. +// LoadBalancerProtocol A protocol that defines the type of traffic accepted by a listener. type LoadBalancerProtocol struct { - // The name of the protocol. + // The name of a protocol. + // Example: 'HTTP' Name *string `mandatory:"true" json:"name"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_shape.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_shape.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_shape.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/load_balancer_shape.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -19,6 +20,7 @@ type LoadBalancerShape struct { // The name of the shape. + // Example: `100Mbps` Name *string `mandatory:"true" json:"name"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_match_type.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_match_type.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_match_type.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_match_type.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -23,7 +24,7 @@ // * **PREFIX_MATCH** - Looks for a `path` string that matches the beginning portion of the incoming URI path. // * **SUFFIX_MATCH** - Looks for a `path` string that matches the ending portion of the incoming URI path. // For a full description of how the system handles `matchType` in a path route set containing multiple rules, see - // Managing Request Routing (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). + // Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm). MatchType PathMatchTypeMatchTypeEnum `mandatory:"true" json:"matchType"` } @@ -34,7 +35,7 @@ // PathMatchTypeMatchTypeEnum Enum with underlying type: string type PathMatchTypeMatchTypeEnum string -// Set of constants representing the allowable values for PathMatchTypeMatchType +// Set of constants representing the allowable values for PathMatchTypeMatchTypeEnum const ( PathMatchTypeMatchTypeExactMatch PathMatchTypeMatchTypeEnum = "EXACT_MATCH" PathMatchTypeMatchTypeForceLongestPrefixMatch PathMatchTypeMatchTypeEnum = "FORCE_LONGEST_PREFIX_MATCH" @@ -49,7 +50,7 @@ "SUFFIX_MATCH": PathMatchTypeMatchTypeSuffixMatch, } -// GetPathMatchTypeMatchTypeEnumValues Enumerates the set of values for PathMatchTypeMatchType +// GetPathMatchTypeMatchTypeEnumValues Enumerates the set of values for PathMatchTypeMatchTypeEnum func GetPathMatchTypeMatchTypeEnumValues() []PathMatchTypeMatchTypeEnum { values := make([]PathMatchTypeMatchTypeEnum, 0) for _, v := range mappingPathMatchTypeMatchType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -16,10 +17,6 @@ // Path route rules apply only to HTTP and HTTPS requests. They have no effect on TCP requests. type PathRoute struct { - // The name of the target backend set for requests where the incoming URI matches the specified path. - // Example: `My_backend_set` - BackendSetName *string `mandatory:"true" json:"backendSetName"` - // The path string to match against the incoming URI path. // * Path strings are case-insensitive. // * Asterisk (*) wildcards are not supported. @@ -29,6 +26,10 @@ // The type of matching to apply to incoming URIs. PathMatchType *PathMatchType `mandatory:"true" json:"pathMatchType"` + + // The name of the target backend set for requests where the incoming URI matches the specified path. + // Example: `example_backend_set` + BackendSetName *string `mandatory:"true" json:"backendSetName"` } func (m PathRoute) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/path_route_set.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,11 +14,12 @@ ) // PathRouteSet A named set of path route rules. For more information, see -// Managing Request Routing (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). +// Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type PathRouteSet struct { // The unique name for this set of path route rules. Avoid entering confidential information. - // Example: `path-route-set-001` + // Example: `example_path_route_set` Name *string `mandatory:"true" json:"name"` // The set of path route rules. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_request_header_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_request_header_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_request_header_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_request_header_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// RemoveHttpRequestHeaderRule An object that represents the action of removing a header from a request. This rule applies only to HTTP listeners. +// If the same header appears more than once in the request, the load balancer removes all occurances of the specified header. +// **NOTE:** The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore +// or dash characters to uniquely distinguish header names. +type RemoveHttpRequestHeaderRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` +} + +func (m RemoveHttpRequestHeaderRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m RemoveHttpRequestHeaderRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeRemoveHttpRequestHeaderRule RemoveHttpRequestHeaderRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeRemoveHttpRequestHeaderRule + }{ + "REMOVE_HTTP_REQUEST_HEADER", + (MarshalTypeRemoveHttpRequestHeaderRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_response_header_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_response_header_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_response_header_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/remove_http_response_header_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// RemoveHttpResponseHeaderRule An object that represents the action of removing a header from a response. This rule applies only to HTTP listeners. +// If the same header appears more than once in the response, the load balancer removes all occurances of the specified header. +// **NOTE:** The system does not distinquish between underscore and dash characters in headers. That is, it treats +// `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore +// or dash characters to uniquely distinguish header names. +type RemoveHttpResponseHeaderRule struct { + + // A header name that conforms to RFC 7230. + // Example: `example_header_name` + Header *string `mandatory:"true" json:"header"` +} + +func (m RemoveHttpResponseHeaderRule) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m RemoveHttpResponseHeaderRule) MarshalJSON() (buff []byte, e error) { + type MarshalTypeRemoveHttpResponseHeaderRule RemoveHttpResponseHeaderRule + s := struct { + DiscriminatorParam string `json:"action"` + MarshalTypeRemoveHttpResponseHeaderRule + }{ + "REMOVE_HTTP_RESPONSE_HEADER", + (MarshalTypeRemoveHttpResponseHeaderRule)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// Rule An object that represents an action to apply to a listener. +type Rule interface { +} + +type rule struct { + JsonData []byte + Action string `json:"action"` +} + +// UnmarshalJSON unmarshals json +func (m *rule) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerrule rule + s := struct { + Model Unmarshalerrule + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Action = s.Model.Action + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *rule) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Action { + case "ADD_HTTP_REQUEST_HEADER": + mm := AddHttpRequestHeaderRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REMOVE_HTTP_REQUEST_HEADER": + mm := RemoveHttpRequestHeaderRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EXTEND_HTTP_REQUEST_HEADER_VALUE": + mm := ExtendHttpRequestHeaderValueRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REMOVE_HTTP_RESPONSE_HEADER": + mm := RemoveHttpResponseHeaderRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ADD_HTTP_RESPONSE_HEADER": + mm := AddHttpResponseHeaderRule{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EXTEND_HTTP_RESPONSE_HEADER_VALUE": + mm := ExtendHttpResponseHeaderValueRule{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m rule) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// RuleSetDetails The rules that compose a rule set. +type RuleSetDetails struct { + + // An array of rules that compose the rule set. + Items []Rule `mandatory:"true" json:"items"` +} + +func (m RuleSetDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *RuleSetDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []rule `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Items = make([]Rule, len(model.Items)) + for i, n := range model.Items { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Items[i] = nn.(Rule) + } else { + m.Items[i] = nil + } + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/rule_set.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// RuleSet A named set of rules associated with a load balancer. Rules are objects that represent actions to apply to a listener, +// such as adding, altering, or removing HTTP headers. For more information, see +// Managing Rule Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrulesets.htm). +type RuleSet struct { + + // The name for this set of rules. It must be unique and it cannot be changed. Avoid entering + // confidential information. + // Example: `example_rule_set` + Name *string `mandatory:"true" json:"name"` + + // An array of rules that compose the rule set. + Items []Rule `mandatory:"true" json:"items"` +} + +func (m RuleSet) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *RuleSet) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Items []rule `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Name = model.Name + m.Items = make([]Rule, len(model.Items)) + for i, n := range model.Items { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Items[i] = nn.(Rule) + } else { + m.Items[i] = nil + } + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/session_persistence_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/session_persistence_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/session_persistence_configuration_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/session_persistence_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,7 +15,7 @@ // SessionPersistenceConfigurationDetails The configuration details for implementing session persistence. Session persistence enables the Load Balancing // Service to direct any number of requests that originate from a single logical client to a single backend web server. -// For more information, see Session Persistence (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/sessionpersistence.htm). +// For more information, see Session Persistence (https://docs.cloud.oracle.com/Content/Balance/Reference/sessionpersistence.htm). // To disable session persistence on a running load balancer, use the // UpdateBackendSet operation and specify "null" for the // `SessionPersistenceConfigurationDetails` object. @@ -23,12 +24,12 @@ // The name of the cookie used to detect a session initiated by the backend server. Use '*' to specify // that any cookie set by the backend causes the session to persist. - // Example: `myCookieName` + // Example: `example_cookie` CookieName *string `mandatory:"true" json:"cookieName"` // Whether the load balancer is prevented from directing traffic from a persistent session client to // a different backend server if the original server is unavailable. Defaults to false. - // Example: `true` + // Example: `false` DisableFallback *bool `mandatory:"false" json:"disableFallback"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,21 +14,22 @@ ) // SslConfigurationDetails The load balancer's SSL handling configuration details. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type SslConfigurationDetails struct { // A friendly name for the certificate bundle. It must be unique and it cannot be changed. // Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. // Certificate bundle names cannot contain spaces. Avoid entering confidential information. - // Example: `My_certificate_bundle` + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" json:"certificateName"` - // The maximum depth for peer certificate chain verification. - // Example: `3` - VerifyDepth *int `mandatory:"false" json:"verifyDepth"` - // Whether the load balancer listener should verify peer certificates. // Example: `true` VerifyPeerCertificate *bool `mandatory:"false" json:"verifyPeerCertificate"` + + // The maximum depth for peer certificate chain verification. + // Example: `3` + VerifyDepth *int `mandatory:"false" json:"verifyDepth"` } func (m SslConfigurationDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/ssl_configuration.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,21 +15,22 @@ // SslConfiguration A listener's SSL handling configuration. // To use SSL, a listener must be associated with a Certificate. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type SslConfiguration struct { // A friendly name for the certificate bundle. It must be unique and it cannot be changed. // Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. // Certificate bundle names cannot contain spaces. Avoid entering confidential information. - // Example: `My_certificate_bundle` + // Example: `example_certificate_bundle` CertificateName *string `mandatory:"true" json:"certificateName"` - // The maximum depth for peer certificate chain verification. - // Example: `3` - VerifyDepth *int `mandatory:"true" json:"verifyDepth"` - // Whether the load balancer listener should verify peer certificates. // Example: `true` VerifyPeerCertificate *bool `mandatory:"true" json:"verifyPeerCertificate"` + + // The maximum depth for peer certificate chain verification. + // Example: `3` + VerifyDepth *int `mandatory:"true" json:"verifyDepth"` } func (m SslConfiguration) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,28 +16,28 @@ // UpdateBackendDetails The configuration details for updating a backend server. type UpdateBackendDetails struct { + // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + // as a server weighted '1'. + // For more information on load balancing policies, see + // How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // Example: `3` + Weight *int `mandatory:"true" json:"weight"` + // Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress // traffic to this backend server unless all other backend servers not marked as "backup" fail the health check policy. - // Example: `true` + // Example: `false` Backup *bool `mandatory:"true" json:"backup"` // Whether the load balancer should drain this server. Servers marked "drain" receive no new // incoming traffic. - // Example: `true` + // Example: `false` Drain *bool `mandatory:"true" json:"drain"` // Whether the load balancer should treat this server as offline. Offline servers receive no incoming // traffic. - // Example: `true` + // Example: `false` Offline *bool `mandatory:"true" json:"offline"` - - // The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger - // proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections - // as a server weighted '1'. - // For more information on load balancing policies, see - // How Load Balancing Policies Work (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). - // Example: `3` - Weight *int `mandatory:"true" json:"weight"` } func (m UpdateBackendDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,15 +14,15 @@ // Details for updating a backend server. UpdateBackendDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the backend server. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The IP address and port of the backend server to update. - // Example: `1.1.1.7:42` + // Example: `10.0.0.3:8080` BackendName *string `mandatory:"true" contributesTo:"path" name:"backendName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -35,26 +35,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateBackendRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateBackendRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBackendRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateBackendResponse wrapper for the UpdateBackend operation type UpdateBackendResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateBackendResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBackendResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -14,20 +15,21 @@ // UpdateBackendSetDetails The configuration details for updating a load balancer backend set. // For more information on backend set configuration, see -// Managing Backend Sets (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). type UpdateBackendSetDetails struct { - Backends []BackendDetails `mandatory:"true" json:"backends"` - - HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` // The load balancer policy for the backend set. To get a list of available policies, use the // ListPolicies operation. // Example: `LEAST_CONNECTIONS` Policy *string `mandatory:"true" json:"policy"` - SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` + Backends []BackendDetails `mandatory:"true" json:"backends"` + + HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + SessionPersistenceConfiguration *SessionPersistenceConfigurationDetails `mandatory:"false" json:"sessionPersistenceConfiguration"` } func (m UpdateBackendSetDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_backend_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,11 +14,11 @@ // The details to update a backend set. UpdateBackendSetDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set to update. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -31,26 +31,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateBackendSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateBackendSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBackendSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateBackendSetResponse wrapper for the UpdateBackendSet operation type UpdateBackendSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateBackendSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBackendSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,35 +16,35 @@ // UpdateHealthCheckerDetails The health checker's configuration details. type UpdateHealthCheckerDetails struct { - // The interval between health checks, in milliseconds. - // Example: `30000` - IntervalInMillis *int `mandatory:"true" json:"intervalInMillis"` + // The protocol the health check must use; either HTTP or TCP. + // Example: `HTTP` + Protocol *string `mandatory:"true" json:"protocol"` // The backend server port against which to run the health check. // Example: `8080` Port *int `mandatory:"true" json:"port"` - // The protocol the health check must use; either HTTP or TCP. - // Example: `HTTP` - Protocol *string `mandatory:"true" json:"protocol"` - - // A regular expression for parsing the response body from the backend server. - // Example: `^(500|40[1348])$` - ResponseBodyRegex *string `mandatory:"true" json:"responseBodyRegex"` + // The status code a healthy backend server should return. + // Example: `200` + ReturnCode *int `mandatory:"true" json:"returnCode"` // The number of retries to attempt before a backend server is considered "unhealthy". // Example: `3` Retries *int `mandatory:"true" json:"retries"` - // The status code a healthy backend server should return. - // Example: `200` - ReturnCode *int `mandatory:"true" json:"returnCode"` - // The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply // returns within this timeout period. - // Example: `6000` + // Example: `3000` TimeoutInMillis *int `mandatory:"true" json:"timeoutInMillis"` + // The interval between health checks, in milliseconds. + // Example: `10000` + IntervalInMillis *int `mandatory:"true" json:"intervalInMillis"` + + // A regular expression for parsing the response body from the backend server. + // Example: `^((?!false).|\s)*$` + ResponseBodyRegex *string `mandatory:"true" json:"responseBodyRegex"` + // The path against which to run the health check. // Example: `/healthcheck` UrlPath *string `mandatory:"false" json:"urlPath"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_health_checker_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,11 +14,11 @@ // The health check policy configuration details. UpdateHealthCheckerDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be updated. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be updated. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the backend set associated with the health check policy to be retrieved. - // Example: `My_backend_set` + // Example: `example_backend_set` BackendSetName *string `mandatory:"true" contributesTo:"path" name:"backendSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -31,26 +31,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateHealthCheckerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateHealthCheckerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHealthCheckerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateHealthCheckerResponse wrapper for the UpdateHealthChecker operation type UpdateHealthCheckerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateHealthCheckerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHealthCheckerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateHostnameDetails The configuration details for updating a virtual hostname. +// For more information on virtual hostnames, see +// Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm). +type UpdateHostnameDetails struct { + + // The virtual hostname to update. For more information about virtual hostname string construction, see + // Managing Request Routing (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingrequest.htm#routing). + // Example: `app.example.com` + Hostname *string `mandatory:"false" json:"hostname"` +} + +func (m UpdateHostnameDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_hostname_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateHostnameRequest wrapper for the UpdateHostname operation +type UpdateHostnameRequest struct { + + // The configuration details to update a virtual hostname. + UpdateHostnameDetails `contributesTo:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the virtual hostname + // to update. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the hostname resource to update. + // Example: `example_hostname_001` + Name *string `mandatory:"true" contributesTo:"path" name:"name"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateHostnameRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateHostnameRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHostnameRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateHostnameResponse wrapper for the UpdateHostname operation +type UpdateHostnameResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateHostnameResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHostnameResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -16,7 +17,7 @@ type UpdateListenerDetails struct { // The name of the associated backend set. - // Example: `My_backend_set` + // Example: `example_backend_set` DefaultBackendSetName *string `mandatory:"true" json:"defaultBackendSetName"` // The communication port for the listener. @@ -29,14 +30,21 @@ // Example: `HTTP` Protocol *string `mandatory:"true" json:"protocol"` - ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + // An array of hostname resource names. + HostnameNames []string `mandatory:"false" json:"hostnameNames"` // The name of the set of path-based routing rules, PathRouteSet, // applied to this listener's traffic. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"false" json:"pathRouteSetName"` SslConfiguration *SslConfigurationDetails `mandatory:"false" json:"sslConfiguration"` + + ConnectionConfiguration *ConnectionConfiguration `mandatory:"false" json:"connectionConfiguration"` + + // The names of the RuleSet to apply to the listener. + // Example: ["example_rule_set"] + RuleSetNames []string `mandatory:"false" json:"ruleSetNames"` } func (m UpdateListenerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_listener_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,11 +14,11 @@ // Details to update a listener. UpdateListenerDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to update. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to update. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the listener to update. - // Example: `My listener` + // Example: `example_listener` ListenerName *string `mandatory:"true" contributesTo:"path" name:"listenerName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -31,26 +31,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateListenerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateListenerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateListenerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateListenerResponse wrapper for the UpdateListener operation type UpdateListenerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateListenerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateListenerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -13,12 +14,23 @@ ) // UpdateLoadBalancerDetails Configuration details to update a load balancer. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type UpdateLoadBalancerDetails struct { // The user-friendly display name for the load balancer. It does not have to be unique, and it is changeable. // Avoid entering confidential information. - // Example: `My load balancer` - DisplayName *string `mandatory:"true" json:"displayName"` + // Example: `example_load_balancer` + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateLoadBalancerDetails) String() string { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_load_balancer_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,7 +14,7 @@ // The details for updating a load balancer's configuration. UpdateLoadBalancerDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to update. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to update. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -27,26 +27,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateLoadBalancerRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateLoadBalancerResponse wrapper for the UpdateLoadBalancer operation type UpdateLoadBalancerResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateLoadBalancerResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateLoadBalancerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_path_route_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package loadbalancer @@ -14,11 +14,11 @@ // The configuration details to update a path route set. UpdatePathRouteSetDetails `contributesTo:"body"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route set to update. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the path route set to update. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The name of the path route set to update. - // Example: `path-route-set-001` + // Example: `example_path_route_set` PathRouteSetName *string `mandatory:"true" contributesTo:"path" name:"pathRouteSetName"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -31,26 +31,45 @@ // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdatePathRouteSetRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdatePathRouteSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePathRouteSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdatePathRouteSetResponse wrapper for the UpdatePathRouteSet operation type UpdatePathRouteSetResponse struct { // The underlying http response RawResponse *http.Response + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdatePathRouteSetResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePathRouteSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Load Balancing API +// +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). +// + +package loadbalancer + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateRuleSetDetails An updated set of rules that overwrites the existing set of rules. +type UpdateRuleSetDetails struct { + + // An array of rules that compose the rule set. + Items []Rule `mandatory:"true" json:"items"` +} + +func (m UpdateRuleSetDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateRuleSetDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []rule `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Items = make([]Rule, len(model.Items)) + for i, n := range model.Items { + nn, err := n.UnmarshalPolymorphicJSON(n.JsonData) + if err != nil { + return err + } + if nn != nil { + m.Items[i] = nn.(Rule) + } else { + m.Items[i] = nil + } + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/update_rule_set_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package loadbalancer + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateRuleSetRequest wrapper for the UpdateRuleSet operation +type UpdateRuleSetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` + + // The name of the rule set to update. + // Example: `example_rule_set` + RuleSetName *string `mandatory:"true" contributesTo:"path" name:"ruleSetName"` + + // The configuration details to update a set of rules. + UpdateRuleSetDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateRuleSetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateRuleSetRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateRuleSetRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateRuleSetResponse wrapper for the UpdateRuleSet operation +type UpdateRuleSetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateRuleSetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateRuleSetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request_error.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -27,7 +28,7 @@ // WorkRequestErrorErrorCodeEnum Enum with underlying type: string type WorkRequestErrorErrorCodeEnum string -// Set of constants representing the allowable values for WorkRequestErrorErrorCode +// Set of constants representing the allowable values for WorkRequestErrorErrorCodeEnum const ( WorkRequestErrorErrorCodeBadInput WorkRequestErrorErrorCodeEnum = "BAD_INPUT" WorkRequestErrorErrorCodeInternalError WorkRequestErrorErrorCodeEnum = "INTERNAL_ERROR" @@ -38,7 +39,7 @@ "INTERNAL_ERROR": WorkRequestErrorErrorCodeInternalError, } -// GetWorkRequestErrorErrorCodeEnumValues Enumerates the set of values for WorkRequestErrorErrorCode +// GetWorkRequestErrorErrorCodeEnumValues Enumerates the set of values for WorkRequestErrorErrorCodeEnum func GetWorkRequestErrorErrorCodeEnumValues() []WorkRequestErrorErrorCodeEnum { values := make([]WorkRequestErrorErrorCodeEnum, 0) for _, v := range mappingWorkRequestErrorErrorCode { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/loadbalancer/work_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,10 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. -// Load Balancing Service API +// Load Balancing API // -// API for the Load Balancing Service +// API for the Load Balancing service. Use this API to manage load balancers, backend sets, and related items. For more +// information, see Overview of Load Balancing (https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm). // package loadbalancer @@ -15,20 +16,23 @@ // WorkRequest Many of the API requests you use to create and configure load balancing do not take effect immediately. // In these cases, the request spawns an asynchronous work flow to fulfill the request. WorkRequest objects provide visibility // for in-progress work flows. -// For more information about work requests, see Viewing the State of a Work Request (https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/viewingworkrequest.htm). +// For more information about work requests, see Viewing the State of a Work Request (https://docs.cloud.oracle.com/Content/Balance/Tasks/viewingworkrequest.htm). type WorkRequest struct { - ErrorDetails []WorkRequestError `mandatory:"true" json:"errorDetails"` - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Id *string `mandatory:"true" json:"id"` - // The current state of the work request. - LifecycleState WorkRequestLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - - // The OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request // is associated. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` + // The type of action the work request represents. + // Example: `CreateListener` + Type *string `mandatory:"true" json:"type"` + + // The current state of the work request. + LifecycleState WorkRequestLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. // Possible data elements include: // - workflow name @@ -42,8 +46,7 @@ // Example: `2016-08-25T21:10:29.600Z` TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` - // The type of action the work request represents. - Type *string `mandatory:"true" json:"type"` + ErrorDetails []WorkRequestError `mandatory:"true" json:"errorDetails"` // The date and time the work request was completed, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` @@ -57,7 +60,7 @@ // WorkRequestLifecycleStateEnum Enum with underlying type: string type WorkRequestLifecycleStateEnum string -// Set of constants representing the allowable values for WorkRequestLifecycleState +// Set of constants representing the allowable values for WorkRequestLifecycleStateEnum const ( WorkRequestLifecycleStateAccepted WorkRequestLifecycleStateEnum = "ACCEPTED" WorkRequestLifecycleStateInProgress WorkRequestLifecycleStateEnum = "IN_PROGRESS" @@ -72,7 +75,7 @@ "SUCCEEDED": WorkRequestLifecycleStateSucceeded, } -// GetWorkRequestLifecycleStateEnumValues Enumerates the set of values for WorkRequestLifecycleState +// GetWorkRequestLifecycleStateEnumValues Enumerates the set of values for WorkRequestLifecycleStateEnum func GetWorkRequestLifecycleStateEnumValues() []WorkRequestLifecycleStateEnum { values := make([]WorkRequestLifecycleStateEnum, 0) for _, v := range mappingWorkRequestLifecycleState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/Makefile juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/Makefile --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/Makefile 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/Makefile 2019-06-28 17:13:01.000000000 +0000 @@ -1,10 +1,10 @@ -DOC_SERVER_URL=https:\/\/docs.us-phoenix-1.oraclecloud.com +DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email -NON_GEN_TARGETS = common common/auth +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget ##SPECNAME## +NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) -TARGETS_WITH_TESTS = common common/auth +TARGETS_WITH_TESTS = common common/auth objectstorage/transfer TARGETS_BUILD = $(patsubst %,build-%, $(TARGETS)) TARGETS_CLEAN = $(patsubst %,clean-%, $(GEN_TARGETS)) TARGETS_LINT = $(patsubst %,lint-%, $(TARGETS)) @@ -13,6 +13,8 @@ GOLINT=$(GOPATH)/bin/golint LINT_FLAGS=-min_confidence 0.9 -set_exit_status +# directories under gen targets which contains hand writen code +EXCLUDED_CLEAN_DIRECTORIES = objectstorage/transfer* .PHONY: $(TARGETS_BUILD) $(TARGET_TEST) @@ -33,21 +35,34 @@ (cd $< && $(GOLINT) $(LINT_FLAGS) .);\ fi +# for sample code, only build them via 'go test -c' $(TARGETS_BUILD): build-%:% @echo "building: $<" - @(cd $< && find . -name '*_integ_test.go' | xargs -I{} mv {} ../integtest) - @(cd $< && go build -v) + @if [ \( $< = example \) ]; then\ + (cd $< && go test -c);\ + else\ + (cd $< && find . -name '*_integ_test.go' | xargs -I{} mv {} ../integtest);\ + (cd $< && go build -v);\ + fi $(TARGETS_TEST): test-%:% @(cd $< && go test -v) $(TARGETS_CLEAN): clean-%:% @echo "cleaning $<" - @-rm -rf $< + @-find $< -not -path "$<" | grep -vZ ${EXCLUDED_CLEAN_DIRECTORIES} | xargs rm -rf + +# clean all generated code under GEN_TARGETS folder +clean-generate: + for target in ${GEN_TARGETS}; do \ + echo "cleaning $$target"; \ + find $$target -not -path "$$target" | grep -vZ ${EXCLUDED_CLEAN_DIRECTORIES} | xargs rm -rf; \ + done pre-doc: @echo "Rendering doc server to ${DOC_SERVER_URL}" find . -name \*.go |xargs sed -i '' 's/{{DOC_SERVER_URL}}/${DOC_SERVER_URL}/g' + find . -name \*.go |xargs sed -i '' 's/https:\/\/docs.us-phoenix-1.oraclecloud.com/${DOC_SERVER_URL}/g' gen-version: go generate -x diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/aggregated_datapoint.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/aggregated_datapoint.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/aggregated_datapoint.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/aggregated_datapoint.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AggregatedDatapoint A timestamp-value pair returned for the specified request. +type AggregatedDatapoint struct { + + // The date and time associated with the value of this data point. Format defined by RFC3339. + // Example: `2019-02-01T01:02:29.600Z` + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` + + // Numeric value of the metric. + // Example: `10.4` + Value *float64 `mandatory:"true" json:"value"` +} + +func (m AggregatedDatapoint) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Alarm The properties that define an alarm. +// For information about alarms, see Alarms Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). +// For information about endpoints and signing API requests, see +// About the API (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see +// SDKS and Other Tools (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdks.htm). +type Alarm struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name for the alarm. It does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // This name is sent as the title for notifications related to this alarm. + // Example: `High CPU Utilization` + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric + // being evaluated by the alarm. + MetricCompartmentId *string `mandatory:"true" json:"metricCompartmentId"` + + // The source service or application emitting the metric that is evaluated by the alarm. + // Example: `oci_computeagent` + Namespace *string `mandatory:"true" json:"namespace"` + + // The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of + // the Monitoring service interprets results for each returned time series as Boolean values, + // where zero represents false and a non-zero value represents true. A true value means that the trigger + // rule condition has been met. The query must specify a metric, statistic, interval, and trigger + // rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally + // specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + // For details about Monitoring Query Language (MQL), see Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. + // See Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example of threshold alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85 + // ----- + // Example of absence alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent() + // ----- + Query *string `mandatory:"true" json:"query"` + + // The perceived type of response required when the alarm is in the "FIRING" state. + // Example: `CRITICAL` + Severity AlarmSeverityEnum `mandatory:"true" json:"severity"` + + // An array of OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) to which the notifications for + // this alarm will be delivered. An example destination is an OCID for a topic managed by the + // Oracle Cloud Infrastructure Notification service. + Destinations []string `mandatory:"true" json:"destinations"` + + // Whether the alarm is enabled. + // Example: `true` + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The current lifecycle state of the alarm. + // Example: `DELETED` + LifecycleState AlarmLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the alarm was created. Format defined by RFC3339. + // Example: `2019-02-01T01:02:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the alarm was last updated. Format defined by RFC3339. + // Example: `2019-02-03T01:02:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can + // only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified + // in metricCompartmentId. Default is false. + // Example: `true` + MetricCompartmentIdInSubtree *bool `mandatory:"false" json:"metricCompartmentIdInSubtree"` + + // The time between calculated aggregation windows for the alarm. Supported value: `1m` + Resolution *string `mandatory:"false" json:"resolution"` + + // The period of time that the condition defined in the alarm must persist before the alarm state + // changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the + // alarm must persist in breaching the condition for five minutes before the alarm updates its + // state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five + // minutes before the alarm updates its state to "OK." + // The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` + // for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M. + // Under the default value of PT1M, the first evaluation that breaches the alarm updates the + // state to "FIRING" and the first evaluation that does not breach the alarm updates the state + // to "OK". + // Example: `PT5M` + PendingDuration *string `mandatory:"false" json:"pendingDuration"` + + // The human-readable content of the notification delivered. Oracle recommends providing guidance + // to operators for resolving the alarm condition. Consider adding links to standard runbook + // practices. Avoid entering confidential information. + // Example: `High CPU usage alert. Follow runbook instructions for resolution.` + Body *string `mandatory:"false" json:"body"` + + // The frequency at which notifications are re-submitted, if the alarm keeps firing without + // interruption. Format defined by ISO 8601. For example, `PT4H` indicates four hours. + // Minimum: PT1M. Maximum: P30D. + // Default value: null (notifications are not re-submitted). + // Example: `PT2H` + RepeatNotificationDuration *string `mandatory:"false" json:"repeatNotificationDuration"` + + // The configuration details for suppressing an alarm. + Suppression *Suppression `mandatory:"false" json:"suppression"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Alarm) String() string { + return common.PointerString(m) +} + +// AlarmSeverityEnum Enum with underlying type: string +type AlarmSeverityEnum string + +// Set of constants representing the allowable values for AlarmSeverityEnum +const ( + AlarmSeverityCritical AlarmSeverityEnum = "CRITICAL" + AlarmSeverityError AlarmSeverityEnum = "ERROR" + AlarmSeverityWarning AlarmSeverityEnum = "WARNING" + AlarmSeverityInfo AlarmSeverityEnum = "INFO" +) + +var mappingAlarmSeverity = map[string]AlarmSeverityEnum{ + "CRITICAL": AlarmSeverityCritical, + "ERROR": AlarmSeverityError, + "WARNING": AlarmSeverityWarning, + "INFO": AlarmSeverityInfo, +} + +// GetAlarmSeverityEnumValues Enumerates the set of values for AlarmSeverityEnum +func GetAlarmSeverityEnumValues() []AlarmSeverityEnum { + values := make([]AlarmSeverityEnum, 0) + for _, v := range mappingAlarmSeverity { + values = append(values, v) + } + return values +} + +// AlarmLifecycleStateEnum Enum with underlying type: string +type AlarmLifecycleStateEnum string + +// Set of constants representing the allowable values for AlarmLifecycleStateEnum +const ( + AlarmLifecycleStateActive AlarmLifecycleStateEnum = "ACTIVE" + AlarmLifecycleStateDeleting AlarmLifecycleStateEnum = "DELETING" + AlarmLifecycleStateDeleted AlarmLifecycleStateEnum = "DELETED" +) + +var mappingAlarmLifecycleState = map[string]AlarmLifecycleStateEnum{ + "ACTIVE": AlarmLifecycleStateActive, + "DELETING": AlarmLifecycleStateDeleting, + "DELETED": AlarmLifecycleStateDeleted, +} + +// GetAlarmLifecycleStateEnumValues Enumerates the set of values for AlarmLifecycleStateEnum +func GetAlarmLifecycleStateEnumValues() []AlarmLifecycleStateEnum { + values := make([]AlarmLifecycleStateEnum, 0) + for _, v := range mappingAlarmLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_collection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_collection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_collection.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_collection.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlarmHistoryCollection The configuration details for retrieving alarm history. +type AlarmHistoryCollection struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm for which to retrieve history. + AlarmId *string `mandatory:"true" json:"alarmId"` + + // Whether the alarm is enabled. + // Example: `true` + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The set of history entries retrieved for the alarm. + Entries []AlarmHistoryEntry `mandatory:"true" json:"entries"` +} + +func (m AlarmHistoryCollection) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_history_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlarmHistoryEntry An alarm history entry indicating a description of the entry and the time that the entry occurred. +// If the entry corresponds to a state transition, such as OK to Firing, then the entry also includes a transition timestamp. +type AlarmHistoryEntry struct { + + // Description for this alarm history entry. Avoid entering confidential information. + // Example 1 - alarm state history entry: `The alarm state is FIRING` + // Example 2 - alarm state transition history entry: `State transitioned from OK to Firing` + Summary *string `mandatory:"true" json:"summary"` + + // Timestamp for this alarm history entry. Format defined by RFC3339. + // Example: `2019-02-01T01:02:29.600Z` + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` + + // Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. + // Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. + // Example: `2019-02-01T0:59:00.789Z` + TimestampTriggered *common.SDKTime `mandatory:"false" json:"timestampTriggered"` +} + +func (m AlarmHistoryEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_status_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_status_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_status_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_status_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlarmStatusSummary A summary of properties for the specified alarm and its current evaluation status. +// For information about alarms, see Alarms Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). +// For information about endpoints and signing API requests, see +// About the API (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see +// SDKS and Other Tools (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdks.htm). +type AlarmStatusSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm. + Id *string `mandatory:"true" json:"id"` + + // The configured name of the alarm. + // Example: `High CPU Utilization` + DisplayName *string `mandatory:"true" json:"displayName"` + + // The configured severity of the alarm. + // Example: `CRITICAL` + Severity AlarmStatusSummarySeverityEnum `mandatory:"true" json:"severity"` + + // Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. + // Example: `2019-02-01T01:02:29.600Z` + TimestampTriggered *common.SDKTime `mandatory:"true" json:"timestampTriggered"` + + // The status of this alarm. + // Example: `FIRING` + Status AlarmStatusSummaryStatusEnum `mandatory:"true" json:"status"` + + // The configuration details for suppressing an alarm. + Suppression *Suppression `mandatory:"false" json:"suppression"` +} + +func (m AlarmStatusSummary) String() string { + return common.PointerString(m) +} + +// AlarmStatusSummarySeverityEnum Enum with underlying type: string +type AlarmStatusSummarySeverityEnum string + +// Set of constants representing the allowable values for AlarmStatusSummarySeverityEnum +const ( + AlarmStatusSummarySeverityCritical AlarmStatusSummarySeverityEnum = "CRITICAL" + AlarmStatusSummarySeverityError AlarmStatusSummarySeverityEnum = "ERROR" + AlarmStatusSummarySeverityWarning AlarmStatusSummarySeverityEnum = "WARNING" + AlarmStatusSummarySeverityInfo AlarmStatusSummarySeverityEnum = "INFO" +) + +var mappingAlarmStatusSummarySeverity = map[string]AlarmStatusSummarySeverityEnum{ + "CRITICAL": AlarmStatusSummarySeverityCritical, + "ERROR": AlarmStatusSummarySeverityError, + "WARNING": AlarmStatusSummarySeverityWarning, + "INFO": AlarmStatusSummarySeverityInfo, +} + +// GetAlarmStatusSummarySeverityEnumValues Enumerates the set of values for AlarmStatusSummarySeverityEnum +func GetAlarmStatusSummarySeverityEnumValues() []AlarmStatusSummarySeverityEnum { + values := make([]AlarmStatusSummarySeverityEnum, 0) + for _, v := range mappingAlarmStatusSummarySeverity { + values = append(values, v) + } + return values +} + +// AlarmStatusSummaryStatusEnum Enum with underlying type: string +type AlarmStatusSummaryStatusEnum string + +// Set of constants representing the allowable values for AlarmStatusSummaryStatusEnum +const ( + AlarmStatusSummaryStatusFiring AlarmStatusSummaryStatusEnum = "FIRING" + AlarmStatusSummaryStatusOk AlarmStatusSummaryStatusEnum = "OK" + AlarmStatusSummaryStatusSuspended AlarmStatusSummaryStatusEnum = "SUSPENDED" +) + +var mappingAlarmStatusSummaryStatus = map[string]AlarmStatusSummaryStatusEnum{ + "FIRING": AlarmStatusSummaryStatusFiring, + "OK": AlarmStatusSummaryStatusOk, + "SUSPENDED": AlarmStatusSummaryStatusSuspended, +} + +// GetAlarmStatusSummaryStatusEnumValues Enumerates the set of values for AlarmStatusSummaryStatusEnum +func GetAlarmStatusSummaryStatusEnumValues() []AlarmStatusSummaryStatusEnum { + values := make([]AlarmStatusSummaryStatusEnum, 0) + for _, v := range mappingAlarmStatusSummaryStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/alarm_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,123 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AlarmSummary A summary of properties for the specified alarm. +// For information about alarms, see Alarms Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, +// talk to an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). +// For information about endpoints and signing API requests, see +// About the API (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see +// SDKS and Other Tools (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdks.htm). +type AlarmSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name for the alarm. It does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // This name is sent as the title for notifications related to this alarm. + // Example: `High CPU Utilization` + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric + // being evaluated by the alarm. + MetricCompartmentId *string `mandatory:"true" json:"metricCompartmentId"` + + // The source service or application emitting the metric that is evaluated by the alarm. + // Example: `oci_computeagent` + Namespace *string `mandatory:"true" json:"namespace"` + + // The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of + // the Monitoring service interprets results for each returned time series as Boolean values, + // where zero represents false and a non-zero value represents true. A true value means that the trigger + // rule condition has been met. The query must specify a metric, statistic, interval, and trigger + // rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally + // specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + // For details about Monitoring Query Language (MQL), see Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. + // See Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example of threshold alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85 + // ----- + // Example of absence alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent() + // ----- + Query *string `mandatory:"true" json:"query"` + + // The perceived severity of the alarm with regard to the affected system. + // Example: `CRITICAL` + Severity AlarmSummarySeverityEnum `mandatory:"true" json:"severity"` + + // An array of OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) to which the notifications for + // this alarm will be delivered. An example destination is an OCID for a topic managed by the + // Oracle Cloud Infrastructure Notification service. + Destinations []string `mandatory:"true" json:"destinations"` + + // Whether the alarm is enabled. + // Example: `true` + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The current lifecycle state of the alarm. + // Example: `DELETED` + LifecycleState AlarmLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The configuration details for suppressing an alarm. + Suppression *Suppression `mandatory:"false" json:"suppression"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m AlarmSummary) String() string { + return common.PointerString(m) +} + +// AlarmSummarySeverityEnum Enum with underlying type: string +type AlarmSummarySeverityEnum string + +// Set of constants representing the allowable values for AlarmSummarySeverityEnum +const ( + AlarmSummarySeverityCritical AlarmSummarySeverityEnum = "CRITICAL" + AlarmSummarySeverityError AlarmSummarySeverityEnum = "ERROR" + AlarmSummarySeverityWarning AlarmSummarySeverityEnum = "WARNING" + AlarmSummarySeverityInfo AlarmSummarySeverityEnum = "INFO" +) + +var mappingAlarmSummarySeverity = map[string]AlarmSummarySeverityEnum{ + "CRITICAL": AlarmSummarySeverityCritical, + "ERROR": AlarmSummarySeverityError, + "WARNING": AlarmSummarySeverityWarning, + "INFO": AlarmSummarySeverityInfo, +} + +// GetAlarmSummarySeverityEnumValues Enumerates the set of values for AlarmSummarySeverityEnum +func GetAlarmSummarySeverityEnumValues() []AlarmSummarySeverityEnum { + values := make([]AlarmSummarySeverityEnum, 0) + for _, v := range mappingAlarmSummarySeverity { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateAlarmDetails The configuration details for creating an alarm. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateAlarmDetails struct { + + // A user-friendly name for the alarm. It does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // This name is sent as the title for notifications related to this alarm. + // Example: `High CPU Utilization` + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric + // being evaluated by the alarm. + MetricCompartmentId *string `mandatory:"true" json:"metricCompartmentId"` + + // The source service or application emitting the metric that is evaluated by the alarm. + // Example: `oci_computeagent` + Namespace *string `mandatory:"true" json:"namespace"` + + // The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of + // the Monitoring service interprets results for each returned time series as Boolean values, + // where zero represents false and a non-zero value represents true. A true value means that the trigger + // rule condition has been met. The query must specify a metric, statistic, interval, and trigger + // rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally + // specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + // For details about Monitoring Query Language (MQL), see Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. + // See Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example of threshold alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85 + // ----- + // Example of absence alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent() + // ----- + Query *string `mandatory:"true" json:"query"` + + // The perceived type of response required when the alarm is in the "FIRING" state. + // Example: `CRITICAL` + Severity AlarmSeverityEnum `mandatory:"true" json:"severity"` + + // An array of OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) to which the notifications for + // this alarm will be delivered. An example destination is an OCID for a topic managed by the + // Oracle Cloud Infrastructure Notification service. + Destinations []string `mandatory:"true" json:"destinations"` + + // Whether the alarm is enabled. + // Example: `true` + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can + // only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified + // in metricCompartmentId. Default is false. + // Example: `true` + MetricCompartmentIdInSubtree *bool `mandatory:"false" json:"metricCompartmentIdInSubtree"` + + // The time between calculated aggregation windows for the alarm. Supported value: `1m` + Resolution *string `mandatory:"false" json:"resolution"` + + // The period of time that the condition defined in the alarm must persist before the alarm state + // changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the + // alarm must persist in breaching the condition for five minutes before the alarm updates its + // state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five + // minutes before the alarm updates its state to "OK." + // The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` + // for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M. + // Under the default value of PT1M, the first evaluation that breaches the alarm updates the + // state to "FIRING" and the first evaluation that does not breach the alarm updates the state + // to "OK". + // Example: `PT5M` + PendingDuration *string `mandatory:"false" json:"pendingDuration"` + + // The human-readable content of the notification delivered. Oracle recommends providing guidance + // to operators for resolving the alarm condition. Consider adding links to standard runbook + // practices. Avoid entering confidential information. + // Example: `High CPU usage alert. Follow runbook instructions for resolution.` + Body *string `mandatory:"false" json:"body"` + + // The frequency at which notifications are re-submitted, if the alarm keeps firing without + // interruption. Format defined by ISO 8601. For example, `PT4H` indicates four hours. + // Minimum: PT1M. Maximum: P30D. + // Default value: null (notifications are not re-submitted). + // Example: `PT2H` + RepeatNotificationDuration *string `mandatory:"false" json:"repeatNotificationDuration"` + + // The configuration details for suppressing an alarm. + Suppression *Suppression `mandatory:"false" json:"suppression"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateAlarmDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/create_alarm_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateAlarmRequest wrapper for the CreateAlarm operation +type CreateAlarmRequest struct { + + // Document for creating an alarm. + CreateAlarmDetails `contributesTo:"body"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateAlarmRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAlarmRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAlarmRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateAlarmResponse wrapper for the CreateAlarm operation +type CreateAlarmResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Alarm instance + Alarm `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateAlarmResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAlarmResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/datapoint.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/datapoint.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/datapoint.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/datapoint.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Datapoint Metric value for a specific timestamp. +type Datapoint struct { + + // Timestamp for this metric value. Format defined by RFC3339. + // Example: `2019-02-01T01:02:29.600Z` + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` + + // Numeric value of the metric. + // Example: `10.23` + Value *float64 `mandatory:"true" json:"value"` + + // The number of occurrences of the associated value in the set of data. + // Optional. Default is 1. + Count *int `mandatory:"false" json:"count"` +} + +func (m Datapoint) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/delete_alarm_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/delete_alarm_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/delete_alarm_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/delete_alarm_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteAlarmRequest wrapper for the DeleteAlarm operation +type DeleteAlarmRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm. + AlarmId *string `mandatory:"true" contributesTo:"path" name:"alarmId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteAlarmRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAlarmRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAlarmRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteAlarmResponse wrapper for the DeleteAlarm operation +type DeleteAlarmResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteAlarmResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAlarmResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/failed_metric_record.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/failed_metric_record.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/failed_metric_record.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/failed_metric_record.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// FailedMetricRecord The record of a single metric object that failed input validation and the reason for the failure. +type FailedMetricRecord struct { + + // An error message indicating the reason that the indicated metric object failed input validation. + Message *string `mandatory:"true" json:"message"` + + // Identifier of a metric object that failed input validation. + MetricData *MetricDataDetails `mandatory:"true" json:"metricData"` +} + +func (m FailedMetricRecord) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_history_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_history_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_history_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_history_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAlarmHistoryRequest wrapper for the GetAlarmHistory operation +type GetAlarmHistoryRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm. + AlarmId *string `mandatory:"true" contributesTo:"path" name:"alarmId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The type of history entries to retrieve. State history (STATE_HISTORY) or state transition history (STATE_TRANSITION_HISTORY). + // If not specified, entries of both types are retrieved. + // Example: `STATE_HISTORY` + AlarmHistorytype GetAlarmHistoryAlarmHistorytypeEnum `mandatory:"false" contributesTo:"query" name:"alarmHistorytype" omitEmpty:"true"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Default: 1000 + // Example: 500 + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. + // Example: `2019-01-01T01:00:00.789Z` + TimestampGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timestampGreaterThanOrEqualTo"` + + // A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. + // Example: `2019-01-02T01:00:00.789Z` + TimestampLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timestampLessThan"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAlarmHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAlarmHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAlarmHistoryRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAlarmHistoryResponse wrapper for the GetAlarmHistory operation +type GetAlarmHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AlarmHistoryCollection instances + AlarmHistoryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response GetAlarmHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAlarmHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetAlarmHistoryAlarmHistorytypeEnum Enum with underlying type: string +type GetAlarmHistoryAlarmHistorytypeEnum string + +// Set of constants representing the allowable values for GetAlarmHistoryAlarmHistorytypeEnum +const ( + GetAlarmHistoryAlarmHistorytypeHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_HISTORY" + GetAlarmHistoryAlarmHistorytypeTransitionHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_TRANSITION_HISTORY" +) + +var mappingGetAlarmHistoryAlarmHistorytype = map[string]GetAlarmHistoryAlarmHistorytypeEnum{ + "STATE_HISTORY": GetAlarmHistoryAlarmHistorytypeHistory, + "STATE_TRANSITION_HISTORY": GetAlarmHistoryAlarmHistorytypeTransitionHistory, +} + +// GetGetAlarmHistoryAlarmHistorytypeEnumValues Enumerates the set of values for GetAlarmHistoryAlarmHistorytypeEnum +func GetGetAlarmHistoryAlarmHistorytypeEnumValues() []GetAlarmHistoryAlarmHistorytypeEnum { + values := make([]GetAlarmHistoryAlarmHistorytypeEnum, 0) + for _, v := range mappingGetAlarmHistoryAlarmHistorytype { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/get_alarm_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetAlarmRequest wrapper for the GetAlarm operation +type GetAlarmRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm. + AlarmId *string `mandatory:"true" contributesTo:"path" name:"alarmId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetAlarmRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAlarmRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAlarmRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetAlarmResponse wrapper for the GetAlarm operation +type GetAlarmResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Alarm instance + Alarm `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetAlarmResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAlarmResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAlarmsRequest wrapper for the ListAlarms operation +type ListAlarmsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources monitored by the metric that you are searching for. Use tenancyId to search in + // the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Default: 1000 + // Example: 500 + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A filter to return only resources that match the given display name exactly. + // Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only alarms that match the given lifecycle state exactly. When not specified, only alarms in the ACTIVE lifecycle state are listed. + LifecycleState AlarmLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The field to use when sorting returned alarm definitions. Only one sorting level is provided. + // Example: `severity` + SortBy ListAlarmsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC). + // Example: `ASC` + SortOrder ListAlarmsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // When true, returns resources from all compartments and subcompartments. The parameter can + // only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, returns resources from only the compartment specified in + // compartmentId. Default is false. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAlarmsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAlarmsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAlarmsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAlarmsResponse wrapper for the ListAlarms operation +type ListAlarmsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AlarmSummary instances + Items []AlarmSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAlarmsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAlarmsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAlarmsSortByEnum Enum with underlying type: string +type ListAlarmsSortByEnum string + +// Set of constants representing the allowable values for ListAlarmsSortByEnum +const ( + ListAlarmsSortByDisplayname ListAlarmsSortByEnum = "displayName" + ListAlarmsSortBySeverity ListAlarmsSortByEnum = "severity" +) + +var mappingListAlarmsSortBy = map[string]ListAlarmsSortByEnum{ + "displayName": ListAlarmsSortByDisplayname, + "severity": ListAlarmsSortBySeverity, +} + +// GetListAlarmsSortByEnumValues Enumerates the set of values for ListAlarmsSortByEnum +func GetListAlarmsSortByEnumValues() []ListAlarmsSortByEnum { + values := make([]ListAlarmsSortByEnum, 0) + for _, v := range mappingListAlarmsSortBy { + values = append(values, v) + } + return values +} + +// ListAlarmsSortOrderEnum Enum with underlying type: string +type ListAlarmsSortOrderEnum string + +// Set of constants representing the allowable values for ListAlarmsSortOrderEnum +const ( + ListAlarmsSortOrderAsc ListAlarmsSortOrderEnum = "ASC" + ListAlarmsSortOrderDesc ListAlarmsSortOrderEnum = "DESC" +) + +var mappingListAlarmsSortOrder = map[string]ListAlarmsSortOrderEnum{ + "ASC": ListAlarmsSortOrderAsc, + "DESC": ListAlarmsSortOrderDesc, +} + +// GetListAlarmsSortOrderEnumValues Enumerates the set of values for ListAlarmsSortOrderEnum +func GetListAlarmsSortOrderEnumValues() []ListAlarmsSortOrderEnum { + values := make([]ListAlarmsSortOrderEnum, 0) + for _, v := range mappingListAlarmsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_status_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_status_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_status_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_alarms_status_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAlarmsStatusRequest wrapper for the ListAlarmsStatus operation +type ListAlarmsStatusRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources monitored by the metric that you are searching for. Use tenancyId to search in + // the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // When true, returns resources from all compartments and subcompartments. The parameter can + // only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, returns resources from only the compartment specified in + // compartmentId. Default is false. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Default: 1000 + // Example: 500 + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A filter to return only resources that match the given display name exactly. + // Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to use when sorting returned alarm definitions. Only one sorting level is provided. + // Example: `severity` + SortBy ListAlarmsStatusSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC). + // Example: `ASC` + SortOrder ListAlarmsStatusSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAlarmsStatusRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAlarmsStatusRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAlarmsStatusRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAlarmsStatusResponse wrapper for the ListAlarmsStatus operation +type ListAlarmsStatusResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AlarmStatusSummary instances + Items []AlarmStatusSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAlarmsStatusResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAlarmsStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAlarmsStatusSortByEnum Enum with underlying type: string +type ListAlarmsStatusSortByEnum string + +// Set of constants representing the allowable values for ListAlarmsStatusSortByEnum +const ( + ListAlarmsStatusSortByDisplayname ListAlarmsStatusSortByEnum = "displayName" + ListAlarmsStatusSortBySeverity ListAlarmsStatusSortByEnum = "severity" +) + +var mappingListAlarmsStatusSortBy = map[string]ListAlarmsStatusSortByEnum{ + "displayName": ListAlarmsStatusSortByDisplayname, + "severity": ListAlarmsStatusSortBySeverity, +} + +// GetListAlarmsStatusSortByEnumValues Enumerates the set of values for ListAlarmsStatusSortByEnum +func GetListAlarmsStatusSortByEnumValues() []ListAlarmsStatusSortByEnum { + values := make([]ListAlarmsStatusSortByEnum, 0) + for _, v := range mappingListAlarmsStatusSortBy { + values = append(values, v) + } + return values +} + +// ListAlarmsStatusSortOrderEnum Enum with underlying type: string +type ListAlarmsStatusSortOrderEnum string + +// Set of constants representing the allowable values for ListAlarmsStatusSortOrderEnum +const ( + ListAlarmsStatusSortOrderAsc ListAlarmsStatusSortOrderEnum = "ASC" + ListAlarmsStatusSortOrderDesc ListAlarmsStatusSortOrderEnum = "DESC" +) + +var mappingListAlarmsStatusSortOrder = map[string]ListAlarmsStatusSortOrderEnum{ + "ASC": ListAlarmsStatusSortOrderAsc, + "DESC": ListAlarmsStatusSortOrderDesc, +} + +// GetListAlarmsStatusSortOrderEnumValues Enumerates the set of values for ListAlarmsStatusSortOrderEnum +func GetListAlarmsStatusSortOrderEnumValues() []ListAlarmsStatusSortOrderEnum { + values := make([]ListAlarmsStatusSortOrderEnum, 0) + for _, v := range mappingListAlarmsStatusSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ListMetricsDetails The request details for retrieving metric definitions. Specify optional properties to filter the returned results. +// Use an asterisk ("\*") as a wildcard character, placed anywhere in the string. +// For example, to search for all metrics with names that begin with "disk", specify "name" as "disk\*". +// If no properties are specified, then all metric definitions within the request scope are returned. +type ListMetricsDetails struct { + + // The metric name to use when searching for metric definitions. + // Example: `CpuUtilization` + Name *string `mandatory:"false" json:"name"` + + // The source service or application to use when searching for metric definitions. + // Example: `oci_computeagent` + Namespace *string `mandatory:"false" json:"namespace"` + + // Qualifiers that you want to use when searching for metric definitions. + // Available dimensions vary by metric namespace. Each dimension takes the form of a key-value pair. + // Example: { "resourceId": "<instance_OCID>" } + DimensionFilters map[string]string `mandatory:"false" json:"dimensionFilters"` + + // Group metrics by these fields in the response. For example, to list all metric namespaces available + // in a compartment, groupBy the "namespace" field. + // Example - group by namespace and resource: + // `[ "namespace", "resourceId" ]` + GroupBy []string `mandatory:"false" json:"groupBy"` + + // The field to use when sorting returned metric definitions. Only one sorting level is provided. + // Example: `NAMESPACE` + SortBy ListMetricsDetailsSortByEnum `mandatory:"false" json:"sortBy,omitempty"` + + // The sort order to use when sorting returned metric definitions. Ascending (ASC) or + // descending (DESC). + // Example: `ASC` + SortOrder ListMetricsDetailsSortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` +} + +func (m ListMetricsDetails) String() string { + return common.PointerString(m) +} + +// ListMetricsDetailsSortByEnum Enum with underlying type: string +type ListMetricsDetailsSortByEnum string + +// Set of constants representing the allowable values for ListMetricsDetailsSortByEnum +const ( + ListMetricsDetailsSortByNamespace ListMetricsDetailsSortByEnum = "NAMESPACE" + ListMetricsDetailsSortByName ListMetricsDetailsSortByEnum = "NAME" +) + +var mappingListMetricsDetailsSortBy = map[string]ListMetricsDetailsSortByEnum{ + "NAMESPACE": ListMetricsDetailsSortByNamespace, + "NAME": ListMetricsDetailsSortByName, +} + +// GetListMetricsDetailsSortByEnumValues Enumerates the set of values for ListMetricsDetailsSortByEnum +func GetListMetricsDetailsSortByEnumValues() []ListMetricsDetailsSortByEnum { + values := make([]ListMetricsDetailsSortByEnum, 0) + for _, v := range mappingListMetricsDetailsSortBy { + values = append(values, v) + } + return values +} + +// ListMetricsDetailsSortOrderEnum Enum with underlying type: string +type ListMetricsDetailsSortOrderEnum string + +// Set of constants representing the allowable values for ListMetricsDetailsSortOrderEnum +const ( + ListMetricsDetailsSortOrderAsc ListMetricsDetailsSortOrderEnum = "ASC" + ListMetricsDetailsSortOrderDesc ListMetricsDetailsSortOrderEnum = "DESC" +) + +var mappingListMetricsDetailsSortOrder = map[string]ListMetricsDetailsSortOrderEnum{ + "ASC": ListMetricsDetailsSortOrderAsc, + "DESC": ListMetricsDetailsSortOrderDesc, +} + +// GetListMetricsDetailsSortOrderEnumValues Enumerates the set of values for ListMetricsDetailsSortOrderEnum +func GetListMetricsDetailsSortOrderEnumValues() []ListMetricsDetailsSortOrderEnum { + values := make([]ListMetricsDetailsSortOrderEnum, 0) + for _, v := range mappingListMetricsDetailsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/list_metrics_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListMetricsRequest wrapper for the ListMetrics operation +type ListMetricsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources monitored by the metric that you are searching for. Use tenancyId to search in + // the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The dimensions used to filter metrics. + ListMetricsDetails `contributesTo:"body"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Default: 1000 + // Example: 500 + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // When true, returns resources from all compartments and subcompartments. The parameter can + // only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, returns resources from only the compartment specified in + // compartmentId. Default is false. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListMetricsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMetricsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMetricsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListMetricsResponse wrapper for the ListMetrics operation +type ListMetricsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Metric instances + Items []Metric `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListMetricsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMetricsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MetricDataDetails A metric object containing raw metric data points to be posted to the Monitoring service. +type MetricDataDetails struct { + + // The source service or application emitting the metric. + // A valid namespace value starts with an alphabetical character and includes only alphanumeric characters and underscores. The "oci_" prefix is reserved. + // Avoid entering confidential information. + // Example: `my_namespace` + Namespace *string `mandatory:"true" json:"namespace"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to use for metrics. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the metric. + // A valid name value starts with an alphabetical character and includes only alphanumeric characters, dots, underscores, hyphens, and dollar signs. + // Avoid entering confidential information. + // Example: `my_app.success_rate` + Name *string `mandatory:"true" json:"name"` + + // A list of metric values with timestamps. At least one data point is required per call. + Datapoints []Datapoint `mandatory:"true" json:"datapoints"` + + // Qualifiers provided in a metric definition. Available dimensions vary by metric namespace. + // Each dimension takes the form of a key-value pair. A valid dimension key includes only printable ASCII, excluding periods (.) and spaces. A valid dimension value includes only Unicode characters. + // Empty strings are not allowed for keys or values. Avoid entering confidential information. + // Example: `"resourceId": "ocid1.instance.region1.phx.exampleuniqueID"` + Dimensions map[string]string `mandatory:"false" json:"dimensions"` + + // Properties describing metrics. These are not part of the unique fields identifying the metric. + // Example: `"unit": "bytes"` + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m MetricDataDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric_data.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MetricData The set of aggregated data returned for a metric. +// For information about metrics, see Metrics Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#MetricsOverview). +type MetricData struct { + + // The reference provided in a metric definition to indicate the source service or + // application that emitted the metric. + // Example: `oci_computeagent` + Namespace *string `mandatory:"true" json:"namespace"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources from which the aggregated data was returned. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the metric. + // Example: `CpuUtilization` + Name *string `mandatory:"true" json:"name"` + + // Qualifiers provided in the definition of the returned metric. + // Available dimensions vary by metric namespace. Each dimension takes the form of a key-value pair. + // Example: `"resourceId": "ocid1.instance.region1.phx.exampleuniqueID"` + Dimensions map[string]string `mandatory:"true" json:"dimensions"` + + // The list of timestamp-value pairs returned for the specified request. Metric values are rolled up to the start time specified in the request. + AggregatedDatapoints []AggregatedDatapoint `mandatory:"true" json:"aggregatedDatapoints"` + + // The references provided in a metric definition to indicate extra information about the metric. + // Example: `"unit": "bytes"` + Metadata map[string]string `mandatory:"false" json:"metadata"` + + // The time between calculated aggregation windows. Use with the query interval to vary the + // frequency at which aggregated data points are returned. For example, use a query interval of + // 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute + // frequency. The resolution must be equal or less than the interval in the query. The default + // resolution is 1m (one minute). Supported values: `1m`-`60m` (also `1h`). + // Example: `5m` + Resolution *string `mandatory:"false" json:"resolution"` +} + +func (m MetricData) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/metric.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Metric The properties that define a metric. +// For information about metrics, see Metrics Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#MetricsOverview). +type Metric struct { + + // The name of the metric. + // Example: `CpuUtilization` + Name *string `mandatory:"false" json:"name"` + + // The source service or application emitting the metric. + // Example: `oci_computeagent` + Namespace *string `mandatory:"false" json:"namespace"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing + // the resources monitored by the metric. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Qualifiers provided in a metric definition. Available dimensions vary by metric namespace. + // Each dimension takes the form of a key-value pair. + // Example: `"resourceId": "ocid1.instance.region1.phx.exampleuniqueID"` + Dimensions map[string]string `mandatory:"false" json:"dimensions"` +} + +func (m Metric) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/monitoring_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/monitoring_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/monitoring_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/monitoring_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,532 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//MonitoringClient a client for Monitoring +type MonitoringClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewMonitoringClientWithConfigurationProvider Creates a new default Monitoring client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewMonitoringClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client MonitoringClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = MonitoringClient{BaseClient: baseClient} + client.BasePath = "20180401" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *MonitoringClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("telemetry") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *MonitoringClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *MonitoringClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateAlarm Creates a new alarm in the specified compartment. +func (client MonitoringClient) CreateAlarm(ctx context.Context, request CreateAlarmRequest) (response CreateAlarmResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createAlarm, policy) + if err != nil { + if ociResponse != nil { + response = CreateAlarmResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateAlarmResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAlarmResponse") + } + return +} + +// createAlarm implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) createAlarm(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/alarms") + if err != nil { + return nil, err + } + + var response CreateAlarmResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAlarm Deletes the specified alarm. +func (client MonitoringClient) DeleteAlarm(ctx context.Context, request DeleteAlarmRequest) (response DeleteAlarmResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAlarm, policy) + if err != nil { + if ociResponse != nil { + response = DeleteAlarmResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAlarmResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAlarmResponse") + } + return +} + +// deleteAlarm implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) deleteAlarm(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/alarms/{alarmId}") + if err != nil { + return nil, err + } + + var response DeleteAlarmResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAlarm Gets the specified alarm. +func (client MonitoringClient) GetAlarm(ctx context.Context, request GetAlarmRequest) (response GetAlarmResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAlarm, policy) + if err != nil { + if ociResponse != nil { + response = GetAlarmResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAlarmResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAlarmResponse") + } + return +} + +// getAlarm implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) getAlarm(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/alarms/{alarmId}") + if err != nil { + return nil, err + } + + var response GetAlarmResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAlarmHistory Get the history of the specified alarm. +func (client MonitoringClient) GetAlarmHistory(ctx context.Context, request GetAlarmHistoryRequest) (response GetAlarmHistoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAlarmHistory, policy) + if err != nil { + if ociResponse != nil { + response = GetAlarmHistoryResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetAlarmHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAlarmHistoryResponse") + } + return +} + +// getAlarmHistory implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) getAlarmHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/alarms/{alarmId}/history") + if err != nil { + return nil, err + } + + var response GetAlarmHistoryResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAlarms Lists the alarms for the specified compartment. +func (client MonitoringClient) ListAlarms(ctx context.Context, request ListAlarmsRequest) (response ListAlarmsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAlarms, policy) + if err != nil { + if ociResponse != nil { + response = ListAlarmsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAlarmsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAlarmsResponse") + } + return +} + +// listAlarms implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) listAlarms(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/alarms") + if err != nil { + return nil, err + } + + var response ListAlarmsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAlarmsStatus List the status of each alarm in the specified compartment. +func (client MonitoringClient) ListAlarmsStatus(ctx context.Context, request ListAlarmsStatusRequest) (response ListAlarmsStatusResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAlarmsStatus, policy) + if err != nil { + if ociResponse != nil { + response = ListAlarmsStatusResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAlarmsStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAlarmsStatusResponse") + } + return +} + +// listAlarmsStatus implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) listAlarmsStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/alarms/status") + if err != nil { + return nil, err + } + + var response ListAlarmsStatusResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMetrics Returns metric definitions that match the criteria specified in the request. Compartment OCID required. +// For information about metrics, see Metrics Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#MetricsOverview). +func (client MonitoringClient) ListMetrics(ctx context.Context, request ListMetricsRequest) (response ListMetricsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listMetrics, policy) + if err != nil { + if ociResponse != nil { + response = ListMetricsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListMetricsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMetricsResponse") + } + return +} + +// listMetrics implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) listMetrics(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/metrics/actions/listMetrics") + if err != nil { + return nil, err + } + + var response ListMetricsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PostMetricData Publishes raw metric data points to the Monitoring service. +// For more information about publishing metrics, see Publishing Custom Metrics (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/publishingcustommetrics.htm). +// The endpoints for this operation differ from other Monitoring operations. Replace the string `telemetry` with `telemetry-ingestion` in the endpoint, as in the following example: +// https://telemetry-ingestion.eu-frankfurt-1.oraclecloud.com +func (client MonitoringClient) PostMetricData(ctx context.Context, request PostMetricDataRequest) (response PostMetricDataResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.postMetricData, policy) + if err != nil { + if ociResponse != nil { + response = PostMetricDataResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PostMetricDataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PostMetricDataResponse") + } + return +} + +// postMetricData implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) postMetricData(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/metrics") + if err != nil { + return nil, err + } + + var response PostMetricDataResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveAlarmSuppression Removes any existing suppression for the specified alarm. +func (client MonitoringClient) RemoveAlarmSuppression(ctx context.Context, request RemoveAlarmSuppressionRequest) (response RemoveAlarmSuppressionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.removeAlarmSuppression, policy) + if err != nil { + if ociResponse != nil { + response = RemoveAlarmSuppressionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(RemoveAlarmSuppressionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveAlarmSuppressionResponse") + } + return +} + +// removeAlarmSuppression implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) removeAlarmSuppression(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/alarms/{alarmId}/actions/removeSuppression") + if err != nil { + return nil, err + } + + var response RemoveAlarmSuppressionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeMetricsData Returns aggregated data that match the criteria specified in the request. Compartment OCID required. +// For information on metric queries, see Building Metric Queries (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/buildingqueries.htm). +func (client MonitoringClient) SummarizeMetricsData(ctx context.Context, request SummarizeMetricsDataRequest) (response SummarizeMetricsDataResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeMetricsData, policy) + if err != nil { + if ociResponse != nil { + response = SummarizeMetricsDataResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeMetricsDataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeMetricsDataResponse") + } + return +} + +// summarizeMetricsData implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) summarizeMetricsData(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/metrics/actions/summarizeMetricsData") + if err != nil { + return nil, err + } + + var response SummarizeMetricsDataResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAlarm Updates the specified alarm. +func (client MonitoringClient) UpdateAlarm(ctx context.Context, request UpdateAlarmRequest) (response UpdateAlarmResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateAlarm, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAlarmResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAlarmResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAlarmResponse") + } + return +} + +// updateAlarm implements the OCIOperation interface (enables retrying operations) +func (client MonitoringClient) updateAlarm(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/alarms/{alarmId}") + if err != nil { + return nil, err + } + + var response UpdateAlarmResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PostMetricDataDetails An array of metric objects containing raw metric data points to be posted to the Monitoring service. +type PostMetricDataDetails struct { + + // A metric object containing raw metric data points to be posted to the Monitoring service. + MetricData []MetricDataDetails `mandatory:"true" json:"metricData"` + + // Batch atomicity behavior. Requires either partial or full pass of input validation for + // metric objects in PostMetricData requests. The default value of NON_ATOMIC requires a + // partial pass: at least one metric object in the request must pass input validation, and + // any objects that failed validation are identified in the returned summary, along with + // their error messages. A value of ATOMIC requires a full pass: all metric objects in + // the request must pass input validation. + // Example: `NON_ATOMIC` + BatchAtomicity PostMetricDataDetailsBatchAtomicityEnum `mandatory:"false" json:"batchAtomicity,omitempty"` +} + +func (m PostMetricDataDetails) String() string { + return common.PointerString(m) +} + +// PostMetricDataDetailsBatchAtomicityEnum Enum with underlying type: string +type PostMetricDataDetailsBatchAtomicityEnum string + +// Set of constants representing the allowable values for PostMetricDataDetailsBatchAtomicityEnum +const ( + PostMetricDataDetailsBatchAtomicityAtomic PostMetricDataDetailsBatchAtomicityEnum = "ATOMIC" + PostMetricDataDetailsBatchAtomicityNonAtomic PostMetricDataDetailsBatchAtomicityEnum = "NON_ATOMIC" +) + +var mappingPostMetricDataDetailsBatchAtomicity = map[string]PostMetricDataDetailsBatchAtomicityEnum{ + "ATOMIC": PostMetricDataDetailsBatchAtomicityAtomic, + "NON_ATOMIC": PostMetricDataDetailsBatchAtomicityNonAtomic, +} + +// GetPostMetricDataDetailsBatchAtomicityEnumValues Enumerates the set of values for PostMetricDataDetailsBatchAtomicityEnum +func GetPostMetricDataDetailsBatchAtomicityEnumValues() []PostMetricDataDetailsBatchAtomicityEnum { + values := make([]PostMetricDataDetailsBatchAtomicityEnum, 0) + for _, v := range mappingPostMetricDataDetailsBatchAtomicity { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// PostMetricDataRequest wrapper for the PostMetricData operation +type PostMetricDataRequest struct { + + // An array of metric objects containing raw metric data points to be posted to the Monitoring service. + PostMetricDataDetails `contributesTo:"body"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PostMetricDataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PostMetricDataRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PostMetricDataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// PostMetricDataResponse wrapper for the PostMetricData operation +type PostMetricDataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PostMetricDataResponseDetails instance + PostMetricDataResponseDetails `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PostMetricDataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PostMetricDataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_response_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_response_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_response_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/post_metric_data_response_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,29 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PostMetricDataResponseDetails The response object returned from a PostMetricData operation. +type PostMetricDataResponseDetails struct { + + // The number of metric objects that failed input validation. + FailedMetricsCount *int `mandatory:"true" json:"failedMetricsCount"` + + // A list of records identifying metric objects that failed input validation + // and the reasons for the failures. + FailedMetrics []FailedMetricRecord `mandatory:"false" json:"failedMetrics"` +} + +func (m PostMetricDataResponseDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/remove_alarm_suppression_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/remove_alarm_suppression_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/remove_alarm_suppression_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/remove_alarm_suppression_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// RemoveAlarmSuppressionRequest wrapper for the RemoveAlarmSuppression operation +type RemoveAlarmSuppressionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm. + AlarmId *string `mandatory:"true" contributesTo:"path" name:"alarmId"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveAlarmSuppressionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveAlarmSuppressionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveAlarmSuppressionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// RemoveAlarmSuppressionResponse wrapper for the RemoveAlarmSuppression operation +type RemoveAlarmSuppressionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RemoveAlarmSuppressionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveAlarmSuppressionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SummarizeMetricsDataDetails The request details for retrieving aggregated data. +// Use the query and optional properties to filter the returned results. +type SummarizeMetricsDataDetails struct { + + // The source service or application to use when searching for metric data points to aggregate. + // Example: `oci_computeagent` + Namespace *string `mandatory:"true" json:"namespace"` + + // The Monitoring Query Language (MQL) expression to use when searching for metric data points to + // aggregate. The query must specify a metric, statistic, and interval. Supported values for + // interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. + // Supported grouping functions: `grouping()`, `groupBy()`. + // For details about Monitoring Query Language (MQL), see + // Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. + // See Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example: `CpuUtilization[1m].sum()` + Query *string `mandatory:"true" json:"query"` + + // The beginning of the time range to use when searching for metric data points. + // Format is defined by RFC3339. The response includes metric data points for the startTime. + // Default value: the timestamp 3 hours before the call was sent. + // Example: `2019-02-01T01:02:29.600Z` + StartTime *common.SDKTime `mandatory:"false" json:"startTime"` + + // The end of the time range to use when searching for metric data points. + // Format is defined by RFC3339. The response excludes metric data points for the endTime. + // Default value: the timestamp representing when the call was sent. + // Example: `2019-02-01T02:02:29.600Z` + EndTime *common.SDKTime `mandatory:"false" json:"endTime"` + + // The time between calculated aggregation windows. Use with the query interval to vary the + // frequency at which aggregated data points are returned. For example, use a query interval of + // 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute + // frequency. The resolution must be equal or less than the interval in the query. The default + // resolution is 1m (one minute). Supported values: `1m`-`60m` (also `1h`). + // Example: `5m` + Resolution *string `mandatory:"false" json:"resolution"` +} + +func (m SummarizeMetricsDataDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/summarize_metrics_data_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// SummarizeMetricsDataRequest wrapper for the SummarizeMetricsData operation +type SummarizeMetricsDataRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the + // resources monitored by the metric that you are searching for. Use tenancyId to search in + // the root compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The dimensions used to filter for metrics. + SummarizeMetricsDataDetails `contributesTo:"body"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // When true, returns resources from all compartments and subcompartments. The parameter can + // only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, returns resources from only the compartment specified in + // compartmentId. Default is false. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeMetricsDataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeMetricsDataRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeMetricsDataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// SummarizeMetricsDataResponse wrapper for the SummarizeMetricsData operation +type SummarizeMetricsDataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []MetricData instance + Items []MetricData `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response SummarizeMetricsDataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeMetricsDataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/suppression.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/suppression.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/suppression.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/suppression.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Suppression The configuration details for suppressing an alarm. +// For information about alarms, see Alarms Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type Suppression struct { + + // The start date and time for the suppression to take place, inclusive. Format defined by RFC3339. + // Example: `2019-02-01T01:02:29.600Z` + TimeSuppressFrom *common.SDKTime `mandatory:"true" json:"timeSuppressFrom"` + + // The end date and time for the suppression to take place, inclusive. Format defined by RFC3339. + // Example: `2019-02-01T02:02:29.600Z` + TimeSuppressUntil *common.SDKTime `mandatory:"true" json:"timeSuppressUntil"` + + // Human-readable reason for suppressing alarm notifications. + // It does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // Oracle recommends including tracking information for the event or associated work, + // such as a ticket number. + // Example: `Planned outage due to change IT-1234.` + Description *string `mandatory:"false" json:"description"` +} + +func (m Suppression) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// For information about monitoring, see Monitoring Overview (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm). +// + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateAlarmDetails The configuration details for updating an alarm. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateAlarmDetails struct { + + // A user-friendly name for the alarm. It does not have to be unique, and it's changeable. + // Avoid entering confidential information. + // This name is sent as the title for notifications related to this alarm. + // Example: `High CPU Utilization` + DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric + // being evaluated by the alarm. + MetricCompartmentId *string `mandatory:"false" json:"metricCompartmentId"` + + // When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can + // only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). + // A true value requires the user to have tenancy-level permissions. If this requirement is not met, + // then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified + // in metricCompartmentId. Default is false. + // Example: `true` + MetricCompartmentIdInSubtree *bool `mandatory:"false" json:"metricCompartmentIdInSubtree"` + + // The source service or application emitting the metric that is evaluated by the alarm. + // Example: `oci_computeagent` + Namespace *string `mandatory:"false" json:"namespace"` + + // The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of + // the Monitoring service interprets results for each returned time series as Boolean values, + // where zero represents false and a non-zero value represents true. A true value means that the trigger + // rule condition has been met. The query must specify a metric, statistic, interval, and trigger + // rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally + // specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + // For details about Monitoring Query Language (MQL), see Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. + // See Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example of threshold alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85 + // ----- + // Example of absence alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent() + // ----- + Query *string `mandatory:"false" json:"query"` + + // The time between calculated aggregation windows for the alarm. Supported value: `1m` + Resolution *string `mandatory:"false" json:"resolution"` + + // The period of time that the condition defined in the alarm must persist before the alarm state + // changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the + // alarm must persist in breaching the condition for five minutes before the alarm updates its + // state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five + // minutes before the alarm updates its state to "OK." + // The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` + // for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M. + // Under the default value of PT1M, the first evaluation that breaches the alarm updates the + // state to "FIRING" and the first evaluation that does not breach the alarm updates the state + // to "OK". + // Example: `PT5M` + PendingDuration *string `mandatory:"false" json:"pendingDuration"` + + // The perceived severity of the alarm with regard to the affected system. + // Example: `CRITICAL` + Severity AlarmSeverityEnum `mandatory:"false" json:"severity,omitempty"` + + // The human-readable content of the notification delivered. Oracle recommends providing guidance + // to operators for resolving the alarm condition. Consider adding links to standard runbook + // practices. Avoid entering confidential information. + // Example: `High CPU usage alert. Follow runbook instructions for resolution.` + Body *string `mandatory:"false" json:"body"` + + // An array of OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) to which the notifications for + // this alarm will be delivered. An example destination is an OCID for a topic managed by the + // Oracle Cloud Infrastructure Notification service. + Destinations []string `mandatory:"false" json:"destinations"` + + // The frequency at which notifications are re-submitted, if the alarm keeps firing without + // interruption. Format defined by ISO 8601. For example, `PT4H` indicates four hours. + // Minimum: PT1M. Maximum: P30D. + // Default value: null (notifications are not re-submitted). + // Example: `PT2H` + RepeatNotificationDuration *string `mandatory:"false" json:"repeatNotificationDuration"` + + // The configuration details for suppressing an alarm. + Suppression *Suppression `mandatory:"false" json:"suppression"` + + // Whether the alarm is enabled. + // Example: `true` + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateAlarmDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/monitoring/update_alarm_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package monitoring + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAlarmRequest wrapper for the UpdateAlarm operation +type UpdateAlarmRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm. + AlarmId *string `mandatory:"true" contributesTo:"path" name:"alarmId"` + + // Document for updating an alarm. + UpdateAlarmDetails `contributesTo:"body"` + + // Customer part of the request identifier token. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAlarmRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAlarmRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAlarmRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAlarmResponse wrapper for the UpdateAlarm operation +type UpdateAlarmResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Alarm instance + Alarm `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateAlarmResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAlarmResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/abort_multipart_upload_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/abort_multipart_upload_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/abort_multipart_upload_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/abort_multipart_upload_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // AbortMultipartUploadRequest wrapper for the AbortMultipartUpload operation type AbortMultipartUploadRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -27,12 +27,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request AbortMultipartUploadRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request AbortMultipartUploadRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AbortMultipartUploadRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // AbortMultipartUploadResponse wrapper for the AbortMultipartUpload operation type AbortMultipartUploadResponse struct { @@ -50,3 +64,8 @@ func (response AbortMultipartUploadResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response AbortMultipartUploadResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -14,13 +14,13 @@ // Bucket A bucket is a container for storing objects in a compartment within a namespace. A bucket is associated with a single compartment. // The compartment has policies that indicate what actions a user can perform on a bucket and all the objects in the bucket. For more -// information, see Managing Buckets (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingbuckets.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// information, see Managing Buckets (https://docs.cloud.oracle.com/Content/Object/Tasks/managingbuckets.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type Bucket struct { - // The namespace in which the bucket lives. + // The Object Storage namespace in which the bucket lives. Namespace *string `mandatory:"true" json:"namespace"` // The name of the bucket. Avoid entering confidential information. @@ -39,7 +39,7 @@ // The date and time the bucket was created, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The entity tag for the bucket. + // The entity tag (ETag) for the bucket. Etag *string `mandatory:"true" json:"etag"` // The type of public access enabled on this bucket. @@ -49,21 +49,35 @@ // bucket, public access is allowed for the `GetObject` and `HeadObject` operations. PublicAccessType BucketPublicAccessTypeEnum `mandatory:"false" json:"publicAccessType,omitempty"` - // The type of storage tier of this bucket. - // A bucket is set to 'Standard' tier by default, which means the bucket will be put in the standard storage tier. - // When 'Archive' tier type is set explicitly, the bucket is put in the archive storage tier. The 'storageTier' - // property is immutable after bucket is created. + // The storage tier type assigned to the bucket. A bucket is set to 'Standard' tier by default, which means + // objects uploaded or copied to the bucket will be in the standard storage tier. When the 'Archive' tier type + // is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. + // The 'storageTier' property is immutable after bucket is created. StorageTier BucketStorageTierEnum `mandatory:"false" json:"storageTier,omitempty"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID of a KMS key id used to call KMS to generate data key or decrypt the encrypted data key. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` + + // The entity tag (ETag) for the live object lifecycle policy on the bucket. + ObjectLifecyclePolicyEtag *string `mandatory:"false" json:"objectLifecyclePolicyEtag"` + + // The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a + // lag between what is displayed and the actual object count. + ApproximateCount *int64 `mandatory:"false" json:"approximateCount"` + + // The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will + // see a lag between what is displayed and the actual size of the bucket. + ApproximateSize *int64 `mandatory:"false" json:"approximateSize"` } func (m Bucket) String() string { @@ -73,7 +87,7 @@ // BucketPublicAccessTypeEnum Enum with underlying type: string type BucketPublicAccessTypeEnum string -// Set of constants representing the allowable values for BucketPublicAccessType +// Set of constants representing the allowable values for BucketPublicAccessTypeEnum const ( BucketPublicAccessTypeNopublicaccess BucketPublicAccessTypeEnum = "NoPublicAccess" BucketPublicAccessTypeObjectread BucketPublicAccessTypeEnum = "ObjectRead" @@ -86,7 +100,7 @@ "ObjectReadWithoutList": BucketPublicAccessTypeObjectreadwithoutlist, } -// GetBucketPublicAccessTypeEnumValues Enumerates the set of values for BucketPublicAccessType +// GetBucketPublicAccessTypeEnumValues Enumerates the set of values for BucketPublicAccessTypeEnum func GetBucketPublicAccessTypeEnumValues() []BucketPublicAccessTypeEnum { values := make([]BucketPublicAccessTypeEnum, 0) for _, v := range mappingBucketPublicAccessType { @@ -98,7 +112,7 @@ // BucketStorageTierEnum Enum with underlying type: string type BucketStorageTierEnum string -// Set of constants representing the allowable values for BucketStorageTier +// Set of constants representing the allowable values for BucketStorageTierEnum const ( BucketStorageTierStandard BucketStorageTierEnum = "Standard" BucketStorageTierArchive BucketStorageTierEnum = "Archive" @@ -109,7 +123,7 @@ "Archive": BucketStorageTierArchive, } -// GetBucketStorageTierEnumValues Enumerates the set of values for BucketStorageTier +// GetBucketStorageTierEnumValues Enumerates the set of values for BucketStorageTierEnum func GetBucketStorageTierEnumValues() []BucketStorageTierEnum { values := make([]BucketStorageTierEnum, 0) for _, v := range mappingBucketStorageTier { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/bucket_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,12 +12,12 @@ "github.com/oracle/oci-go-sdk/common" ) -// BucketSummary To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// BucketSummary To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type BucketSummary struct { - // The namespace in which the bucket lives. + // The Object Storage namespace in which the bucket lives. Namespace *string `mandatory:"true" json:"namespace"` // The name of the bucket. Avoid entering confidential information. @@ -33,16 +33,16 @@ // The date and time the bucket was created, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The entity tag for the bucket. + // The entity tag (ETag) for the bucket. Etag *string `mandatory:"true" json:"etag"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/cancel_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/cancel_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/cancel_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/cancel_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +type CancelWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,12 +12,12 @@ "github.com/oracle/oci-go-sdk/common" ) -// CommitMultipartUploadDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// CommitMultipartUploadDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type CommitMultipartUploadDetails struct { - // The part numbers and ETags for the parts to be committed. + // The part numbers and entity tags (ETags) for the parts to be committed. PartsToCommit []CommitMultipartUploadPartDetails `mandatory:"true" json:"partsToCommit"` // The part numbers for the parts to be excluded from the completed object. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_part_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_part_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_part_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_part_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,15 +12,15 @@ "github.com/oracle/oci-go-sdk/common" ) -// CommitMultipartUploadPartDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// CommitMultipartUploadPartDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type CommitMultipartUploadPartDetails struct { // The part number for this part. PartNum *int `mandatory:"true" json:"partNum"` - // The ETag returned when this part was uploaded. + // The entity tag (ETag) returned when this part was uploaded. Etag *string `mandatory:"true" json:"etag"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/commit_multipart_upload_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // CommitMultipartUploadRequest wrapper for the CommitMultipartUpload operation type CommitMultipartUploadRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -25,25 +25,40 @@ // The upload ID for a multipart upload. UploadId *string `mandatory:"true" contributesTo:"query" name:"uploadId"` - // The part numbers and ETags for the parts you want to commit. + // The part numbers and entity tags (ETags) for the parts you want to commit. CommitMultipartUploadDetails `contributesTo:"body"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CommitMultipartUploadRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CommitMultipartUploadRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CommitMultipartUploadRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CommitMultipartUploadResponse wrapper for the CommitMultipartUpload operation type CommitMultipartUploadResponse struct { @@ -64,7 +79,7 @@ // by a hyphen and the total number of parts (for example, '-6'). OpcMultipartMd5 *string `presentIn:"header" name:"opc-multipart-md5"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` // The time the object was last modified, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. @@ -74,3 +89,8 @@ func (response CommitMultipartUploadResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CommitMultipartUploadResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CopyObjectDetails The parameters required by Object Storage to process a request to copy an object to another bucket. +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +type CopyObjectDetails struct { + + // The name of the object to be copied. + SourceObjectName *string `mandatory:"true" json:"sourceObjectName"` + + // The destination region the object will be copied to, for example "us-ashburn-1". + DestinationRegion *string `mandatory:"true" json:"destinationRegion"` + + // The destination Object Storage namespace the object will be copied to. + DestinationNamespace *string `mandatory:"true" json:"destinationNamespace"` + + // The destination bucket the object will be copied to. + DestinationBucket *string `mandatory:"true" json:"destinationBucket"` + + // The name of the destination object resulting from the copy operation. + DestinationObjectName *string `mandatory:"true" json:"destinationObjectName"` + + // The entity tag (ETag) to match against that of the source object. Used to confirm that the source object + // with a given name is the version of that object storing a specified ETag. + SourceObjectIfMatchETag *string `mandatory:"false" json:"sourceObjectIfMatchETag"` + + // The entity tag (ETag) to match against that of the destination object (an object intended to be overwritten). + // Used to confirm that the destination object stored under a given name is the version of that object + // storing a specified entity tag. + DestinationObjectIfMatchETag *string `mandatory:"false" json:"destinationObjectIfMatchETag"` + + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail + // if the object already exists in the destination bucket. + DestinationObjectIfNoneMatchETag *string `mandatory:"false" json:"destinationObjectIfNoneMatchETag"` + + // Arbitrary string keys and values for the user-defined metadata for the object. Keys must be in + // "opc-meta-*" format. Avoid entering confidential information. Metadata key-value pairs entered + // in this field are assigned to the destination object. If you enter no metadata values, the destination + // object will inherit any existing metadata values associated with the source object. + DestinationObjectMetadata map[string]string `mandatory:"false" json:"destinationObjectMetadata"` +} + +func (m CopyObjectDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/copy_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CopyObjectRequest wrapper for the CopyObject operation +type CopyObjectRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the bucket. Avoid entering confidential information. + // Example: `my-new-bucket1` + BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` + + // The source and destination of the object to be copied. + CopyObjectDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CopyObjectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CopyObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CopyObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CopyObjectResponse wrapper for the CopyObject operation +type CopyObjectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. If you need to contact Oracle about a + // particular request, provide this request ID. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response CopyObjectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CopyObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,13 +12,13 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateBucketDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// CreateBucketDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type CreateBucketDetails struct { - // The name of the bucket. Valid characters are uppercase or lowercase letters, - // numbers, and dashes. Bucket names must be unique within the namespace. Avoid entering confidential information. + // The name of the bucket. Valid characters are uppercase or lowercase letters, numbers, and dashes. + // Bucket names must be unique within an Object Storage namespace. Avoid entering confidential information. // example: Example: my-new-bucket1 Name *string `mandatory:"true" json:"name"` @@ -42,14 +42,17 @@ StorageTier CreateBucketDetailsStorageTierEnum `mandatory:"false" json:"storageTier,omitempty"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID of a KMS key id used to call KMS to generate the data key or decrypt the encrypted data key. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m CreateBucketDetails) String() string { @@ -59,7 +62,7 @@ // CreateBucketDetailsPublicAccessTypeEnum Enum with underlying type: string type CreateBucketDetailsPublicAccessTypeEnum string -// Set of constants representing the allowable values for CreateBucketDetailsPublicAccessType +// Set of constants representing the allowable values for CreateBucketDetailsPublicAccessTypeEnum const ( CreateBucketDetailsPublicAccessTypeNopublicaccess CreateBucketDetailsPublicAccessTypeEnum = "NoPublicAccess" CreateBucketDetailsPublicAccessTypeObjectread CreateBucketDetailsPublicAccessTypeEnum = "ObjectRead" @@ -72,7 +75,7 @@ "ObjectReadWithoutList": CreateBucketDetailsPublicAccessTypeObjectreadwithoutlist, } -// GetCreateBucketDetailsPublicAccessTypeEnumValues Enumerates the set of values for CreateBucketDetailsPublicAccessType +// GetCreateBucketDetailsPublicAccessTypeEnumValues Enumerates the set of values for CreateBucketDetailsPublicAccessTypeEnum func GetCreateBucketDetailsPublicAccessTypeEnumValues() []CreateBucketDetailsPublicAccessTypeEnum { values := make([]CreateBucketDetailsPublicAccessTypeEnum, 0) for _, v := range mappingCreateBucketDetailsPublicAccessType { @@ -84,7 +87,7 @@ // CreateBucketDetailsStorageTierEnum Enum with underlying type: string type CreateBucketDetailsStorageTierEnum string -// Set of constants representing the allowable values for CreateBucketDetailsStorageTier +// Set of constants representing the allowable values for CreateBucketDetailsStorageTierEnum const ( CreateBucketDetailsStorageTierStandard CreateBucketDetailsStorageTierEnum = "Standard" CreateBucketDetailsStorageTierArchive CreateBucketDetailsStorageTierEnum = "Archive" @@ -95,7 +98,7 @@ "Archive": CreateBucketDetailsStorageTierArchive, } -// GetCreateBucketDetailsStorageTierEnumValues Enumerates the set of values for CreateBucketDetailsStorageTier +// GetCreateBucketDetailsStorageTierEnumValues Enumerates the set of values for CreateBucketDetailsStorageTierEnum func GetCreateBucketDetailsStorageTierEnumValues() []CreateBucketDetailsStorageTierEnum { values := make([]CreateBucketDetailsStorageTierEnum, 0) for _, v := range mappingCreateBucketDetailsStorageTier { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_bucket_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // CreateBucketRequest wrapper for the CreateBucket operation type CreateBucketRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // Request object for creating a bucket. @@ -19,12 +19,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateBucketRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateBucketRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateBucketRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateBucketResponse wrapper for the CreateBucket operation type CreateBucketResponse struct { @@ -41,7 +55,7 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The entity tag for the bucket that was created. + // The entity tag (ETag) for the bucket that was created. ETag *string `presentIn:"header" name:"etag"` // The full path to the bucket that was created. @@ -51,3 +65,8 @@ func (response CreateBucketResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateBucketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,9 +12,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// CreateMultipartUploadDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// CreateMultipartUploadDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type CreateMultipartUploadDetails struct { // The name of the object to which this multi-part upload is targeted. Avoid entering confidential information. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_multipart_upload_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // CreateMultipartUploadRequest wrapper for the CreateMultipartUpload operation type CreateMultipartUploadRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -21,22 +21,37 @@ // Request object for creating a multi-part upload. CreateMultipartUploadDetails `contributesTo:"body"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreateMultipartUploadRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreateMultipartUploadRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateMultipartUploadRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreateMultipartUploadResponse wrapper for the CreateMultipartUpload operation type CreateMultipartUploadResponse struct { @@ -60,3 +75,8 @@ func (response CreateMultipartUploadResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreateMultipartUploadResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -15,16 +15,18 @@ // CreatePreauthenticatedRequestDetails The representation of CreatePreauthenticatedRequestDetails type CreatePreauthenticatedRequestDetails struct { - // A user-specified name for the pre-authenticated request. Helpful for management purposes. + // A user-specified name for the pre-authenticated request. Names can be helpful in managing pre-authenticated requests. Name *string `mandatory:"true" json:"name"` // The operation that can be performed on this resource. AccessType CreatePreauthenticatedRequestDetailsAccessTypeEnum `mandatory:"true" json:"accessType"` - // The expiration date for the pre-authenticated request as per RFC 3339 (https://tools.ietf.org/rfc/rfc3339). After this date the pre-authenticated request will no longer be valid. + // The expiration date for the pre-authenticated request as per RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + // After this date the pre-authenticated request will no longer be valid. TimeExpires *common.SDKTime `mandatory:"true" json:"timeExpires"` - // The name of object that is being granted access to by the pre-authenticated request. This can be null and if it is, the pre-authenticated request grants access to the entire bucket. + // The name of the object that is being granted access to by the pre-authenticated request. Avoid entering confidential + // information. The object name can be null and if so, the pre-authenticated request grants access to the entire bucket. ObjectName *string `mandatory:"false" json:"objectName"` } @@ -35,7 +37,7 @@ // CreatePreauthenticatedRequestDetailsAccessTypeEnum Enum with underlying type: string type CreatePreauthenticatedRequestDetailsAccessTypeEnum string -// Set of constants representing the allowable values for CreatePreauthenticatedRequestDetailsAccessType +// Set of constants representing the allowable values for CreatePreauthenticatedRequestDetailsAccessTypeEnum const ( CreatePreauthenticatedRequestDetailsAccessTypeObjectread CreatePreauthenticatedRequestDetailsAccessTypeEnum = "ObjectRead" CreatePreauthenticatedRequestDetailsAccessTypeObjectwrite CreatePreauthenticatedRequestDetailsAccessTypeEnum = "ObjectWrite" @@ -50,7 +52,7 @@ "AnyObjectWrite": CreatePreauthenticatedRequestDetailsAccessTypeAnyobjectwrite, } -// GetCreatePreauthenticatedRequestDetailsAccessTypeEnumValues Enumerates the set of values for CreatePreauthenticatedRequestDetailsAccessType +// GetCreatePreauthenticatedRequestDetailsAccessTypeEnumValues Enumerates the set of values for CreatePreauthenticatedRequestDetailsAccessTypeEnum func GetCreatePreauthenticatedRequestDetailsAccessTypeEnumValues() []CreatePreauthenticatedRequestDetailsAccessTypeEnum { values := make([]CreatePreauthenticatedRequestDetailsAccessTypeEnum, 0) for _, v := range mappingCreatePreauthenticatedRequestDetailsAccessType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/create_preauthenticated_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // CreatePreauthenticatedRequestRequest wrapper for the CreatePreauthenticatedRequest operation type CreatePreauthenticatedRequestRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -23,12 +23,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request CreatePreauthenticatedRequestRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request CreatePreauthenticatedRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePreauthenticatedRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // CreatePreauthenticatedRequestResponse wrapper for the CreatePreauthenticatedRequest operation type CreatePreauthenticatedRequestResponse struct { @@ -49,3 +63,8 @@ func (response CreatePreauthenticatedRequestResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response CreatePreauthenticatedRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_bucket_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_bucket_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_bucket_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_bucket_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,25 +11,39 @@ // DeleteBucketRequest wrapper for the DeleteBucket operation type DeleteBucketRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. // Example: `my-new-bucket1` BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteBucketRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteBucketRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteBucketRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteBucketResponse wrapper for the DeleteBucket operation type DeleteBucketResponse struct { @@ -47,3 +61,8 @@ func (response DeleteBucketResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteBucketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_lifecycle_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_lifecycle_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_lifecycle_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_lifecycle_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteObjectLifecyclePolicyRequest wrapper for the DeleteObjectLifecyclePolicy operation +type DeleteObjectLifecyclePolicyRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the bucket. Avoid entering confidential information. + // Example: `my-new-bucket1` + BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // For uploading a part, this is the entity tag of the target part. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteObjectLifecyclePolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteObjectLifecyclePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteObjectLifecyclePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteObjectLifecyclePolicyResponse wrapper for the DeleteObjectLifecyclePolicy operation +type DeleteObjectLifecyclePolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response DeleteObjectLifecyclePolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteObjectLifecyclePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // DeleteObjectRequest wrapper for the DeleteObject operation type DeleteObjectRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -22,18 +22,32 @@ // Example: `test/object1.log` ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeleteObjectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeleteObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeleteObjectResponse wrapper for the DeleteObject operation type DeleteObjectResponse struct { @@ -54,3 +68,8 @@ func (response DeleteObjectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeleteObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_preauthenticated_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_preauthenticated_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_preauthenticated_request_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/delete_preauthenticated_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // DeletePreauthenticatedRequestRequest wrapper for the DeletePreauthenticatedRequest operation type DeletePreauthenticatedRequestRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -24,12 +24,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request DeletePreauthenticatedRequestRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request DeletePreauthenticatedRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePreauthenticatedRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // DeletePreauthenticatedRequestResponse wrapper for the DeletePreauthenticatedRequest operation type DeletePreauthenticatedRequestResponse struct { @@ -47,3 +61,8 @@ func (response DeletePreauthenticatedRequestResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response DeletePreauthenticatedRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_bucket_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_bucket_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_bucket_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_bucket_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,29 +11,49 @@ // GetBucketRequest wrapper for the GetBucket operation type GetBucketRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. // Example: `my-new-bucket1` BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Bucket summary includes the 'namespace', 'name', 'compartmentId', 'createdBy', 'timeCreated', + // and 'etag' fields. This parameter can also include 'approximateCount' (approximate number of objects) and 'approximateSize' + // (total approximate size in bytes of all objects). For example 'approximateCount,approximateSize'. + Fields []GetBucketFieldsEnum `contributesTo:"query" name:"fields" omitEmpty:"true" collectionFormat:"csv"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetBucketRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetBucketRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetBucketRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetBucketResponse wrapper for the GetBucket operation type GetBucketResponse struct { @@ -50,7 +70,7 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The current entity tag for the bucket. + // The current entity tag (ETag) for the bucket. ETag *string `presentIn:"header" name:"etag"` // Flag to indicate whether or not the object was modified. If this is true, @@ -63,3 +83,31 @@ func (response GetBucketResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetBucketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetBucketFieldsEnum Enum with underlying type: string +type GetBucketFieldsEnum string + +// Set of constants representing the allowable values for GetBucketFieldsEnum +const ( + GetBucketFieldsApproximatecount GetBucketFieldsEnum = "approximateCount" + GetBucketFieldsApproximatesize GetBucketFieldsEnum = "approximateSize" +) + +var mappingGetBucketFields = map[string]GetBucketFieldsEnum{ + "approximateCount": GetBucketFieldsApproximatecount, + "approximateSize": GetBucketFieldsApproximatesize, +} + +// GetGetBucketFieldsEnumValues Enumerates the set of values for GetBucketFieldsEnum +func GetGetBucketFieldsEnumValues() []GetBucketFieldsEnum { + values := make([]GetBucketFieldsEnum, 0) + for _, v := range mappingGetBucketFields { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_metadata_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_metadata_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_metadata_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_metadata_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,17 +11,31 @@ // GetNamespaceMetadataRequest wrapper for the GetNamespaceMetadata operation type GetNamespaceMetadataRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetNamespaceMetadataRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetNamespaceMetadataRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNamespaceMetadataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetNamespaceMetadataResponse wrapper for the GetNamespaceMetadata operation type GetNamespaceMetadataResponse struct { @@ -42,3 +56,8 @@ func (response GetNamespaceMetadataResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetNamespaceMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_namespace_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -13,12 +13,30 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // This is an optional field representing the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace + // name has to be retrieved. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetNamespaceRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetNamespaceRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNamespaceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetNamespaceResponse wrapper for the GetNamespace operation type GetNamespaceResponse struct { @@ -32,3 +50,8 @@ func (response GetNamespaceResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetNamespaceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_lifecycle_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_lifecycle_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_lifecycle_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_lifecycle_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetObjectLifecyclePolicyRequest wrapper for the GetObjectLifecyclePolicy operation +type GetObjectLifecyclePolicyRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the bucket. Avoid entering confidential information. + // Example: `my-new-bucket1` + BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetObjectLifecyclePolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetObjectLifecyclePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetObjectLifecyclePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetObjectLifecyclePolicyResponse wrapper for the GetObjectLifecyclePolicy operation +type GetObjectLifecyclePolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ObjectLifecyclePolicy instance + ObjectLifecyclePolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // The entity tag (ETag) for the object lifecycle policy. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response GetObjectLifecyclePolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetObjectLifecyclePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -12,7 +12,7 @@ // GetObjectRequest wrapper for the GetObject operation type GetObjectRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -23,12 +23,13 @@ // Example: `test/object1.log` ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. @@ -37,12 +38,26 @@ // Optional byte range to fetch, as described in RFC 7233 (https://tools.ietf.org/rfc/rfc7233), section 2.1. // Note that only a single range of bytes is supported. Range *string `mandatory:"false" contributesTo:"header" name:"range"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetObjectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetObjectResponse wrapper for the GetObject operation type GetObjectResponse struct { @@ -59,14 +74,14 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` // The user-defined metadata for the object. OpcMeta map[string]string `presentIn:"header-collection" prefix:"opc-meta-"` // The object size in bytes. - ContentLength *int `presentIn:"header" name:"content-length"` + ContentLength *int64 `presentIn:"header" name:"content-length"` // Content-Range header for range requests, per RFC 7233 (https://tools.ietf.org/rfc/rfc7233), section 4.2. ContentRange *string `presentIn:"header" name:"content-range"` @@ -111,10 +126,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response GetObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // GetObjectArchivalStateEnum Enum with underlying type: string type GetObjectArchivalStateEnum string -// Set of constants representing the allowable values for GetObjectArchivalState +// Set of constants representing the allowable values for GetObjectArchivalStateEnum const ( GetObjectArchivalStateAvailable GetObjectArchivalStateEnum = "AVAILABLE" GetObjectArchivalStateArchived GetObjectArchivalStateEnum = "ARCHIVED" @@ -129,7 +149,7 @@ "RESTORED": GetObjectArchivalStateRestored, } -// GetGetObjectArchivalStateEnumValues Enumerates the set of values for GetObjectArchivalState +// GetGetObjectArchivalStateEnumValues Enumerates the set of values for GetObjectArchivalStateEnum func GetGetObjectArchivalStateEnumValues() []GetObjectArchivalStateEnum { values := make([]GetObjectArchivalStateEnum, 0) for _, v := range mappingGetObjectArchivalState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_preauthenticated_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_preauthenticated_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_preauthenticated_request_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_preauthenticated_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // GetPreauthenticatedRequestRequest wrapper for the GetPreauthenticatedRequest operation type GetPreauthenticatedRequestRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -24,12 +24,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request GetPreauthenticatedRequestRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request GetPreauthenticatedRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPreauthenticatedRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // GetPreauthenticatedRequestResponse wrapper for the GetPreauthenticatedRequest operation type GetPreauthenticatedRequestResponse struct { @@ -50,3 +64,8 @@ func (response GetPreauthenticatedRequestResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response GetPreauthenticatedRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/get_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +type GetWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *float32 `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_bucket_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_bucket_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_bucket_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_bucket_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,29 +11,44 @@ // HeadBucketRequest wrapper for the HeadBucket operation type HeadBucketRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. // Example: `my-new-bucket1` BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request HeadBucketRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request HeadBucketRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request HeadBucketRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // HeadBucketResponse wrapper for the HeadBucket operation type HeadBucketResponse struct { @@ -47,7 +62,7 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The current entity tag for the bucket. + // The current entity tag (ETag) for the bucket. ETag *string `presentIn:"header" name:"etag"` // Flag to indicate whether or not the object was modified. If this is true, @@ -60,3 +75,8 @@ func (response HeadBucketResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response HeadBucketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_object_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/head_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // HeadObjectRequest wrapper for the HeadObject operation type HeadObjectRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -22,22 +22,37 @@ // Example: `test/object1.log` ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request HeadObjectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request HeadObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request HeadObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // HeadObjectResponse wrapper for the HeadObject operation type HeadObjectResponse struct { @@ -51,14 +66,14 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` // The user-defined metadata for the object. OpcMeta map[string]string `presentIn:"header-collection" prefix:"opc-meta-"` // The object size in bytes. - ContentLength *int `presentIn:"header" name:"content-length"` + ContentLength *int64 `presentIn:"header" name:"content-length"` // Content-MD5 header, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.15. // Unavailable for objects uploaded using multipart upload. @@ -100,10 +115,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response HeadObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // HeadObjectArchivalStateEnum Enum with underlying type: string type HeadObjectArchivalStateEnum string -// Set of constants representing the allowable values for HeadObjectArchivalState +// Set of constants representing the allowable values for HeadObjectArchivalStateEnum const ( HeadObjectArchivalStateAvailable HeadObjectArchivalStateEnum = "AVAILABLE" HeadObjectArchivalStateArchived HeadObjectArchivalStateEnum = "ARCHIVED" @@ -118,7 +138,7 @@ "RESTORED": HeadObjectArchivalStateRestored, } -// GetHeadObjectArchivalStateEnumValues Enumerates the set of values for HeadObjectArchivalState +// GetHeadObjectArchivalStateEnumValues Enumerates the set of values for HeadObjectArchivalStateEnum func GetHeadObjectArchivalStateEnumValues() []HeadObjectArchivalStateEnum { values := make([]HeadObjectArchivalStateEnum, 0) for _, v := range mappingHeadObjectArchivalState { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_buckets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_buckets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_buckets_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_buckets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // ListBucketsRequest wrapper for the ListBuckets operation type ListBucketsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The ID of the compartment in which to list buckets. @@ -30,19 +30,33 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListBucketsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListBucketsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListBucketsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListBucketsResponse wrapper for the ListBuckets operation type ListBucketsResponse struct { // The underlying http response RawResponse *http.Response - // The []BucketSummary instance + // A list of []BucketSummary instances Items []BucketSummary `presentIn:"body"` // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. @@ -52,10 +66,12 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of `Bucket`s. If this header appears in the response, then this - // is a partial list of buckets. Include this value as the `page` parameter in a subsequent - // GET request to get the next batch of buckets. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#nine). + // Paginating a list of buckets. + // In the GET request, set the limit to the number of buckets items that you want returned in the response. + // If the opc-next-page header appears in the response, then this is a partial list and there are additional + // buckets to get. Include the header's value as the `page` parameter in the subsequent GET request to get the + // next batch of buckets. Repeat this process to retrieve the entire list of buckets. + // By default, the page limit is set to 25 buckets per page, but you can specify a value from 1 to 1000. OpcNextPage *string `presentIn:"header" name:"opc-next-page"` } @@ -63,10 +79,15 @@ return common.PointerString(response) } +// HTTPResponse implements the OCIResponse interface +func (response ListBucketsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + // ListBucketsFieldsEnum Enum with underlying type: string type ListBucketsFieldsEnum string -// Set of constants representing the allowable values for ListBucketsFields +// Set of constants representing the allowable values for ListBucketsFieldsEnum const ( ListBucketsFieldsTags ListBucketsFieldsEnum = "tags" ) @@ -75,7 +96,7 @@ "tags": ListBucketsFieldsTags, } -// GetListBucketsFieldsEnumValues Enumerates the set of values for ListBucketsFields +// GetListBucketsFieldsEnumValues Enumerates the set of values for ListBucketsFieldsEnum func GetListBucketsFieldsEnumValues() []ListBucketsFieldsEnum { values := make([]ListBucketsFieldsEnum, 0) for _, v := range mappingListBucketsFields { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_upload_parts_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_upload_parts_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_upload_parts_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_upload_parts_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // ListMultipartUploadPartsRequest wrapper for the ListMultipartUploadParts operation type ListMultipartUploadPartsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -33,19 +33,33 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListMultipartUploadPartsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListMultipartUploadPartsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMultipartUploadPartsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListMultipartUploadPartsResponse wrapper for the ListMultipartUploadParts operation type ListMultipartUploadPartsResponse struct { // The underlying http response RawResponse *http.Response - // The []MultipartUploadPartSummary instance + // A list of []MultipartUploadPartSummary instances Items []MultipartUploadPartSummary `presentIn:"body"` // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. @@ -55,13 +69,20 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of `MultipartUploadPartSummary`s. If this header appears in the response, - // then this is a partial list of object parts. Include this value as the `page` parameter in a subsequent - // GET request to get the next batch of object parts. For information about pagination, see - // List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). + // Paginating a list of multipart upload parts. + // In the GET request, set the limit to the number of multipart upload parts that you want returned in the + // response. If the opc-next-page header appears in the response, then this is a partial list and there are + // additional multipart upload parts to get. Include the header's value as the `page` parameter in the subsequent + // GET request to get the next batch of multipart upload parts. Repeat this process to retrieve the entire list + // of multipart upload parts. OpcNextPage *string `presentIn:"header" name:"opc-next-page"` } func (response ListMultipartUploadPartsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListMultipartUploadPartsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_uploads_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_uploads_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_uploads_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_multipart_uploads_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // ListMultipartUploadsRequest wrapper for the ListMultipartUploads operation type ListMultipartUploadsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -26,19 +26,33 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListMultipartUploadsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListMultipartUploadsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMultipartUploadsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListMultipartUploadsResponse wrapper for the ListMultipartUploads operation type ListMultipartUploadsResponse struct { // The underlying http response RawResponse *http.Response - // The []MultipartUpload instance + // A list of []MultipartUpload instances Items []MultipartUpload `presentIn:"body"` // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. @@ -48,12 +62,20 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of `MultipartUpload`s. If this header appears in the response, then - // this is a partial list of multipart uploads. Include this value as the `page` parameter in a subsequent - // GET request. For information about pagination, see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). + // Paginating a list of multipart uploads. + // In the GET request, set the limit to the number of multipart uploads that you want returned in the response. + // If the opc-next-page header appears in the response, then this is a partial list and there are + // additional multipart uploads to get. Include the header's value as the `page` parameter in the subsequent + // GET request to get the next batch of objects. Repeat this process to retrieve the entire list of + // multipart uploads. OpcNextPage *string `presentIn:"header" name:"opc-next-page"` } func (response ListMultipartUploadsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListMultipartUploadsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,9 +12,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// ListObjects To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// ListObjects To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type ListObjects struct { // An array of object summaries. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_objects_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // ListObjectsRequest wrapper for the ListObjects operation type ListObjectsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -45,12 +45,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListObjectsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListObjectsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListObjectsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListObjectsResponse wrapper for the ListObjects operation type ListObjectsResponse struct { @@ -71,3 +85,8 @@ func (response ListObjectsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListObjectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_preauthenticated_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_preauthenticated_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_preauthenticated_requests_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_preauthenticated_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // ListPreauthenticatedRequestsRequest wrapper for the ListPreauthenticatedRequests operation type ListPreauthenticatedRequestsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -29,19 +29,33 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request ListPreauthenticatedRequestsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request ListPreauthenticatedRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPreauthenticatedRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // ListPreauthenticatedRequestsResponse wrapper for the ListPreauthenticatedRequests operation type ListPreauthenticatedRequestsResponse struct { // The underlying http response RawResponse *http.Response - // The []PreauthenticatedRequestSummary instance + // A list of []PreauthenticatedRequestSummary instances Items []PreauthenticatedRequestSummary `presentIn:"body"` // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. @@ -51,13 +65,20 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // For pagination of a list of pre-authenticated requests, if this header appears in the response, - // then this is a partial list. Include this value as the `page` parameter in a subsequent - // GET request to get the next batch of pre-authenticated requests. - // For information about pagination, see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm#nine). + // Paginating a list of pre-authenticated requests. + // In the GET request, set the limit to the number of pre-authenticated requests that you want returned in + // the response. If the opc-next-page header appears in the response, then this is a partial list and there + // are additional pre-authenticated requests to get. Include the header's value as the `page` parameter in + // the subsequent GET request to get the next batch of pre-authenticated requests. Repeat this process to + // retrieve the entire list of pre-authenticated requests. OpcNextPage *string `presentIn:"header" name:"opc-next-page"` } func (response ListPreauthenticatedRequestsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response ListPreauthenticatedRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_errors_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_errors_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_errors_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_errors_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestError instances + Items []WorkRequestError `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Paginating a list of work request errors. + // In the GET request, set the limit to the number of work request errors that you want returned in the + // response. If the opc-next-page header appears in the response, then this is a partial list and there are + // additional work request errors to get. Include the header's value as the `page` parameter in the subsequent + // GET request to get the next batch of work request errors. Repeat this process to retrieve the entire list of work + // request errors. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_logs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_logs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_logs_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_request_logs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestLogEntry instances + Items []WorkRequestLogEntry `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // Paginating a list of work request logs. + // In the GET request, set the limit to the number of compartment work requests that you want returned in the + // response. If the opc-next-page header appears in the response, then this is a partial list and there are + // additional work requests to get. Include the header's value as the `page` parameter in the subsequent + // GET request to get the next batch of work requests. Repeat this process to retrieve the entire list of work + // requests. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/list_work_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +type ListWorkRequestsRequest struct { + + // The ID of the compartment in which to list buckets. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestSummary instances + Items []WorkRequestSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Paginating a list of work requests. + // In the GET request, set the limit to the number of compartment work requests that you want returned in the + // response. If the opc-next-page header appears in the response, then this is a partial list and there are + // additional work requests to get. Include the header's value as the `page` parameter in the subsequent + // GET request to get the next batch of work requests. Repeat this process to retrieve the entire list of work + // requests. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -16,13 +16,13 @@ // objects that are too large for a single upload operation. With multipart uploads, individual parts of an object can be // uploaded in parallel to reduce the amount of time you spend uploading. Multipart uploads can also minimize the impact // of network failures by letting you retry a failed part upload instead of requiring you to retry an entire object upload. -// See Managing Multipart Uploads (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingmultipartuploads.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// See Using Multipart Uploads (https://docs.cloud.oracle.com/Content/Object/Tasks/usingmultipartuploads.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type MultipartUpload struct { - // The namespace in which the in-progress multipart upload is stored. + // The Object Storage namespace in which the in-progress multipart upload is stored. Namespace *string `mandatory:"true" json:"namespace"` // The bucket in which the in-progress multipart upload is stored. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload_part_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload_part_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload_part_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/multipart_upload_part_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,20 +12,20 @@ "github.com/oracle/oci-go-sdk/common" ) -// MultipartUploadPartSummary Get summary information about multipart uploads. -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, -// see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// MultipartUploadPartSummary Gets summary information about multipart uploads. +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, +// see Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type MultipartUploadPartSummary struct { - // The current entity tag for the part. + // The current entity tag (ETag) for the part. Etag *string `mandatory:"true" json:"etag"` // The MD5 hash of the bytes of the part. Md5 *string `mandatory:"true" json:"md5"` // The size of the part in bytes. - Size *int `mandatory:"true" json:"size"` + Size *int64 `mandatory:"true" json:"size"` // The part number for this part. PartNumber *int `mandatory:"true" json:"partNumber"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/namespace_metadata.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/namespace_metadata.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/namespace_metadata.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/namespace_metadata.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,16 +12,16 @@ "github.com/oracle/oci-go-sdk/common" ) -// NamespaceMetadata A NamespaceMetadta is a map for storing namespace and defaultS3CompartmentId, defaultSwiftCompartmentId. +// NamespaceMetadata NamespaceMetadata maps a namespace string to defaultS3CompartmentId and defaultSwiftCompartmentId values. type NamespaceMetadata struct { - // The namespace to which the metadata belongs. + // The Object Storage namespace to which the metadata belongs. Namespace *string `mandatory:"true" json:"namespace"` - // The default compartment ID for an S3 client. + // If the field is set, specifies the default compartment assignment for the Amazon S3 Compatibility API. DefaultS3CompartmentId *string `mandatory:"true" json:"defaultS3CompartmentId"` - // The default compartment ID for a Swift client. + // If the field is set, specifies the default compartment assignment for the Swift API. DefaultSwiftCompartmentId *string `mandatory:"true" json:"defaultSwiftCompartmentId"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ObjectLifecyclePolicy The collection of lifecycle policy rules that together form the object lifecycle policy of a given bucket. +type ObjectLifecyclePolicy struct { + + // The date and time the object lifecycle policy was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The live lifecycle policy on the bucket. + // For an example of this value, see the + // PutObjectLifecyclePolicy API documentation (https://docs.cloud.oracle.com/iaas/api/#/en/objectstorage/20160918/ObjectLifecyclePolicy/PutObjectLifecyclePolicy). + Items []ObjectLifecycleRule `mandatory:"false" json:"items"` +} + +func (m ObjectLifecyclePolicy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_lifecycle_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ObjectLifecycleRule To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +type ObjectLifecycleRule struct { + + // The name of the lifecycle rule to be applied. + Name *string `mandatory:"true" json:"name"` + + // The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects into the + // Archive Storage tier (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). Rules using the action + // 'DELETE' permanently delete objects from buckets. 'ARCHIVE' and 'DELETE' are the only two supported + // actions at this time. + Action *string `mandatory:"true" json:"action"` + + // Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the + // timeUnit parameter, and is calculated in relation to each object's Last-Modified time. + TimeAmount *int64 `mandatory:"true" json:"timeAmount"` + + // The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. + // Years are defined as 365.2425 days long and likewise round up to the next midnight UTC. + TimeUnit ObjectLifecycleRuleTimeUnitEnum `mandatory:"true" json:"timeUnit"` + + // A boolean that determines whether this rule is currently enabled. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // A filter limiting object names that the rule will apply to. + ObjectNameFilter *ObjectNameFilter `mandatory:"false" json:"objectNameFilter"` +} + +func (m ObjectLifecycleRule) String() string { + return common.PointerString(m) +} + +// ObjectLifecycleRuleTimeUnitEnum Enum with underlying type: string +type ObjectLifecycleRuleTimeUnitEnum string + +// Set of constants representing the allowable values for ObjectLifecycleRuleTimeUnitEnum +const ( + ObjectLifecycleRuleTimeUnitDays ObjectLifecycleRuleTimeUnitEnum = "DAYS" + ObjectLifecycleRuleTimeUnitYears ObjectLifecycleRuleTimeUnitEnum = "YEARS" +) + +var mappingObjectLifecycleRuleTimeUnit = map[string]ObjectLifecycleRuleTimeUnitEnum{ + "DAYS": ObjectLifecycleRuleTimeUnitDays, + "YEARS": ObjectLifecycleRuleTimeUnitYears, +} + +// GetObjectLifecycleRuleTimeUnitEnumValues Enumerates the set of values for ObjectLifecycleRuleTimeUnitEnum +func GetObjectLifecycleRuleTimeUnitEnumValues() []ObjectLifecycleRuleTimeUnitEnum { + values := make([]ObjectLifecycleRuleTimeUnitEnum, 0) + for _, v := range mappingObjectLifecycleRuleTimeUnit { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_name_filter.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_name_filter.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_name_filter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_name_filter.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ObjectNameFilter A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a +// given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. +// The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns +// instead of prefixes. Exclusions take precedence over inclusions. +type ObjectNameFilter struct { + + // An array of glob patterns to match the object names to include. An empty array includes all objects in the + // bucket. Exclusion patterns take precedence over inclusion patterns. + // A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other + // than the special pattern characters described below, matches itself. + // Glob patterns must be between 1 and 1024 characters. + // The special pattern characters have the following meanings: + // \ Escapes the following character + // * Matches any string of characters. + // ? Matches any single character . + // [...] Matches a group of characters. A group of characters can be: + // A set of characters, for example: [Zafg9@]. This matches any character in the brackets. + // A range of characters, for example: [a-z]. This matches any character in the range. + // [a-f] is equivalent to [abcdef]. + // For character ranges only the CHARACTER-CHARACTER pattern is supported. + // [ab-yz] is not valid + // [a-mn-z] is not valid + // Character ranges can not start with ^ or : + // To include a '-' in the range, make it the first or last character. + InclusionPatterns []string `mandatory:"false" json:"inclusionPatterns"` + + // An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion + // patterns take precedence over inclusion patterns. + // A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other + // than the special pattern characters described below, matches itself. + // Glob patterns must be between 1 and 1024 characters. + // The special pattern characters have the following meanings: + // \ Escapes the following character + // * Matches any string of characters. + // ? Matches any single character . + // [...] Matches a group of characters. A group of characters can be: + // A set of characters, for example: [Zafg9@]. This matches any character in the brackets. + // A range of characters, for example: [a-z]. This matches any character in the range. + // [a-f] is equivalent to [abcdef]. + // For character ranges only the CHARACTER-CHARACTER pattern is supported. + // [ab-yz] is not valid + // [a-mn-z] is not valid + // Character ranges can not start with ^ or : + // To include a '-' in the range, make it the first or last character. + ExclusionPatterns []string `mandatory:"false" json:"exclusionPatterns"` + + // An array of object name prefixes that the rule will apply to. An empty array means to include all objects. + InclusionPrefixes []string `mandatory:"false" json:"inclusionPrefixes"` +} + +func (m ObjectNameFilter) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/objectstorage_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/objectstorage_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/objectstorage_client.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/objectstorage_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -21,16 +21,6 @@ config *common.ConfigurationProvider } -func buildSigner(configProvider common.ConfigurationProvider) common.HTTPRequestSigner { - objStorageHeaders := []string{"date", "(request-target)", "host"} - defaultBodyHeaders := []string{"content-length", "content-type", "x-content-sha256"} - shouldHashBody := func(r *http.Request) bool { - return r.Method == http.MethodPost - } - signer := common.RequestSignerWithBodyHashingPredicate(configProvider, objStorageHeaders, defaultBodyHeaders, shouldHashBody) - return signer -} - // NewObjectStorageClientWithConfigurationProvider Creates a new default ObjectStorage client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewObjectStorageClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ObjectStorageClient, err error) { @@ -38,7 +28,6 @@ if err != nil { return } - baseClient.Signer = buildSigner(configProvider) client = ObjectStorageClient{BaseClient: baseClient} err = client.setConfigurationProvider(configProvider) @@ -47,7 +36,7 @@ // SetRegion overrides the region of this client. func (client *ObjectStorageClient) SetRegion(region string) { - client.Host = fmt.Sprintf(common.DefaultHostURLTemplate, "objectstorage", region) + client.Host = common.StringToRegion(region).EndpointForTemplate("objectstorage", "https://objectstorage.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid @@ -58,8 +47,8 @@ // Error has been checked already region, _ := configProvider.Region() - client.config = &configProvider client.SetRegion(region) + client.config = &configProvider return nil } @@ -70,482 +59,1516 @@ // AbortMultipartUpload Aborts an in-progress multipart upload and deletes all parts that have been uploaded. func (client ObjectStorageClient) AbortMultipartUpload(ctx context.Context, request AbortMultipartUploadRequest) (response AbortMultipartUploadResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/u/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.abortMultipartUpload, policy) if err != nil { + if ociResponse != nil { + response = AbortMultipartUploadResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(AbortMultipartUploadResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AbortMultipartUploadResponse") + } + return +} + +// abortMultipartUpload implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) abortMultipartUpload(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/u/{objectName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response AbortMultipartUploadResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CancelWorkRequest Cancels a work request. +func (client ObjectStorageClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = CancelWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } return } -// CommitMultipartUpload Commits a multipart upload, which involves checking part numbers and ETags of the parts, to create an aggregate object. +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CommitMultipartUpload Commits a multipart upload, which involves checking part numbers and entity tags (ETags) of the parts, to create an aggregate object. func (client ObjectStorageClient) CommitMultipartUpload(ctx context.Context, request CommitMultipartUploadRequest) (response CommitMultipartUploadResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/u/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.commitMultipartUpload, policy) if err != nil { + if ociResponse != nil { + response = CommitMultipartUploadResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CommitMultipartUploadResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CommitMultipartUploadResponse") + } + return +} + +// commitMultipartUpload implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) commitMultipartUpload(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/u/{objectName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CommitMultipartUploadResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CopyObject Creates a request to copy an object within a region or to another region. +func (client ObjectStorageClient) CopyObject(ctx context.Context, request CopyObjectRequest) (response CopyObjectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.copyObject, policy) + if err != nil { + if ociResponse != nil { + response = CopyObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CopyObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CopyObjectResponse") + } return } -// CreateBucket Creates a bucket in the given namespace with a bucket name and optional user-defined metadata. +// copyObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) copyObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/actions/copyObject") + if err != nil { + return nil, err + } + + var response CopyObjectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateBucket Creates a bucket in the given namespace with a bucket name and optional user-defined metadata. Avoid entering +// confidential information in bucket names. func (client ObjectStorageClient) CreateBucket(ctx context.Context, request CreateBucketRequest) (response CreateBucketResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createBucket, policy) if err != nil { + if ociResponse != nil { + response = CreateBucketResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateBucketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateBucketResponse") + } + return +} + +// createBucket implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) createBucket(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateBucketResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreateMultipartUpload Starts a new multipart upload to a specific object in the given bucket in the given namespace. func (client ObjectStorageClient) CreateMultipartUpload(ctx context.Context, request CreateMultipartUploadRequest) (response CreateMultipartUploadResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/u", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createMultipartUpload, policy) if err != nil { + if ociResponse != nil { + response = CreateMultipartUploadResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreateMultipartUploadResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMultipartUploadResponse") + } + return +} + +// createMultipartUpload implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) createMultipartUpload(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/u") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response CreateMultipartUploadResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // CreatePreauthenticatedRequest Creates a pre-authenticated request specific to the bucket. func (client ObjectStorageClient) CreatePreauthenticatedRequest(ctx context.Context, request CreatePreauthenticatedRequestRequest) (response CreatePreauthenticatedRequestResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/p/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createPreauthenticatedRequest, policy) if err != nil { + if ociResponse != nil { + response = CreatePreauthenticatedRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(CreatePreauthenticatedRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePreauthenticatedRequestResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// createPreauthenticatedRequest implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) createPreauthenticatedRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/p/") + if err != nil { + return nil, err + } + + var response CreatePreauthenticatedRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// DeleteBucket Deletes a bucket if it is already empty. If the bucket is not empty, use DeleteObject first. +// DeleteBucket Deletes a bucket if the bucket is already empty. If the bucket is not empty, use +// DeleteObject first. You also cannot +// delete a bucket that has a pre-authenticated request associated with that bucket. func (client ObjectStorageClient) DeleteBucket(ctx context.Context, request DeleteBucketRequest) (response DeleteBucketResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteBucket, policy) if err != nil { + if ociResponse != nil { + response = DeleteBucketResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteBucketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteBucketResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// deleteBucket implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) deleteBucket(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/") + if err != nil { + return nil, err + } + + var response DeleteBucketResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // DeleteObject Deletes an object. func (client ObjectStorageClient) DeleteObject(ctx context.Context, request DeleteObjectRequest) (response DeleteObjectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/o/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteObject, policy) if err != nil { + if ociResponse != nil { + response = DeleteObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeleteObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteObjectResponse") + } + return +} + +// deleteObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) deleteObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/o/{objectName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeleteObjectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteObjectLifecyclePolicy Deletes the object lifecycle policy for the bucket. +func (client ObjectStorageClient) DeleteObjectLifecyclePolicy(ctx context.Context, request DeleteObjectLifecyclePolicyRequest) (response DeleteObjectLifecyclePolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteObjectLifecyclePolicy, policy) + if err != nil { + if ociResponse != nil { + response = DeleteObjectLifecyclePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteObjectLifecyclePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteObjectLifecyclePolicyResponse") + } return } +// deleteObjectLifecyclePolicy implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) deleteObjectLifecyclePolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/l") + if err != nil { + return nil, err + } + + var response DeleteObjectLifecyclePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeletePreauthenticatedRequest Deletes the pre-authenticated request for the bucket. func (client ObjectStorageClient) DeletePreauthenticatedRequest(ctx context.Context, request DeletePreauthenticatedRequestRequest) (response DeletePreauthenticatedRequestResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/p/{parId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deletePreauthenticatedRequest, policy) if err != nil { + if ociResponse != nil { + response = DeletePreauthenticatedRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(DeletePreauthenticatedRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePreauthenticatedRequestResponse") + } + return +} + +// deletePreauthenticatedRequest implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) deletePreauthenticatedRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/b/{bucketName}/p/{parId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response DeletePreauthenticatedRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetBucket Gets the current representation of the given bucket in the given namespace. +// GetBucket Gets the current representation of the given bucket in the given Object Storage namespace. func (client ObjectStorageClient) GetBucket(ctx context.Context, request GetBucketRequest) (response GetBucketResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getBucket, policy) if err != nil { + if ociResponse != nil { + response = GetBucketResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetBucketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetBucketResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// getBucket implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getBucket(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/") + if err != nil { + return nil, err + } + + var response GetBucketResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetNamespace Namespaces are unique. Namespaces are either the tenancy name or a random string automatically generated during -// account creation. You cannot edit a namespace. +// GetNamespace Each Oracle Cloud Infrastructure tenant is assigned one unique and uneditable Object Storage namespace. The namespace +// is a system-generated string assigned during account creation. For some older tenancies, the namespace string may be +// the tenancy name in all lower-case letters. You cannot edit a namespace. +// GetNamespace returns the name of the Object Storage namespace for the user making the request. +// If an optional compartmentId query parameter is provided, GetNamespace returns the namespace name of the corresponding +// tenancy, provided the user has access to it. func (client ObjectStorageClient) GetNamespace(ctx context.Context, request GetNamespaceRequest) (response GetNamespaceResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getNamespace, policy) if err != nil { + if ociResponse != nil { + response = GetNamespaceResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetNamespaceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNamespaceResponse") + } + return +} + +// getNamespace implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getNamespace(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetNamespaceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// GetNamespaceMetadata Get the metadata for the namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId. -// Any user with the NAMESPACE_READ permission will be able to see the current metadata. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write -// policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// GetNamespaceMetadata Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and +// defaultSwiftCompartmentId. +// Any user with the NAMESPACE_READ permission will be able to see the current metadata. If you are +// not authorized, talk to an administrator. If you are an administrator who needs to write policies +// to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). func (client ObjectStorageClient) GetNamespaceMetadata(ctx context.Context, request GetNamespaceMetadataRequest) (response GetNamespaceMetadataResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getNamespaceMetadata, policy) if err != nil { + if ociResponse != nil { + response = GetNamespaceMetadataResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetNamespaceMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNamespaceMetadataResponse") + } + return +} + +// getNamespaceMetadata implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getNamespaceMetadata(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetNamespaceMetadataResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // GetObject Gets the metadata and body of an object. func (client ObjectStorageClient) GetObject(ctx context.Context, request GetObjectRequest) (response GetObjectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/o/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getObject, policy) if err != nil { + if ociResponse != nil { + response = GetObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetObjectResponse") + } + return +} + +// getObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/o/{objectName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetObjectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetObjectLifecyclePolicy Gets the object lifecycle policy for the bucket. +func (client ObjectStorageClient) GetObjectLifecyclePolicy(ctx context.Context, request GetObjectLifecyclePolicyRequest) (response GetObjectLifecyclePolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getObjectLifecyclePolicy, policy) + if err != nil { + if ociResponse != nil { + response = GetObjectLifecyclePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetObjectLifecyclePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetObjectLifecyclePolicyResponse") + } return } +// getObjectLifecyclePolicy implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getObjectLifecyclePolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/l") + if err != nil { + return nil, err + } + + var response GetObjectLifecyclePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetPreauthenticatedRequest Gets the pre-authenticated request for the bucket. func (client ObjectStorageClient) GetPreauthenticatedRequest(ctx context.Context, request GetPreauthenticatedRequestRequest) (response GetPreauthenticatedRequestResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/p/{parId}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPreauthenticatedRequest, policy) if err != nil { + if ociResponse != nil { + response = GetPreauthenticatedRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(GetPreauthenticatedRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPreauthenticatedRequestResponse") + } + return +} + +// getPreauthenticatedRequest implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getPreauthenticatedRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/p/{parId}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response GetPreauthenticatedRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the status of the work request for the given ID. +func (client ObjectStorageClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = GetWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } return } -// HeadBucket Efficiently checks to see if a bucket exists and gets the current ETag for the bucket. +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// HeadBucket Efficiently checks to see if a bucket exists and gets the current entity tag (ETag) for the bucket. func (client ObjectStorageClient) HeadBucket(ctx context.Context, request HeadBucketRequest) (response HeadBucketResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodHead, "/n/{namespaceName}/b/{bucketName}/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.headBucket, policy) if err != nil { + if ociResponse != nil { + response = HeadBucketResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(HeadBucketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into HeadBucketResponse") + } + return +} + +// headBucket implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) headBucket(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodHead, "/n/{namespaceName}/b/{bucketName}/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response HeadBucketResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// HeadObject Gets the user-defined metadata and entity tag for an object. +// HeadObject Gets the user-defined metadata and entity tag (ETag) for an object. func (client ObjectStorageClient) HeadObject(ctx context.Context, request HeadObjectRequest) (response HeadObjectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodHead, "/n/{namespaceName}/b/{bucketName}/o/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.headObject, policy) if err != nil { + if ociResponse != nil { + response = HeadObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(HeadObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into HeadObjectResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// headObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) headObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodHead, "/n/{namespaceName}/b/{bucketName}/o/{objectName}") + if err != nil { + return nil, err + } + + var response HeadObjectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListBuckets Gets a list of all `BucketSummary`s in a compartment. A `BucketSummary` contains only summary fields for the bucket +// ListBuckets Gets a list of all BucketSummary items in a compartment. A BucketSummary contains only summary fields for the bucket // and does not contain fields like the user-defined metadata. -// To use this and other API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). func (client ObjectStorageClient) ListBuckets(ctx context.Context, request ListBucketsRequest) (response ListBucketsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listBuckets, policy) if err != nil { + if ociResponse != nil { + response = ListBucketsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListBucketsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBucketsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listBuckets implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listBuckets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/") + if err != nil { + return nil, err + } + + var response ListBucketsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListMultipartUploadParts Lists the parts of an in-progress multipart upload. func (client ObjectStorageClient) ListMultipartUploadParts(ctx context.Context, request ListMultipartUploadPartsRequest) (response ListMultipartUploadPartsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/u/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listMultipartUploadParts, policy) if err != nil { + if ociResponse != nil { + response = ListMultipartUploadPartsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListMultipartUploadPartsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMultipartUploadPartsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listMultipartUploadParts implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listMultipartUploadParts(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/u/{objectName}") + if err != nil { + return nil, err + } + + var response ListMultipartUploadPartsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// ListMultipartUploads Lists all in-progress multipart uploads for the given bucket in the given namespace. +// ListMultipartUploads Lists all of the in-progress multipart uploads for the given bucket in the given Object Storage namespace. func (client ObjectStorageClient) ListMultipartUploads(ctx context.Context, request ListMultipartUploadsRequest) (response ListMultipartUploadsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/u", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listMultipartUploads, policy) if err != nil { + if ociResponse != nil { + response = ListMultipartUploadsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListMultipartUploadsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMultipartUploadsResponse") + } + return +} + +// listMultipartUploads implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listMultipartUploads(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/u") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListMultipartUploadsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListObjects Lists the objects in a bucket. -// To use this and other API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). func (client ObjectStorageClient) ListObjects(ctx context.Context, request ListObjectsRequest) (response ListObjectsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/o", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listObjects, policy) if err != nil { + if ociResponse != nil { + response = ListObjectsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListObjectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListObjectsResponse") + } + return +} + +// listObjects implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listObjects(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/o") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response ListObjectsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // ListPreauthenticatedRequests Lists pre-authenticated requests for the bucket. func (client ObjectStorageClient) ListPreauthenticatedRequests(ctx context.Context, request ListPreauthenticatedRequestsRequest) (response ListPreauthenticatedRequestsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/p/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listPreauthenticatedRequests, policy) if err != nil { + if ociResponse != nil { + response = ListPreauthenticatedRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListPreauthenticatedRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPreauthenticatedRequestsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listPreauthenticatedRequests implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listPreauthenticatedRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/b/{bucketName}/p/") + if err != nil { + return nil, err + } + + var response ListPreauthenticatedRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Lists the errors of the work request with the given ID. +func (client ObjectStorageClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestErrorsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors") + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Lists the logs of the work request with the given ID. +func (client ObjectStorageClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestLogsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } return } -// PutObject Creates a new object or overwrites an existing one. -func (client ObjectStorageClient) PutObject(ctx context.Context, request PutObjectRequest) (response PutObjectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/n/{namespaceName}/b/{bucketName}/o/{objectName}", request) +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs") + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +func (client ObjectStorageClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listWorkRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests") + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PutObject Creates a new object or overwrites an existing one. See Special Instructions for Object Storage +// PUT (https://docs.cloud.oracle.com/Content/API/Concepts/signingrequests.htm#ObjectStoragePut) for request signature requirements. +func (client ObjectStorageClient) PutObject(ctx context.Context, request PutObjectRequest) (response PutObjectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.putObject, policy) + if err != nil { + if ociResponse != nil { + response = PutObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(PutObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PutObjectResponse") + } + return +} + +// putObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) putObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/n/{namespaceName}/b/{bucketName}/o/{objectName}") + if err != nil { + return nil, err + } + + var response PutObjectResponse + var httpResponse *http.Response + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PutObjectLifecyclePolicy Creates or replaces the object lifecycle policy for the bucket. +func (client ObjectStorageClient) PutObjectLifecyclePolicy(ctx context.Context, request PutObjectLifecyclePolicyRequest) (response PutObjectLifecyclePolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.putObjectLifecyclePolicy, policy) + if err != nil { + if ociResponse != nil { + response = PutObjectLifecyclePolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PutObjectLifecyclePolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PutObjectLifecyclePolicyResponse") + } return } -// RenameObject Rename an object from source key to target key in the given namespace. +// putObjectLifecyclePolicy implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) putObjectLifecyclePolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/n/{namespaceName}/b/{bucketName}/l") + if err != nil { + return nil, err + } + + var response PutObjectLifecyclePolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RenameObject Rename an object in the given Object Storage namespace. func (client ObjectStorageClient) RenameObject(ctx context.Context, request RenameObjectRequest) (response RenameObjectResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/actions/renameObject", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.renameObject, policy) if err != nil { + if ociResponse != nil { + response = RenameObjectResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(RenameObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RenameObjectResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// renameObject implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) renameObject(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/actions/renameObject") + if err != nil { + return nil, err + } + + var response RenameObjectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// RestoreObjects Restore one or more objects specified by objectName parameter. -// By default object will be restored for 24 hours.Duration can be configured using hours parameter. +// RestoreObjects Restores one or more objects specified by the objectName parameter. +// By default objects will be restored for 24 hours. Duration can be configured using the hours parameter. func (client ObjectStorageClient) RestoreObjects(ctx context.Context, request RestoreObjectsRequest) (response RestoreObjectsResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/actions/restoreObjects", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.restoreObjects, policy) if err != nil { + if ociResponse != nil { + response = RestoreObjectsResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(RestoreObjectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RestoreObjectsResponse") + } + return +} + +// restoreObjects implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) restoreObjects(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/actions/restoreObjects") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response RestoreObjectsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UpdateBucket Performs a partial or full update of a bucket's user-defined metadata. func (client ObjectStorageClient) UpdateBucket(ctx context.Context, request UpdateBucketRequest) (response UpdateBucketResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateBucket, policy) if err != nil { + if ociResponse != nil { + response = UpdateBucketResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateBucketResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateBucketResponse") + } + return +} + +// updateBucket implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) updateBucket(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/b/{bucketName}/") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UpdateBucketResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } -// UpdateNamespaceMetadata Change the default Swift/S3 compartmentId of user's namespace into the user-defined compartmentId. Upon doing -// this, all subsequent bucket creations will use the new default compartment, but no previously created -// buckets will be modified. A user must have the NAMESPACE_UPDATE permission to make changes to the default -// compartments for S3 and Swift. +// UpdateNamespaceMetadata By default, buckets created using the Amazon S3 Compatibility API or the Swift API are created in the root +// compartment of the Oracle Cloud Infrastructure tenancy. +// You can change the default Swift/Amazon S3 compartmentId designation to a different compartmentId. All +// subsequent bucket creations will use the new default compartment, but no previously created +// buckets will be modified. A user must have NAMESPACE_UPDATE permission to make changes to the default +// compartments for Amazon S3 and Swift. func (client ObjectStorageClient) UpdateNamespaceMetadata(ctx context.Context, request UpdateNamespaceMetadataRequest) (response UpdateNamespaceMetadataResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/n/{namespaceName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateNamespaceMetadata, policy) if err != nil { + if ociResponse != nil { + response = UpdateNamespaceMetadataResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UpdateNamespaceMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNamespaceMetadataResponse") + } + return +} - httpResponse, err := client.Call(ctx, &httpRequest) +// updateNamespaceMetadata implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) updateNamespaceMetadata(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/n/{namespaceName}") + if err != nil { + return nil, err + } + + var response UpdateNamespaceMetadataResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } // UploadPart Uploads a single part of a multipart upload. func (client ObjectStorageClient) UploadPart(ctx context.Context, request UploadPartRequest) (response UploadPartResponse, err error) { - httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/n/{namespaceName}/b/{bucketName}/u/{objectName}", request) + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.uploadPart, policy) if err != nil { + if ociResponse != nil { + response = UploadPartResponse{RawResponse: ociResponse.HTTPResponse()} + } return } + if convertedResponse, ok := ociResponse.(UploadPartResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadPartResponse") + } + return +} + +// uploadPart implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) uploadPart(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/n/{namespaceName}/b/{bucketName}/u/{objectName}") + if err != nil { + return nil, err + } - httpResponse, err := client.Call(ctx, &httpRequest) + var response UploadPartResponse + var httpResponse *http.Response + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - return + return response, err } err = common.UnmarshalResponse(httpResponse, &response) - return + return response, err } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/object_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,9 +12,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// ObjectSummary To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// ObjectSummary To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type ObjectSummary struct { // The name of the object. Avoid entering confidential information. @@ -22,7 +22,7 @@ Name *string `mandatory:"true" json:"name"` // Size of the object in bytes. - Size *int `mandatory:"false" json:"size"` + Size *int64 `mandatory:"false" json:"size"` // Base64-encoded MD5 hash of the object data. Md5 *string `mandatory:"false" json:"md5"` diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/pattern_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/pattern_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/pattern_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/pattern_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PatternDetails Specifying inclusion and exclusion patterns. +type PatternDetails struct { + + // An array of glob patterns to match the object names to include. An empty array includes all objects in the + // bucket. Exclusion patterns take precedence over inclusion patterns. + // A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other + // than the special pattern characters described below, matches itself. + // Glob patterns must be between 1 and 1024 characters. + // The special pattern characters have the following meanings: + // \ Escapes the following character + // * Matches any string of characters. + // ? Matches any single character . + // [...] Matches a group of characters. A group of characters can be: + // A set of characters, for example: [Zafg9@]. This matches any character in the brackets. + // A range of characters, for example: [a-z]. This matches any character in the range. + // [a-f] is equivalent to [abcdef]. + // For character ranges only the CHARACTER-CHARACTER pattern is supported. + // [ab-yz] is not valid + // [a-mn-z] is not valid + // Character ranges can not start with ^ or : + // To include a '-' in the range, make it the first or last character. + InclusionPatterns []string `mandatory:"false" json:"inclusionPatterns"` + + // An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion + // patterns take precedence over inclusion patterns. + // A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other + // than the special pattern characters described below, matches itself. + // Glob patterns must be between 1 and 1024 characters. + // The special pattern characters have the following meanings: + // \ Escapes the following character + // * Matches any string of characters. + // ? Matches any single character . + // [...] Matches a group of characters. A group of characters can be: + // A set of characters, for example: [Zafg9@]. This matches any character in the brackets. + // A range of characters, for example: [a-z]. This matches any character in the range. + // [a-f] is equivalent to [abcdef]. + // For character ranges only the CHARACTER-CHARACTER pattern is supported. + // [ab-yz] is not valid + // [a-mn-z] is not valid + // Character ranges can not start with ^ or : + // To include a '-' in the range, make it the first or last character. + ExclusionPatterns []string `mandatory:"false" json:"exclusionPatterns"` +} + +func (m PatternDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -14,9 +14,11 @@ // PreauthenticatedRequest Pre-authenticated requests provide a way to let users access a bucket or an object without having their own credentials. // When you create a pre-authenticated request, a unique URL is generated. Users in your organization, partners, or third -// parties can use this URL to access the targets identified in the pre-authenticated request. See Managing Access to Buckets and Objects (https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm). -// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. -// If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// parties can use this URL to access the targets identified in the pre-authenticated request. +// See Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an +// administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type PreauthenticatedRequest struct { // The unique identifier to use when directly addressing the pre-authenticated request. @@ -31,16 +33,16 @@ // The operation that can be performed on this resource. AccessType PreauthenticatedRequestAccessTypeEnum `mandatory:"true" json:"accessType"` - // The expiration date for the pre-authenticated request as per RFC 3339 (https://tools.ietf.org/rfc/rfc3339). After this date the pre-authenticated request will no longer be valid. + // The expiration date for the pre-authenticated request as per RFC 3339 (https://tools.ietf.org/rfc/rfc3339). After + // this date the pre-authenticated request will no longer be valid. TimeExpires *common.SDKTime `mandatory:"true" json:"timeExpires"` // The date when the pre-authenticated request was created as per specification // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The name of the object that is being granted access to by the pre-authenticated request. This can be null and - // if so, the pre-authenticated request grants access to the entire bucket. Avoid entering confidential information. - // Example: test/object1.log + // The name of the object that is being granted access to by the pre-authenticated request. Avoid entering confidential + // information. The object name can be null and if so, the pre-authenticated request grants access to the entire bucket. ObjectName *string `mandatory:"false" json:"objectName"` } @@ -51,7 +53,7 @@ // PreauthenticatedRequestAccessTypeEnum Enum with underlying type: string type PreauthenticatedRequestAccessTypeEnum string -// Set of constants representing the allowable values for PreauthenticatedRequestAccessType +// Set of constants representing the allowable values for PreauthenticatedRequestAccessTypeEnum const ( PreauthenticatedRequestAccessTypeObjectread PreauthenticatedRequestAccessTypeEnum = "ObjectRead" PreauthenticatedRequestAccessTypeObjectwrite PreauthenticatedRequestAccessTypeEnum = "ObjectWrite" @@ -66,7 +68,7 @@ "AnyObjectWrite": PreauthenticatedRequestAccessTypeAnyobjectwrite, } -// GetPreauthenticatedRequestAccessTypeEnumValues Enumerates the set of values for PreauthenticatedRequestAccessType +// GetPreauthenticatedRequestAccessTypeEnumValues Enumerates the set of values for PreauthenticatedRequestAccessTypeEnum func GetPreauthenticatedRequestAccessTypeEnumValues() []PreauthenticatedRequestAccessTypeEnum { values := make([]PreauthenticatedRequestAccessTypeEnum, 0) for _, v := range mappingPreauthenticatedRequestAccessType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request_summary.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/preauthenticated_request_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -30,7 +30,8 @@ // The date when the pre-authenticated request was created as per RFC 3339 (https://tools.ietf.org/rfc/rfc3339). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The name of object that is being granted access to by the pre-authenticated request. This can be null and if it is, the pre-authenticated request grants access to the entire bucket. + // The name of object that is being granted access to by the pre-authenticated request. This can be null and if it is, + // the pre-authenticated request grants access to the entire bucket. ObjectName *string `mandatory:"false" json:"objectName"` } @@ -41,7 +42,7 @@ // PreauthenticatedRequestSummaryAccessTypeEnum Enum with underlying type: string type PreauthenticatedRequestSummaryAccessTypeEnum string -// Set of constants representing the allowable values for PreauthenticatedRequestSummaryAccessType +// Set of constants representing the allowable values for PreauthenticatedRequestSummaryAccessTypeEnum const ( PreauthenticatedRequestSummaryAccessTypeObjectread PreauthenticatedRequestSummaryAccessTypeEnum = "ObjectRead" PreauthenticatedRequestSummaryAccessTypeObjectwrite PreauthenticatedRequestSummaryAccessTypeEnum = "ObjectWrite" @@ -56,7 +57,7 @@ "AnyObjectWrite": PreauthenticatedRequestSummaryAccessTypeAnyobjectwrite, } -// GetPreauthenticatedRequestSummaryAccessTypeEnumValues Enumerates the set of values for PreauthenticatedRequestSummaryAccessType +// GetPreauthenticatedRequestSummaryAccessTypeEnumValues Enumerates the set of values for PreauthenticatedRequestSummaryAccessTypeEnum func GetPreauthenticatedRequestSummaryAccessTypeEnumValues() []PreauthenticatedRequestSummaryAccessTypeEnum { values := make([]PreauthenticatedRequestSummaryAccessTypeEnum, 0) for _, v := range mappingPreauthenticatedRequestSummaryAccessType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PutObjectLifecyclePolicyDetails Creates a new object lifecycle policy for a bucket. +type PutObjectLifecyclePolicyDetails struct { + + // The bucket's set of lifecycle policy rules. + Items []ObjectLifecycleRule `mandatory:"false" json:"items"` +} + +func (m PutObjectLifecyclePolicyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_lifecycle_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// PutObjectLifecyclePolicyRequest wrapper for the PutObjectLifecyclePolicy operation +type PutObjectLifecyclePolicyRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the bucket. Avoid entering confidential information. + // Example: `my-new-bucket1` + BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` + + // The lifecycle policy to apply to the bucket. + PutObjectLifecyclePolicyDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // For uploading a part, this is the entity tag of the target part. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PutObjectLifecyclePolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PutObjectLifecyclePolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PutObjectLifecyclePolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// PutObjectLifecyclePolicyResponse wrapper for the PutObjectLifecyclePolicy operation +type PutObjectLifecyclePolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ObjectLifecyclePolicy instance + ObjectLifecyclePolicy `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // The entity tag (ETag) for the object lifecycle policy. + ETag *string `presentIn:"header" name:"etag"` +} + +func (response PutObjectLifecyclePolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PutObjectLifecyclePolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/put_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -12,7 +12,7 @@ // PutObjectRequest wrapper for the PutObject operation type PutObjectRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -24,17 +24,18 @@ ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` // The content length of the body. - ContentLength *int `mandatory:"true" contributesTo:"header" name:"Content-Length"` + ContentLength *int64 `mandatory:"true" contributesTo:"header" name:"Content-Length"` // The object to upload to the object store. PutObjectBody io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // The client request ID for tracing. @@ -43,7 +44,10 @@ // 100-continue Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"` - // The base-64 encoded MD5 hash of the body. + // The base-64 encoded MD5 hash of the body. If the Content-MD5 header is present, Object Storage performs an integrity check + // on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. + // If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message: + // "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)" ContentMD5 *string `mandatory:"false" contributesTo:"header" name:"Content-MD5"` // The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call. @@ -57,12 +61,26 @@ // Optional user-defined metadata key and value. OpcMeta map[string]string `mandatory:"false" contributesTo:"header-collection" prefix:"opc-meta-"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request PutObjectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request PutObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PutObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // PutObjectResponse wrapper for the PutObject operation type PutObjectResponse struct { @@ -79,7 +97,7 @@ // The base-64 encoded MD5 hash of the request body as computed by the server. OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` // The time the object was modified, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. @@ -89,3 +107,8 @@ func (response PutObjectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response PutObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,9 +12,9 @@ "github.com/oracle/oci-go-sdk/common" ) -// RenameObjectDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// RenameObjectDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type RenameObjectDetails struct { // The name of the source object to be renamed. @@ -23,13 +23,13 @@ // The new name of the source object. NewName *string `mandatory:"true" json:"newName"` - // The if-match entity tag of the source object. + // The if-match entity tag (ETag) of the source object. SrcObjIfMatchETag *string `mandatory:"false" json:"srcObjIfMatchETag"` - // The if-match entity tag of the new object. + // The if-match entity tag (ETag) of the new object. NewObjIfMatchETag *string `mandatory:"false" json:"newObjIfMatchETag"` - // The if-none-match entity tag of the new object. + // The if-none-match entity tag (ETag) of the new object. NewObjIfNoneMatchETag *string `mandatory:"false" json:"newObjIfNoneMatchETag"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/rename_object_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // RenameObjectRequest wrapper for the RenameObject operation type RenameObjectRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -23,12 +23,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request RenameObjectRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request RenameObjectRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RenameObjectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // RenameObjectResponse wrapper for the RenameObject operation type RenameObjectResponse struct { @@ -42,7 +56,7 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` // The time the object was modified, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. @@ -52,3 +66,8 @@ func (response RenameObjectResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response RenameObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -15,11 +15,11 @@ // RestoreObjectsDetails The representation of RestoreObjectsDetails type RestoreObjectsDetails struct { - // A object which was in an archived state and need to be restored. + // An object that is in an archive storage tier and needs to be restored. ObjectName *string `mandatory:"true" json:"objectName"` // The number of hours for which this object will be restored. - // By default object will be restored for 24 hours.It can be configured using hours parameter. + // By default objects will be restored for 24 hours. You can instead configure the duration using the hours parameter. Hours *int `mandatory:"false" json:"hours"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/restore_objects_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // RestoreObjectsRequest wrapper for the RestoreObjects operation type RestoreObjectsRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -23,12 +23,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request RestoreObjectsRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request RestoreObjectsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RestoreObjectsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // RestoreObjectsResponse wrapper for the RestoreObjects operation type RestoreObjectsResponse struct { @@ -46,3 +60,8 @@ func (response RestoreObjectsResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response RestoreObjectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,198 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "context" + "errors" + "os" + "sync" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/objectstorage" +) + +// FileUploader is an interface to upload a file +type FileUploader interface { + // split file into multiple parts and uploads them to blob storage, then merge + UploadFileMultiparts(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) + + // uploads a file to blob storage via PutObject API + UploadFilePutObject(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) + + // resume a file upload, use it when UploadFile failed + ResumeUploadFile(ctx context.Context, uploadID string) (response UploadResponse, err error) +} + +type fileUpload struct { + uploadID string + manifest *multipartManifest + multipartUploader multipartUploader + fileUploadReqs map[string]UploadFileRequest // save user input to resume +} + +func (fileUpload *fileUpload) UploadFileMultiparts(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) { + file, err := os.Open(request.FilePath) + defer file.Close() + if err != nil { + return + } + + fi, err := file.Stat() + if err != nil { + return + } + + fileSize := fi.Size() + + uploadID, err := fileUpload.multipartUploader.createMultipartUpload(ctx, request.UploadRequest) + fileUpload.uploadID = uploadID + + if err != nil { + return + } + + if fileUpload.fileUploadReqs == nil { + fileUpload.fileUploadReqs = make(map[string]UploadFileRequest) + } + + if fileUpload.manifest == nil { + fileUpload.manifest = &multipartManifest{parts: make(map[string]map[int]uploadPart)} + } + + // save the request for later resume if needed + fileUpload.fileUploadReqs[uploadID] = request + + // UploadFileMultiparts closes the done channel when it returns + done := make(chan struct{}) + defer close(done) + parts := fileUpload.manifest.splitFileToParts(done, *request.PartSize, file, fileSize) + + response, err = fileUpload.startConcurrentUpload(ctx, done, parts, request) + return +} + +func (fileUpload *fileUpload) UploadFilePutObject(ctx context.Context, request UploadFileRequest) (UploadResponse, error) { + response := UploadResponse{Type: SinglepartUpload} + file, err := os.Open(request.FilePath) + defer file.Close() + if err != nil { + return response, err + } + + fi, err := file.Stat() + if err != nil { + return response, err + } + + fileSize := int64(fi.Size()) + + req := objectstorage.PutObjectRequest{ + NamespaceName: request.NamespaceName, + BucketName: request.BucketName, + ObjectName: request.ObjectName, + ContentLength: common.Int64(fileSize), + PutObjectBody: file, + OpcMeta: request.Metadata, + IfMatch: request.IfMatch, + IfNoneMatch: request.IfNoneMatch, + ContentType: request.ContentType, + ContentLanguage: request.ContentLanguage, + ContentEncoding: request.ContentEncoding, + ContentMD5: request.ContentMD5, + OpcClientRequestId: request.OpcClientRequestID, + RequestMetadata: request.RequestMetadata, + } + + resp, err := request.ObjectStorageClient.PutObject(ctx, req) + + if err != nil { + return response, err + } + + // set the response + response.SinglepartUploadResponse = &SinglepartUploadResponse{PutObjectResponse: resp} + return response, nil +} + +func (fileUpload *fileUpload) ResumeUploadFile(ctx context.Context, uploadID string) (UploadResponse, error) { + response := UploadResponse{Type: MultipartUpload} + if fileUpload.manifest == nil || fileUpload.manifest.parts == nil { + err := errors.New("cannot resume upload file, please call UploadFileMultiparts first") + return response, err + } + + parts := fileUpload.manifest.parts[uploadID] + + failedParts := []uploadPart{} + for _, failedPart := range parts { + if failedPart.err != nil || failedPart.etag == nil { + failedPart.err = nil // reset the previouse error to nil for resume + failedParts = append(failedParts, failedPart) + } + } + + if len(failedParts) == 0 { + err := errors.New("previous upload succeed, cannot resume") + return response, err + } + + failedPartsChannel := make(chan uploadPart, len(failedParts)) + go func() { + // close the channel after splitFile returns + defer func() { + common.Debugln("closing parts channel from failedPartsChannel") + close(failedPartsChannel) + }() + + for _, failedPart := range failedParts { + failedPartsChannel <- failedPart + } + }() + + // ResumeUploadFile closes the done channel when it returns + done := make(chan struct{}) + defer close(done) + + response, err := fileUpload.startConcurrentUpload(ctx, done, failedPartsChannel, fileUpload.fileUploadReqs[uploadID]) + return response, err +} + +func (fileUpload *fileUpload) startConcurrentUpload(ctx context.Context, done <-chan struct{}, parts <-chan uploadPart, request UploadFileRequest) (response UploadResponse, err error) { + result := make(chan uploadPart) + numUploads := *request.NumberOfGoroutines + var wg sync.WaitGroup + wg.Add(numUploads) + + // start fixed number of goroutines to upload parts + for i := 0; i < numUploads; i++ { + go func() { + fileUpload.multipartUploader.uploadParts(ctx, done, parts, result, request.UploadRequest, fileUpload.uploadID) + wg.Done() + }() + } + + go func() { + wg.Wait() + close(result) + }() + + fileUpload.manifest.updateManifest(result, fileUpload.uploadID) + resp, err := fileUpload.multipartUploader.commit(ctx, request.UploadRequest, fileUpload.manifest.parts[fileUpload.uploadID], fileUpload.uploadID) + + if err != nil { + common.Debugf("failed to commit with error: %v\n", err) + return UploadResponse{ + Type: MultipartUpload, + MultipartUploadResponse: &MultipartUploadResponse{ + isResumable: common.Bool(true), UploadID: common.String(fileUpload.uploadID)}}, + err + } + + response = UploadResponse{ + Type: MultipartUpload, + MultipartUploadResponse: &MultipartUploadResponse{ + CommitMultipartUploadResponse: resp, UploadID: common.String(fileUpload.uploadID)}, + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_req_resp.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_req_resp.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_req_resp.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_req_resp.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "errors" + + "github.com/oracle/oci-go-sdk/common" +) + +// UploadFileRequest defines the input parameters for UploadFile method +type UploadFileRequest struct { + UploadRequest + + // The path of the file to be uploaded (includs file name) + FilePath string +} + +var errorInvalidFilePath = errors.New("filePath is required") + +const defaultFilePartSize = 128 * 1024 * 1024 // 128MB + +func (request UploadFileRequest) validate() error { + err := request.UploadRequest.validate() + + if err != nil { + return err + } + + if len(request.FilePath) == 0 { + return errorInvalidFilePath + } + + return nil +} + +func (request *UploadFileRequest) initDefaultValues() error { + if request.PartSize == nil { + request.PartSize = common.Int64(defaultFilePartSize) + } + + return request.UploadRequest.initDefaultValues() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/file_uploader_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/oracle/oci-go-sdk/objectstorage" +) + +type fake struct { + upLoadID string + failedPartNumbers []int // use to simulate the part has error to upload for retry and resume + numberOfUploadedParts *int + numberOfCommitedParts *int + resumedPartNumbers []int // parts which are uploaded via resume +} + +func (fake *fake) createMultipartUpload(ctx context.Context, request UploadRequest) (string, error) { + return fake.upLoadID, nil +} + +func (fake *fake) uploadParts(ctx context.Context, done <-chan struct{}, parts <-chan uploadPart, result chan<- uploadPart, request UploadRequest, uploadID string) { + // loop through the part from parts channel created by splitFileParts method + for part := range parts { + resp, err := fake.uploadPart(ctx, request, part, uploadID) + part.etag = resp.ETag + part.err = err + + select { + case result <- part: + case <-done: + return + } + } +} + +func (fake *fake) uploadPart(ctx context.Context, request UploadRequest, part uploadPart, uploadID string) (objectstorage.UploadPartResponse, error) { + // mark parts as failed + for _, failedPartNum := range fake.failedPartNumbers { + if failedPartNum == part.partNum { + // simulate part upload failed + return objectstorage.UploadPartResponse{}, errors.New("upload failed") + } + } + + *fake.numberOfUploadedParts++ + return objectstorage.UploadPartResponse{ETag: common.String("etag")}, nil +} + +func (fake *fake) commit(ctx context.Context, request UploadRequest, parts map[int]uploadPart, uploadID string) (resp objectstorage.CommitMultipartUploadResponse, err error) { + *fake.numberOfCommitedParts = 0 + for _, part := range parts { + if part.err == nil { + *fake.numberOfCommitedParts++ + } else { + *fake.numberOfCommitedParts = 0 + break + } + } + + return +} + +func TestUploadFileMultiparts(t *testing.T) { + type testStruct struct { + uploadID string + failedPartNumbers []int + expectedUploadID string + expectedCachedNumOfRequest int + expectedNumOfUploadParts int + expectedNumOfCommitParts int + } + + testDataSet := []testStruct{ + { + uploadID: "id1", + failedPartNumbers: []int{}, + expectedUploadID: "id1", + expectedCachedNumOfRequest: 1, + expectedNumOfUploadParts: 10, + expectedNumOfCommitParts: 10, + }, + { + uploadID: "id2", + failedPartNumbers: []int{1, 2}, + expectedUploadID: "id2", + expectedCachedNumOfRequest: 2, + expectedNumOfUploadParts: 8, + expectedNumOfCommitParts: 10, + }, + } + + fileUpload := fileUpload{} + var partSize, fileSize int64 + fileSize = 100 + partSize = 10 + + ctx := context.Background() + for _, testData := range testDataSet { + fake := fake{upLoadID: testData.uploadID, failedPartNumbers: testData.failedPartNumbers, numberOfCommitedParts: common.Int(0), numberOfUploadedParts: common.Int(0)} + fileUpload.multipartUploader = &fake + filePath, _ := helpers.WriteTempFileOfSize(int64(fileSize)) + request := UploadFileRequest{ + UploadRequest: UploadRequest{PartSize: common.Int64(partSize)}, + FilePath: filePath, + } + + request.initDefaultValues() + resp, err := fileUpload.UploadFileMultiparts(ctx, request) + assert.Equal(t, testData.expectedUploadID, *resp.UploadID) + assert.NotEmpty(t, fileUpload.fileUploadReqs[testData.uploadID]) + assert.Equal(t, testData.expectedCachedNumOfRequest, len(fileUpload.fileUploadReqs)) + assert.NotEmpty(t, fileUpload.manifest.parts) + + // all parts have been committed + totalParts := int(fileSize / partSize) + failedParts := len(fake.failedPartNumbers) + assert.Equal(t, testData.expectedNumOfUploadParts, totalParts-failedParts) + assert.NoError(t, err) + + if failedParts != 0 { + // no parts should be commit as there are failed parts + assert.Equal(t, 0, *fake.numberOfCommitedParts) + + // parts gonna to be resumed + fake.resumedPartNumbers = fake.failedPartNumbers + + // empty the failed part numbers array + fake.failedPartNumbers = []int{} + fileUpload.ResumeUploadFile(ctx, testData.uploadID) + assert.Equal(t, totalParts, *fake.numberOfCommitedParts) + } + + // finally, all parts should be committed + assert.Equal(t, testData.expectedNumOfCommitParts, *fake.numberOfCommitedParts) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "io" + "os" + + "github.com/oracle/oci-go-sdk/common" +) + +// multipartManifest provides thread-safe access to an ongoing manifest upload. +type multipartManifest struct { + // key is UploadID, define it as map since user can upload multiple times + // second key is part number + parts map[string]map[int]uploadPart +} + +type uploadPart struct { + size int64 + offset int64 + partBody []byte + partNum int + hash *string + opcMD5 *string + etag *string + err error +} + +// splitFileToParts starts a goroutine to read a file and break down to parts and send the parts to +// uploadPart channel. It sends the error to error chanel. If done is closed, splitFileToParts +// abandones its works. +func (manifest *multipartManifest) splitFileToParts(done <-chan struct{}, partSize int64, file *os.File, fileSize int64) <-chan uploadPart { + parts := make(chan uploadPart) + + // Number of parts of the file + numberOfParts := int(fileSize / partSize) + + go func() { + // close the channel after splitFile returns + defer func() { + common.Debugln("closing parts channel from splitFileParts") + close(parts) + }() + + // All buffer sizes are the same in the normal case. Offsets depend on the index. + // Second go routine should start at 100, for example, given our + // buffer size of 100. + for i := 0; i < numberOfParts; i++ { + offset := partSize * int64(i) // offset of the file, start with 0 + + buffer := make([]byte, partSize) + _, err := file.ReadAt(buffer, offset) + + part := uploadPart{ + partNum: i + 1, + size: partSize, + offset: offset, + err: err, + partBody: buffer, + } + + select { + case parts <- part: + case <-done: + return + } + } + + // check for any left over bytes. Add the residual number of bytes as the + // the last chunk size. + if remainder := fileSize % int64(partSize); remainder != 0 { + part := uploadPart{offset: (int64(numberOfParts) * partSize), partNum: numberOfParts + 1} + + part.partBody = make([]byte, remainder) + _, err := file.ReadAt(part.partBody, part.offset) + + part.size = remainder + part.err = err + + select { + case parts <- part: + case <-done: + return + } + } + }() + + return parts +} + +// splitStreamToParts starts a goroutine to read a stream and break down to parts and send the parts to +// uploadPart channel. It sends the error to error chanel. If done is closed, splitStreamToParts +// abandones its works. +func (manifest *multipartManifest) splitStreamToParts(done <-chan struct{}, partSize int64, reader io.Reader) <-chan uploadPart { + parts := make(chan uploadPart) + + go func() { + defer close(parts) + partNum := 1 + for { + buffer := make([]byte, partSize) + _, err := reader.Read(buffer) + + if err == io.EOF { + break + } + + part := uploadPart{ + partNum: partNum, + size: partSize, + err: err, + partBody: buffer, + } + + partNum++ + select { + case parts <- part: + case <-done: + return + } + } + }() + + return parts +} + +// update the result in manifest +func (manifest *multipartManifest) updateManifest(result <-chan uploadPart, uploadID string) { + if manifest.parts[uploadID] == nil { + manifest.parts[uploadID] = make(map[int]uploadPart) + } + for r := range result { + manifest.parts[uploadID][r.partNum] = r + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/multipart_manifest_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "os" + "path" + "testing" + + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/stretchr/testify/assert" +) + +func TestSplitFileParts(t *testing.T) { + type splitFilePartsTest struct { + contentLen int + partSize int64 + expectedPartNum int + expectedInitOffset int64 + expectedLastOffset int64 + expectedLastPartSize int64 + } + + testDataSet := []splitFilePartsTest{ + { + contentLen: 100, + partSize: 10, + expectedPartNum: 10, + expectedInitOffset: 10, + expectedLastOffset: 90, + expectedLastPartSize: 10, + }, + { + contentLen: 30, + partSize: 14, + expectedPartNum: 3, + expectedInitOffset: 14, + expectedLastOffset: 28, + expectedLastPartSize: 2, + }, + } + + for _, testData := range testDataSet { + filePath, fileSize := helpers.WriteTempFileOfSize(int64(testData.contentLen)) + file, err := os.Open(filePath) + assert.NoError(t, err) + + manifest := &multipartManifest{parts: make(map[string]map[int]uploadPart)} + + // UploadFileMultiparts closes the done channel when it returns; it may do so before + // receiving all the values from result and errc channel + done := make(chan struct{}) + partsChannel := manifest.splitFileToParts(done, testData.partSize, file, fileSize) + + // read through channel + parts := []uploadPart{} + for part := range partsChannel { + assert.NoError(t, part.err) + parts = append(parts, part) + } + + assert.Equal(t, testData.expectedPartNum, len(parts)) + assert.Equal(t, testData.expectedInitOffset, parts[1].offset) + assert.Equal(t, testData.partSize, parts[1].size) + assert.Equal(t, testData.expectedLastOffset, parts[len(parts)-1].offset) + assert.Equal(t, testData.expectedLastPartSize, parts[len(parts)-1].size) + + file.Close() + os.Remove(path.Base(filePath)) + close(done) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/mutipart_uploader.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/mutipart_uploader.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/mutipart_uploader.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/mutipart_uploader.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,126 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "bytes" + "context" + "io/ioutil" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/objectstorage" +) + +// multipartUploader is an interface wrap the methods talk to object storage service +type multipartUploader interface { + createMultipartUpload(ctx context.Context, request UploadRequest) (string, error) + uploadParts(ctx context.Context, done <-chan struct{}, parts <-chan uploadPart, result chan<- uploadPart, request UploadRequest, uploadID string) + uploadPart(ctx context.Context, request UploadRequest, part uploadPart, uploadID string) (objectstorage.UploadPartResponse, error) + commit(ctx context.Context, request UploadRequest, parts map[int]uploadPart, uploadID string) (resp objectstorage.CommitMultipartUploadResponse, err error) +} + +// multipartUpload implements multipartUploader interface +type multipartUpload struct{} + +// createMultipartUpload creates a new multipart upload in Object Storage and return the uploadId +func (uploader *multipartUpload) createMultipartUpload(ctx context.Context, request UploadRequest) (string, error) { + multipartUploadRequest := objectstorage.CreateMultipartUploadRequest{ + NamespaceName: request.NamespaceName, + BucketName: request.BucketName, + IfMatch: request.IfMatch, + IfNoneMatch: request.IfNoneMatch, + OpcClientRequestId: request.OpcClientRequestID, + } + + multipartUploadRequest.Object = request.ObjectName + multipartUploadRequest.ContentType = request.ContentType + multipartUploadRequest.ContentEncoding = request.ContentEncoding + multipartUploadRequest.ContentLanguage = request.ContentLanguage + multipartUploadRequest.Metadata = request.Metadata + + resp, err := request.ObjectStorageClient.CreateMultipartUpload(ctx, multipartUploadRequest) + return *resp.UploadId, err +} + +func (uploader *multipartUpload) uploadParts(ctx context.Context, done <-chan struct{}, parts <-chan uploadPart, result chan<- uploadPart, request UploadRequest, uploadID string) { + // loop through the part from parts channel created by splitFileParts method + for part := range parts { + if part.err != nil { + // ignore this part which contains error from split function + result <- part + return + } + + resp, err := uploader.uploadPart(ctx, request, part, uploadID) + if err != nil { + common.Debugf("upload error %v\n", err) + part.err = err + } + part.etag = resp.ETag + select { + case result <- part: + common.Debugf("uploadParts resp %v, %v\n", part.partNum, resp.ETag) + case <-done: + common.Debugln("uploadParts received Done") + return + } + } +} + +// send request to upload part to object storage +func (uploader *multipartUpload) uploadPart(ctx context.Context, request UploadRequest, part uploadPart, uploadID string) (objectstorage.UploadPartResponse, error) { + req := objectstorage.UploadPartRequest{ + NamespaceName: request.NamespaceName, + BucketName: request.BucketName, + ObjectName: request.ObjectName, + UploadId: common.String(uploadID), + UploadPartNum: common.Int(part.partNum), + UploadPartBody: ioutil.NopCloser(bytes.NewReader(part.partBody)), + ContentLength: common.Int64(part.size), + IfMatch: request.IfMatch, + IfNoneMatch: request.IfNoneMatch, + OpcClientRequestId: request.OpcClientRequestID, + RequestMetadata: request.RequestMetadata, + } + + resp, err := request.ObjectStorageClient.UploadPart(ctx, req) + + return resp, err +} + +// commits the multipart upload +func (uploader *multipartUpload) commit(ctx context.Context, request UploadRequest, parts map[int]uploadPart, uploadID string) (resp objectstorage.CommitMultipartUploadResponse, err error) { + req := objectstorage.CommitMultipartUploadRequest{ + NamespaceName: request.NamespaceName, + BucketName: request.BucketName, + ObjectName: request.ObjectName, + UploadId: common.String(uploadID), + IfMatch: request.IfMatch, + IfNoneMatch: request.IfNoneMatch, + OpcClientRequestId: request.OpcClientRequestID, + RequestMetadata: request.RequestMetadata, + } + + partsToCommit := []objectstorage.CommitMultipartUploadPartDetails{} + + for _, part := range parts { + if part.etag != nil { + detail := objectstorage.CommitMultipartUploadPartDetails{ + Etag: part.etag, + PartNum: common.Int(part.partNum), + } + + // update the parts to commit + partsToCommit = append(partsToCommit, detail) + } else { + // some parts failed, return error for resume + common.Debugf("uploadPart has error: %v\n", part.err) + err = part.err + return + } + } + + req.PartsToCommit = partsToCommit + resp, err = request.ObjectStorageClient.CommitMultipartUpload(ctx, req) + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "context" + "sync" + + "github.com/oracle/oci-go-sdk/common" +) + +// StreamUploader is an interface for upload a stream +type StreamUploader interface { + // uploads a stream to blob storage + UploadStream(ctx context.Context, request UploadStreamRequest) (response UploadResponse, err error) +} + +type streamUpload struct { + uploadID string + manifest *multipartManifest + multipartUploader multipartUploader + request UploadStreamRequest +} + +func (streamUpload *streamUpload) UploadStream(ctx context.Context, request UploadStreamRequest) (response UploadResponse, err error) { + + uploadID, err := streamUpload.multipartUploader.createMultipartUpload(ctx, request.UploadRequest) + streamUpload.uploadID = uploadID + + if err != nil { + return UploadResponse{}, err + } + + if streamUpload.manifest == nil { + streamUpload.manifest = &multipartManifest{parts: make(map[string]map[int]uploadPart)} + } + + // UploadFileMultiparts closes the done channel when it returns + done := make(chan struct{}) + defer close(done) + parts := streamUpload.manifest.splitStreamToParts(done, *request.PartSize, request.StreamReader) + + return streamUpload.startConcurrentUpload(ctx, done, parts, request) +} + +func (streamUpload *streamUpload) startConcurrentUpload(ctx context.Context, done <-chan struct{}, parts <-chan uploadPart, request UploadStreamRequest) (response UploadResponse, err error) { + result := make(chan uploadPart) + numUploads := *request.NumberOfGoroutines + var wg sync.WaitGroup + wg.Add(numUploads) + + // start fixed number of goroutines to upload parts + for i := 0; i < numUploads; i++ { + go func() { + streamUpload.multipartUploader.uploadParts(ctx, done, parts, result, request.UploadRequest, streamUpload.uploadID) + wg.Done() + }() + } + + go func() { + wg.Wait() + close(result) + }() + + streamUpload.manifest.updateManifest(result, streamUpload.uploadID) + resp, err := streamUpload.multipartUploader.commit(ctx, request.UploadRequest, streamUpload.manifest.parts[streamUpload.uploadID], streamUpload.uploadID) + + if err != nil { + common.Debugf("failed to commit with error: %v\n", err) + return UploadResponse{ + Type: MultipartUpload, + MultipartUploadResponse: &MultipartUploadResponse{UploadID: common.String(streamUpload.uploadID)}}, + err + } + + response = UploadResponse{ + Type: MultipartUpload, + MultipartUploadResponse: &MultipartUploadResponse{CommitMultipartUploadResponse: resp}, + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_req_resp.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_req_resp.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_req_resp.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_req_resp.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "errors" + "io" + + "github.com/oracle/oci-go-sdk/common" +) + +// UploadStreamRequest defines the input parameters for UploadFile method +type UploadStreamRequest struct { + UploadRequest + + // The reader of input stream + StreamReader io.Reader +} + +var errorInvalidStream = errors.New("uploadStream is required") + +const defaultStreamPartSize = 10 * 1024 * 1024 // 10MB + +func (request UploadStreamRequest) validate() error { + err := request.UploadRequest.validate() + + if err != nil { + return err + } + + if request.StreamReader == nil { + return errorInvalidStream + } + + return nil +} + +func (request *UploadStreamRequest) initDefaultValues() error { + if request.PartSize == nil { + request.PartSize = common.Int64(defaultStreamPartSize) + } + + return request.UploadRequest.initDefaultValues() +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/stream_uploader_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" +) + +func TestUploadStreamMultiparts(t *testing.T) { + type testStruct struct { + uploadID string + failedPartNumbers []int + expectedNumOfUploadParts int + expectedNumOfCommitParts int + } + + testDataSet := []testStruct{ + { + uploadID: "id1", + failedPartNumbers: []int{}, + expectedNumOfUploadParts: 10, + expectedNumOfCommitParts: 10, + }, + { + uploadID: "id2", + failedPartNumbers: []int{1, 2}, + expectedNumOfUploadParts: 8, + expectedNumOfCommitParts: 0, + }, + } + + streamUpload := streamUpload{} + var fileSize, partSize int64 + fileSize = 100 + partSize = 10 + + ctx := context.Background() + for _, testData := range testDataSet { + fake := fake{upLoadID: testData.uploadID, failedPartNumbers: testData.failedPartNumbers, numberOfCommitedParts: common.Int(0), numberOfUploadedParts: common.Int(0)} + streamUpload.multipartUploader = &fake + filePath, _ := helpers.WriteTempFileOfSize(int64(fileSize)) + + file, err := os.Open(filePath) + defer file.Close() + assert.NoError(t, err) + + request := UploadStreamRequest{ + UploadRequest: UploadRequest{PartSize: common.Int64(partSize)}, + StreamReader: file, + } + + request.initDefaultValues() + streamUpload.UploadStream(ctx, request) + assert.NotEmpty(t, streamUpload.manifest.parts) + + // all parts have been committed + totalParts := int(fileSize / partSize) + failedParts := len(fake.failedPartNumbers) + assert.Equal(t, testData.expectedNumOfUploadParts, totalParts-failedParts) + assert.NoError(t, err) + + if failedParts != 0 { + // not parts should be commit as there are failed parts + assert.Equal(t, 0, *fake.numberOfCommitedParts) + } + + // finally, all parts should be committed + assert.Equal(t, testData.expectedNumOfCommitParts, *fake.numberOfCommitedParts) + } +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,129 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +// Package transfer simplifies interaction with the Object Storage service by abstracting away the method used +// to upload objects. Depending on the configuration parameters, UploadManager may choose to do a single +// put_object request, or break up the upload into multiple parts and utilize multi-part uploads. +// +// An advantage of using multi-part uploads is the ability to retry individual failed parts, as well as being +// able to upload parts in parallel to reduce upload time. +// +// To use this package, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. +package transfer + +import ( + "context" + "errors" + "math" + "os" + "strings" + "time" + + "github.com/oracle/oci-go-sdk/common" +) + +// UploadManager is the interface that groups the upload methods +type UploadManager struct { + FileUploader FileUploader + StreamUploader StreamUploader +} + +var ( + errorInvalidStreamUploader = errors.New("streamUploader is required, use NewUploadManager for default implementation") + errorInvalidFileUploader = errors.New("fileUploader is required, use NewUploadManager for default implementation") +) + +// NewUploadManager return a pointer to UploadManager +func NewUploadManager() *UploadManager { + return &UploadManager{ + FileUploader: &fileUpload{multipartUploader: &multipartUpload{}}, + StreamUploader: &streamUpload{multipartUploader: &multipartUpload{}}, + } +} + +// UploadFile uploads an object to Object Storage. Depending on the options provided and the +// size of the object, the object may be uploaded in multiple parts or just an signle object. +func (uploadManager *UploadManager) UploadFile(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) { + if err = request.validate(); err != nil { + return + } + + if err = request.initDefaultValues(); err != nil { + return + } + + if uploadManager.FileUploader == nil { + err = errorInvalidFileUploader + return + } + + file, err := os.Open(request.FilePath) + defer file.Close() + + if err != nil { + return + } + + fi, err := file.Stat() + if err != nil { + return + } + + fileSize := fi.Size() + + // parrallel upload disabled by user or the file size smaller than or equal to partSize + // use UploadFilePutObject + if !*request.AllowMultipartUploads || + int64(fileSize) <= *request.PartSize { + response, err = uploadManager.FileUploader.UploadFilePutObject(ctx, request) + return + } + + response, err = uploadManager.FileUploader.UploadFileMultiparts(ctx, request) + return +} + +// ResumeUploadFile resumes a multipart file upload. +func (uploadManager *UploadManager) ResumeUploadFile(ctx context.Context, uploadID string) (response UploadResponse, err error) { + if len(strings.TrimSpace(uploadID)) == 0 { + err = errors.New("uploadID is required to resume a multipart file upload") + return + } + response, err = uploadManager.FileUploader.ResumeUploadFile(ctx, uploadID) + return +} + +// UploadStream uploads streaming data to Object Storage. If the stream is non-empty, this will always perform a +// multipart upload, splitting parts based on the part size (10 MiB if none specified). If the stream is empty, +// this will upload a single empty object to Object Storage. +// Stream uploads are not currently resumable. +func (uploadManager *UploadManager) UploadStream(ctx context.Context, request UploadStreamRequest) (response UploadResponse, err error) { + if err = request.validate(); err != nil { + return + } + + if err = request.initDefaultValues(); err != nil { + return + } + + if uploadManager.StreamUploader == nil { + err = errorInvalidStreamUploader + return + } + + response, err = uploadManager.StreamUploader.UploadStream(ctx, request) + return +} + +func getUploadManagerRetryPolicy() *common.RetryPolicy { + attempts := uint(3) + retryOnAllNon200ResponseCodes := func(r common.OCIOperationResponse) bool { + return !(r.Error == nil && 199 < r.Response.HTTPResponse().StatusCode && r.Response.HTTPResponse().StatusCode < 300) + } + + exponentialBackoff := func(r common.OCIOperationResponse) time.Duration { + return time.Duration(math.Pow(float64(2), float64(r.AttemptNumber-1))) * time.Second + } + policy := common.NewRetryPolicy(attempts, retryOnAllNon200ResponseCodes, exponentialBackoff) + + return &policy +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,214 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "errors" + "math" + "net/http" + "time" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/objectstorage" +) + +// requestValidator validate user's input and assign default values if not defined +type requestValidator interface { + // validate inputs, return error if request is not valid + validate() error + + // assign default values + assignDefaultValues() error +} + +// UploadRequest defines the input parameters for UploadFile method +type UploadRequest struct { + // The top-level namespace used for the request. + NamespaceName *string `mandatory:"true"` + + // The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1 + BucketName *string `mandatory:"true"` + + // The name of the object. Avoid entering confidential information. Example: test/object1.log + ObjectName *string `mandatory:"true"` + + // [Optional] Override the default part size of 128 MiB, value is in bytes. + PartSize *int64 `mandatory:"false"` + + // [Optional] Whether or not this UploadManager supports performing mulitpart uploads. Defaults to True. + AllowMultipartUploads *bool `mandatory:"false"` + + // [Optional] Whether or not this UploadManager supports uploading individual parts of a multipart upload in parallel. + // This setting has no effect on uploads that are performed using a single put_object call. Defaults to True. + AllowParrallelUploads *bool `mandatory:"false"` + + // The number of go routines for uploading individual parts of a multipart upload. + // This setting is only used if allow_parallel_uploads is set to True. Defaults to 10. + // TODO: check with service team for upper bounds of the concurrent number of uploads + // and update the document here + NumberOfGoroutines *int `mandatory:"false"` + + // A configured object storage client to use for interacting with the Object Storage service. + ObjectStorageClient *objectstorage.ObjectStorageClient `mandatory:"false"` + + // [Optional] The entity tag of the object to match. + IfMatch *string `mandatory:"false"` + + // [Optional] The entity tag of the object to avoid matching. The only valid value is ‘*’, + // which indicates that the request should fail if the object already exists. + IfNoneMatch *string `mandatory:"false"` + + // [Optional] The base-64 encoded MD5 hash of the body. This parameter is only used if the object is uploaded in a single part. + ContentMD5 *string `mandatory:"false"` + + // [Optional] The content type of the object to upload. + ContentType *string `mandatory:"false"` + + // [Optional] The content language of the object to upload. + ContentLanguage *string `mandatory:"false"` + + // [Optional] The content encoding of the object to upload. + ContentEncoding *string `mandatory:"false"` + + // [Optional] Arbitrary string keys and values for the user-defined metadata for the object. + // Keys must be in "opc-meta-*" format. + Metadata map[string]string `mandatory:"false"` + + // [Optional] The client request ID for tracing. + OpcClientRequestID *string `mandatory:"false"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +var ( + errorInvalidNamespace = errors.New("namespaceName is required") + errorInvalidBucketName = errors.New("bucketName is required") + errorInvalidObjectName = errors.New("objectName is required") +) + +const defaultNumberOfGoroutines = 5 // increase the value might cause 409 error form service and client timeout + +func (request UploadRequest) validate() error { + if request.NamespaceName == nil { + return errorInvalidNamespace + } + + if request.BucketName == nil { + return errorInvalidBucketName + } + + if request.ObjectName == nil { + return errorInvalidObjectName + } + + return nil +} + +func (request *UploadRequest) initDefaultValues() error { + if request.ObjectStorageClient == nil { + client, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.DefaultConfigProvider()) + + // default timeout is 60s which includes the time for reading the body + // default timeout doesn't work for big file, here will use the default + // 0s which means no timeout + client.HTTPClient = &http.Client{} + + if err != nil { + return err + } + + request.ObjectStorageClient = &client + } + + if request.NumberOfGoroutines == nil || + *request.NumberOfGoroutines <= 0 { + request.NumberOfGoroutines = common.Int(defaultNumberOfGoroutines) + } + + if request.AllowMultipartUploads == nil { + request.AllowMultipartUploads = common.Bool(true) + } + + if request.AllowParrallelUploads == nil { + request.AllowParrallelUploads = common.Bool(true) + } + + if !*request.AllowParrallelUploads { + request.NumberOfGoroutines = common.Int(1) // one go routine for upload + } + + if request.RetryPolicy() == nil { + // default retry policy + request.RequestMetadata = common.RequestMetadata{RetryPolicy: getUploadManagerDefaultRetryPolicy()} + } + + return nil +} + +// UploadResponseType with underlying type: string +type UploadResponseType string + +// Set of constants representing the allowable values for VolumeAttachmentLifecycleState +const ( + MultipartUpload UploadResponseType = "MULTIPARTUPLOAD" + SinglepartUpload UploadResponseType = "SINGLEPARTUPLOAD" +) + +// UploadResponse is the response from commitMultipart or the putObject API operation. +type UploadResponse struct { + + // Polymorphic reponse type indicates the response type + Type UploadResponseType + + // response for putObject API response (single part upload), will be nil if the operation is multiPart upload + *SinglepartUploadResponse + + // response for commitMultipart API response (multipart upload), will be nil if the operation is singlePart upload + *MultipartUploadResponse +} + +// IsResumable is a function to check is previous failed upload resumable or not +func (resp UploadResponse) IsResumable() bool { + if resp.Type == SinglepartUpload { + return false + } + + return *resp.MultipartUploadResponse.isResumable +} + +// SinglepartUploadResponse is the response from putObject API operation. +type SinglepartUploadResponse struct { + objectstorage.PutObjectResponse +} + +// MultipartUploadResponse is the response from commitMultipart API operation. +type MultipartUploadResponse struct { + objectstorage.CommitMultipartUploadResponse + + // The upload ID for a multipart upload. + UploadID *string + + // The value indicates is the operation IsResumable or not, call the resume function if is true + isResumable *bool +} + +func getUploadManagerDefaultRetryPolicy() *common.RetryPolicy { + attempts := uint(3) + retryOnAllNon200ResponseCodes := func(r common.OCIOperationResponse) bool { + return !(r.Error == nil && 199 < r.Response.HTTPResponse().StatusCode && r.Response.HTTPResponse().StatusCode < 300) + } + + exponentialBackoff := func(r common.OCIOperationResponse) time.Duration { + return time.Duration(math.Pow(float64(2), float64(r.AttemptNumber-1))) * time.Second + } + policy := common.NewRetryPolicy(attempts, retryOnAllNon200ResponseCodes, exponentialBackoff) + + return &policy +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_req_resp_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "testing" + + "github.com/oracle/oci-go-sdk/common" + "github.com/stretchr/testify/assert" +) + +func TestUploadReqest_validate(t *testing.T) { + type testData struct { + NamespaceName *string + BucketName *string + ObjectName *string + ExpectedError error + } + + testDataSet := []testData{ + { + NamespaceName: nil, + BucketName: common.String("test"), + ObjectName: common.String("test"), + ExpectedError: errorInvalidNamespace, + }, { + NamespaceName: common.String("test"), + BucketName: nil, + ObjectName: common.String("test"), + ExpectedError: errorInvalidBucketName, + }, { + NamespaceName: common.String("test"), + BucketName: common.String("test"), + ObjectName: nil, + ExpectedError: errorInvalidObjectName, + }, + } + + for _, testData := range testDataSet { + req := UploadRequest{ + NamespaceName: testData.NamespaceName, + BucketName: testData.BucketName, + ObjectName: testData.ObjectName, + } + + err := req.validate() + assert.Equal(t, testData.ExpectedError, err) + } +} + +func TestUploadReqest_initDefaultValues(t *testing.T) { + req := UploadRequest{} + err := req.initDefaultValues() + assert.NoError(t, err) + assert.Equal(t, defaultNumberOfGoroutines, *req.NumberOfGoroutines) + assert.Equal(t, true, *req.AllowMultipartUploads) + assert.Equal(t, true, *req.AllowParrallelUploads) + assert.NotEmpty(t, req.ObjectStorageClient) +} + +func TestUploadFileReqest_initDefaultValues(t *testing.T) { + req := UploadFileRequest{} + err := req.initDefaultValues() + assert.NoError(t, err) + assert.Equal(t, int64(defaultFilePartSize), *req.PartSize) +} + +func TestUploadFileReqest_validate(t *testing.T) { + req := UploadFileRequest{ + UploadRequest: UploadRequest{ + NamespaceName: common.String("test"), + BucketName: common.String("test"), + ObjectName: common.String("test"), + }, + FilePath: "", + } + + err := req.validate() + assert.Equal(t, errorInvalidFilePath, err) +} + +func TestUploadStreamReqest_validate(t *testing.T) { + req := UploadStreamRequest{ + UploadRequest: UploadRequest{ + NamespaceName: common.String("test"), + BucketName: common.String("test"), + ObjectName: common.String("test"), + }, + StreamReader: nil, + } + + err := req.validate() + assert.Equal(t, errorInvalidStream, err) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/transfer/upload_manager_test.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +package transfer + +import ( + "context" + "testing" + + "github.com/oracle/oci-go-sdk/common" + "github.com/oracle/oci-go-sdk/example/helpers" + "github.com/stretchr/testify/assert" +) + +type fakeFileUpload struct{} + +// split file into multiple parts and uploads them to blob storage, then merge +func (fake fakeFileUpload) UploadFileMultiparts(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) { + response = UploadResponse{ + Type: MultipartUpload, + } + + return +} + +// uploads a file to blob storage via PutObject API +func (fake fakeFileUpload) UploadFilePutObject(ctx context.Context, request UploadFileRequest) (response UploadResponse, err error) { + response = UploadResponse{ + Type: SinglepartUpload, + } + + return +} + +// resume a file upload, use it when UploadFile failed +func (fake fakeFileUpload) ResumeUploadFile(ctx context.Context, uploadID string) (response UploadResponse, err error) { + return +} + +func TestUploadManager_UploadFile(t *testing.T) { + type testData struct { + FileSize int + PartSize *int64 + FileUploader FileUploader + ExpectedResponsType UploadResponseType + ExpectedError error + } + + testDataSet := []testData{ + { + FileSize: 100, + PartSize: common.Int64(1000), + FileUploader: fakeFileUpload{}, + ExpectedResponsType: SinglepartUpload, + }, { + FileSize: 60, + PartSize: common.Int64(50), + FileUploader: fakeFileUpload{}, + ExpectedResponsType: MultipartUpload, + }, { + FileSize: 60, + PartSize: common.Int64(50), + FileUploader: nil, + ExpectedError: errorInvalidFileUploader, + }, + } + + for _, testData := range testDataSet { + uploadManager := UploadManager{FileUploader: testData.FileUploader} + // small file fits into one part + filePath, _ := helpers.WriteTempFileOfSize(int64(testData.FileSize)) + req := UploadFileRequest{ + UploadRequest: UploadRequest{ + NamespaceName: common.String("namespace"), + BucketName: common.String("bname"), + ObjectName: common.String("objectName"), + PartSize: testData.PartSize, + }, + FilePath: filePath, + } + + resp, err := uploadManager.UploadFile(context.Background(), req) + assert.Equal(t, err, testData.ExpectedError) + assert.Equal(t, testData.ExpectedResponsType, resp.Type) + } + +} + +func TestUploadManager_ResumeUploadFile(t *testing.T) { + fileUploader := fakeFileUpload{} + uploadManager := UploadManager{FileUploader: fileUploader} + _, err := uploadManager.ResumeUploadFile(context.Background(), "") + assert.Error(t, err) +} + +type fakeReader struct{} + +func (fr fakeReader) Read(p []byte) (n int, err error) { + return +} + +func TestUploadManager_UploadStream(t *testing.T) { + + req := UploadStreamRequest{ + UploadRequest: UploadRequest{ + NamespaceName: common.String("namespace"), + BucketName: common.String("bname"), + ObjectName: common.String("objectName"), + }, + StreamReader: fakeReader{}, + } + uploadManager := UploadManager{StreamUploader: nil} + _, err := uploadManager.UploadStream(context.Background(), req) + assert.Equal(t, errorInvalidStreamUploader, err) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,12 +12,12 @@ "github.com/oracle/oci-go-sdk/common" ) -// UpdateBucketDetails To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, -// talk to an administrator. If you're an administrator who needs to write policies to give users access, see -// Getting Started with Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). +// UpdateBucketDetails To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). type UpdateBucketDetails struct { - // The namespace in which the bucket lives. + // The Object Storage namespace in which the bucket lives. Namespace *string `mandatory:"false" json:"namespace"` // The compartmentId for the compartment to which the bucket is targeted to move to. @@ -37,14 +37,20 @@ PublicAccessType UpdateBucketDetailsPublicAccessTypeEnum `mandatory:"false" json:"publicAccessType,omitempty"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}} DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A KMS key OCID that will be associated with the given bucket. If it is empty the Update operation will + // actually remove the KMS key, if there is one, from the given bucket. Note that the old kms key should + // still be enbaled in KMS otherwise all the objects in the bucket encrypted with the old KMS key will no + // longer be accessible. + KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m UpdateBucketDetails) String() string { @@ -54,7 +60,7 @@ // UpdateBucketDetailsPublicAccessTypeEnum Enum with underlying type: string type UpdateBucketDetailsPublicAccessTypeEnum string -// Set of constants representing the allowable values for UpdateBucketDetailsPublicAccessType +// Set of constants representing the allowable values for UpdateBucketDetailsPublicAccessTypeEnum const ( UpdateBucketDetailsPublicAccessTypeNopublicaccess UpdateBucketDetailsPublicAccessTypeEnum = "NoPublicAccess" UpdateBucketDetailsPublicAccessTypeObjectread UpdateBucketDetailsPublicAccessTypeEnum = "ObjectRead" @@ -67,7 +73,7 @@ "ObjectReadWithoutList": UpdateBucketDetailsPublicAccessTypeObjectreadwithoutlist, } -// GetUpdateBucketDetailsPublicAccessTypeEnumValues Enumerates the set of values for UpdateBucketDetailsPublicAccessType +// GetUpdateBucketDetailsPublicAccessTypeEnumValues Enumerates the set of values for UpdateBucketDetailsPublicAccessTypeEnum func GetUpdateBucketDetailsPublicAccessTypeEnumValues() []UpdateBucketDetailsPublicAccessTypeEnum { values := make([]UpdateBucketDetailsPublicAccessTypeEnum, 0) for _, v := range mappingUpdateBucketDetailsPublicAccessType { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_bucket_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // UpdateBucketRequest wrapper for the UpdateBucket operation type UpdateBucketRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -21,18 +21,32 @@ // Request object for updating a bucket. UpdateBucketDetails `contributesTo:"body"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateBucketRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateBucketRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateBucketRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateBucketResponse wrapper for the UpdateBucket operation type UpdateBucketResponse struct { @@ -49,10 +63,15 @@ // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The entity tag for the updated bucket. + // The entity tag (ETag) for the updated bucket. ETag *string `presentIn:"header" name:"etag"` } func (response UpdateBucketResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateBucketResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_details.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,9 +1,9 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. // Object Storage Service API // -// Common set of Object and Archive Storage APIs for managing buckets and objects. +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. // package objectstorage @@ -12,14 +12,14 @@ "github.com/oracle/oci-go-sdk/common" ) -// UpdateNamespaceMetadataDetails An UpdateNamespaceMetadataDetails is used for update NamespaceMetadata. To be able to upate the NamespaceMetadata, a user -// must have NAMESPACE_UPDATE permission. +// UpdateNamespaceMetadataDetails UpdateNamespaceMetadataDetails is used to update the NamespaceMetadata. To update NamespaceMetadata, a user +// must have NAMESPACE_UPDATE permission. type UpdateNamespaceMetadataDetails struct { - // The update compartment id for an S3 client if this field is set. + // The updated compartment id for use by an S3 client, if this field is set. DefaultS3CompartmentId *string `mandatory:"false" json:"defaultS3CompartmentId"` - // The update compartment id for a Swift client if this field is set. + // The updated compartment id for use by a Swift client, if this field is set. DefaultSwiftCompartmentId *string `mandatory:"false" json:"defaultSwiftCompartmentId"` } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/update_namespace_metadata_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -11,7 +11,7 @@ // UpdateNamespaceMetadataRequest wrapper for the UpdateNamespaceMetadata operation type UpdateNamespaceMetadataRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // Request object for update NamespaceMetadata. @@ -19,12 +19,26 @@ // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UpdateNamespaceMetadataRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UpdateNamespaceMetadataRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNamespaceMetadataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UpdateNamespaceMetadataResponse wrapper for the UpdateNamespaceMetadata operation type UpdateNamespaceMetadataResponse struct { @@ -45,3 +59,8 @@ func (response UpdateNamespaceMetadataResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNamespaceMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/upload_part_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/upload_part_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/upload_part_request_response.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/upload_part_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package objectstorage @@ -12,7 +12,7 @@ // UploadPartRequest wrapper for the UploadPart operation type UploadPartRequest struct { - // The top-level namespace used for the request. + // The Object Storage namespace used for the request. NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` // The name of the bucket. Avoid entering confidential information. @@ -30,33 +30,51 @@ UploadPartNum *int `mandatory:"true" contributesTo:"query" name:"uploadPartNum"` // The content length of the body. - ContentLength *int `mandatory:"true" contributesTo:"header" name:"Content-Length"` + ContentLength *int64 `mandatory:"true" contributesTo:"header" name:"Content-Length"` - // The part being uploaded to the Object Storage Service. + // The part being uploaded to the Object Storage service. UploadPartBody io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` - // The entity tag to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. + // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. // For uploading a part, this is the entity tag of the target part. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` - // The entity tag to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. - // For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part. + // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object + // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a + // part, this is the entity tag of the target part. IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` // 100-continue Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"` - // The base-64 encoded MD5 hash of the body. + // The base-64 encoded MD5 hash of the body. If the Content-MD5 header is present, Object Storage performs an integrity check + // on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. + // If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message: + // "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)" ContentMD5 *string `mandatory:"false" contributesTo:"header" name:"Content-MD5"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata } func (request UploadPartRequest) String() string { return common.PointerString(request) } +// HTTPRequest implements the OCIRequest interface +func (request UploadPartRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadPartRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + // UploadPartResponse wrapper for the UploadPart operation type UploadPartResponse struct { @@ -73,10 +91,15 @@ // The base64-encoded MD5 hash of the request body, as computed by the server. OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"` - // The entity tag for the object. + // The entity tag (ETag) for the object. ETag *string `presentIn:"header" name:"etag"` } func (response UploadPartResponse) String() string { return common.PointerString(response) } + +// HTTPResponse implements the OCIResponse interface +func (response UploadPartResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestError The representation of WorkRequestError +type WorkRequestError struct { + + // A machine-usable code for the error that occurred. For the list of error codes, + // see API Errors (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm). + Code *string `mandatory:"false" json:"code"` + + // A human-readable description of the issue that produced the error. + Message *string `mandatory:"false" json:"message"` + + // The time the error occurred. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequest A description of workRequest status. +type WorkRequest struct { + + // The type of work request. + OperationType WorkRequestOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // The status of the specified work request. + Status WorkRequestStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The id of the work request. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // Percentage of the work request completed. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` + + // The date and time the work request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // The date and time the work request was started, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// WorkRequestOperationTypeEnum Enum with underlying type: string +type WorkRequestOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestOperationTypeEnum +const ( + WorkRequestOperationTypeObject WorkRequestOperationTypeEnum = "COPY_OBJECT" +) + +var mappingWorkRequestOperationType = map[string]WorkRequestOperationTypeEnum{ + "COPY_OBJECT": WorkRequestOperationTypeObject, +} + +// GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum { + values := make([]WorkRequestOperationTypeEnum, 0) + for _, v := range mappingWorkRequestOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestStatusEnum Enum with underlying type: string +type WorkRequestStatusEnum string + +// Set of constants representing the allowable values for WorkRequestStatusEnum +const ( + WorkRequestStatusAccepted WorkRequestStatusEnum = "ACCEPTED" + WorkRequestStatusInProgress WorkRequestStatusEnum = "IN_PROGRESS" + WorkRequestStatusFailed WorkRequestStatusEnum = "FAILED" + WorkRequestStatusCompleted WorkRequestStatusEnum = "COMPLETED" + WorkRequestStatusCanceling WorkRequestStatusEnum = "CANCELING" + WorkRequestStatusCanceled WorkRequestStatusEnum = "CANCELED" +) + +var mappingWorkRequestStatus = map[string]WorkRequestStatusEnum{ + "ACCEPTED": WorkRequestStatusAccepted, + "IN_PROGRESS": WorkRequestStatusInProgress, + "FAILED": WorkRequestStatusFailed, + "COMPLETED": WorkRequestStatusCompleted, + "CANCELING": WorkRequestStatusCanceling, + "CANCELED": WorkRequestStatusCanceled, +} + +// GetWorkRequestStatusEnumValues Enumerates the set of values for WorkRequestStatusEnum +func GetWorkRequestStatusEnumValues() []WorkRequestStatusEnum { + values := make([]WorkRequestStatusEnum, 0) + for _, v := range mappingWorkRequestStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_log_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_log_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_log_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_log_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestLogEntry The representation of WorkRequestLogEntry +type WorkRequestLogEntry struct { + + // Human-readable log message. + Message *string `mandatory:"false" json:"message"` + + // The date and time the log message was written, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestResource The representation of WorkRequestResource +type WorkRequestResource struct { + + // The status of the work request. + ActionType WorkRequestResourceActionTypeEnum `mandatory:"false" json:"actionType,omitempty"` + + // The resource type the work request affects. + EntityType *string `mandatory:"false" json:"entityType"` + + // The resource type identifier. + Identifier *string `mandatory:"false" json:"identifier"` + + // The URI path that you can use for a GET request to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` + + // The metadata of the resource. + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// WorkRequestResourceActionTypeEnum Enum with underlying type: string +type WorkRequestResourceActionTypeEnum string + +// Set of constants representing the allowable values for WorkRequestResourceActionTypeEnum +const ( + WorkRequestResourceActionTypeCreated WorkRequestResourceActionTypeEnum = "CREATED" + WorkRequestResourceActionTypeUpdated WorkRequestResourceActionTypeEnum = "UPDATED" + WorkRequestResourceActionTypeDeleted WorkRequestResourceActionTypeEnum = "DELETED" + WorkRequestResourceActionTypeRelated WorkRequestResourceActionTypeEnum = "RELATED" + WorkRequestResourceActionTypeInProgress WorkRequestResourceActionTypeEnum = "IN_PROGRESS" + WorkRequestResourceActionTypeRead WorkRequestResourceActionTypeEnum = "READ" + WorkRequestResourceActionTypeWritten WorkRequestResourceActionTypeEnum = "WRITTEN" +) + +var mappingWorkRequestResourceActionType = map[string]WorkRequestResourceActionTypeEnum{ + "CREATED": WorkRequestResourceActionTypeCreated, + "UPDATED": WorkRequestResourceActionTypeUpdated, + "DELETED": WorkRequestResourceActionTypeDeleted, + "RELATED": WorkRequestResourceActionTypeRelated, + "IN_PROGRESS": WorkRequestResourceActionTypeInProgress, + "READ": WorkRequestResourceActionTypeRead, + "WRITTEN": WorkRequestResourceActionTypeWritten, +} + +// GetWorkRequestResourceActionTypeEnumValues Enumerates the set of values for WorkRequestResourceActionTypeEnum +func GetWorkRequestResourceActionTypeEnumValues() []WorkRequestResourceActionTypeEnum { + values := make([]WorkRequestResourceActionTypeEnum, 0) + for _, v := range mappingWorkRequestResourceActionType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource_metadata_key.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource_metadata_key.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource_metadata_key.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_resource_metadata_key.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestResourceMetadataKey The keys of WorkRequestResource metadata. +type WorkRequestResourceMetadataKey struct { +} + +func (m WorkRequestResourceMetadataKey) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/objectstorage/work_request_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Object Storage Service API +// +// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. +// + +package objectstorage + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestSummary A summary of the status of a work request. +type WorkRequestSummary struct { + + // The type of work request. + OperationType WorkRequestSummaryOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // The status of a specified work request. + Status WorkRequestSummaryStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The id of the work request. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // Percentage of the work request completed. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` + + // The date and time the work request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"false" json:"timeAccepted"` + + // The date and time the work request was started, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// WorkRequestSummaryOperationTypeEnum Enum with underlying type: string +type WorkRequestSummaryOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryOperationTypeEnum +const ( + WorkRequestSummaryOperationTypeObject WorkRequestSummaryOperationTypeEnum = "COPY_OBJECT" +) + +var mappingWorkRequestSummaryOperationType = map[string]WorkRequestSummaryOperationTypeEnum{ + "COPY_OBJECT": WorkRequestSummaryOperationTypeObject, +} + +// GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum +func GetWorkRequestSummaryOperationTypeEnumValues() []WorkRequestSummaryOperationTypeEnum { + values := make([]WorkRequestSummaryOperationTypeEnum, 0) + for _, v := range mappingWorkRequestSummaryOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestSummaryStatusEnum Enum with underlying type: string +type WorkRequestSummaryStatusEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryStatusEnum +const ( + WorkRequestSummaryStatusAccepted WorkRequestSummaryStatusEnum = "ACCEPTED" + WorkRequestSummaryStatusInProgress WorkRequestSummaryStatusEnum = "IN_PROGRESS" + WorkRequestSummaryStatusFailed WorkRequestSummaryStatusEnum = "FAILED" + WorkRequestSummaryStatusCompleted WorkRequestSummaryStatusEnum = "COMPLETED" + WorkRequestSummaryStatusCanceling WorkRequestSummaryStatusEnum = "CANCELING" + WorkRequestSummaryStatusCanceled WorkRequestSummaryStatusEnum = "CANCELED" +) + +var mappingWorkRequestSummaryStatus = map[string]WorkRequestSummaryStatusEnum{ + "ACCEPTED": WorkRequestSummaryStatusAccepted, + "IN_PROGRESS": WorkRequestSummaryStatusInProgress, + "FAILED": WorkRequestSummaryStatusFailed, + "COMPLETED": WorkRequestSummaryStatusCompleted, + "CANCELING": WorkRequestSummaryStatusCanceling, + "CANCELED": WorkRequestSummaryStatusCanceled, +} + +// GetWorkRequestSummaryStatusEnumValues Enumerates the set of values for WorkRequestSummaryStatusEnum +func GetWorkRequestSummaryStatusEnumValues() []WorkRequestSummaryStatusEnum { + values := make([]WorkRequestSummaryStatusEnum, 0) + for _, v := range mappingWorkRequestSummaryStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/oci.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/oci.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/oci.go 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/oci.go 2019-06-28 17:13:01.000000000 +0000 @@ -1,4 +1,3 @@ - /* This is the official Go SDK for Oracle Cloud Infrastructure @@ -54,12 +53,12 @@ More examples can be found in the SDK Github repo: https://github.com/oracle/oci-go-sdk/tree/master/example -Optional fields in the SDK +Optional Fields in the SDK Optional fields are represented with the `mandatory:"false"` tag on input structs. The SDK will omit all optional fields that are nil when making requests. In the case of enum-type fields, the SDK will omit fields whose value is an empty string. -Helper functions +Helper Functions The SDK uses pointers for primitive types in many input structs. To aid in the construction of such structs, the SDK provides functions that return a pointer for a given value. For example: @@ -84,7 +83,29 @@ } -Signing custom requests +Customizing Requests + +The SDK exposes functionality that allows the user to customize any http request before is sent to the service. + +You can do so by setting the `Interceptor` field in any of the `Client` structs. For example: + + client, err := audit.NewAuditClientWithConfigurationProvider(common.DefaultConfigProvider()) + if err != nil { + panic(err) + } + + // This will add a header called "X-CustomHeader" to all request + // performed with client + client.Interceptor = func(request *http.Request) error { + request.Header.Set("X-CustomHeader", "CustomValue") + return nil + } + +The Interceptor closure gets called before the signing process, thus any changes done to the request will be properly +signed and submitted to the service. + + +Signing Custom Requests The SDK exposes a stand-alone signer that can be used to signing custom requests. Related code can be found here: https://github.com/oracle/oci-go-sdk/blob/master/common/http_signer.go. @@ -144,11 +165,41 @@ // Execute the request c.Do(request) -For more information on the signing algorithm refer to: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/signingrequests.htm +You can combine a custom signer with the exposed clients in the SDK. +This allows you to add custom signed headers to the request. Following is an example: + + //Create a provider of cryptographic keys + provider := common.DefaultConfigProvider() + + //Create a client for the service you interested in + c, _ := identity.NewIdentityClientWithConfigurationProvider(provider) + + //Define a custom header to be signed, and add it to the list of default headers + customHeader := "opc-my-token" + allHeaders := append(common.DefaultGenericHeaders(), customHeader) + + //Overwrite the signer in your client to sign the new slice of headers + c.Signer = common.RequestSigner(provider, allHeaders, common.DefaultBodyHeaders()) + + //Set the value of the header. This can be done with an Interceptor + c.Interceptor = func(request *http.Request) error { + request.Header.Add(customHeader, "customvalue") + return nil + } + + //Execute your operation as before + c.ListGroups(..) + +Bear in mind that some services have a white list of headers that it expects to be signed. +Therefore, adding an arbitrary header can result in authentications errors. +To see a runnable example, see https://github.com/oracle/oci-go-sdk/blob/master/example/example_identity_test.go + + +For more information on the signing algorithm refer to: https://docs.cloud.oracle.com/Content/API/Concepts/signingrequests.htm -Polymorphic json requests and responses +Polymorphic JSON Requests and Responses -Some operations accept or return polymorphic json objects. The SDK models such objects as interfaces. Further the SDK provides +Some operations accept or return polymorphic JSON objects. The SDK models such objects as interfaces. Further the SDK provides structs that implement such interfaces. Thus, for all operations that expect interfaces as input, pass the struct in the SDK that satisfies such interface. For example: @@ -179,7 +230,7 @@ provider := response.IdentityProvider.(identity.Saml2IdentityProvider) -An example of polymorphic json request handling can be found here: https://github.com/oracle/oci-go-sdk/blob/master/example/example_core_test.go#L63 +An example of polymorphic JSON request handling can be found here: https://github.com/oracle/oci-go-sdk/blob/master/example/example_core_test.go#L63 Pagination @@ -193,10 +244,28 @@ The SDK has a built-in logging mechanism used internally. The internal logging logic is used to record the raw http requests, responses and potential errors when (un)marshalling request and responses. -To expose debugging logs, set the environment variable "OCI_GO_SDK_DEBUG" to "1", or some other non empty string. +Built-in logging in the SDK is controlled via the environment variable "OCI_GO_SDK_DEBUG" and its contents. The below are possible values for the "OCI_GO_SDK_DEBUG" variable +1. "info" or "i" enables all info logging messages -Using the SDK with a proxy server +2. "debug" or "d" enables all debug and info logging messages + +3. "verbose" or "v" or "1" enables all verbose, debug and info logging messages + +4. "null" turns all logging messages off. + +If the value of the environment variable does not match any of the above then default logging level is "info". +If the environment variable is not present then no logging messages are emitted. + + +Retry + +Sometimes you may need to wait until an attribute of a resource, such as an instance or a VCN, reaches a certain state. +An example of this would be launching an instance and then waiting for the instance to become available, or waiting until a subnet in a VCN has been terminated. +You might also want to retry the same operation again if there's network issue etc... +This can be accomplished by using the RequestMetadata.RetryPolicy. You can find the examples here: https://github.com/oracle/oci-go-sdk/blob/master/example/example_retry_test.go + +Using the SDK with a Proxy Server The GO SDK uses the net/http package to make calls to OCI services. If your environment requires you to use a proxy server for outgoing HTTP requests then you can set this up in the following ways: @@ -219,14 +288,42 @@ } +Uploading Large Objects + +The Object Storage service supports multipart uploads to make large object uploads easier by splitting the large object into parts. The Go SDK supports raw multipart upload operations for advanced use cases, as well as a higher level upload class that uses the multipart upload APIs. For links to the APIs used for multipart upload operations, see Managing Multipart Uploads (https://docs.cloud.oracle.com/iaas/Content/Object/Tasks/usingmultipartuploads.htm). Higher level multipart uploads are implemented using the UploadManager, which will: split a large object into parts for you, upload the parts in parallel, and then recombine and commit the parts as a single object in storage. + +This code sample shows how to use the UploadManager to automatically split an object into parts for upload to simplify interaction with the Object Storage service: https://github.com/oracle/oci-go-sdk/blob/master/example/example_objectstorage_test.go + + Forward Compatibility Some response fields are enum-typed. In the future, individual services may return values not covered by existing enums for that field. To address this possibility, every enum-type response field is a modeled as a type that supports any string. Thus if a service returns a value that is not recognized by your version of the SDK, then the response field will be set to this value. -When individual services return a polymorphic json response not available as a concrete struct, the SDK will return an implementation that only satisfies -the interface modeling the polymorphic json response. +When individual services return a polymorphic JSON response not available as a concrete struct, the SDK will return an implementation that only satisfies +the interface modeling the polymorphic JSON response. + + +New Region Support + +If you are using a version of the SDK released prior to the announcement of a new region, you may need to use a workaround to reach it, depending on whether the region is in the oraclecloud.com realm. + +A region is a localized geographic area. For more information on regions and how to identify them, see Regions and Availability Domains(https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + +A realm is a set of regions that share entities. You can identify your realm by looking at the domain name at the end of the network address. For example, the realm for xyz.abc.123.oraclecloud.com is oraclecloud.com. + +oraclecloud.com Realm: For regions in the oraclecloud.com realm, even if common.Region does not contain the new region, the forward compatibility of the SDK can automatically handle it. You can pass new region names just as you would pass ones that are already defined. For more information on passing region names in the configuration, see Configuring (https://github.com/oracle/oci-go-sdk/blob/master/README.md#configuring). For details on common.Region, see (https://github.com/oracle/oci-go-sdk/blob/master/common/common.go). + +Other Realms: For regions in realms other than oraclecloud.com, you can use the following workarounds to reach new regions with earlier versions of the SDK. + +NOTE: Be sure to supply the appropriate endpoints for your region. + +You can overwrite the target host with client.Host: + client.Host = 'https://identity.us-gov-phoenix-1.oraclegovcloud.com' + +If you are authenticating via instance principals, you can set the authentication endpoint in an environment variable: + export OCI_SDK_AUTH_CLIENT_REGION_URL="https://identity.us-gov-phoenix-1.oraclegovcloud.com" Contributions @@ -249,7 +346,7 @@ - */ +*/ package oci //go:generate go run cmd/genver/main.go cmd/genver/version_template.go --output common/version.go diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/backoff_retry_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/backoff_retry_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/backoff_retry_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/backoff_retry_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BackoffRetryPolicy The backoff retry portion of the subscription delivery policy. +type BackoffRetryPolicy struct { + + // The maximum retry duration in milliseconds. + MaxRetryDuration *int `mandatory:"true" json:"maxRetryDuration"` + + // The type of delivery policy. Default value: EXPONENTIAL. + PolicyType BackoffRetryPolicyPolicyTypeEnum `mandatory:"true" json:"policyType"` +} + +func (m BackoffRetryPolicy) String() string { + return common.PointerString(m) +} + +// BackoffRetryPolicyPolicyTypeEnum Enum with underlying type: string +type BackoffRetryPolicyPolicyTypeEnum string + +// Set of constants representing the allowable values for BackoffRetryPolicyPolicyTypeEnum +const ( + BackoffRetryPolicyPolicyTypeExponential BackoffRetryPolicyPolicyTypeEnum = "EXPONENTIAL" +) + +var mappingBackoffRetryPolicyPolicyType = map[string]BackoffRetryPolicyPolicyTypeEnum{ + "EXPONENTIAL": BackoffRetryPolicyPolicyTypeExponential, +} + +// GetBackoffRetryPolicyPolicyTypeEnumValues Enumerates the set of values for BackoffRetryPolicyPolicyTypeEnum +func GetBackoffRetryPolicyPolicyTypeEnumValues() []BackoffRetryPolicyPolicyTypeEnum { + values := make([]BackoffRetryPolicyPolicyTypeEnum, 0) + for _, v := range mappingBackoffRetryPolicyPolicyType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/confirmation_result.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/confirmation_result.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/confirmation_result.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/confirmation_result.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ConfirmationResult The confirmation result. +type ConfirmationResult struct { + + // The name of the subscribed topic. + TopicName *string `mandatory:"true" json:"topicName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to delete. + TopicId *string `mandatory:"true" json:"topicId"` + + // The endpoint of the subscription. Valid values depend on the protocol. + // For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters. + // Avoid entering confidential information. + Endpoint *string `mandatory:"true" json:"endpoint"` + + // The URL user can use to unsubscribe the topic. + UnsubscribeUrl *string `mandatory:"true" json:"unsubscribeUrl"` + + // Human readable text which tells the user if the confirmation succeeds. + Message *string `mandatory:"true" json:"message"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription. + SubscriptionId *string `mandatory:"false" json:"subscriptionId"` +} + +func (m ConfirmationResult) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateSubscriptionDetails The configuration details for creating the subscription. +type CreateSubscriptionDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic for the subscription. + TopicId *string `mandatory:"true" json:"topicId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment for the subscription. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The protocol to use for delivering messages. Valid values: EMAIL, HTTPS. + Protocol *string `mandatory:"true" json:"protocol"` + + // The endpoint of the subscription. Valid values depend on the protocol. + // For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters. + // Avoid entering confidential information. + Endpoint *string `mandatory:"true" json:"endpoint"` + + // Metadata for the subscription. Avoid entering confidential information. + Metadata *string `mandatory:"false" json:"metadata"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateSubscriptionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateSubscriptionRequest wrapper for the CreateSubscription operation +type CreateSubscriptionRequest struct { + + // The subscription to create. + CreateSubscriptionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before that due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateSubscriptionResponse wrapper for the CreateSubscription operation +type CreateSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Subscription instance + Subscription `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateTopicDetails The configuration details for creating the topic. +type CreateTopicDetails struct { + + // The name of the topic being created. Avoid entering confidential information. + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the topic in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The description of the topic being created. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateTopicDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/create_topic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateTopicRequest wrapper for the CreateTopic operation +type CreateTopicRequest struct { + + // The topic to create. + CreateTopicDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before that due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateTopicRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateTopicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTopicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateTopicResponse wrapper for the CreateTopic operation +type CreateTopicResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NotificationTopic instance + NotificationTopic `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateTopicResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateTopicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteSubscriptionRequest wrapper for the DeleteSubscription operation +type DeleteSubscriptionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to delete. + SubscriptionId *string `mandatory:"true" contributesTo:"path" name:"subscriptionId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteSubscriptionResponse wrapper for the DeleteSubscription operation +type DeleteSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_topic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_topic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_topic_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delete_topic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteTopicRequest wrapper for the DeleteTopic operation +type DeleteTopicRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to delete. + TopicId *string `mandatory:"true" contributesTo:"path" name:"topicId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteTopicRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteTopicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteTopicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteTopicResponse wrapper for the DeleteTopic operation +type DeleteTopicResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteTopicResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteTopicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delivery_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delivery_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delivery_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/delivery_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DeliveryPolicy The subscription delivery policy. +type DeliveryPolicy struct { + BackoffRetryPolicy *BackoffRetryPolicy `mandatory:"false" json:"backoffRetryPolicy"` +} + +func (m DeliveryPolicy) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_confirm_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_confirm_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_confirm_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_confirm_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetConfirmSubscriptionRequest wrapper for the GetConfirmSubscription operation +type GetConfirmSubscriptionRequest struct { + + // The subscription ID. + Id *string `mandatory:"true" contributesTo:"path" name:"id"` + + // The subscription confirmation token. + Token *string `mandatory:"true" contributesTo:"query" name:"token"` + + // The subscription protocol. Valid values: EMAIL, HTTPS. + Protocol *string `mandatory:"true" contributesTo:"query" name:"protocol"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetConfirmSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetConfirmSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConfirmSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetConfirmSubscriptionResponse wrapper for the GetConfirmSubscription operation +type GetConfirmSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ConfirmationResult instance + ConfirmationResult `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetConfirmSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetConfirmSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetSubscriptionRequest wrapper for the GetSubscription operation +type GetSubscriptionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to retrieve. + SubscriptionId *string `mandatory:"true" contributesTo:"path" name:"subscriptionId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetSubscriptionResponse wrapper for the GetSubscription operation +type GetSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Subscription instance + Subscription `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_topic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_topic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_topic_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_topic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetTopicRequest wrapper for the GetTopic operation +type GetTopicRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to retrieve. + TopicId *string `mandatory:"true" contributesTo:"path" name:"topicId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetTopicRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetTopicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTopicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetTopicResponse wrapper for the GetTopic operation +type GetTopicResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NotificationTopic instance + NotificationTopic `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetTopicResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetTopicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_unsubscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_unsubscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_unsubscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/get_unsubscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetUnsubscriptionRequest wrapper for the GetUnsubscription operation +type GetUnsubscriptionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to unsubscribe from. + Id *string `mandatory:"true" contributesTo:"path" name:"id"` + + // The subscription confirmation token. + Token *string `mandatory:"true" contributesTo:"query" name:"token"` + + // The subscription protocol. Valid values: EMAIL, HTTPS. + Protocol *string `mandatory:"true" contributesTo:"query" name:"protocol"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetUnsubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetUnsubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetUnsubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetUnsubscriptionResponse wrapper for the GetUnsubscription operation +type GetUnsubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The string instance + Value *string `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetUnsubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetUnsubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_subscriptions_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_subscriptions_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_subscriptions_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_subscriptions_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListSubscriptionsRequest wrapper for the ListSubscriptions operation +type ListSubscriptionsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set. + TopicId *string `mandatory:"false" contributesTo:"query" name:"topicId"` + + // For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListSubscriptionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSubscriptionsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSubscriptionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListSubscriptionsResponse wrapper for the ListSubscriptions operation +type ListSubscriptionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []SubscriptionSummary instances + Items []SubscriptionSummary `presentIn:"body"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. Default value: 10. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListSubscriptionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSubscriptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_topics_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_topics_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_topics_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/list_topics_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListTopicsRequest wrapper for the ListTopics operation +type ListTopicsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to only return resources that match the given id exactly. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // A filter to only return resources that match the given name exactly. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one field can be selected for sorting. Default value: TIMECREATED. + SortBy ListTopicsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use (ascending or descending). Default value: ASC. + SortOrder ListTopicsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filter returned list by specified lifecycle state. This parameter is case-insensitive. + LifecycleState NotificationTopicSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListTopicsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListTopicsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTopicsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListTopicsResponse wrapper for the ListTopics operation +type ListTopicsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NotificationTopicSummary instances + Items []NotificationTopicSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For important details about how pagination works, see List Pagination. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListTopicsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListTopicsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListTopicsSortByEnum Enum with underlying type: string +type ListTopicsSortByEnum string + +// Set of constants representing the allowable values for ListTopicsSortByEnum +const ( + ListTopicsSortByTimecreated ListTopicsSortByEnum = "TIMECREATED" + ListTopicsSortByLifecyclestate ListTopicsSortByEnum = "LIFECYCLESTATE" +) + +var mappingListTopicsSortBy = map[string]ListTopicsSortByEnum{ + "TIMECREATED": ListTopicsSortByTimecreated, + "LIFECYCLESTATE": ListTopicsSortByLifecyclestate, +} + +// GetListTopicsSortByEnumValues Enumerates the set of values for ListTopicsSortByEnum +func GetListTopicsSortByEnumValues() []ListTopicsSortByEnum { + values := make([]ListTopicsSortByEnum, 0) + for _, v := range mappingListTopicsSortBy { + values = append(values, v) + } + return values +} + +// ListTopicsSortOrderEnum Enum with underlying type: string +type ListTopicsSortOrderEnum string + +// Set of constants representing the allowable values for ListTopicsSortOrderEnum +const ( + ListTopicsSortOrderAsc ListTopicsSortOrderEnum = "ASC" + ListTopicsSortOrderDesc ListTopicsSortOrderEnum = "DESC" +) + +var mappingListTopicsSortOrder = map[string]ListTopicsSortOrderEnum{ + "ASC": ListTopicsSortOrderAsc, + "DESC": ListTopicsSortOrderDesc, +} + +// GetListTopicsSortOrderEnumValues Enumerates the set of values for ListTopicsSortOrderEnum +func GetListTopicsSortOrderEnumValues() []ListTopicsSortOrderEnum { + values := make([]ListTopicsSortOrderEnum, 0) + for _, v := range mappingListTopicsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/message_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/message_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/message_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/message_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// MessageDetails The content of the message to be published. +type MessageDetails struct { + + // The body of the message to be published. + // For `messageType` of JSON, a default key-value pair is required. Example: `{"default": "Alarm breached", "Email": "Alarm breached: "}.` + // Avoid entering confidential information. + Body *string `mandatory:"true" json:"body"` + + // The title of the message to be published. Avoid entering confidential information. + Title *string `mandatory:"false" json:"title"` +} + +func (m MessageDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NotificationTopic The properties that define a topic. +type NotificationTopic struct { + + // The name of the topic. Avoid entering confidential information. + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment for the topic. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The lifecycle state of the topic. + LifecycleState NotificationTopicLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the topic was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The endpoint for managing topic subscriptions or publishing messages to the topic. + ApiEndpoint *string `mandatory:"true" json:"apiEndpoint"` + + // The description of the topic. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m NotificationTopic) String() string { + return common.PointerString(m) +} + +// NotificationTopicLifecycleStateEnum Enum with underlying type: string +type NotificationTopicLifecycleStateEnum string + +// Set of constants representing the allowable values for NotificationTopicLifecycleStateEnum +const ( + NotificationTopicLifecycleStateActive NotificationTopicLifecycleStateEnum = "ACTIVE" + NotificationTopicLifecycleStateDeleting NotificationTopicLifecycleStateEnum = "DELETING" + NotificationTopicLifecycleStateCreating NotificationTopicLifecycleStateEnum = "CREATING" +) + +var mappingNotificationTopicLifecycleState = map[string]NotificationTopicLifecycleStateEnum{ + "ACTIVE": NotificationTopicLifecycleStateActive, + "DELETING": NotificationTopicLifecycleStateDeleting, + "CREATING": NotificationTopicLifecycleStateCreating, +} + +// GetNotificationTopicLifecycleStateEnumValues Enumerates the set of values for NotificationTopicLifecycleStateEnum +func GetNotificationTopicLifecycleStateEnumValues() []NotificationTopicLifecycleStateEnum { + values := make([]NotificationTopicLifecycleStateEnum, 0) + for _, v := range mappingNotificationTopicLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/notification_topic_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// NotificationTopicSummary A summary of the properties that define a topic. +type NotificationTopicSummary struct { + + // The name of the topic. Avoid entering confidential information. + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment for the topic. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The lifecycle state of the topic. + LifecycleState NotificationTopicSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the topic was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The endpoint for managing topic subscriptions or publishing messages to the topic. + ApiEndpoint *string `mandatory:"true" json:"apiEndpoint"` + + // The description of the topic. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m NotificationTopicSummary) String() string { + return common.PointerString(m) +} + +// NotificationTopicSummaryLifecycleStateEnum Enum with underlying type: string +type NotificationTopicSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for NotificationTopicSummaryLifecycleStateEnum +const ( + NotificationTopicSummaryLifecycleStateActive NotificationTopicSummaryLifecycleStateEnum = "ACTIVE" + NotificationTopicSummaryLifecycleStateDeleting NotificationTopicSummaryLifecycleStateEnum = "DELETING" + NotificationTopicSummaryLifecycleStateCreating NotificationTopicSummaryLifecycleStateEnum = "CREATING" +) + +var mappingNotificationTopicSummaryLifecycleState = map[string]NotificationTopicSummaryLifecycleStateEnum{ + "ACTIVE": NotificationTopicSummaryLifecycleStateActive, + "DELETING": NotificationTopicSummaryLifecycleStateDeleting, + "CREATING": NotificationTopicSummaryLifecycleStateCreating, +} + +// GetNotificationTopicSummaryLifecycleStateEnumValues Enumerates the set of values for NotificationTopicSummaryLifecycleStateEnum +func GetNotificationTopicSummaryLifecycleStateEnumValues() []NotificationTopicSummaryLifecycleStateEnum { + values := make([]NotificationTopicSummaryLifecycleStateEnum, 0) + for _, v := range mappingNotificationTopicSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationcontrolplane_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationcontrolplane_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationcontrolplane_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationcontrolplane_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,283 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//NotificationControlPlaneClient a client for NotificationControlPlane +type NotificationControlPlaneClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewNotificationControlPlaneClientWithConfigurationProvider Creates a new default NotificationControlPlane client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewNotificationControlPlaneClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client NotificationControlPlaneClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = NotificationControlPlaneClient{BaseClient: baseClient} + client.BasePath = "20181201" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *NotificationControlPlaneClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("notification") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *NotificationControlPlaneClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *NotificationControlPlaneClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateTopic Creates a topic in the specified compartment. For general information about topics, see +// Managing Topics and Subscriptions (https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm). +// For the purposes of access control, you must provide the OCID of the compartment where you want the topic to reside. +// For information about access control and compartments, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). +// You must specify a display name for the topic. +// All Oracle Cloud Infrastructure resources, including topics, get an Oracle-assigned, unique ID called an +// Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also +// retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the +// Console. Fore more information, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). +func (client NotificationControlPlaneClient) CreateTopic(ctx context.Context, request CreateTopicRequest) (response CreateTopicResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createTopic, policy) + if err != nil { + if ociResponse != nil { + response = CreateTopicResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateTopicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTopicResponse") + } + return +} + +// createTopic implements the OCIOperation interface (enables retrying operations) +func (client NotificationControlPlaneClient) createTopic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/topics") + if err != nil { + return nil, err + } + + var response CreateTopicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteTopic Deletes the specified topic. +func (client NotificationControlPlaneClient) DeleteTopic(ctx context.Context, request DeleteTopicRequest) (response DeleteTopicResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteTopic, policy) + if err != nil { + if ociResponse != nil { + response = DeleteTopicResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteTopicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteTopicResponse") + } + return +} + +// deleteTopic implements the OCIOperation interface (enables retrying operations) +func (client NotificationControlPlaneClient) deleteTopic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/topics/{topicId}") + if err != nil { + return nil, err + } + + var response DeleteTopicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTopic Gets the specified topic's configuration information. +func (client NotificationControlPlaneClient) GetTopic(ctx context.Context, request GetTopicRequest) (response GetTopicResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getTopic, policy) + if err != nil { + if ociResponse != nil { + response = GetTopicResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetTopicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTopicResponse") + } + return +} + +// getTopic implements the OCIOperation interface (enables retrying operations) +func (client NotificationControlPlaneClient) getTopic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/topics/{topicId}") + if err != nil { + return nil, err + } + + var response GetTopicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTopics Lists topics in the specified compartment. +func (client NotificationControlPlaneClient) ListTopics(ctx context.Context, request ListTopicsRequest) (response ListTopicsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listTopics, policy) + if err != nil { + if ociResponse != nil { + response = ListTopicsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListTopicsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTopicsResponse") + } + return +} + +// listTopics implements the OCIOperation interface (enables retrying operations) +func (client NotificationControlPlaneClient) listTopics(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/topics") + if err != nil { + return nil, err + } + + var response ListTopicsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateTopic Updates the specified topic's configuration. +func (client NotificationControlPlaneClient) UpdateTopic(ctx context.Context, request UpdateTopicRequest) (response UpdateTopicResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateTopic, policy) + if err != nil { + if ociResponse != nil { + response = UpdateTopicResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTopicResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTopicResponse") + } + return +} + +// updateTopic implements the OCIOperation interface (enables retrying operations) +func (client NotificationControlPlaneClient) updateTopic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/topics/{topicId}") + if err != nil { + return nil, err + } + + var response UpdateTopicResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationdataplane_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationdataplane_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationdataplane_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/ons_notificationdataplane_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,443 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//NotificationDataPlaneClient a client for NotificationDataPlane +type NotificationDataPlaneClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewNotificationDataPlaneClientWithConfigurationProvider Creates a new default NotificationDataPlane client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewNotificationDataPlaneClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client NotificationDataPlaneClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = NotificationDataPlaneClient{BaseClient: baseClient} + client.BasePath = "20181201" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *NotificationDataPlaneClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("notification") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *NotificationDataPlaneClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *NotificationDataPlaneClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateSubscription Creates a subscription for the specified topic. +func (client NotificationDataPlaneClient) CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (response CreateSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSubscription, policy) + if err != nil { + if ociResponse != nil { + response = CreateSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateSubscriptionResponse") + } + return +} + +// createSubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) createSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/subscriptions") + if err != nil { + return nil, err + } + + var response CreateSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteSubscription Deletes the specified subscription. +func (client NotificationDataPlaneClient) DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) (response DeleteSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSubscription, policy) + if err != nil { + if ociResponse != nil { + response = DeleteSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteSubscriptionResponse") + } + return +} + +// deleteSubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) deleteSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/subscriptions/{subscriptionId}") + if err != nil { + return nil, err + } + + var response DeleteSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetConfirmSubscription Gets the confirmation details for the specified subscription. +func (client NotificationDataPlaneClient) GetConfirmSubscription(ctx context.Context, request GetConfirmSubscriptionRequest) (response GetConfirmSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConfirmSubscription, policy) + if err != nil { + if ociResponse != nil { + response = GetConfirmSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetConfirmSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConfirmSubscriptionResponse") + } + return +} + +// getConfirmSubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) getConfirmSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subscriptions/{id}/confirmation") + if err != nil { + return nil, err + } + + var response GetConfirmSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSubscription Gets the specified subscription's configuration information. +func (client NotificationDataPlaneClient) GetSubscription(ctx context.Context, request GetSubscriptionRequest) (response GetSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSubscription, policy) + if err != nil { + if ociResponse != nil { + response = GetSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetSubscriptionResponse") + } + return +} + +// getSubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) getSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subscriptions/{subscriptionId}") + if err != nil { + return nil, err + } + + var response GetSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetUnsubscription Gets the unsubscription details for the specified subscription. +func (client NotificationDataPlaneClient) GetUnsubscription(ctx context.Context, request GetUnsubscriptionRequest) (response GetUnsubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getUnsubscription, policy) + if err != nil { + if ociResponse != nil { + response = GetUnsubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetUnsubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetUnsubscriptionResponse") + } + return +} + +// getUnsubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) getUnsubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subscriptions/{id}/unsubscription") + if err != nil { + return nil, err + } + + var response GetUnsubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSubscriptions Lists the subscriptions in the specified compartment or topic. +func (client NotificationDataPlaneClient) ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) (response ListSubscriptionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSubscriptions, policy) + if err != nil { + if ociResponse != nil { + response = ListSubscriptionsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListSubscriptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSubscriptionsResponse") + } + return +} + +// listSubscriptions implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) listSubscriptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/subscriptions") + if err != nil { + return nil, err + } + + var response ListSubscriptionsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PublishMessage Publishes a message to the specified topic. For more information about publishing messages, see Publishing Messages (https://docs.cloud.oracle.com/iaas/Content/Notification/Tasks/publishingmessages.htm). +func (client NotificationDataPlaneClient) PublishMessage(ctx context.Context, request PublishMessageRequest) (response PublishMessageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.publishMessage, policy) + if err != nil { + if ociResponse != nil { + response = PublishMessageResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PublishMessageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PublishMessageResponse") + } + return +} + +// publishMessage implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) publishMessage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/topics/{topicId}/messages") + if err != nil { + return nil, err + } + + var response PublishMessageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ResendSubscriptionConfirmation Resends the confirmation details for the specified subscription. +func (client NotificationDataPlaneClient) ResendSubscriptionConfirmation(ctx context.Context, request ResendSubscriptionConfirmationRequest) (response ResendSubscriptionConfirmationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.resendSubscriptionConfirmation, policy) + if err != nil { + if ociResponse != nil { + response = ResendSubscriptionConfirmationResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ResendSubscriptionConfirmationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResendSubscriptionConfirmationResponse") + } + return +} + +// resendSubscriptionConfirmation implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) resendSubscriptionConfirmation(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/subscriptions/{id}/resendConfirmation") + if err != nil { + return nil, err + } + + var response ResendSubscriptionConfirmationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSubscription Updates the specified subscription's configuration. +func (client NotificationDataPlaneClient) UpdateSubscription(ctx context.Context, request UpdateSubscriptionRequest) (response UpdateSubscriptionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSubscription, policy) + if err != nil { + if ociResponse != nil { + response = UpdateSubscriptionResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSubscriptionResponse") + } + return +} + +// updateSubscription implements the OCIOperation interface (enables retrying operations) +func (client NotificationDataPlaneClient) updateSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/subscriptions/{subscriptionId}") + if err != nil { + return nil, err + } + + var response UpdateSubscriptionResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_message_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_message_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_message_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_message_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// PublishMessageRequest wrapper for the PublishMessage operation +type PublishMessageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" contributesTo:"path" name:"topicId"` + + // The message to publish. + MessageDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Type of message body in the request. Default value: JSON. + MessageType PublishMessageMessageTypeEnum `mandatory:"false" contributesTo:"header" name:"messageType"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PublishMessageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PublishMessageRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PublishMessageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// PublishMessageResponse wrapper for the PublishMessage operation +type PublishMessageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PublishResult instance + PublishResult `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PublishMessageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PublishMessageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// PublishMessageMessageTypeEnum Enum with underlying type: string +type PublishMessageMessageTypeEnum string + +// Set of constants representing the allowable values for PublishMessageMessageTypeEnum +const ( + PublishMessageMessageTypeJson PublishMessageMessageTypeEnum = "JSON" + PublishMessageMessageTypeRawText PublishMessageMessageTypeEnum = "RAW_TEXT" +) + +var mappingPublishMessageMessageType = map[string]PublishMessageMessageTypeEnum{ + "JSON": PublishMessageMessageTypeJson, + "RAW_TEXT": PublishMessageMessageTypeRawText, +} + +// GetPublishMessageMessageTypeEnumValues Enumerates the set of values for PublishMessageMessageTypeEnum +func GetPublishMessageMessageTypeEnumValues() []PublishMessageMessageTypeEnum { + values := make([]PublishMessageMessageTypeEnum, 0) + for _, v := range mappingPublishMessageMessageType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_result.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_result.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_result.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/publish_result.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PublishResult The response to a PublishMessage call. +type PublishResult struct { + + // The UUID of the message. + MessageId *string `mandatory:"true" json:"messageId"` + + // The time that the service received the message. + TimeStamp *common.SDKTime `mandatory:"false" json:"timeStamp"` +} + +func (m PublishResult) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/resend_subscription_confirmation_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/resend_subscription_confirmation_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/resend_subscription_confirmation_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/resend_subscription_confirmation_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ResendSubscriptionConfirmationRequest wrapper for the ResendSubscriptionConfirmation operation +type ResendSubscriptionConfirmationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to resend the confirmation for. + Id *string `mandatory:"true" contributesTo:"path" name:"id"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ResendSubscriptionConfirmationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResendSubscriptionConfirmationRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResendSubscriptionConfirmationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ResendSubscriptionConfirmationResponse wrapper for the ResendSubscriptionConfirmation operation +type ResendSubscriptionConfirmationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Subscription instance + Subscription `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ResendSubscriptionConfirmationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResendSubscriptionConfirmationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Subscription The subscription's configuration. +type Subscription struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription. + Id *string `mandatory:"true" json:"id"` + + // The subscription protocol. Valid values: EMAIL, HTTPS. + Protocol *string `mandatory:"true" json:"protocol"` + + // The endpoint of the subscription. Valid values depend on the protocol. + // For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters. + // Avoid entering confidential information. + Endpoint *string `mandatory:"true" json:"endpoint"` + + // The lifecycle state of the subscription. + LifecycleState SubscriptionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The delivery policy of the subscription. Stored as a JSON string. + DeliverPolicy *string `mandatory:"false" json:"deliverPolicy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Subscription) String() string { + return common.PointerString(m) +} + +// SubscriptionLifecycleStateEnum Enum with underlying type: string +type SubscriptionLifecycleStateEnum string + +// Set of constants representing the allowable values for SubscriptionLifecycleStateEnum +const ( + SubscriptionLifecycleStatePending SubscriptionLifecycleStateEnum = "PENDING" + SubscriptionLifecycleStateActive SubscriptionLifecycleStateEnum = "ACTIVE" + SubscriptionLifecycleStateDeleted SubscriptionLifecycleStateEnum = "DELETED" +) + +var mappingSubscriptionLifecycleState = map[string]SubscriptionLifecycleStateEnum{ + "PENDING": SubscriptionLifecycleStatePending, + "ACTIVE": SubscriptionLifecycleStateActive, + "DELETED": SubscriptionLifecycleStateDeleted, +} + +// GetSubscriptionLifecycleStateEnumValues Enumerates the set of values for SubscriptionLifecycleStateEnum +func GetSubscriptionLifecycleStateEnumValues() []SubscriptionLifecycleStateEnum { + values := make([]SubscriptionLifecycleStateEnum, 0) + for _, v := range mappingSubscriptionLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/subscription_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SubscriptionSummary The subscription's configuration summary. +type SubscriptionSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated topic. + TopicId *string `mandatory:"true" json:"topicId"` + + // The protocol used for the subscription. Valid values: EMAIL, HTTPS. + Protocol *string `mandatory:"true" json:"protocol"` + + // The endpoint of the subscription. Valid values depend on the protocol. + // For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters. + // Avoid entering confidential information. + Endpoint *string `mandatory:"true" json:"endpoint"` + + // The lifecycle state of the subscription. Default value for a newly created subscription: PENDING. + LifecycleState SubscriptionSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time when this suscription was created. + CreatedTime *int64 `mandatory:"false" json:"createdTime"` + + DeliveryPolicy *DeliveryPolicy `mandatory:"false" json:"deliveryPolicy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m SubscriptionSummary) String() string { + return common.PointerString(m) +} + +// SubscriptionSummaryLifecycleStateEnum Enum with underlying type: string +type SubscriptionSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SubscriptionSummaryLifecycleStateEnum +const ( + SubscriptionSummaryLifecycleStatePending SubscriptionSummaryLifecycleStateEnum = "PENDING" + SubscriptionSummaryLifecycleStateActive SubscriptionSummaryLifecycleStateEnum = "ACTIVE" + SubscriptionSummaryLifecycleStateDeleted SubscriptionSummaryLifecycleStateEnum = "DELETED" +) + +var mappingSubscriptionSummaryLifecycleState = map[string]SubscriptionSummaryLifecycleStateEnum{ + "PENDING": SubscriptionSummaryLifecycleStatePending, + "ACTIVE": SubscriptionSummaryLifecycleStateActive, + "DELETED": SubscriptionSummaryLifecycleStateDeleted, +} + +// GetSubscriptionSummaryLifecycleStateEnumValues Enumerates the set of values for SubscriptionSummaryLifecycleStateEnum +func GetSubscriptionSummaryLifecycleStateEnumValues() []SubscriptionSummaryLifecycleStateEnum { + values := make([]SubscriptionSummaryLifecycleStateEnum, 0) + for _, v := range mappingSubscriptionSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/topic_attributes_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/topic_attributes_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/topic_attributes_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/topic_attributes_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// TopicAttributesDetails The configuration details for updating the topic. +type TopicAttributesDetails struct { + + // The description of the topic. Avoid entering confidential information. + Description *string `mandatory:"true" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m TopicAttributesDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Notification API +// +// Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern. +// For information about managing topics, subscriptions, and messages, see Notification Overview (https://docs.cloud.oracle.com/iaas/Content/Notification/Concepts/notificationoverview.htm). +// + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateSubscriptionDetails The configuration details for updating the subscription. +type UpdateSubscriptionDetails struct { + + // The delivery policy of the subscription. Stored as a JSON string. + DeliveryPolicy *DeliveryPolicy `mandatory:"false" json:"deliveryPolicy"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateSubscriptionDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_subscription_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateSubscriptionRequest wrapper for the UpdateSubscription operation +type UpdateSubscriptionRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to update. + SubscriptionId *string `mandatory:"true" contributesTo:"path" name:"subscriptionId"` + + // The configuration details for updating the subscription. + UpdateSubscriptionDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSubscriptionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateSubscriptionResponse wrapper for the UpdateSubscription operation +type UpdateSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UpdateSubscriptionDetails instance + UpdateSubscriptionDetails `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_topic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_topic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_topic_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/ons/update_topic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package ons + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateTopicRequest wrapper for the UpdateTopic operation +type UpdateTopicRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to update. + TopicId *string `mandatory:"true" contributesTo:"path" name:"topicId"` + + // TopicAttributes + TopicAttributesDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateTopicRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTopicRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTopicRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateTopicResponse wrapper for the UpdateTopic operation +type UpdateTopicResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NotificationTopic instance + NotificationTopic `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateTopicResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTopicResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/README.md juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/README.md --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/README.md 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/README.md 2019-06-28 17:13:01.000000000 +0000 @@ -27,6 +27,8 @@ ### Configuring Before using the SDK, set up a config file with the required credentials. See [SDK and Tool Configuration](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm) for instructions. +Note that the Go SDK does not support profile inheritance or defining custom values in the configuration file. + Once a config file has been setup, call `common.DefaultConfigProvider()` function as follows: ```go @@ -53,8 +55,8 @@ } ``` -### Making a request -To make a request to an OCI service, create a client for the service and then use the client to call a function from the service. +### Making a Request +To make a request to an Oracle Cloud Infrastructure service, create a client for the service and then use the client to call a function from the service. - *Creating a client*: All packages provide a function to create clients, using the naming convention `NewClientWithConfigurationProvider`, such as `NewVirtualNetworkClientWithConfigurationProvider` or `NewIdentityClientWithConfigurationProvider`. To create a new client, @@ -130,8 +132,8 @@ ## Known Issues You can find information on any known issues with the SDK here and under the [Issues](https://github.com/oracle/oci-go-sdk/issues) tab of this project's GitHub repository. -## Building and testing -### Dev dependencies +## Building and Testing +### Dev Dependencies - Install [Testify](https://github.com/stretchr/testify) with the command: ```sh go get github.com/stretchr/testify diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/apply_job_plan_resolution.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/apply_job_plan_resolution.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/apply_job_plan_resolution.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/apply_job_plan_resolution.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ApplyJobPlanResolution Specifies which plan job provides an execution plan for input to the apply or destroy job. +// You can set only one of the three job properties. For destroy jobs, only `isAutoApproved` is permitted. +type ApplyJobPlanResolution struct { + + // OCID that specifies the most recently executed plan job. + PlanJobId *string `mandatory:"false" json:"planJobId"` + + // Specifies whether to use the OCID of the most recently run plan job. + // `True` if using the latest job OCID. Must be a plan job that completed successfully. + IsUseLatestJobId *bool `mandatory:"false" json:"isUseLatestJobId"` + + // Specifies whether to use the configuration directly, without reference to a Plan job. + // `True` if using the configuration directly. Note that it is not necessary + // for a Plan job to have run successfully. + IsAutoApproved *bool `mandatory:"false" json:"isAutoApproved"` +} + +func (m ApplyJobPlanResolution) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/cancel_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/cancel_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/cancel_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/cancel_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CancelJobRequest wrapper for the CancelJob operation +type CancelJobRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` + // parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CancelJobResponse wrapper for the CancelJob operation +type CancelJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CancelJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/config_source.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/config_source.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/config_source.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/config_source.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ConfigSource Location of the zip file that contains the Terraform configuration. +type ConfigSource interface { + + // File path to the directory from which Terraform runs. + // If not specified, we use the root directory. + GetWorkingDirectory() *string +} + +type configsource struct { + JsonData []byte + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + ConfigSourceType string `json:"configSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *configsource) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerconfigsource configsource + s := struct { + Model Unmarshalerconfigsource + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.WorkingDirectory = s.Model.WorkingDirectory + m.ConfigSourceType = s.Model.ConfigSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *configsource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ConfigSourceType { + case "ZIP_UPLOAD": + mm := ZipUploadConfigSource{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetWorkingDirectory returns WorkingDirectory +func (m configsource) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m configsource) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_config_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_config_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_config_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_config_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateConfigSourceDetails Property details for the configuration source. +type CreateConfigSourceDetails interface { + + // File path to the directory from which Terraform runs. + // If not specified, the root directory is used. + GetWorkingDirectory() *string +} + +type createconfigsourcedetails struct { + JsonData []byte + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + ConfigSourceType string `json:"configSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *createconfigsourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateconfigsourcedetails createconfigsourcedetails + s := struct { + Model Unmarshalercreateconfigsourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.WorkingDirectory = s.Model.WorkingDirectory + m.ConfigSourceType = s.Model.ConfigSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createconfigsourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ConfigSourceType { + case "ZIP_UPLOAD": + mm := CreateZipUploadConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetWorkingDirectory returns WorkingDirectory +func (m createconfigsourcedetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m createconfigsourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateJobDetails Defines the requirements and properties of a job to create and run against the specified stack. +type CreateJobDetails struct { + + // OCID of the stack that is associated with the current job. + StackId *string `mandatory:"true" json:"stackId"` + + // Terraform-specific operation to execute. + Operation JobOperationEnum `mandatory:"true" json:"operation"` + + // Description of the job. + DisplayName *string `mandatory:"false" json:"displayName"` + + ApplyJobPlanResolution *ApplyJobPlanResolution `mandatory:"false" json:"applyJobPlanResolution"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateJobDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateJobRequest wrapper for the CreateJob operation +type CreateJobRequest struct { + + // The properties for a request to create a job. + CreateJobDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of retrying the same action. Retry tokens expire after + // 24 hours, but can be invalidated before then due to conflicting operations. For example, + // if a resource has been deleted and purged from the system, then a retry of the original + // creation request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateJobResponse wrapper for the CreateJob operation +type CreateJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateStackDetails Properties provided for creating a stack. +type CreateStackDetails struct { + + // Unique identifier (OCID) of the compartment in which the stack resides. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ConfigSource CreateConfigSourceDetails `mandatory:"true" json:"configSource"` + + // The stack's display name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the stack. + Description *string `mandatory:"false" json:"description"` + + // Terraform variables associated with this resource. + // Maximum number of variables supported is 100. + // The maximum size of each variable, including both name and value, is 4096 bytes. + // Example: `{"CompartmentId": "compartment-id-value"}` + Variables map[string]string `mandatory:"false" json:"variables"` + + // Free-form tags associated with this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags associated with this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateStackDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateStackDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + Variables map[string]string `json:"variables"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + CompartmentId *string `json:"compartmentId"` + ConfigSource createconfigsourcedetails `json:"configSource"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DisplayName = model.DisplayName + m.Description = model.Description + m.Variables = model.Variables + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + m.CompartmentId = model.CompartmentId + nn, e := model.ConfigSource.UnmarshalPolymorphicJSON(model.ConfigSource.JsonData) + if e != nil { + return + } + if nn != nil { + m.ConfigSource = nn.(CreateConfigSourceDetails) + } else { + m.ConfigSource = nil + } + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_stack_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateStackRequest wrapper for the CreateStack operation +type CreateStackRequest struct { + + // The properties for creating a stack. + CreateStackDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of retrying the same action. Retry tokens expire after + // 24 hours, but can be invalidated before then due to conflicting operations. For example, + // if a resource has been deleted and purged from the system, then a retry of the original + // creation request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateStackRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateStackRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateStackRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateStackResponse wrapper for the CreateStack operation +type CreateStackResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stack instance + Stack `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateStackResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateStackResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_zip_upload_config_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_zip_upload_config_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_zip_upload_config_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/create_zip_upload_config_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// CreateZipUploadConfigSourceDetails Property details for uploading the configuration zip file. +type CreateZipUploadConfigSourceDetails struct { + ZipFileBase64Encoded *string `mandatory:"true" json:"zipFileBase64Encoded"` + + // File path to the directory from which Terraform runs. + // If not specified, the root directory is used. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m CreateZipUploadConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m CreateZipUploadConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m CreateZipUploadConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateZipUploadConfigSourceDetails CreateZipUploadConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeCreateZipUploadConfigSourceDetails + }{ + "ZIP_UPLOAD", + (MarshalTypeCreateZipUploadConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/delete_stack_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/delete_stack_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/delete_stack_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/delete_stack_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteStackRequest wrapper for the DeleteStack operation +type DeleteStackRequest struct { + + // The stack OCID. + StackId *string `mandatory:"true" contributesTo:"path" name:"stackId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` + // parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteStackRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteStackRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteStackRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteStackResponse wrapper for the DeleteStack operation +type DeleteStackResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteStackResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteStackResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/failure_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/failure_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/failure_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/failure_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// FailureDetails The representation of FailureDetails +type FailureDetails struct { + + // Job failure reason. + Code FailureDetailsCodeEnum `mandatory:"true" json:"code"` + + // A human-readable error string. + Message *string `mandatory:"true" json:"message"` +} + +func (m FailureDetails) String() string { + return common.PointerString(m) +} + +// FailureDetailsCodeEnum Enum with underlying type: string +type FailureDetailsCodeEnum string + +// Set of constants representing the allowable values for FailureDetailsCodeEnum +const ( + FailureDetailsCodeInternalServiceError FailureDetailsCodeEnum = "INTERNAL_SERVICE_ERROR" + FailureDetailsCodeTerraformExecutionError FailureDetailsCodeEnum = "TERRAFORM_EXECUTION_ERROR" + FailureDetailsCodeTerraformConfigUnzipFailed FailureDetailsCodeEnum = "TERRAFORM_CONFIG_UNZIP_FAILED" + FailureDetailsCodeInvalidWorkingDirectory FailureDetailsCodeEnum = "INVALID_WORKING_DIRECTORY" + FailureDetailsCodeJobTimeout FailureDetailsCodeEnum = "JOB_TIMEOUT" + FailureDetailsCodeTerraformConfigVirusFound FailureDetailsCodeEnum = "TERRAFORM_CONFIG_VIRUS_FOUND" +) + +var mappingFailureDetailsCode = map[string]FailureDetailsCodeEnum{ + "INTERNAL_SERVICE_ERROR": FailureDetailsCodeInternalServiceError, + "TERRAFORM_EXECUTION_ERROR": FailureDetailsCodeTerraformExecutionError, + "TERRAFORM_CONFIG_UNZIP_FAILED": FailureDetailsCodeTerraformConfigUnzipFailed, + "INVALID_WORKING_DIRECTORY": FailureDetailsCodeInvalidWorkingDirectory, + "JOB_TIMEOUT": FailureDetailsCodeJobTimeout, + "TERRAFORM_CONFIG_VIRUS_FOUND": FailureDetailsCodeTerraformConfigVirusFound, +} + +// GetFailureDetailsCodeEnumValues Enumerates the set of values for FailureDetailsCodeEnum +func GetFailureDetailsCodeEnumValues() []FailureDetailsCodeEnum { + values := make([]FailureDetailsCodeEnum, 0) + for _, v := range mappingFailureDetailsCode { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_content_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_content_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_content_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_content_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetJobLogsContentRequest wrapper for the GetJobLogsContent operation +type GetJobLogsContentRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJobLogsContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobLogsContentRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobLogsContentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJobLogsContentResponse wrapper for the GetJobLogsContent operation +type GetJobLogsContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The string instance + Value *string `presentIn:"body" encoding:"plain-text"` + + // Unique identifier for the request + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetJobLogsContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobLogsContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_logs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetJobLogsRequest wrapper for the GetJobLogs operation +type GetJobLogsRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter that returns only logs of a specified type. + Type []LogEntryTypeEnum `contributesTo:"query" name:"type" omitEmpty:"true" collectionFormat:"multi"` + + // A filter that returns only log entries that match a given severity level or greater. + LevelGreaterThanOrEqualTo LogEntryLevelEnum `mandatory:"false" contributesTo:"query" name:"levelGreaterThanOrEqualTo" omitEmpty:"true"` + + // The sort order, either `ASC` (ascending) or `DESC` (descending). + SortOrder GetJobLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The number of items returned in a paginated `List` call. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the preceding `List` call. + // For information about pagination, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Time stamp specifying the lower time limit for which logs are returned in a query. + TimestampGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timestampGreaterThanOrEqualTo"` + + // Time stamp specifying the upper time limit for which logs are returned in a query. + TimestampLessThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timestampLessThanOrEqualTo"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJobLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobLogsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJobLogsResponse wrapper for the GetJobLogs operation +type GetJobLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []LogEntry instances + Items []LogEntry `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Retrieves the next page of paginated list items. If the `opc-next-page` + // header appears in the response, additional pages of results remain. + // To receive the next page, include the header value in the `page` param. + // If the `opc-next-page` header does not appear in the response, there + // are no more list items to get. For more information about list pagination, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response GetJobLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetJobLogsSortOrderEnum Enum with underlying type: string +type GetJobLogsSortOrderEnum string + +// Set of constants representing the allowable values for GetJobLogsSortOrderEnum +const ( + GetJobLogsSortOrderAsc GetJobLogsSortOrderEnum = "ASC" + GetJobLogsSortOrderDesc GetJobLogsSortOrderEnum = "DESC" +) + +var mappingGetJobLogsSortOrder = map[string]GetJobLogsSortOrderEnum{ + "ASC": GetJobLogsSortOrderAsc, + "DESC": GetJobLogsSortOrderDesc, +} + +// GetGetJobLogsSortOrderEnumValues Enumerates the set of values for GetJobLogsSortOrderEnum +func GetGetJobLogsSortOrderEnumValues() []GetJobLogsSortOrderEnum { + values := make([]GetJobLogsSortOrderEnum, 0) + for _, v := range mappingGetJobLogsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetJobRequest wrapper for the GetJob operation +type GetJobRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJobResponse wrapper for the GetJob operation +type GetJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// GetJobTfConfigRequest wrapper for the GetJobTfConfig operation +type GetJobTfConfigRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJobTfConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobTfConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobTfConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJobTfConfigResponse wrapper for the GetJobTfConfig operation +type GetJobTfConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetJobTfConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobTfConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_state_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_state_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_state_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_job_tf_state_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// GetJobTfStateRequest wrapper for the GetJobTfState operation +type GetJobTfStateRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJobTfStateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJobTfStateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJobTfStateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJobTfStateResponse wrapper for the GetJobTfState operation +type GetJobTfStateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetJobTfStateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJobTfStateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetStackRequest wrapper for the GetStack operation +type GetStackRequest struct { + + // The stack OCID. + StackId *string `mandatory:"true" contributesTo:"path" name:"stackId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetStackRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetStackRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetStackRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetStackResponse wrapper for the GetStack operation +type GetStackResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stack instance + Stack `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetStackResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetStackResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_tf_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_tf_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_tf_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/get_stack_tf_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "io" + "net/http" +) + +// GetStackTfConfigRequest wrapper for the GetStackTfConfig operation +type GetStackTfConfigRequest struct { + + // The stack OCID. + StackId *string `mandatory:"true" contributesTo:"path" name:"stackId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetStackTfConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetStackTfConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetStackTfConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetStackTfConfigResponse wrapper for the GetStackTfConfig operation +type GetStackTfConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetStackTfConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetStackTfConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,132 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Job Jobs perform the actions that are defined in your configuration. There are three job types +// - **Plan job**. A plan job takes your Terraform configuration, parses it, and creates an execution plan. +// - **Apply job**. The apply job takes your execution plan, applies it to the associated stack, then executes +// the configuration's instructions. +// - **Destroy job**. To clean up the infrastructure controlled by the stack, you run a destroy job. +// A destroy job does not delete the stack or associated job resources, +// but instead releases the resources managed by the stack. +type Job struct { + + // The job's OCID. + Id *string `mandatory:"false" json:"id"` + + // The OCID of the stack that is associated with the job. + StackId *string `mandatory:"false" json:"stackId"` + + // The OCID of the compartment in which the job's associated stack resides. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The job's display name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The type of job executing. + Operation JobOperationEnum `mandatory:"false" json:"operation,omitempty"` + + ApplyJobPlanResolution *ApplyJobPlanResolution `mandatory:"false" json:"applyJobPlanResolution"` + + // The plan job OCID that was used (if this was an apply job and was not auto-approved). + ResolvedPlanJobId *string `mandatory:"false" json:"resolvedPlanJobId"` + + // The date and time at which the job was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time at which the job stopped running, irrespective of whether the job ran successfully. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + LifecycleState JobLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + FailureDetails *FailureDetails `mandatory:"false" json:"failureDetails"` + + // The file path to the directory within the configuration from which the job runs. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // Terraform variables associated with this resource. + // Maximum number of variables supported is 100. + // The maximum size of each variable, including both name and value, is 4096 bytes. + // Example: `{"CompartmentId": "compartment-id-value"}` + Variables map[string]string `mandatory:"false" json:"variables"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Job) String() string { + return common.PointerString(m) +} + +// JobOperationEnum Enum with underlying type: string +type JobOperationEnum string + +// Set of constants representing the allowable values for JobOperationEnum +const ( + JobOperationPlan JobOperationEnum = "PLAN" + JobOperationApply JobOperationEnum = "APPLY" + JobOperationDestroy JobOperationEnum = "DESTROY" +) + +var mappingJobOperation = map[string]JobOperationEnum{ + "PLAN": JobOperationPlan, + "APPLY": JobOperationApply, + "DESTROY": JobOperationDestroy, +} + +// GetJobOperationEnumValues Enumerates the set of values for JobOperationEnum +func GetJobOperationEnumValues() []JobOperationEnum { + values := make([]JobOperationEnum, 0) + for _, v := range mappingJobOperation { + values = append(values, v) + } + return values +} + +// JobLifecycleStateEnum Enum with underlying type: string +type JobLifecycleStateEnum string + +// Set of constants representing the allowable values for JobLifecycleStateEnum +const ( + JobLifecycleStateAccepted JobLifecycleStateEnum = "ACCEPTED" + JobLifecycleStateInProgress JobLifecycleStateEnum = "IN_PROGRESS" + JobLifecycleStateFailed JobLifecycleStateEnum = "FAILED" + JobLifecycleStateSucceeded JobLifecycleStateEnum = "SUCCEEDED" + JobLifecycleStateCanceling JobLifecycleStateEnum = "CANCELING" + JobLifecycleStateCanceled JobLifecycleStateEnum = "CANCELED" +) + +var mappingJobLifecycleState = map[string]JobLifecycleStateEnum{ + "ACCEPTED": JobLifecycleStateAccepted, + "IN_PROGRESS": JobLifecycleStateInProgress, + "FAILED": JobLifecycleStateFailed, + "SUCCEEDED": JobLifecycleStateSucceeded, + "CANCELING": JobLifecycleStateCanceling, + "CANCELED": JobLifecycleStateCanceled, +} + +// GetJobLifecycleStateEnumValues Enumerates the set of values for JobLifecycleStateEnum +func GetJobLifecycleStateEnumValues() []JobLifecycleStateEnum { + values := make([]JobLifecycleStateEnum, 0) + for _, v := range mappingJobLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/job_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// JobSummary Returns a listing of all of the specified job's properties and their values. +type JobSummary struct { + + // The job's OCID. + Id *string `mandatory:"false" json:"id"` + + // OCID of the stack that is associated with the specified job. + StackId *string `mandatory:"false" json:"stackId"` + + // OCID of the compartment where the stack of the associated job resides. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The job's display name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The type of job executing + Operation JobOperationEnum `mandatory:"false" json:"operation,omitempty"` + + ApplyJobPlanResolution *ApplyJobPlanResolution `mandatory:"false" json:"applyJobPlanResolution"` + + // The plan job OCID that was used (if this was an APPLY job and not auto approved). + ResolvedPlanJobId *string `mandatory:"false" json:"resolvedPlanJobId"` + + // The date and time the job was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the job succeeded or failed. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // Current state of the specified job. Allowed values are: + // - ACCEPTED + // - IN_PROGRESS + // - FAILED + // - SUCCEEDED + // - CANCELING + // - CANCELED + LifecycleState JobLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m JobSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_jobs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_jobs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_jobs_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_jobs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,150 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListJobsRequest wrapper for the ListJobs operation +type ListJobsRequest struct { + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The compartment OCID on which to filter. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The stack OCID on which to filter. + StackId *string `mandatory:"false" contributesTo:"query" name:"stackId"` + + // The OCID on which to query for jobs. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // A filter that returns all resources that match the specified lifecycle state. + // The state value is case-insensitive. + // Allowable values: + // - ACCEPTED + // - IN_PROGRESS + // - FAILED + // - SUCCEEDED + // - CANCELING + // - CANCELED + LifecycleState JobLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Display name on which to query. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Specifies the field on which to sort. + // By default, `TIMECREATED` is ordered descending. + // By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field. + SortBy ListJobsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListJobsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The number of items returned in a paginated `List` call. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the preceding `List` call. + // For information about pagination, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListJobsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListJobsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListJobsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListJobsResponse wrapper for the ListJobs operation +type ListJobsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []JobSummary instances + Items []JobSummary `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Retrieves the next page of paginated list items. If the `opc-next-page` + // header appears in the response, additional pages of results remain. + // To receive the next page, include the header value in the `page` param. + // If the `opc-next-page` header does not appear in the response, there + // are no more list items to get. For more information about list pagination, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListJobsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListJobsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListJobsSortByEnum Enum with underlying type: string +type ListJobsSortByEnum string + +// Set of constants representing the allowable values for ListJobsSortByEnum +const ( + ListJobsSortByTimecreated ListJobsSortByEnum = "TIMECREATED" + ListJobsSortByDisplayname ListJobsSortByEnum = "DISPLAYNAME" +) + +var mappingListJobsSortBy = map[string]ListJobsSortByEnum{ + "TIMECREATED": ListJobsSortByTimecreated, + "DISPLAYNAME": ListJobsSortByDisplayname, +} + +// GetListJobsSortByEnumValues Enumerates the set of values for ListJobsSortByEnum +func GetListJobsSortByEnumValues() []ListJobsSortByEnum { + values := make([]ListJobsSortByEnum, 0) + for _, v := range mappingListJobsSortBy { + values = append(values, v) + } + return values +} + +// ListJobsSortOrderEnum Enum with underlying type: string +type ListJobsSortOrderEnum string + +// Set of constants representing the allowable values for ListJobsSortOrderEnum +const ( + ListJobsSortOrderAsc ListJobsSortOrderEnum = "ASC" + ListJobsSortOrderDesc ListJobsSortOrderEnum = "DESC" +) + +var mappingListJobsSortOrder = map[string]ListJobsSortOrderEnum{ + "ASC": ListJobsSortOrderAsc, + "DESC": ListJobsSortOrderDesc, +} + +// GetListJobsSortOrderEnumValues Enumerates the set of values for ListJobsSortOrderEnum +func GetListJobsSortOrderEnumValues() []ListJobsSortOrderEnum { + values := make([]ListJobsSortOrderEnum, 0) + for _, v := range mappingListJobsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_stacks_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_stacks_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_stacks_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/list_stacks_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListStacksRequest wrapper for the ListStacks operation +type ListStacksRequest struct { + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The compartment OCID on which to filter. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID on which to query for a stack. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // A filter that returns only those resources that match the specified + // lifecycle state. The state value is case-insensitive. + // Allowable values: + // - CREATING + // - ACTIVE + // - DELETING + // - DELETED + // + LifecycleState StackLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Display name on which to query. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Specifies the field on which to sort. + // By default, `TIMECREATED` is ordered descending. + // By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field. + SortBy ListStacksSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListStacksSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The number of items returned in a paginated `List` call. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the preceding `List` call. + // For information about pagination, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListStacksRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListStacksRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListStacksRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListStacksResponse wrapper for the ListStacks operation +type ListStacksResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []StackSummary instances + Items []StackSummary `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Retrieves the next page of paginated list items. If the `opc-next-page` + // header appears in the response, additional pages of results remain. + // To receive the next page, include the header value in the `page` param. + // If the `opc-next-page` header does not appear in the response, there + // are no more list items to get. For more information about list pagination, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListStacksResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListStacksResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListStacksSortByEnum Enum with underlying type: string +type ListStacksSortByEnum string + +// Set of constants representing the allowable values for ListStacksSortByEnum +const ( + ListStacksSortByTimecreated ListStacksSortByEnum = "TIMECREATED" + ListStacksSortByDisplayname ListStacksSortByEnum = "DISPLAYNAME" +) + +var mappingListStacksSortBy = map[string]ListStacksSortByEnum{ + "TIMECREATED": ListStacksSortByTimecreated, + "DISPLAYNAME": ListStacksSortByDisplayname, +} + +// GetListStacksSortByEnumValues Enumerates the set of values for ListStacksSortByEnum +func GetListStacksSortByEnumValues() []ListStacksSortByEnum { + values := make([]ListStacksSortByEnum, 0) + for _, v := range mappingListStacksSortBy { + values = append(values, v) + } + return values +} + +// ListStacksSortOrderEnum Enum with underlying type: string +type ListStacksSortOrderEnum string + +// Set of constants representing the allowable values for ListStacksSortOrderEnum +const ( + ListStacksSortOrderAsc ListStacksSortOrderEnum = "ASC" + ListStacksSortOrderDesc ListStacksSortOrderEnum = "DESC" +) + +var mappingListStacksSortOrder = map[string]ListStacksSortOrderEnum{ + "ASC": ListStacksSortOrderAsc, + "DESC": ListStacksSortOrderDesc, +} + +// GetListStacksSortOrderEnumValues Enumerates the set of values for ListStacksSortOrderEnum +func GetListStacksSortOrderEnumValues() []ListStacksSortOrderEnum { + values := make([]ListStacksSortOrderEnum, 0) + for _, v := range mappingListStacksSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/log_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/log_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/log_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/log_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// LogEntry Log entry for an operation resulting from a job's execution. +type LogEntry struct { + + // Specifies the log type for the log entry. + Type LogEntryTypeEnum `mandatory:"false" json:"type,omitempty"` + + // Specifies the severity level of the log entry. + Level LogEntryLevelEnum `mandatory:"false" json:"level,omitempty"` + + // Date and time of the log entry. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` + + // The log entry value. + Message *string `mandatory:"false" json:"message"` +} + +func (m LogEntry) String() string { + return common.PointerString(m) +} + +// LogEntryTypeEnum Enum with underlying type: string +type LogEntryTypeEnum string + +// Set of constants representing the allowable values for LogEntryTypeEnum +const ( + LogEntryTypeConsole LogEntryTypeEnum = "TERRAFORM_CONSOLE" +) + +var mappingLogEntryType = map[string]LogEntryTypeEnum{ + "TERRAFORM_CONSOLE": LogEntryTypeConsole, +} + +// GetLogEntryTypeEnumValues Enumerates the set of values for LogEntryTypeEnum +func GetLogEntryTypeEnumValues() []LogEntryTypeEnum { + values := make([]LogEntryTypeEnum, 0) + for _, v := range mappingLogEntryType { + values = append(values, v) + } + return values +} + +// LogEntryLevelEnum Enum with underlying type: string +type LogEntryLevelEnum string + +// Set of constants representing the allowable values for LogEntryLevelEnum +const ( + LogEntryLevelTrace LogEntryLevelEnum = "TRACE" + LogEntryLevelDebug LogEntryLevelEnum = "DEBUG" + LogEntryLevelInfo LogEntryLevelEnum = "INFO" + LogEntryLevelWarn LogEntryLevelEnum = "WARN" + LogEntryLevelError LogEntryLevelEnum = "ERROR" + LogEntryLevelFatal LogEntryLevelEnum = "FATAL" +) + +var mappingLogEntryLevel = map[string]LogEntryLevelEnum{ + "TRACE": LogEntryLevelTrace, + "DEBUG": LogEntryLevelDebug, + "INFO": LogEntryLevelInfo, + "WARN": LogEntryLevelWarn, + "ERROR": LogEntryLevelError, + "FATAL": LogEntryLevelFatal, +} + +// GetLogEntryLevelEnumValues Enumerates the set of values for LogEntryLevelEnum +func GetLogEntryLevelEnumValues() []LogEntryLevelEnum { + values := make([]LogEntryLevelEnum, 0) + for _, v := range mappingLogEntryLevel { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/resourcemanager_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/resourcemanager_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/resourcemanager_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/resourcemanager_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,709 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//ResourceManagerClient a client for ResourceManager +type ResourceManagerClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewResourceManagerClientWithConfigurationProvider Creates a new default ResourceManager client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewResourceManagerClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ResourceManagerClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = ResourceManagerClient{BaseClient: baseClient} + client.BasePath = "20180917" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ResourceManagerClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("resourcemanager", "https://resourcemanager.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ResourceManagerClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ResourceManagerClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelJob Indicates the intention to cancel the specified job. +// Cancellation of the job is not immediate, and may be delayed, +// or may not happen at all. +func (client ResourceManagerClient) CancelJob(ctx context.Context, request CancelJobRequest) (response CancelJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.cancelJob, policy) + if err != nil { + if ociResponse != nil { + response = CancelJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CancelJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelJobResponse") + } + return +} + +// cancelJob implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) cancelJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/jobs/{jobId}") + if err != nil { + return nil, err + } + + var response CancelJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateJob Creates a job. +func (client ResourceManagerClient) CreateJob(ctx context.Context, request CreateJobRequest) (response CreateJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createJob, policy) + if err != nil { + if ociResponse != nil { + response = CreateJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateJobResponse") + } + return +} + +// createJob implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) createJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/jobs") + if err != nil { + return nil, err + } + + var response CreateJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateStack Creates a stack in the specified comparment. +// Specify the compartment using the compartment ID. +func (client ResourceManagerClient) CreateStack(ctx context.Context, request CreateStackRequest) (response CreateStackResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createStack, policy) + if err != nil { + if ociResponse != nil { + response = CreateStackResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateStackResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateStackResponse") + } + return +} + +// createStack implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) createStack(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/stacks") + if err != nil { + return nil, err + } + + var response CreateStackResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteStack Deletes the specified stack object. +func (client ResourceManagerClient) DeleteStack(ctx context.Context, request DeleteStackRequest) (response DeleteStackResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteStack, policy) + if err != nil { + if ociResponse != nil { + response = DeleteStackResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteStackResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteStackResponse") + } + return +} + +// deleteStack implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) deleteStack(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/stacks/{stackId}") + if err != nil { + return nil, err + } + + var response DeleteStackResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJob Returns the specified job along with the job details. +func (client ResourceManagerClient) GetJob(ctx context.Context, request GetJobRequest) (response GetJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJob, policy) + if err != nil { + if ociResponse != nil { + response = GetJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobResponse") + } + return +} + +// getJob implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}") + if err != nil { + return nil, err + } + + var response GetJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJobLogs Returns log entries for the specified job in JSON format. +func (client ResourceManagerClient) GetJobLogs(ctx context.Context, request GetJobLogsRequest) (response GetJobLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJobLogs, policy) + if err != nil { + if ociResponse != nil { + response = GetJobLogsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJobLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobLogsResponse") + } + return +} + +// getJobLogs implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getJobLogs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}/logs") + if err != nil { + return nil, err + } + + var response GetJobLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJobLogsContent Returns raw log file for the specified job in text format. +// Returns a maximum of 100,000 log entries. +func (client ResourceManagerClient) GetJobLogsContent(ctx context.Context, request GetJobLogsContentRequest) (response GetJobLogsContentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJobLogsContent, policy) + if err != nil { + if ociResponse != nil { + response = GetJobLogsContentResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJobLogsContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobLogsContentResponse") + } + return +} + +// getJobLogsContent implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getJobLogsContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}/logs/content") + if err != nil { + return nil, err + } + + var response GetJobLogsContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJobTfConfig Returns the Terraform configuration file for the specified job in .zip format. +// Returns an error if no zip file is found. +func (client ResourceManagerClient) GetJobTfConfig(ctx context.Context, request GetJobTfConfigRequest) (response GetJobTfConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJobTfConfig, policy) + if err != nil { + if ociResponse != nil { + response = GetJobTfConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJobTfConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobTfConfigResponse") + } + return +} + +// getJobTfConfig implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getJobTfConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}/tfConfig") + if err != nil { + return nil, err + } + + var response GetJobTfConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJobTfState Returns the Terraform state for the specified job. +func (client ResourceManagerClient) GetJobTfState(ctx context.Context, request GetJobTfStateRequest) (response GetJobTfStateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJobTfState, policy) + if err != nil { + if ociResponse != nil { + response = GetJobTfStateResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJobTfStateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJobTfStateResponse") + } + return +} + +// getJobTfState implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getJobTfState(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs/{jobId}/tfState") + if err != nil { + return nil, err + } + + var response GetJobTfStateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetStack Gets a stack using the stack ID. +func (client ResourceManagerClient) GetStack(ctx context.Context, request GetStackRequest) (response GetStackResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getStack, policy) + if err != nil { + if ociResponse != nil { + response = GetStackResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetStackResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetStackResponse") + } + return +} + +// getStack implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getStack(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/stacks/{stackId}") + if err != nil { + return nil, err + } + + var response GetStackResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetStackTfConfig Returns the Terraform configuration file in .zip format for the specified stack. +// Returns an error if no zip file is found. +func (client ResourceManagerClient) GetStackTfConfig(ctx context.Context, request GetStackTfConfigRequest) (response GetStackTfConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getStackTfConfig, policy) + if err != nil { + if ociResponse != nil { + response = GetStackTfConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetStackTfConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetStackTfConfigResponse") + } + return +} + +// getStackTfConfig implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) getStackTfConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/stacks/{stackId}/tfConfig") + if err != nil { + return nil, err + } + + var response GetStackTfConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListJobs Returns a list of jobs in a stack or compartment, ordered by time created. +// - To list all jobs in a stack, provide the stack OCID. +// - To list all jobs in a compartment, provide the compartment OCID. +// - To return a specific job, provide the job OCID. +func (client ResourceManagerClient) ListJobs(ctx context.Context, request ListJobsRequest) (response ListJobsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listJobs, policy) + if err != nil { + if ociResponse != nil { + response = ListJobsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListJobsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListJobsResponse") + } + return +} + +// listJobs implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) listJobs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs") + if err != nil { + return nil, err + } + + var response ListJobsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListStacks Returns a list of stacks. +// - If called using the compartment ID, returns all stacks in the specified compartment. +// - If called using the stack ID, returns the specified stack. +func (client ResourceManagerClient) ListStacks(ctx context.Context, request ListStacksRequest) (response ListStacksResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listStacks, policy) + if err != nil { + if ociResponse != nil { + response = ListStacksResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListStacksResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListStacksResponse") + } + return +} + +// listStacks implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) listStacks(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/stacks") + if err != nil { + return nil, err + } + + var response ListStacksResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateJob Updates the specified job. +func (client ResourceManagerClient) UpdateJob(ctx context.Context, request UpdateJobRequest) (response UpdateJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateJob, policy) + if err != nil { + if ociResponse != nil { + response = UpdateJobResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateJobResponse") + } + return +} + +// updateJob implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) updateJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/jobs/{jobId}") + if err != nil { + return nil, err + } + + var response UpdateJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateStack Updates the specified stack object. +// Use `UpdateStack` when you update your Terraform configuration +// and want your changes to be reflected in the execution plan. +func (client ResourceManagerClient) UpdateStack(ctx context.Context, request UpdateStackRequest) (response UpdateStackResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateStack, policy) + if err != nil { + if ociResponse != nil { + response = UpdateStackResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateStackResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateStackResponse") + } + return +} + +// updateStack implements the OCIOperation interface (enables retrying operations) +func (client ResourceManagerClient) updateStack(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/stacks/{stackId}") + if err != nil { + return nil, err + } + + var response UpdateStackResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,128 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// Stack The stack object. Stacks represent definitions of groups of Oracle Cloud Infrastructure +// resources that you can act upon as a group. You take action on stacks by using jobs. +type Stack struct { + + // Unique identifier (OCID) for the stack. + Id *string `mandatory:"false" json:"id"` + + // Unique identifier (OCID) for the compartment where the stack is located. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable name of the stack. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the stack. + Description *string `mandatory:"false" json:"description"` + + // The date and time at which the stack was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The current lifecycle state of the stack. + LifecycleState StackLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Specifies the `configSourceType` for uploading the Terraform configuration. + // Presently, the .zip file type (`ZIP_UPLOAD`) is the only supported `configSourceType`. + ConfigSource ConfigSource `mandatory:"false" json:"configSource"` + + // Terraform variables associated with this resource. + // Maximum number of variables supported is 100. + // The maximum size of each variable, including both name and value, is 4096 bytes. + // Example: `{"CompartmentId": "compartment-id-value"}` + Variables map[string]string `mandatory:"false" json:"variables"` + + // Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Stack) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *Stack) UnmarshalJSON(data []byte) (e error) { + model := struct { + Id *string `json:"id"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState StackLifecycleStateEnum `json:"lifecycleState"` + ConfigSource configsource `json:"configSource"` + Variables map[string]string `json:"variables"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.Id = model.Id + m.CompartmentId = model.CompartmentId + m.DisplayName = model.DisplayName + m.Description = model.Description + m.TimeCreated = model.TimeCreated + m.LifecycleState = model.LifecycleState + nn, e := model.ConfigSource.UnmarshalPolymorphicJSON(model.ConfigSource.JsonData) + if e != nil { + return + } + if nn != nil { + m.ConfigSource = nn.(ConfigSource) + } else { + m.ConfigSource = nil + } + m.Variables = model.Variables + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + return +} + +// StackLifecycleStateEnum Enum with underlying type: string +type StackLifecycleStateEnum string + +// Set of constants representing the allowable values for StackLifecycleStateEnum +const ( + StackLifecycleStateCreating StackLifecycleStateEnum = "CREATING" + StackLifecycleStateActive StackLifecycleStateEnum = "ACTIVE" + StackLifecycleStateDeleting StackLifecycleStateEnum = "DELETING" + StackLifecycleStateDeleted StackLifecycleStateEnum = "DELETED" +) + +var mappingStackLifecycleState = map[string]StackLifecycleStateEnum{ + "CREATING": StackLifecycleStateCreating, + "ACTIVE": StackLifecycleStateActive, + "DELETING": StackLifecycleStateDeleting, + "DELETED": StackLifecycleStateDeleted, +} + +// GetStackLifecycleStateEnumValues Enumerates the set of values for StackLifecycleStateEnum +func GetStackLifecycleStateEnumValues() []StackLifecycleStateEnum { + values := make([]StackLifecycleStateEnum, 0) + for _, v := range mappingStackLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/stack_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// StackSummary Returns a list of properties and the defining property values for the specified stack. +type StackSummary struct { + + // Unique identifier of the specified stack. + Id *string `mandatory:"false" json:"id"` + + // Unique identifier of the compartment in which the stack resides. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable display name for the stack. + DisplayName *string `mandatory:"false" json:"displayName"` + + // General description of the stack. + Description *string `mandatory:"false" json:"description"` + + // Date and time at which the stack was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + LifecycleState StackLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m StackSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_config_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_config_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_config_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_config_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateConfigSourceDetails Updates the property details for the configuration source. +type UpdateConfigSourceDetails interface { + + // The path of the directory from which to run terraform. If not specified, the the root will be used. + GetWorkingDirectory() *string +} + +type updateconfigsourcedetails struct { + JsonData []byte + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + ConfigSourceType string `json:"configSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *updateconfigsourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateconfigsourcedetails updateconfigsourcedetails + s := struct { + Model Unmarshalerupdateconfigsourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.WorkingDirectory = s.Model.WorkingDirectory + m.ConfigSourceType = s.Model.ConfigSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateconfigsourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ConfigSourceType { + case "ZIP_UPLOAD": + mm := UpdateZipUploadConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetWorkingDirectory returns WorkingDirectory +func (m updateconfigsourcedetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m updateconfigsourcedetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateJobDetails Updates the display name, free-form tags, and/or defined tag properties of the job. +type UpdateJobDetails struct { + + // The new display name to set. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateJobDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_job_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateJobRequest wrapper for the UpdateJob operation +type UpdateJobRequest struct { + + // The job OCID. + JobId *string `mandatory:"true" contributesTo:"path" name:"jobId"` + + // Updates properties for the specified job. + UpdateJobDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` + // parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateJobRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateJobResponse wrapper for the UpdateJob operation +type UpdateJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Job instance + Job `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateStackDetails Specifies which fields and the data for each to update on the specified stack. +type UpdateStackDetails struct { + + // The name of the stack. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the stack. + Description *string `mandatory:"false" json:"description"` + + ConfigSource UpdateConfigSourceDetails `mandatory:"false" json:"configSource"` + + // Terraform variables associated with this resource. + // The maximum number of variables supported is 100. + // The maximum size of each variable, including both name and value, is 4096 bytes. + // Example: `{"CompartmentId": "compartment-id-value"}` + Variables map[string]string `mandatory:"false" json:"variables"` + + // Free-form tags associated with this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateStackDetails) String() string { + return common.PointerString(m) +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateStackDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + ConfigSource updateconfigsourcedetails `json:"configSource"` + Variables map[string]string `json:"variables"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + m.DisplayName = model.DisplayName + m.Description = model.Description + nn, e := model.ConfigSource.UnmarshalPolymorphicJSON(model.ConfigSource.JsonData) + if e != nil { + return + } + if nn != nil { + m.ConfigSource = nn.(UpdateConfigSourceDetails) + } else { + m.ConfigSource = nil + } + m.Variables = model.Variables + m.FreeformTags = model.FreeformTags + m.DefinedTags = model.DefinedTags + return +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_stack_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcemanager + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateStackRequest wrapper for the UpdateStack operation +type UpdateStackRequest struct { + + // The stack OCID. + StackId *string `mandatory:"true" contributesTo:"path" name:"stackId"` + + // Updated information provided for the stack. + UpdateStackDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` + // parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateStackRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateStackRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateStackRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateStackResponse wrapper for the UpdateStack operation +type UpdateStackResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stack instance + Stack `presentIn:"body"` + + // Unique identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateStackResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateStackResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_zip_upload_config_source_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_zip_upload_config_source_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_zip_upload_config_source_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/update_zip_upload_config_source_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateZipUploadConfigSourceDetails Updates property details for the configuration .zip file. +type UpdateZipUploadConfigSourceDetails struct { + + // The path of the directory from which to run terraform. If not specified, the the root will be used. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + ZipFileBase64Encoded *string `mandatory:"false" json:"zipFileBase64Encoded"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m UpdateZipUploadConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m UpdateZipUploadConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m UpdateZipUploadConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateZipUploadConfigSourceDetails UpdateZipUploadConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeUpdateZipUploadConfigSourceDetails + }{ + "ZIP_UPLOAD", + (MarshalTypeUpdateZipUploadConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/zip_upload_config_source.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/zip_upload_config_source.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/zip_upload_config_source.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcemanager/zip_upload_config_source.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// ZipUploadConfigSource File path to the location of the zip file that contains the Terraform configuration. +type ZipUploadConfigSource struct { + + // File path to the directory from which Terraform runs. + // If not specified, we use the root directory. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m ZipUploadConfigSource) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m ZipUploadConfigSource) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m ZipUploadConfigSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeZipUploadConfigSource ZipUploadConfigSource + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeZipUploadConfigSource + }{ + "ZIP_UPLOAD", + (MarshalTypeZipUploadConfigSource)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/free_text_search_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/free_text_search_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/free_text_search_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/free_text_search_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// FreeTextSearchDetails A request containing arbitrary text that must be present in the resource. +type FreeTextSearchDetails struct { + + // The text to search for. + Text *string `mandatory:"true" json:"text"` + + // The type of matching context returned in the response. If you specify `HIGHLIGHTS`, then the service will highlight fragments in its response. (See ResourceSummary.searchContext and SearchContext for more information.) The default setting is `NONE`. + MatchingContextType SearchDetailsMatchingContextTypeEnum `mandatory:"false" json:"matchingContextType,omitempty"` +} + +//GetMatchingContextType returns MatchingContextType +func (m FreeTextSearchDetails) GetMatchingContextType() SearchDetailsMatchingContextTypeEnum { + return m.MatchingContextType +} + +func (m FreeTextSearchDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m FreeTextSearchDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeFreeTextSearchDetails FreeTextSearchDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeFreeTextSearchDetails + }{ + "FreeText", + (MarshalTypeFreeTextSearchDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/get_resource_type_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/get_resource_type_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/get_resource_type_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/get_resource_type_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetResourceTypeRequest wrapper for the GetResourceType operation +type GetResourceTypeRequest struct { + + // The name of the resource type. + Name *string `mandatory:"true" contributesTo:"path" name:"name"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetResourceTypeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetResourceTypeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetResourceTypeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetResourceTypeResponse wrapper for the GetResourceType operation +type GetResourceTypeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ResourceType instance + ResourceType `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetResourceTypeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetResourceTypeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/list_resource_types_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/list_resource_types_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/list_resource_types_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/list_resource_types_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListResourceTypesRequest wrapper for the ListResourceTypes operation +type ListResourceTypesRequest struct { + + // The maximum number of items to return. The value must be between 1 and 1000. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListResourceTypesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListResourceTypesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListResourceTypesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListResourceTypesResponse wrapper for the ListResourceTypes operation +type ListResourceTypesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ResourceType instances + Items []ResourceType `presentIn:"body"` + + // Pagination token + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListResourceTypesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListResourceTypesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/queryable_field_description.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/queryable_field_description.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/queryable_field_description.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/queryable_field_description.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// QueryableFieldDescription An individual field that can be used as part of a query filter. +type QueryableFieldDescription struct { + + // The type of the field, which dictates what semantics and query constraints you can use when searching or querying. + FieldType QueryableFieldDescriptionFieldTypeEnum `mandatory:"true" json:"fieldType"` + + // The name of the field to use when constructing the query. Field names are present for all types except `OBJECT`. + FieldName *string `mandatory:"true" json:"fieldName"` + + // Indicates this field is actually an array of the specified field type. + IsArray *bool `mandatory:"false" json:"isArray"` + + // If the field type is `OBJECT`, then this property will provide all the individual properties on the object that can + // be queried. + ObjectProperties []QueryableFieldDescription `mandatory:"false" json:"objectProperties"` +} + +func (m QueryableFieldDescription) String() string { + return common.PointerString(m) +} + +// QueryableFieldDescriptionFieldTypeEnum Enum with underlying type: string +type QueryableFieldDescriptionFieldTypeEnum string + +// Set of constants representing the allowable values for QueryableFieldDescriptionFieldTypeEnum +const ( + QueryableFieldDescriptionFieldTypeIdentifier QueryableFieldDescriptionFieldTypeEnum = "IDENTIFIER" + QueryableFieldDescriptionFieldTypeString QueryableFieldDescriptionFieldTypeEnum = "STRING" + QueryableFieldDescriptionFieldTypeInteger QueryableFieldDescriptionFieldTypeEnum = "INTEGER" + QueryableFieldDescriptionFieldTypeRational QueryableFieldDescriptionFieldTypeEnum = "RATIONAL" + QueryableFieldDescriptionFieldTypeBoolean QueryableFieldDescriptionFieldTypeEnum = "BOOLEAN" + QueryableFieldDescriptionFieldTypeDatetime QueryableFieldDescriptionFieldTypeEnum = "DATETIME" + QueryableFieldDescriptionFieldTypeIp QueryableFieldDescriptionFieldTypeEnum = "IP" + QueryableFieldDescriptionFieldTypeObject QueryableFieldDescriptionFieldTypeEnum = "OBJECT" +) + +var mappingQueryableFieldDescriptionFieldType = map[string]QueryableFieldDescriptionFieldTypeEnum{ + "IDENTIFIER": QueryableFieldDescriptionFieldTypeIdentifier, + "STRING": QueryableFieldDescriptionFieldTypeString, + "INTEGER": QueryableFieldDescriptionFieldTypeInteger, + "RATIONAL": QueryableFieldDescriptionFieldTypeRational, + "BOOLEAN": QueryableFieldDescriptionFieldTypeBoolean, + "DATETIME": QueryableFieldDescriptionFieldTypeDatetime, + "IP": QueryableFieldDescriptionFieldTypeIp, + "OBJECT": QueryableFieldDescriptionFieldTypeObject, +} + +// GetQueryableFieldDescriptionFieldTypeEnumValues Enumerates the set of values for QueryableFieldDescriptionFieldTypeEnum +func GetQueryableFieldDescriptionFieldTypeEnumValues() []QueryableFieldDescriptionFieldTypeEnum { + values := make([]QueryableFieldDescriptionFieldTypeEnum, 0) + for _, v := range mappingQueryableFieldDescriptionFieldType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resourcesearch_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resourcesearch_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resourcesearch_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resourcesearch_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,187 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//ResourceSearchClient a client for ResourceSearch +type ResourceSearchClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewResourceSearchClientWithConfigurationProvider Creates a new default ResourceSearch client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewResourceSearchClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ResourceSearchClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = ResourceSearchClient{BaseClient: baseClient} + client.BasePath = "20180409" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ResourceSearchClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("query", "https://query.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ResourceSearchClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ResourceSearchClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetResourceType Gets detailed information about a resource type by using the resource type name. +func (client ResourceSearchClient) GetResourceType(ctx context.Context, request GetResourceTypeRequest) (response GetResourceTypeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getResourceType, policy) + if err != nil { + if ociResponse != nil { + response = GetResourceTypeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetResourceTypeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetResourceTypeResponse") + } + return +} + +// getResourceType implements the OCIOperation interface (enables retrying operations) +func (client ResourceSearchClient) getResourceType(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceTypes/{name}") + if err != nil { + return nil, err + } + + var response GetResourceTypeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListResourceTypes Lists all resource types that you can search or query for. +func (client ResourceSearchClient) ListResourceTypes(ctx context.Context, request ListResourceTypesRequest) (response ListResourceTypesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listResourceTypes, policy) + if err != nil { + if ociResponse != nil { + response = ListResourceTypesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListResourceTypesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListResourceTypesResponse") + } + return +} + +// listResourceTypes implements the OCIOperation interface (enables retrying operations) +func (client ResourceSearchClient) listResourceTypes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceTypes") + if err != nil { + return nil, err + } + + var response ListResourceTypesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SearchResources Queries any and all compartments in the tenancy to find resources that match the specified criteria. +// Results include resources that you have permission to view and can span different resource types. +// You can also sort results based on a specified resource attribute. +func (client ResourceSearchClient) SearchResources(ctx context.Context, request SearchResourcesRequest) (response SearchResourcesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.searchResources, policy) + if err != nil { + if ociResponse != nil { + response = SearchResourcesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(SearchResourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SearchResourcesResponse") + } + return +} + +// searchResources implements the OCIOperation interface (enables retrying operations) +func (client ResourceSearchClient) searchResources(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/resources") + if err != nil { + return nil, err + } + + var response SearchResourcesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary_collection.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary_collection.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary_collection.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary_collection.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ResourceSummaryCollection Summary representation of resources that matched the search criteria. +type ResourceSummaryCollection struct { + + // A list of resources. + Items []ResourceSummary `mandatory:"false" json:"items"` +} + +func (m ResourceSummaryCollection) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ResourceSummary A resource that exists in the user's cloud network. +type ResourceSummary struct { + + // The resource type name. + ResourceType *string `mandatory:"true" json:"resourceType"` + + // The unique identifier for this particular resource, usually an OCID. + Identifier *string `mandatory:"true" json:"identifier"` + + // The OCID of the compartment that contains this resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time this resource was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The display name (or name) of this resource, if one exists. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The availability domain this resource is located in, if applicable. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The lifecycle state of this resource, if applicable. + LifecycleState *string `mandatory:"false" json:"lifecycleState"` + + // The freeform tags associated with this resource, if any. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // The defined tags associated with this resource, if any. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Contains search context, such as highlighting, for found resources. + SearchContext *SearchContext `mandatory:"false" json:"searchContext"` +} + +func (m ResourceSummary) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_type.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_type.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_type.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/resource_type.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ResourceType Defines a type of resource that you can find with a search or query. +type ResourceType struct { + + // The unique name of the resource type, which matches the value returned as part of the ResourceSummary object. + Name *string `mandatory:"true" json:"name"` + + // List of all the fields and their value type that are indexed for querying. + Fields []QueryableFieldDescription `mandatory:"true" json:"fields"` +} + +func (m ResourceType) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_context.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_context.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_context.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_context.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// SearchContext Contains search context, such as highlighting, for found resources. +type SearchContext struct { + + // Describes what in each field matched the search criteria by showing highlighted values, but only for free text searches or for structured + // queries that use a MATCHING clause. The list of strings represents fragments of values that matched the query conditions. Highlighted + // values are wrapped with .. tags. All values are HTML-encoded (except tags). + Highlights map[string][]string `mandatory:"false" json:"highlights"` +} + +func (m SearchContext) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// SearchDetails A base request type containing common criteria for searching for resources. +type SearchDetails interface { + + // The type of matching context returned in the response. If you specify `HIGHLIGHTS`, then the service will highlight fragments in its response. (See ResourceSummary.searchContext and SearchContext for more information.) The default setting is `NONE`. + GetMatchingContextType() SearchDetailsMatchingContextTypeEnum +} + +type searchdetails struct { + JsonData []byte + MatchingContextType SearchDetailsMatchingContextTypeEnum `mandatory:"false" json:"matchingContextType,omitempty"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *searchdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersearchdetails searchdetails + s := struct { + Model Unmarshalersearchdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.MatchingContextType = s.Model.MatchingContextType + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *searchdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "Structured": + mm := StructuredSearchDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "FreeText": + mm := FreeTextSearchDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetMatchingContextType returns MatchingContextType +func (m searchdetails) GetMatchingContextType() SearchDetailsMatchingContextTypeEnum { + return m.MatchingContextType +} + +func (m searchdetails) String() string { + return common.PointerString(m) +} + +// SearchDetailsMatchingContextTypeEnum Enum with underlying type: string +type SearchDetailsMatchingContextTypeEnum string + +// Set of constants representing the allowable values for SearchDetailsMatchingContextTypeEnum +const ( + SearchDetailsMatchingContextTypeNone SearchDetailsMatchingContextTypeEnum = "NONE" + SearchDetailsMatchingContextTypeHighlights SearchDetailsMatchingContextTypeEnum = "HIGHLIGHTS" +) + +var mappingSearchDetailsMatchingContextType = map[string]SearchDetailsMatchingContextTypeEnum{ + "NONE": SearchDetailsMatchingContextTypeNone, + "HIGHLIGHTS": SearchDetailsMatchingContextTypeHighlights, +} + +// GetSearchDetailsMatchingContextTypeEnumValues Enumerates the set of values for SearchDetailsMatchingContextTypeEnum +func GetSearchDetailsMatchingContextTypeEnumValues() []SearchDetailsMatchingContextTypeEnum { + values := make([]SearchDetailsMatchingContextTypeEnum, 0) + for _, v := range mappingSearchDetailsMatchingContextType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_resources_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_resources_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_resources_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/search_resources_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package resourcesearch + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// SearchResourcesRequest wrapper for the SearchResources operation +type SearchResourcesRequest struct { + + // Request parameters that describe query criteria. + SearchDetails `contributesTo:"body"` + + // The maximum number of items to return. The value must be between 1 and 1000. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, please provide the complete request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SearchResourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SearchResourcesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SearchResourcesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// SearchResourcesResponse wrapper for the SearchResources operation +type SearchResourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ResourceSummaryCollection instances + ResourceSummaryCollection `presentIn:"body"` + + // Pagination token + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response SearchResourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SearchResourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/structured_search_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/structured_search_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/structured_search_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/resourcesearch/structured_search_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Search Service API +// +// Search for resources in your cloud network. +// + +package resourcesearch + +import ( + "encoding/json" + "github.com/oracle/oci-go-sdk/common" +) + +// StructuredSearchDetails A request containing search filters using the structured search query language. +type StructuredSearchDetails struct { + + // The structured query describing which resources to search for. + Query *string `mandatory:"true" json:"query"` + + // The type of matching context returned in the response. If you specify `HIGHLIGHTS`, then the service will highlight fragments in its response. (See ResourceSummary.searchContext and SearchContext for more information.) The default setting is `NONE`. + MatchingContextType SearchDetailsMatchingContextTypeEnum `mandatory:"false" json:"matchingContextType,omitempty"` +} + +//GetMatchingContextType returns MatchingContextType +func (m StructuredSearchDetails) GetMatchingContextType() SearchDetailsMatchingContextTypeEnum { + return m.MatchingContextType +} + +func (m StructuredSearchDetails) String() string { + return common.PointerString(m) +} + +// MarshalJSON marshals to json representation +func (m StructuredSearchDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStructuredSearchDetails StructuredSearchDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeStructuredSearchDetails + }{ + "Structured", + (MarshalTypeStructuredSearchDetails)(m), + } + + return json.Marshal(&s) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_commit_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_commit_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_commit_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_commit_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ConsumerCommitRequest wrapper for the ConsumerCommit operation +type ConsumerCommitRequest struct { + + // The OCID of the stream for which the group is committing offsets. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The group-cursor representing the offsets of the group. This cursor is retrieved from the CreateGroupCursor API call. + Cursor *string `mandatory:"true" contributesTo:"query" name:"cursor"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ConsumerCommitRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConsumerCommitRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConsumerCommitRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ConsumerCommitResponse wrapper for the ConsumerCommit operation +type ConsumerCommitResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cursor instance + Cursor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ConsumerCommitResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConsumerCommitResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_heartbeat_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_heartbeat_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_heartbeat_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/consumer_heartbeat_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ConsumerHeartbeatRequest wrapper for the ConsumerHeartbeat operation +type ConsumerHeartbeatRequest struct { + + // The OCID of the stream for which the group is committing offsets. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The group-cursor representing the offsets of the group. This cursor is retrieved from the CreateGroupCursor API call. + Cursor *string `mandatory:"true" contributesTo:"query" name:"cursor"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ConsumerHeartbeatRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConsumerHeartbeatRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConsumerHeartbeatRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ConsumerHeartbeatResponse wrapper for the ConsumerHeartbeat operation +type ConsumerHeartbeatResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cursor instance + Cursor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ConsumerHeartbeatResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConsumerHeartbeatResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateCursorDetails Object used to create a cursor to consume messages in a stream. +type CreateCursorDetails struct { + + // The partition to get messages from. + Partition *string `mandatory:"true" json:"partition"` + + // The type of cursor, which determines the starting point from which the stream will be consumed: + // - `AFTER_OFFSET:` The partition position immediately following the offset you specify. (Offsets are assigned when you successfully append a message to a partition in a stream.) + // - `AT_OFFSET:` The exact partition position indicated by the offset you specify. + // - `AT_TIME:` A specific point in time. + // - `LATEST:` The most recent message in the partition that was added after the cursor was created. + // - `TRIM_HORIZON:` The oldest message in the partition that is within the retention period window. + Type CreateCursorDetailsTypeEnum `mandatory:"true" json:"type"` + + // The offset to consume from if the cursor type is `AT_OFFSET` or `AFTER_OFFSET`. + Offset *int64 `mandatory:"false" json:"offset"` + + // The time to consume from if the cursor type is `AT_TIME`, expressed in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + Time *common.SDKTime `mandatory:"false" json:"time"` +} + +func (m CreateCursorDetails) String() string { + return common.PointerString(m) +} + +// CreateCursorDetailsTypeEnum Enum with underlying type: string +type CreateCursorDetailsTypeEnum string + +// Set of constants representing the allowable values for CreateCursorDetailsTypeEnum +const ( + CreateCursorDetailsTypeAfterOffset CreateCursorDetailsTypeEnum = "AFTER_OFFSET" + CreateCursorDetailsTypeAtOffset CreateCursorDetailsTypeEnum = "AT_OFFSET" + CreateCursorDetailsTypeAtTime CreateCursorDetailsTypeEnum = "AT_TIME" + CreateCursorDetailsTypeLatest CreateCursorDetailsTypeEnum = "LATEST" + CreateCursorDetailsTypeTrimHorizon CreateCursorDetailsTypeEnum = "TRIM_HORIZON" +) + +var mappingCreateCursorDetailsType = map[string]CreateCursorDetailsTypeEnum{ + "AFTER_OFFSET": CreateCursorDetailsTypeAfterOffset, + "AT_OFFSET": CreateCursorDetailsTypeAtOffset, + "AT_TIME": CreateCursorDetailsTypeAtTime, + "LATEST": CreateCursorDetailsTypeLatest, + "TRIM_HORIZON": CreateCursorDetailsTypeTrimHorizon, +} + +// GetCreateCursorDetailsTypeEnumValues Enumerates the set of values for CreateCursorDetailsTypeEnum +func GetCreateCursorDetailsTypeEnumValues() []CreateCursorDetailsTypeEnum { + values := make([]CreateCursorDetailsTypeEnum, 0) + for _, v := range mappingCreateCursorDetailsType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_cursor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateCursorRequest wrapper for the CreateCursor operation +type CreateCursorRequest struct { + + // The OCID of the stream to create a cursor for. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The information used to create the cursor. + CreateCursorDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateCursorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCursorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCursorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateCursorResponse wrapper for the CreateCursor operation +type CreateCursorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cursor instance + Cursor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateCursorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCursorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateGroupCursorDetails Object used to create a group cursor. +type CreateGroupCursorDetails struct { + + // The type of the cursor. This value is only used when the group is created. + Type CreateGroupCursorDetailsTypeEnum `mandatory:"true" json:"type"` + + // Name of the consumer group. + GroupName *string `mandatory:"true" json:"groupName"` + + // The time to consume from if type is AT_TIME. + Time *common.SDKTime `mandatory:"false" json:"time"` + + // A unique identifier for the instance joining the consumer group. If an instanceName is not provided, a UUID will be generated and used. + InstanceName *string `mandatory:"false" json:"instanceName"` + + // The amount of a consumer instance inactivity time, before partition reservations are released. + TimeoutInMs *int `mandatory:"false" json:"timeoutInMs"` + + // When using consumer-groups, the default commit-on-get behaviour can be overriden by setting this value to false. + // If disabled, a consumer must manually commit their cursors. + CommitOnGet *bool `mandatory:"false" json:"commitOnGet"` +} + +func (m CreateGroupCursorDetails) String() string { + return common.PointerString(m) +} + +// CreateGroupCursorDetailsTypeEnum Enum with underlying type: string +type CreateGroupCursorDetailsTypeEnum string + +// Set of constants representing the allowable values for CreateGroupCursorDetailsTypeEnum +const ( + CreateGroupCursorDetailsTypeAtTime CreateGroupCursorDetailsTypeEnum = "AT_TIME" + CreateGroupCursorDetailsTypeLatest CreateGroupCursorDetailsTypeEnum = "LATEST" + CreateGroupCursorDetailsTypeTrimHorizon CreateGroupCursorDetailsTypeEnum = "TRIM_HORIZON" +) + +var mappingCreateGroupCursorDetailsType = map[string]CreateGroupCursorDetailsTypeEnum{ + "AT_TIME": CreateGroupCursorDetailsTypeAtTime, + "LATEST": CreateGroupCursorDetailsTypeLatest, + "TRIM_HORIZON": CreateGroupCursorDetailsTypeTrimHorizon, +} + +// GetCreateGroupCursorDetailsTypeEnumValues Enumerates the set of values for CreateGroupCursorDetailsTypeEnum +func GetCreateGroupCursorDetailsTypeEnumValues() []CreateGroupCursorDetailsTypeEnum { + values := make([]CreateGroupCursorDetailsTypeEnum, 0) + for _, v := range mappingCreateGroupCursorDetailsType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_group_cursor_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateGroupCursorRequest wrapper for the CreateGroupCursor operation +type CreateGroupCursorRequest struct { + + // The OCID of the stream to create a cursor for. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The information used to create the cursor. + CreateGroupCursorDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateGroupCursorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateGroupCursorRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateGroupCursorRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateGroupCursorResponse wrapper for the CreateGroupCursor operation +type CreateGroupCursorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cursor instance + Cursor `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateGroupCursorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateGroupCursorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateStreamDetails Object used to create a stream. +type CreateStreamDetails struct { + + // The name of the stream. Avoid entering confidential information. + // Example: `TelemetryEvents` + Name *string `mandatory:"true" json:"name"` + + // The number of partitions in the stream. + Partitions *int `mandatory:"true" json:"partitions"` + + // The OCID of the compartment that contains the stream. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The retention period of the stream, in hours. Accepted values are between 24 and 168 (7 days). + // If not specified, the stream will have a retention period of 24 hours. + RetentionInHours *int `mandatory:"false" json:"retentionInHours"` + + // Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateStreamDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/create_stream_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateStreamRequest wrapper for the CreateStream operation +type CreateStreamRequest struct { + + // The stream to create. + CreateStreamDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateStreamRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateStreamRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateStreamRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateStreamResponse wrapper for the CreateStream operation +type CreateStreamResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stream instance + Stream `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateStreamResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateStreamResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/cursor.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/cursor.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/cursor.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/cursor.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Cursor A cursor that indicates the position in the stream from which you want to begin consuming messages and which is required by the GetMessages operation. +type Cursor struct { + + // The cursor to pass to the `GetMessages` operation. + Value *string `mandatory:"true" json:"value"` +} + +func (m Cursor) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/delete_stream_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/delete_stream_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/delete_stream_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/delete_stream_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteStreamRequest wrapper for the DeleteStream operation +type DeleteStreamRequest struct { + + // The OCID of the stream to delete. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteStreamRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteStreamRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteStreamRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteStreamResponse wrapper for the DeleteStream operation +type DeleteStreamResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteStreamResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteStreamResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetGroupRequest wrapper for the GetGroup operation +type GetGroupRequest struct { + + // The OCID of the stream, on which the group is operating. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The name of the consumer group. + GroupName *string `mandatory:"true" contributesTo:"path" name:"groupName"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetGroupResponse wrapper for the GetGroup operation +type GetGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Group instance + Group `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_messages_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_messages_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_messages_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_messages_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetMessagesRequest wrapper for the GetMessages operation +type GetMessagesRequest struct { + + // The OCID of the stream to get messages from. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The cursor used to consume the stream. + Cursor *string `mandatory:"true" contributesTo:"query" name:"cursor"` + + // The maximum number of messages to return. You can specify any value up to 10000. By default, the service returns as many messages as possible. + // Consider your average message size to help avoid exceeding throughput on the stream. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetMessagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMessagesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMessagesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetMessagesResponse wrapper for the GetMessages operation +type GetMessagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The []Message instance + Items []Message `presentIn:"body"` + + // The cursor to use to get the next batch of messages. + OpcNextCursor *string `presentIn:"header" name:"opc-next-cursor"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetMessagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMessagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_stream_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_stream_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_stream_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/get_stream_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetStreamRequest wrapper for the GetStream operation +type GetStreamRequest struct { + + // The OCID of the stream to retrieve. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetStreamRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetStreamRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetStreamRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetStreamResponse wrapper for the GetStream operation +type GetStreamResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stream instance + Stream `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetStreamResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetStreamResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/group.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/group.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/group.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/group.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Group Represents the current state of a consumer group, including partition reservations and committed offsets. +type Group struct { + + // The streamId for which the group exists. + StreamId *string `mandatory:"false" json:"streamId"` + + // The name of the consumer group. + GroupName *string `mandatory:"false" json:"groupName"` + + // An array of the partition reservations of a group. + Reservations []PartitionReservation `mandatory:"false" json:"reservations"` +} + +func (m Group) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/list_streams_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/list_streams_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/list_streams_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/list_streams_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListStreamsRequest wrapper for the ListStreams operation +type ListStreamsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given ID exactly. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // A filter to return only resources that match the given name exactly. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // The maximum number of items to return. The value must be between 1 and 50. The default is 10. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page at which to start retrieving results. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The field to sort by. You can provide no more than one sort order. By default, `TIMECREATED` sorts results in descending order and `NAME` sorts results in ascending order. + SortBy ListStreamsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListStreamsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. + LifecycleState StreamLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListStreamsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListStreamsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListStreamsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListStreamsResponse wrapper for the ListStreams operation +type ListStreamsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []StreamSummary instances + Items []StreamSummary `presentIn:"body"` + + // Pagination token + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Pagination token + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListStreamsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListStreamsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListStreamsSortByEnum Enum with underlying type: string +type ListStreamsSortByEnum string + +// Set of constants representing the allowable values for ListStreamsSortByEnum +const ( + ListStreamsSortByName ListStreamsSortByEnum = "NAME" + ListStreamsSortByTimecreated ListStreamsSortByEnum = "TIMECREATED" +) + +var mappingListStreamsSortBy = map[string]ListStreamsSortByEnum{ + "NAME": ListStreamsSortByName, + "TIMECREATED": ListStreamsSortByTimecreated, +} + +// GetListStreamsSortByEnumValues Enumerates the set of values for ListStreamsSortByEnum +func GetListStreamsSortByEnumValues() []ListStreamsSortByEnum { + values := make([]ListStreamsSortByEnum, 0) + for _, v := range mappingListStreamsSortBy { + values = append(values, v) + } + return values +} + +// ListStreamsSortOrderEnum Enum with underlying type: string +type ListStreamsSortOrderEnum string + +// Set of constants representing the allowable values for ListStreamsSortOrderEnum +const ( + ListStreamsSortOrderAsc ListStreamsSortOrderEnum = "ASC" + ListStreamsSortOrderDesc ListStreamsSortOrderEnum = "DESC" +) + +var mappingListStreamsSortOrder = map[string]ListStreamsSortOrderEnum{ + "ASC": ListStreamsSortOrderAsc, + "DESC": ListStreamsSortOrderDesc, +} + +// GetListStreamsSortOrderEnumValues Enumerates the set of values for ListStreamsSortOrderEnum +func GetListStreamsSortOrderEnumValues() []ListStreamsSortOrderEnum { + values := make([]ListStreamsSortOrderEnum, 0) + for _, v := range mappingListStreamsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/message.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/message.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/message.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/message.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Message A message in a stream. +type Message struct { + + // The name of the stream that the message belongs to. + Stream *string `mandatory:"true" json:"stream"` + + // The ID of the partition where the message is stored. + Partition *string `mandatory:"true" json:"partition"` + + // The key associated with the message, expressed as a byte array. + Key []byte `mandatory:"true" json:"key"` + + // The value associated with the message, expressed as a byte array. + Value []byte `mandatory:"true" json:"value"` + + // The offset of the message, which uniquely identifies it within the partition. + Offset *int64 `mandatory:"true" json:"offset"` + + // The timestamp indicating when the server appended the message to the stream. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m Message) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/partition_reservation.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/partition_reservation.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/partition_reservation.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/partition_reservation.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PartitionReservation Represents the state of a single partition reservation. +type PartitionReservation struct { + + // The partition for which the reservation applies. + Partition *string `mandatory:"false" json:"partition"` + + // The latest offset which has been committed for this partition. + CommittedOffset *int64 `mandatory:"false" json:"committedOffset"` + + // The consumer instance which currently has the partition reserved. + ReservedInstance *string `mandatory:"false" json:"reservedInstance"` + + // A timestamp when the current reservation expires. + TimeReservedUntil *common.SDKTime `mandatory:"false" json:"timeReservedUntil"` +} + +func (m PartitionReservation) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PutMessagesDetailsEntry Object that represents a message to emit to a stream. +type PutMessagesDetailsEntry struct { + + // The message, expressed as a byte array up to 1 MiB in size. + Value []byte `mandatory:"true" json:"value"` + + // The key of the message, expressed as a byte array up to 256 bytes in size. Messages with the same key are stored in the same partition. + Key []byte `mandatory:"false" json:"key"` +} + +func (m PutMessagesDetailsEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PutMessagesDetails Object that represents an array of messages to emit to a stream. +type PutMessagesDetails struct { + + // The array of messages to put into a stream. + Messages []PutMessagesDetailsEntry `mandatory:"true" json:"messages"` +} + +func (m PutMessagesDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// PutMessagesRequest wrapper for the PutMessages operation +type PutMessagesRequest struct { + + // The OCID of the stream where you want to put messages. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // Array of messages to put into the stream. + PutMessagesDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PutMessagesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PutMessagesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PutMessagesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// PutMessagesResponse wrapper for the PutMessages operation +type PutMessagesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PutMessagesResult instance + PutMessagesResult `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PutMessagesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PutMessagesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PutMessagesResultEntry Represents the result of a PutMessages request, whether it was successful or not. +// If a message was successfully appended to the stream, the entry includes the `offset`, `partition`, and `timestamp`. +// If the message failed to be appended to the stream, the entry includes the `error` and `errorMessage`. +type PutMessagesResultEntry struct { + + // The ID of the partition where the message was stored. + Partition *string `mandatory:"false" json:"partition"` + + // The offset of the message in the partition. + Offset *int64 `mandatory:"false" json:"offset"` + + // The timestamp indicating when the server appended the message to the stream. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` + + // The error code, in case the message was not successfully appended to the stream. + Error *string `mandatory:"false" json:"error"` + + // A human-readable error message associated with the error code. + ErrorMessage *string `mandatory:"false" json:"errorMessage"` +} + +func (m PutMessagesResultEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/put_messages_result.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PutMessagesResult The response to a PutMessages request. It indicates the number +// of failed messages as well as an array of results for successful and failed messages. +type PutMessagesResult struct { + + // The number of messages that failed to be added to the stream. + Failures *int `mandatory:"true" json:"failures"` + + // An array of items representing the result of each message. + // The order is guaranteed to be the same as in the `PutMessagesDetails` object. + // If a message was successfully appended to the stream, the entry includes the `offset`, `partition`, and `timestamp`. + // If a message failed to be appended to the stream, the entry includes the `error` and `errorMessage`. + Entries []PutMessagesResultEntry `mandatory:"false" json:"entries"` +} + +func (m PutMessagesResult) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Stream Detailed representation of a stream, including all its partitions. +type Stream struct { + + // The name of the stream. Avoid entering confidential information. + // Example: `TelemetryEvents` + Name *string `mandatory:"true" json:"name"` + + // The OCID of the stream. + Id *string `mandatory:"true" json:"id"` + + // The number of partitions in the stream. + Partitions *int `mandatory:"true" json:"partitions"` + + // The retention period of the stream, in hours. This property is read-only. + RetentionInHours *int `mandatory:"true" json:"retentionInHours"` + + // The OCID of the stream. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the stream. + LifecycleState StreamLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the stream was created, expressed in in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // Example: `2018-04-20T00:00:07.405Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The endpoint to use when creating the StreamClient to consume or publish messages in the stream. + MessagesEndpoint *string `mandatory:"true" json:"messagesEndpoint"` + + // Any additional details about the current state of the stream. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}' + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m Stream) String() string { + return common.PointerString(m) +} + +// StreamLifecycleStateEnum Enum with underlying type: string +type StreamLifecycleStateEnum string + +// Set of constants representing the allowable values for StreamLifecycleStateEnum +const ( + StreamLifecycleStateCreating StreamLifecycleStateEnum = "CREATING" + StreamLifecycleStateActive StreamLifecycleStateEnum = "ACTIVE" + StreamLifecycleStateDeleting StreamLifecycleStateEnum = "DELETING" + StreamLifecycleStateDeleted StreamLifecycleStateEnum = "DELETED" + StreamLifecycleStateFailed StreamLifecycleStateEnum = "FAILED" +) + +var mappingStreamLifecycleState = map[string]StreamLifecycleStateEnum{ + "CREATING": StreamLifecycleStateCreating, + "ACTIVE": StreamLifecycleStateActive, + "DELETING": StreamLifecycleStateDeleting, + "DELETED": StreamLifecycleStateDeleted, + "FAILED": StreamLifecycleStateFailed, +} + +// GetStreamLifecycleStateEnumValues Enumerates the set of values for StreamLifecycleStateEnum +func GetStreamLifecycleStateEnumValues() []StreamLifecycleStateEnum { + values := make([]StreamLifecycleStateEnum, 0) + for _, v := range mappingStreamLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_streamadmin_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_streamadmin_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_streamadmin_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_streamadmin_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,275 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//StreamAdminClient a client for StreamAdmin +type StreamAdminClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewStreamAdminClientWithConfigurationProvider Creates a new default StreamAdmin client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewStreamAdminClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client StreamAdminClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = StreamAdminClient{BaseClient: baseClient} + client.BasePath = "20180418" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *StreamAdminClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("streams", "https://streams.{region}.streaming.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *StreamAdminClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *StreamAdminClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateStream Starts the provisioning of a new stream. +// To track the progress of the provisioning, you can periodically call GetStream. +// In the response, the `lifecycleState` parameter of the Stream object tells you its current state. +func (client StreamAdminClient) CreateStream(ctx context.Context, request CreateStreamRequest) (response CreateStreamResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createStream, policy) + if err != nil { + if ociResponse != nil { + response = CreateStreamResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateStreamResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateStreamResponse") + } + return +} + +// createStream implements the OCIOperation interface (enables retrying operations) +func (client StreamAdminClient) createStream(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams") + if err != nil { + return nil, err + } + + var response CreateStreamResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteStream Deletes a stream and its content. Stream contents are deleted immediately. The service retains records of the stream itself for 90 days after deletion. +// The `lifeCycleState` parameter of the `Stream` object changes to `DELETING` and the stream becomes inaccessible for read or write operations. +// To verify that a stream has been deleted, make a GetStream request. If the call returns the stream's +// lifecycle state as `DELETED`, then the stream has been deleted. If the call returns a "404 Not Found" error, that means all records of the +// stream have been deleted. +func (client StreamAdminClient) DeleteStream(ctx context.Context, request DeleteStreamRequest) (response DeleteStreamResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteStream, policy) + if err != nil { + if ociResponse != nil { + response = DeleteStreamResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteStreamResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamResponse") + } + return +} + +// deleteStream implements the OCIOperation interface (enables retrying operations) +func (client StreamAdminClient) deleteStream(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streams/{streamId}") + if err != nil { + return nil, err + } + + var response DeleteStreamResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetStream Gets detailed information about a stream, including the number of partitions. +func (client StreamAdminClient) GetStream(ctx context.Context, request GetStreamRequest) (response GetStreamResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getStream, policy) + if err != nil { + if ociResponse != nil { + response = GetStreamResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetStreamResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetStreamResponse") + } + return +} + +// getStream implements the OCIOperation interface (enables retrying operations) +func (client StreamAdminClient) getStream(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streams/{streamId}") + if err != nil { + return nil, err + } + + var response GetStreamResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListStreams Lists the streams. +func (client StreamAdminClient) ListStreams(ctx context.Context, request ListStreamsRequest) (response ListStreamsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listStreams, policy) + if err != nil { + if ociResponse != nil { + response = ListStreamsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListStreamsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListStreamsResponse") + } + return +} + +// listStreams implements the OCIOperation interface (enables retrying operations) +func (client StreamAdminClient) listStreams(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streams") + if err != nil { + return nil, err + } + + var response ListStreamsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateStream Updates the tags applied to the stream. +func (client StreamAdminClient) UpdateStream(ctx context.Context, request UpdateStreamRequest) (response UpdateStreamResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateStream, policy) + if err != nil { + if ociResponse != nil { + response = UpdateStreamResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateStreamResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateStreamResponse") + } + return +} + +// updateStream implements the OCIOperation interface (enables retrying operations) +func (client StreamAdminClient) updateStream(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/streams/{streamId}") + if err != nil { + return nil, err + } + + var response UpdateStreamResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_stream_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_stream_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_stream_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/streaming_stream_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,415 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//StreamClient a client for Stream +type StreamClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewStreamClientWithConfigurationProvider Creates a new default Stream client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewStreamClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client StreamClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = StreamClient{BaseClient: baseClient} + client.BasePath = "20180418" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *StreamClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("streams", "https://streams.{region}.streaming.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *StreamClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *StreamClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ConsumerCommit Provides a mechanism to manually commit offsets, if not using commit-on-get consumer semantics. +// This commits offsets assicated with the provided cursor, extends the timeout on each of the affected partitions, and returns an updated cursor. +func (client StreamClient) ConsumerCommit(ctx context.Context, request ConsumerCommitRequest) (response ConsumerCommitResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.consumerCommit, policy) + if err != nil { + if ociResponse != nil { + response = ConsumerCommitResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ConsumerCommitResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConsumerCommitResponse") + } + return +} + +// consumerCommit implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) consumerCommit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams/{streamId}/commit") + if err != nil { + return nil, err + } + + var response ConsumerCommitResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ConsumerHeartbeat Allows long-running processes to extend the timeout on partitions reserved by a consumer instance. +func (client StreamClient) ConsumerHeartbeat(ctx context.Context, request ConsumerHeartbeatRequest) (response ConsumerHeartbeatResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.consumerHeartbeat, policy) + if err != nil { + if ociResponse != nil { + response = ConsumerHeartbeatResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ConsumerHeartbeatResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConsumerHeartbeatResponse") + } + return +} + +// consumerHeartbeat implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) consumerHeartbeat(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams/{streamId}/heartbeat") + if err != nil { + return nil, err + } + + var response ConsumerHeartbeatResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCursor Creates a cursor. Cursors are used to consume a stream, starting from a specific point in the partition and going forward from there. +// You can create a cursor based on an offset, a time, the trim horizon, or the most recent message in the stream. As the oldest message +// inside the retention period boundary, using the trim horizon effectively lets you consume all messages in the stream. A cursor based +// on the most recent message allows consumption of only messages that are added to the stream after you create the cursor. Cursors expire +// five minutes after you receive them from the service. +func (client StreamClient) CreateCursor(ctx context.Context, request CreateCursorRequest) (response CreateCursorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createCursor, policy) + if err != nil { + if ociResponse != nil { + response = CreateCursorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateCursorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCursorResponse") + } + return +} + +// createCursor implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) createCursor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams/{streamId}/cursors") + if err != nil { + return nil, err + } + + var response CreateCursorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateGroupCursor Creates a group-cursor. +func (client StreamClient) CreateGroupCursor(ctx context.Context, request CreateGroupCursorRequest) (response CreateGroupCursorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createGroupCursor, policy) + if err != nil { + if ociResponse != nil { + response = CreateGroupCursorResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateGroupCursorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateGroupCursorResponse") + } + return +} + +// createGroupCursor implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) createGroupCursor(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams/{streamId}/groupCursors") + if err != nil { + return nil, err + } + + var response CreateGroupCursorResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetGroup Returns the current state of a consumer group. +func (client StreamClient) GetGroup(ctx context.Context, request GetGroupRequest) (response GetGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getGroup, policy) + if err != nil { + if ociResponse != nil { + response = GetGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetGroupResponse") + } + return +} + +// getGroup implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) getGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streams/{streamId}/groups/{groupName}") + if err != nil { + return nil, err + } + + var response GetGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetMessages Returns messages from the specified stream using the specified cursor as the starting point for consumption. By default, the number of messages returned is undefined, but the service returns as many as possible. +// To get messages, you must first obtain a cursor using the CreateCursor operation. +// In the response, retrieve the value of the 'opc-next-cursor' header to pass as a parameter to get the next batch of messages in the stream. +func (client StreamClient) GetMessages(ctx context.Context, request GetMessagesRequest) (response GetMessagesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getMessages, policy) + if err != nil { + if ociResponse != nil { + response = GetMessagesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetMessagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMessagesResponse") + } + return +} + +// getMessages implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) getMessages(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streams/{streamId}/messages") + if err != nil { + return nil, err + } + + var response GetMessagesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PutMessages Emits messages to a stream. There's no limit to the number of messages in a request, but the total size of a message or request must be 1 MiB or less. +// The service calculates the partition ID from the message key and stores messages that share a key on the same partition. +// If a message does not contain a key or if the key is null, the service generates a message key for you. +// The partition ID cannot be passed as a parameter. +func (client StreamClient) PutMessages(ctx context.Context, request PutMessagesRequest) (response PutMessagesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.putMessages, policy) + if err != nil { + if ociResponse != nil { + response = PutMessagesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(PutMessagesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PutMessagesResponse") + } + return +} + +// putMessages implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) putMessages(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streams/{streamId}/messages") + if err != nil { + return nil, err + } + + var response PutMessagesResponse + var httpResponse *http.Response + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateGroup Forcefully changes the current location of a group as a whole; reseting processing location of all consumers to a particular location in the stream. +func (client StreamClient) UpdateGroup(ctx context.Context, request UpdateGroupRequest) (response UpdateGroupResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateGroup, policy) + if err != nil { + if ociResponse != nil { + response = UpdateGroupResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateGroupResponse") + } + return +} + +// updateGroup implements the OCIOperation interface (enables retrying operations) +func (client StreamClient) updateGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/streams/{streamId}/groups/{groupName}") + if err != nil { + return nil, err + } + + var response UpdateGroupResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/stream_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// StreamSummary Summary representation of a stream. +type StreamSummary struct { + + // The name of the stream. + // Example: `TelemetryEvents` + Name *string `mandatory:"true" json:"name"` + + // The OCID of the stream. + Id *string `mandatory:"true" json:"id"` + + // The number of partitions in the stream. + Partitions *int `mandatory:"true" json:"partitions"` + + // The OCID of the compartment that contains the stream. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The current state of the stream. + LifecycleState StreamSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the stream was created, expressed in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // Example: `2018-04-20T00:00:07.405Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The endpoint to use when creating the StreamClient to consume or publish messages in the stream. + MessagesEndpoint *string `mandatory:"true" json:"messagesEndpoint"` + + // Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m StreamSummary) String() string { + return common.PointerString(m) +} + +// StreamSummaryLifecycleStateEnum Enum with underlying type: string +type StreamSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for StreamSummaryLifecycleStateEnum +const ( + StreamSummaryLifecycleStateCreating StreamSummaryLifecycleStateEnum = "CREATING" + StreamSummaryLifecycleStateActive StreamSummaryLifecycleStateEnum = "ACTIVE" + StreamSummaryLifecycleStateDeleting StreamSummaryLifecycleStateEnum = "DELETING" + StreamSummaryLifecycleStateDeleted StreamSummaryLifecycleStateEnum = "DELETED" + StreamSummaryLifecycleStateFailed StreamSummaryLifecycleStateEnum = "FAILED" +) + +var mappingStreamSummaryLifecycleState = map[string]StreamSummaryLifecycleStateEnum{ + "CREATING": StreamSummaryLifecycleStateCreating, + "ACTIVE": StreamSummaryLifecycleStateActive, + "DELETING": StreamSummaryLifecycleStateDeleting, + "DELETED": StreamSummaryLifecycleStateDeleted, + "FAILED": StreamSummaryLifecycleStateFailed, +} + +// GetStreamSummaryLifecycleStateEnumValues Enumerates the set of values for StreamSummaryLifecycleStateEnum +func GetStreamSummaryLifecycleStateEnumValues() []StreamSummaryLifecycleStateEnum { + values := make([]StreamSummaryLifecycleStateEnum, 0) + for _, v := range mappingStreamSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateGroupDetails Request body for operationally managing a group. +type UpdateGroupDetails struct { + + // The type of the cursor. + Type UpdateGroupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` + + // The time to consume from if type is AT_TIME. + Time *common.SDKTime `mandatory:"false" json:"time"` +} + +func (m UpdateGroupDetails) String() string { + return common.PointerString(m) +} + +// UpdateGroupDetailsTypeEnum Enum with underlying type: string +type UpdateGroupDetailsTypeEnum string + +// Set of constants representing the allowable values for UpdateGroupDetailsTypeEnum +const ( + UpdateGroupDetailsTypeAtTime UpdateGroupDetailsTypeEnum = "AT_TIME" + UpdateGroupDetailsTypeLatest UpdateGroupDetailsTypeEnum = "LATEST" + UpdateGroupDetailsTypeTrimHorizon UpdateGroupDetailsTypeEnum = "TRIM_HORIZON" +) + +var mappingUpdateGroupDetailsType = map[string]UpdateGroupDetailsTypeEnum{ + "AT_TIME": UpdateGroupDetailsTypeAtTime, + "LATEST": UpdateGroupDetailsTypeLatest, + "TRIM_HORIZON": UpdateGroupDetailsTypeTrimHorizon, +} + +// GetUpdateGroupDetailsTypeEnumValues Enumerates the set of values for UpdateGroupDetailsTypeEnum +func GetUpdateGroupDetailsTypeEnumValues() []UpdateGroupDetailsTypeEnum { + values := make([]UpdateGroupDetailsTypeEnum, 0) + for _, v := range mappingUpdateGroupDetailsType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_group_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateGroupRequest wrapper for the UpdateGroup operation +type UpdateGroupRequest struct { + + // The OCID of the stream, on which the group is operating. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The name of the consumer group. + GroupName *string `mandatory:"true" contributesTo:"path" name:"groupName"` + + // The information used to modify the group. + UpdateGroupDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateGroupRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateGroupRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateGroupResponse wrapper for the UpdateGroup operation +type UpdateGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Streaming Service API +// +// The API for the Streaming Service. +// + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateStreamDetails Object used to update a stream. +type UpdateStreamDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateStreamDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/streaming/update_stream_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package streaming + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateStreamRequest wrapper for the UpdateStream operation +type UpdateStreamRequest struct { + + // The OCID of the stream to update. + StreamId *string `mandatory:"true" contributesTo:"path" name:"streamId"` + + // The stream is updated with the tags provided. + UpdateStreamDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateStreamRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateStreamRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateStreamRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateStreamResponse wrapper for the UpdateStream operation +type UpdateStreamResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Stream instance + Stream `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateStreamResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateStreamResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/accept_recommendations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/accept_recommendations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/accept_recommendations_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/accept_recommendations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// AcceptRecommendationsRequest wrapper for the AcceptRecommendations operation +type AcceptRecommendationsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + ProtectionRuleKeys *[]string `mandatory:"true" contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AcceptRecommendationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AcceptRecommendationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AcceptRecommendationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// AcceptRecommendationsResponse wrapper for the AcceptRecommendations operation +type AcceptRecommendationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response AcceptRecommendationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AcceptRecommendationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule_criteria.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule_criteria.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule_criteria.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule_criteria.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AccessRuleCriteria The representation of AccessRuleCriteria +type AccessRuleCriteria struct { + + // The criteria the access rule uses to determine if action should be taken on a request. + // - **URL_IS:** Matches if the concatenation of request URL path and query is identical to the contents of the `value` field. + // - **URL_IS_NOT:** Matches if the concatenation of request URL path and query is not identical to the contents of the `value` field. + // - **URL_STARTS_WITH:** Matches if the concatenation of request URL path and query starts with the contents of the `value` field. + // - **URL_PART_ENDS_WITH:** Matches if the concatenation of request URL path and query ends with the contents of the `value` field. + // - **URL_PART_CONTAINS:** Matches if the concatenation of request URL path and query contains the contents of the `value` field. + // - **URL_REGEX:** Matches if the request is described by the regular expression in the `value` field. + // - **IP_IS:** Matches if the request originates from an IP address in the `value` field. + // - **IP_IS_NOT:** Matches if the request does not originate from an IP address in the `value` field. + // - **HTTP_HEADER_CONTAINS:** Matches if the request includes an HTTP header field whose name and value correspond to data specified in the `value` field with a separating colon. **Example:** `host:test.example.com` where `host` is the name of the field and `test.example.com` is the value of the host field. Comparison is independently applied to every header field whose name is a case insensitive match, and the value is required to be case-sensitive identical. + // - **COUNTRY_IS:** Matches if the request originates from a country in the `value` field. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see ISO's website (https://www.iso.org/obp/ui/#search/code/). + // - **COUNTRY_IS_NOT:** Matches if the request does not originate from a country in the `value` field. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see ISO's website (https://www.iso.org/obp/ui/#search/code/). + // - **USER_AGENT_IS:** Matches if the requesting user agent is identical to the contents of the `value` field. Example: `Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0` + // - **USER_AGENT_IS_NOT:** Matches if the requesting user agent is not identical to the contents of the `value` field. Example: `Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0` + Condition AccessRuleCriteriaConditionEnum `mandatory:"true" json:"condition"` + + // The criteria value. + Value *string `mandatory:"true" json:"value"` +} + +func (m AccessRuleCriteria) String() string { + return common.PointerString(m) +} + +// AccessRuleCriteriaConditionEnum Enum with underlying type: string +type AccessRuleCriteriaConditionEnum string + +// Set of constants representing the allowable values for AccessRuleCriteriaConditionEnum +const ( + AccessRuleCriteriaConditionUrlIs AccessRuleCriteriaConditionEnum = "URL_IS" + AccessRuleCriteriaConditionUrlIsNot AccessRuleCriteriaConditionEnum = "URL_IS_NOT" + AccessRuleCriteriaConditionUrlStartsWith AccessRuleCriteriaConditionEnum = "URL_STARTS_WITH" + AccessRuleCriteriaConditionUrlPartEndsWith AccessRuleCriteriaConditionEnum = "URL_PART_ENDS_WITH" + AccessRuleCriteriaConditionUrlPartContains AccessRuleCriteriaConditionEnum = "URL_PART_CONTAINS" + AccessRuleCriteriaConditionUrlRegex AccessRuleCriteriaConditionEnum = "URL_REGEX" + AccessRuleCriteriaConditionIpIs AccessRuleCriteriaConditionEnum = "IP_IS" + AccessRuleCriteriaConditionIpIsNot AccessRuleCriteriaConditionEnum = "IP_IS_NOT" + AccessRuleCriteriaConditionHttpHeaderContains AccessRuleCriteriaConditionEnum = "HTTP_HEADER_CONTAINS" + AccessRuleCriteriaConditionCountryIs AccessRuleCriteriaConditionEnum = "COUNTRY_IS" + AccessRuleCriteriaConditionCountryIsNot AccessRuleCriteriaConditionEnum = "COUNTRY_IS_NOT" + AccessRuleCriteriaConditionUserAgentIs AccessRuleCriteriaConditionEnum = "USER_AGENT_IS" + AccessRuleCriteriaConditionUserAgentIsNot AccessRuleCriteriaConditionEnum = "USER_AGENT_IS_NOT" +) + +var mappingAccessRuleCriteriaCondition = map[string]AccessRuleCriteriaConditionEnum{ + "URL_IS": AccessRuleCriteriaConditionUrlIs, + "URL_IS_NOT": AccessRuleCriteriaConditionUrlIsNot, + "URL_STARTS_WITH": AccessRuleCriteriaConditionUrlStartsWith, + "URL_PART_ENDS_WITH": AccessRuleCriteriaConditionUrlPartEndsWith, + "URL_PART_CONTAINS": AccessRuleCriteriaConditionUrlPartContains, + "URL_REGEX": AccessRuleCriteriaConditionUrlRegex, + "IP_IS": AccessRuleCriteriaConditionIpIs, + "IP_IS_NOT": AccessRuleCriteriaConditionIpIsNot, + "HTTP_HEADER_CONTAINS": AccessRuleCriteriaConditionHttpHeaderContains, + "COUNTRY_IS": AccessRuleCriteriaConditionCountryIs, + "COUNTRY_IS_NOT": AccessRuleCriteriaConditionCountryIsNot, + "USER_AGENT_IS": AccessRuleCriteriaConditionUserAgentIs, + "USER_AGENT_IS_NOT": AccessRuleCriteriaConditionUserAgentIsNot, +} + +// GetAccessRuleCriteriaConditionEnumValues Enumerates the set of values for AccessRuleCriteriaConditionEnum +func GetAccessRuleCriteriaConditionEnumValues() []AccessRuleCriteriaConditionEnum { + values := make([]AccessRuleCriteriaConditionEnum, 0) + for _, v := range mappingAccessRuleCriteriaCondition { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/access_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AccessRule A content access rule. An access rule specifies an action to take if a set of criteria is matched by a request. +type AccessRule struct { + + // The unique name of the access rule. + Name *string `mandatory:"true" json:"name"` + + // The list of access rule criteria. + Criteria []AccessRuleCriteria `mandatory:"true" json:"criteria"` + + // The action to take when the access criteria are met for a rule. If unspecified, defaults to `ALLOW`. + Action AccessRuleActionEnum `mandatory:"true" json:"action"` + + // The method used to block requests if `action` is set to `BLOCK` and the access criteria are met. If unspecified, defaults to `SET_RESPONSE_CODE`. + BlockAction AccessRuleBlockActionEnum `mandatory:"false" json:"blockAction,omitempty"` + + // The response status code to return when `action` is set to `BLOCK`, `blockAction` is set to `SET_RESPONSE_CODE`, and the access criteria are met. If unspecified, defaults to `403`. + BlockResponseCode *int `mandatory:"false" json:"blockResponseCode"` + + // The message to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the access criteria are met. If unspecified, defaults to 'Access to the website is blocked.' + BlockErrorPageMessage *string `mandatory:"false" json:"blockErrorPageMessage"` + + // The error code to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the access criteria are met. If unspecified, defaults to 'Access rules'. + BlockErrorPageCode *string `mandatory:"false" json:"blockErrorPageCode"` + + // The description text to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the access criteria are met. If unspecified, defaults to 'Access blocked by website owner. Please contact support.' + BlockErrorPageDescription *string `mandatory:"false" json:"blockErrorPageDescription"` +} + +func (m AccessRule) String() string { + return common.PointerString(m) +} + +// AccessRuleActionEnum Enum with underlying type: string +type AccessRuleActionEnum string + +// Set of constants representing the allowable values for AccessRuleActionEnum +const ( + AccessRuleActionAllow AccessRuleActionEnum = "ALLOW" + AccessRuleActionDetect AccessRuleActionEnum = "DETECT" + AccessRuleActionBlock AccessRuleActionEnum = "BLOCK" +) + +var mappingAccessRuleAction = map[string]AccessRuleActionEnum{ + "ALLOW": AccessRuleActionAllow, + "DETECT": AccessRuleActionDetect, + "BLOCK": AccessRuleActionBlock, +} + +// GetAccessRuleActionEnumValues Enumerates the set of values for AccessRuleActionEnum +func GetAccessRuleActionEnumValues() []AccessRuleActionEnum { + values := make([]AccessRuleActionEnum, 0) + for _, v := range mappingAccessRuleAction { + values = append(values, v) + } + return values +} + +// AccessRuleBlockActionEnum Enum with underlying type: string +type AccessRuleBlockActionEnum string + +// Set of constants representing the allowable values for AccessRuleBlockActionEnum +const ( + AccessRuleBlockActionSetResponseCode AccessRuleBlockActionEnum = "SET_RESPONSE_CODE" + AccessRuleBlockActionShowErrorPage AccessRuleBlockActionEnum = "SHOW_ERROR_PAGE" +) + +var mappingAccessRuleBlockAction = map[string]AccessRuleBlockActionEnum{ + "SET_RESPONSE_CODE": AccessRuleBlockActionSetResponseCode, + "SHOW_ERROR_PAGE": AccessRuleBlockActionShowErrorPage, +} + +// GetAccessRuleBlockActionEnumValues Enumerates the set of values for AccessRuleBlockActionEnum +func GetAccessRuleBlockActionEnumValues() []AccessRuleBlockActionEnum { + values := make([]AccessRuleBlockActionEnum, 0) + for _, v := range mappingAccessRuleBlockAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/address_rate_limiting.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/address_rate_limiting.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/address_rate_limiting.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/address_rate_limiting.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// AddressRateLimiting The IP rate limiting configuration. Defines the amount of allowed requests from a unique IP address and the resulting block response code when that threshold is exceeded. +type AddressRateLimiting struct { + + // Enables or disables the address rate limiting Web Application Firewall feature. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The number of allowed requests per second from one IP address. If unspecified, defaults to `1`. + AllowedRatePerAddress *int `mandatory:"false" json:"allowedRatePerAddress"` + + // The maximum number of requests allowed to be queued before subsequent requests are dropped. If unspecified, defaults to `10`. + MaxDelayedCountPerAddress *int `mandatory:"false" json:"maxDelayedCountPerAddress"` + + // The response status code returned when a request is blocked. If unspecified, defaults to `503`. + BlockResponseCode *int `mandatory:"false" json:"blockResponseCode"` +} + +func (m AddressRateLimiting) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/block_challenge_settings.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/block_challenge_settings.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/block_challenge_settings.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/block_challenge_settings.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// BlockChallengeSettings The challenge settings if `action` is set to `BLOCK`. +type BlockChallengeSettings struct { + + // The method used to block requests that fail the challenge, if `action` is set to `BLOCK`. If unspecified, defaults to `SHOW_ERROR_PAGE`. + BlockAction BlockChallengeSettingsBlockActionEnum `mandatory:"false" json:"blockAction,omitempty"` + + // The response status code to return when `action` is set to `BLOCK`, `blockAction` is set to `SET_RESPONSE_CODE` or `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `403`. + BlockResponseCode *int `mandatory:"false" json:"blockResponseCode"` + + // The message to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `Access to the website is blocked`. + BlockErrorPageMessage *string `mandatory:"false" json:"blockErrorPageMessage"` + + // The description text to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `Access blocked by website owner. Please contact support.` + BlockErrorPageDescription *string `mandatory:"false" json:"blockErrorPageDescription"` + + // The error code to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE` and the request is blocked. If unspecified, defaults to `403`. + BlockErrorPageCode *string `mandatory:"false" json:"blockErrorPageCode"` + + // The title used when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Are you human?` + CaptchaTitle *string `mandatory:"false" json:"captchaTitle"` + + // The text to show in the header when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `We have detected an increased number of attempts to access this webapp. To help us keep this webapp secure, please let us know that you are not a robot by entering the text from captcha below.` + CaptchaHeader *string `mandatory:"false" json:"captchaHeader"` + + // The text to show in the footer when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, default to `Enter the letters and numbers as they are shown in image above`. + CaptchaFooter *string `mandatory:"false" json:"captchaFooter"` + + // The text to show on the label of the CAPTCHA challenge submit button when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Yes, I am human`. + CaptchaSubmitLabel *string `mandatory:"false" json:"captchaSubmitLabel"` +} + +func (m BlockChallengeSettings) String() string { + return common.PointerString(m) +} + +// BlockChallengeSettingsBlockActionEnum Enum with underlying type: string +type BlockChallengeSettingsBlockActionEnum string + +// Set of constants representing the allowable values for BlockChallengeSettingsBlockActionEnum +const ( + BlockChallengeSettingsBlockActionSetResponseCode BlockChallengeSettingsBlockActionEnum = "SET_RESPONSE_CODE" + BlockChallengeSettingsBlockActionShowErrorPage BlockChallengeSettingsBlockActionEnum = "SHOW_ERROR_PAGE" + BlockChallengeSettingsBlockActionShowCaptcha BlockChallengeSettingsBlockActionEnum = "SHOW_CAPTCHA" +) + +var mappingBlockChallengeSettingsBlockAction = map[string]BlockChallengeSettingsBlockActionEnum{ + "SET_RESPONSE_CODE": BlockChallengeSettingsBlockActionSetResponseCode, + "SHOW_ERROR_PAGE": BlockChallengeSettingsBlockActionShowErrorPage, + "SHOW_CAPTCHA": BlockChallengeSettingsBlockActionShowCaptcha, +} + +// GetBlockChallengeSettingsBlockActionEnumValues Enumerates the set of values for BlockChallengeSettingsBlockActionEnum +func GetBlockChallengeSettingsBlockActionEnumValues() []BlockChallengeSettingsBlockActionEnum { + values := make([]BlockChallengeSettingsBlockActionEnum, 0) + for _, v := range mappingBlockChallengeSettingsBlockAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/cancel_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/cancel_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/cancel_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/cancel_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +type CancelWorkRequestRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. This number is generated when work request is created. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/captcha.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/captcha.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/captcha.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/captcha.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Captcha The settings of the CAPTCHA challenge. If a specific URL should be accessed only by a human, a CAPTCHA challenge can be placed at the URL to protect the web application from bots. +// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type Captcha struct { + + // The unique URL path at which to show the CAPTCHA challenge. + Url *string `mandatory:"true" json:"url"` + + // The amount of time before the CAPTCHA expires, in seconds. If unspecified, defaults to `300`. + SessionExpirationInSeconds *int `mandatory:"true" json:"sessionExpirationInSeconds"` + + // The title used when displaying a CAPTCHA challenge. If unspecified, defaults to `Are you human?` + Title *string `mandatory:"true" json:"title"` + + // The text to show when incorrect CAPTCHA text is entered. If unspecified, defaults to `The CAPTCHA was incorrect. Try again.` + FailureMessage *string `mandatory:"true" json:"failureMessage"` + + // The text to show on the label of the CAPTCHA challenge submit button. If unspecified, defaults to `Yes, I am human`. + SubmitLabel *string `mandatory:"true" json:"submitLabel"` + + // The text to show in the header when showing a CAPTCHA challenge. If unspecified, defaults to 'We have detected an increased number of attempts to access this website. To help us keep this site secure, please let us know that you are not a robot by entering the text from the image below.' + HeaderText *string `mandatory:"false" json:"headerText"` + + // The text to show in the footer when showing a CAPTCHA challenge. If unspecified, defaults to 'Enter the letters and numbers as they are shown in the image above.' + FooterText *string `mandatory:"false" json:"footerText"` +} + +func (m Captcha) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_extensions.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_extensions.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_extensions.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_extensions.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CertificateExtensions The representation of CertificateExtensions +type CertificateExtensions struct { + Name *string `mandatory:"false" json:"name"` + + IsCritical *bool `mandatory:"false" json:"isCritical"` + + Value *string `mandatory:"false" json:"value"` +} + +func (m CertificateExtensions) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Certificate The details of the SSL certificate. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type Certificate struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the certificate. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the certificate's compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name of the certificate. + DisplayName *string `mandatory:"false" json:"displayName"` + + IssuedBy *string `mandatory:"false" json:"issuedBy"` + + SubjectName *CertificateSubjectName `mandatory:"false" json:"subjectName"` + + IssuerName *CertificateSubjectName `mandatory:"false" json:"issuerName"` + + SerialNumber *string `mandatory:"false" json:"serialNumber"` + + Version *int `mandatory:"false" json:"version"` + + SignatureAlgorithm *string `mandatory:"false" json:"signatureAlgorithm"` + + TimeNotValidBefore *common.SDKTime `mandatory:"false" json:"timeNotValidBefore"` + + // The date and time the certificate will expire, expressed in RFC 3339 timestamp format. + TimeNotValidAfter *common.SDKTime `mandatory:"false" json:"timeNotValidAfter"` + + PublicKeyInfo *CertificatePublicKeyInfo `mandatory:"false" json:"publicKeyInfo"` + + Extensions []CertificateExtensions `mandatory:"false" json:"extensions"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The current lifecycle state of the SSL certificate. + LifecycleState CertificateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The date and time the certificate was created, expressed in RFC 3339 timestamp format. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m Certificate) String() string { + return common.PointerString(m) +} + +// CertificateLifecycleStateEnum Enum with underlying type: string +type CertificateLifecycleStateEnum string + +// Set of constants representing the allowable values for CertificateLifecycleStateEnum +const ( + CertificateLifecycleStateCreating CertificateLifecycleStateEnum = "CREATING" + CertificateLifecycleStateActive CertificateLifecycleStateEnum = "ACTIVE" + CertificateLifecycleStateFailed CertificateLifecycleStateEnum = "FAILED" + CertificateLifecycleStateUpdating CertificateLifecycleStateEnum = "UPDATING" + CertificateLifecycleStateDeleting CertificateLifecycleStateEnum = "DELETING" + CertificateLifecycleStateDeleted CertificateLifecycleStateEnum = "DELETED" +) + +var mappingCertificateLifecycleState = map[string]CertificateLifecycleStateEnum{ + "CREATING": CertificateLifecycleStateCreating, + "ACTIVE": CertificateLifecycleStateActive, + "FAILED": CertificateLifecycleStateFailed, + "UPDATING": CertificateLifecycleStateUpdating, + "DELETING": CertificateLifecycleStateDeleting, + "DELETED": CertificateLifecycleStateDeleted, +} + +// GetCertificateLifecycleStateEnumValues Enumerates the set of values for CertificateLifecycleStateEnum +func GetCertificateLifecycleStateEnumValues() []CertificateLifecycleStateEnum { + values := make([]CertificateLifecycleStateEnum, 0) + for _, v := range mappingCertificateLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_public_key_info.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_public_key_info.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_public_key_info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_public_key_info.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CertificatePublicKeyInfo The representation of CertificatePublicKeyInfo +type CertificatePublicKeyInfo struct { + Algorithm *string `mandatory:"false" json:"algorithm"` + + Exponent *int `mandatory:"false" json:"exponent"` + + KeySize *int `mandatory:"false" json:"keySize"` +} + +func (m CertificatePublicKeyInfo) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_subject_name.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_subject_name.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_subject_name.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_subject_name.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,34 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CertificateSubjectName The representation of CertificateSubjectName +type CertificateSubjectName struct { + Country *string `mandatory:"false" json:"country"` + + StateProvince *string `mandatory:"false" json:"stateProvince"` + + Locality *string `mandatory:"false" json:"locality"` + + Organization *string `mandatory:"false" json:"organization"` + + OrganizationalUnit *string `mandatory:"false" json:"organizationalUnit"` + + CommonName *string `mandatory:"false" json:"commonName"` + + EmailAddress *string `mandatory:"false" json:"emailAddress"` +} + +func (m CertificateSubjectName) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/certificate_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CertificateSummary A summary of the SSL certificate's information. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CertificateSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SSL certificate. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SSL certificate's compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name of the SSL certificate. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The date and time the certificate will expire, expressed in RFC 3339 timestamp format. + TimeNotValidAfter *common.SDKTime `mandatory:"false" json:"timeNotValidAfter"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The current lifecycle state of the certificate. + LifecycleState CertificateSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The date and time the certificate was created, in the format defined by RFC3339. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m CertificateSummary) String() string { + return common.PointerString(m) +} + +// CertificateSummaryLifecycleStateEnum Enum with underlying type: string +type CertificateSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for CertificateSummaryLifecycleStateEnum +const ( + CertificateSummaryLifecycleStateCreating CertificateSummaryLifecycleStateEnum = "CREATING" + CertificateSummaryLifecycleStateActive CertificateSummaryLifecycleStateEnum = "ACTIVE" + CertificateSummaryLifecycleStateFailed CertificateSummaryLifecycleStateEnum = "FAILED" + CertificateSummaryLifecycleStateUpdating CertificateSummaryLifecycleStateEnum = "UPDATING" + CertificateSummaryLifecycleStateDeleting CertificateSummaryLifecycleStateEnum = "DELETING" + CertificateSummaryLifecycleStateDeleted CertificateSummaryLifecycleStateEnum = "DELETED" +) + +var mappingCertificateSummaryLifecycleState = map[string]CertificateSummaryLifecycleStateEnum{ + "CREATING": CertificateSummaryLifecycleStateCreating, + "ACTIVE": CertificateSummaryLifecycleStateActive, + "FAILED": CertificateSummaryLifecycleStateFailed, + "UPDATING": CertificateSummaryLifecycleStateUpdating, + "DELETING": CertificateSummaryLifecycleStateDeleting, + "DELETED": CertificateSummaryLifecycleStateDeleted, +} + +// GetCertificateSummaryLifecycleStateEnumValues Enumerates the set of values for CertificateSummaryLifecycleStateEnum +func GetCertificateSummaryLifecycleStateEnumValues() []CertificateSummaryLifecycleStateEnum { + values := make([]CertificateSummaryLifecycleStateEnum, 0) + for _, v := range mappingCertificateSummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateCertificateDetails The data used to create a new SSL certificate. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateCertificateDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the SSL certificate. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The data of the SSL certificate. + CertificateData *string `mandatory:"true" json:"certificateData"` + + // The private key of the SSL certificate. + PrivateKeyData *string `mandatory:"true" json:"privateKeyData"` + + // A user-friendly name for the SSL certificate. The name can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Set to true if the SSL certificate is self-signed. + IsTrustVerificationDisabled *bool `mandatory:"false" json:"isTrustVerificationDisabled"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateCertificateDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateCertificateRequest wrapper for the CreateCertificate operation +type CreateCertificateRequest struct { + + // The details of the SSL certificate resource to create. + CreateCertificateDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateCertificateResponse wrapper for the CreateCertificate operation +type CreateCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// CreateWaasPolicyDetails The required data to create a WAAS policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type CreateWaasPolicyDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the WAAS policy. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The web application domain that the WAAS policy protects. + Domain *string `mandatory:"true" json:"domain"` + + // A user-friendly name for the WAAS policy. The name is can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // An array of additional domains for the specified web application. + AdditionalDomains []string `mandatory:"false" json:"additionalDomains"` + + // A map of host to origin for the web application. The key should be a customer friendly name for the host, ex. primary, secondary, etc. + Origins map[string]Origin `mandatory:"false" json:"origins"` + + PolicyConfig *PolicyConfig `mandatory:"false" json:"policyConfig"` + + WafConfig *WafConfigDetails `mandatory:"false" json:"wafConfig"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateWaasPolicyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/create_waas_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// CreateWaasPolicyRequest wrapper for the CreateWaasPolicy operation +type CreateWaasPolicyRequest struct { + + // The details of the WAAS policy. + CreateWaasPolicyDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateWaasPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateWaasPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateWaasPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// CreateWaasPolicyResponse wrapper for the CreateWaasPolicy operation +type CreateWaasPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateWaasPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateWaasPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_certificate_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteCertificateRequest wrapper for the DeleteCertificate operation +type DeleteCertificateRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteCertificateResponse wrapper for the DeleteCertificate operation +type DeleteCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_waas_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_waas_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_waas_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/delete_waas_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// DeleteWaasPolicyRequest wrapper for the DeleteWaasPolicy operation +type DeleteWaasPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteWaasPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteWaasPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteWaasPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// DeleteWaasPolicyResponse wrapper for the DeleteWaasPolicy operation +type DeleteWaasPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteWaasPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteWaasPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/device_fingerprint_challenge.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/device_fingerprint_challenge.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/device_fingerprint_challenge.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/device_fingerprint_challenge.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// DeviceFingerprintChallenge The device fingerprint challenge settings. The device fingerprint challenge generates hashed signatures of both virtual and real browsers to identify and block malicious bots. +type DeviceFingerprintChallenge struct { + + // Enables or disables the device fingerprint challenge Web Application Firewall feature. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The action to take on requests from detected bots. If unspecified, defaults to `DETECT`. + Action DeviceFingerprintChallengeActionEnum `mandatory:"false" json:"action,omitempty"` + + // The number of failed requests allowed before taking action. If unspecified, defaults to `10`. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // The number of seconds between challenges for the same IP address. If unspecified, defaults to `60`. + ActionExpirationInSeconds *int `mandatory:"false" json:"actionExpirationInSeconds"` + + // The number of seconds before the failure threshold resets. If unspecified, defaults to `60`. + FailureThresholdExpirationInSeconds *int `mandatory:"false" json:"failureThresholdExpirationInSeconds"` + + // The maximum number of IP addresses permitted with the same device fingerprint. If unspecified, defaults to `20`. + MaxAddressCount *int `mandatory:"false" json:"maxAddressCount"` + + // The number of seconds before the maximum addresses count resets. If unspecified, defaults to `60`. + MaxAddressCountExpirationInSeconds *int `mandatory:"false" json:"maxAddressCountExpirationInSeconds"` + + ChallengeSettings *BlockChallengeSettings `mandatory:"false" json:"challengeSettings"` +} + +func (m DeviceFingerprintChallenge) String() string { + return common.PointerString(m) +} + +// DeviceFingerprintChallengeActionEnum Enum with underlying type: string +type DeviceFingerprintChallengeActionEnum string + +// Set of constants representing the allowable values for DeviceFingerprintChallengeActionEnum +const ( + DeviceFingerprintChallengeActionDetect DeviceFingerprintChallengeActionEnum = "DETECT" + DeviceFingerprintChallengeActionBlock DeviceFingerprintChallengeActionEnum = "BLOCK" +) + +var mappingDeviceFingerprintChallengeAction = map[string]DeviceFingerprintChallengeActionEnum{ + "DETECT": DeviceFingerprintChallengeActionDetect, + "BLOCK": DeviceFingerprintChallengeActionBlock, +} + +// GetDeviceFingerprintChallengeActionEnumValues Enumerates the set of values for DeviceFingerprintChallengeActionEnum +func GetDeviceFingerprintChallengeActionEnumValues() []DeviceFingerprintChallengeActionEnum { + values := make([]DeviceFingerprintChallengeActionEnum, 0) + for _, v := range mappingDeviceFingerprintChallengeAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/edge_subnet.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/edge_subnet.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/edge_subnet.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/edge_subnet.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// EdgeSubnet The details about an edge node subnet. +type EdgeSubnet struct { + + // An edge node subnet. This can include /24 or /8 addresses. + Cidr *string `mandatory:"false" json:"cidr"` + + // The date and time the last change was made to the indicated edge node subnet, expressed in RFC 3339 timestamp format. + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` + + // The name of the region containing the indicated subnet. + Region *string `mandatory:"false" json:"region"` +} + +func (m EdgeSubnet) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_certificate_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetCertificateRequest wrapper for the GetCertificate operation +type GetCertificateRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetCertificateResponse wrapper for the GetCertificate operation +type GetCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_device_fingerprint_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_device_fingerprint_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_device_fingerprint_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_device_fingerprint_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetDeviceFingerprintChallengeRequest wrapper for the GetDeviceFingerprintChallenge operation +type GetDeviceFingerprintChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDeviceFingerprintChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDeviceFingerprintChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDeviceFingerprintChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetDeviceFingerprintChallengeResponse wrapper for the GetDeviceFingerprintChallenge operation +type GetDeviceFingerprintChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DeviceFingerprintChallenge instance + DeviceFingerprintChallenge `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetDeviceFingerprintChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDeviceFingerprintChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_human_interaction_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_human_interaction_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_human_interaction_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_human_interaction_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetHumanInteractionChallengeRequest wrapper for the GetHumanInteractionChallenge operation +type GetHumanInteractionChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetHumanInteractionChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHumanInteractionChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHumanInteractionChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetHumanInteractionChallengeResponse wrapper for the GetHumanInteractionChallenge operation +type GetHumanInteractionChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HumanInteractionChallenge instance + HumanInteractionChallenge `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetHumanInteractionChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHumanInteractionChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_js_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_js_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_js_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_js_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetJsChallengeRequest wrapper for the GetJsChallenge operation +type GetJsChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetJsChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetJsChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetJsChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetJsChallengeResponse wrapper for the GetJsChallenge operation +type GetJsChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The JsChallenge instance + JsChallenge `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetJsChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetJsChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_policy_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_policy_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_policy_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_policy_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetPolicyConfigRequest wrapper for the GetPolicyConfig operation +type GetPolicyConfigRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPolicyConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPolicyConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPolicyConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetPolicyConfigResponse wrapper for the GetPolicyConfig operation +type GetPolicyConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PolicyConfig instance + PolicyConfig `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetPolicyConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPolicyConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_rule_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_rule_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_rule_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_rule_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetProtectionRuleRequest wrapper for the GetProtectionRule operation +type GetProtectionRuleRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The protection rule key. + ProtectionRuleKey *string `mandatory:"true" contributesTo:"path" name:"protectionRuleKey"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetProtectionRuleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetProtectionRuleRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetProtectionRuleRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetProtectionRuleResponse wrapper for the GetProtectionRule operation +type GetProtectionRuleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ProtectionRule instance + ProtectionRule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetProtectionRuleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetProtectionRuleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_settings_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_settings_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_settings_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_protection_settings_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetProtectionSettingsRequest wrapper for the GetProtectionSettings operation +type GetProtectionSettingsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetProtectionSettingsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetProtectionSettingsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetProtectionSettingsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetProtectionSettingsResponse wrapper for the GetProtectionSettings operation +type GetProtectionSettingsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ProtectionSettings instance + ProtectionSettings `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetProtectionSettingsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetProtectionSettingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waas_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waas_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waas_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waas_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWaasPolicyRequest wrapper for the GetWaasPolicy operation +type GetWaasPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWaasPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWaasPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWaasPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWaasPolicyResponse wrapper for the GetWaasPolicy operation +type GetWaasPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WaasPolicy instance + WaasPolicy `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetWaasPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWaasPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_address_rate_limiting_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_address_rate_limiting_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_address_rate_limiting_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_address_rate_limiting_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWafAddressRateLimitingRequest wrapper for the GetWafAddressRateLimiting operation +type GetWafAddressRateLimitingRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWafAddressRateLimitingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWafAddressRateLimitingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWafAddressRateLimitingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWafAddressRateLimitingResponse wrapper for the GetWafAddressRateLimiting operation +type GetWafAddressRateLimitingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AddressRateLimiting instance + AddressRateLimiting `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetWafAddressRateLimitingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWafAddressRateLimitingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_waf_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWafConfigRequest wrapper for the GetWafConfig operation +type GetWafConfigRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWafConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWafConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWafConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWafConfigResponse wrapper for the GetWafConfig operation +type GetWafConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WafConfig instance + WafConfig `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetWafConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWafConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_work_request_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_work_request_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_work_request_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/get_work_request_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +type GetWorkRequestRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. This number is generated when work request is created. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *float32 `presentIn:"header" name:"retry-after"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/good_bot.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/good_bot.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/good_bot.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/good_bot.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// GoodBot The good bot settings. Good bots provides a list of bots which are managed by known providers. +type GoodBot struct { + + // The unique key for the bot. + Key *string `mandatory:"true" json:"key"` + + // Enables or disables the bot. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The bot name. + Name *string `mandatory:"false" json:"name"` + + // The description of the bot. + Description *string `mandatory:"false" json:"description"` +} + +func (m GoodBot) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/header.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/header.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/header.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/header.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Header An HTTP header name and value. You can configure your origin server to only allow requests that contain the custom header values that you specify. +type Header struct { + + // The name of the header. + Name *string `mandatory:"true" json:"name"` + + // The value of the header. + Value *string `mandatory:"true" json:"value"` +} + +func (m Header) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/human_interaction_challenge.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/human_interaction_challenge.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/human_interaction_challenge.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/human_interaction_challenge.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// HumanInteractionChallenge The human interaction challenge settings. The human interaction challenge checks various event listeners in the user's browser to determine if there is a human user making a request. +type HumanInteractionChallenge struct { + + // Enables or disables the human interaction challenge Web Application Firewall feature. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The action to take against requests from detected bots. If unspecified, defaults to `DETECT`. + Action HumanInteractionChallengeActionEnum `mandatory:"false" json:"action,omitempty"` + + // The number of failed requests before taking action. If unspecified, defaults to `10`. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // The number of seconds between challenges for the same IP address. If unspecified, defaults to `60`. + ActionExpirationInSeconds *int `mandatory:"false" json:"actionExpirationInSeconds"` + + // The number of seconds before the failure threshold resets. If unspecified, defaults to `60`. + FailureThresholdExpirationInSeconds *int `mandatory:"false" json:"failureThresholdExpirationInSeconds"` + + // The number of interactions required to pass the challenge. If unspecified, defaults to `3`. + InteractionThreshold *int `mandatory:"false" json:"interactionThreshold"` + + // The number of seconds to record the interactions from the user. If unspecified, defaults to `15`. + RecordingPeriodInSeconds *int `mandatory:"false" json:"recordingPeriodInSeconds"` + + // Adds an additional HTTP header to requests that fail the challenge before being passed to the origin. Only applicable when the `action` is set to `DETECT`. + SetHttpHeader *Header `mandatory:"false" json:"setHttpHeader"` + + ChallengeSettings *BlockChallengeSettings `mandatory:"false" json:"challengeSettings"` +} + +func (m HumanInteractionChallenge) String() string { + return common.PointerString(m) +} + +// HumanInteractionChallengeActionEnum Enum with underlying type: string +type HumanInteractionChallengeActionEnum string + +// Set of constants representing the allowable values for HumanInteractionChallengeActionEnum +const ( + HumanInteractionChallengeActionDetect HumanInteractionChallengeActionEnum = "DETECT" + HumanInteractionChallengeActionBlock HumanInteractionChallengeActionEnum = "BLOCK" +) + +var mappingHumanInteractionChallengeAction = map[string]HumanInteractionChallengeActionEnum{ + "DETECT": HumanInteractionChallengeActionDetect, + "BLOCK": HumanInteractionChallengeActionBlock, +} + +// GetHumanInteractionChallengeActionEnumValues Enumerates the set of values for HumanInteractionChallengeActionEnum +func GetHumanInteractionChallengeActionEnumValues() []HumanInteractionChallengeActionEnum { + values := make([]HumanInteractionChallengeActionEnum, 0) + for _, v := range mappingHumanInteractionChallengeAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/js_challenge.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/js_challenge.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/js_challenge.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/js_challenge.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// JsChallenge The JavaScript challenge settings. Javascript Challenge is the function to filter abnormal or malicious bots and allow access to real clients. +type JsChallenge struct { + + // Enables or disables the JavaScript challenge Web Application Firewall feature. + IsEnabled *bool `mandatory:"true" json:"isEnabled"` + + // The action to take against requests from detected bots. If unspecified, defaults to `DETECT`. + Action JsChallengeActionEnum `mandatory:"false" json:"action,omitempty"` + + // The number of failed requests before taking action. If unspecified, defaults to `10`. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // The number of seconds between challenges from the same IP address. If unspecified, defaults to `60`. + ActionExpirationInSeconds *int `mandatory:"false" json:"actionExpirationInSeconds"` + + // Adds an additional HTTP header to requests that fail the challenge before being passed to the origin. Only applicable when the `action` is set to `DETECT`. + SetHttpHeader *Header `mandatory:"false" json:"setHttpHeader"` + + ChallengeSettings *BlockChallengeSettings `mandatory:"false" json:"challengeSettings"` +} + +func (m JsChallenge) String() string { + return common.PointerString(m) +} + +// JsChallengeActionEnum Enum with underlying type: string +type JsChallengeActionEnum string + +// Set of constants representing the allowable values for JsChallengeActionEnum +const ( + JsChallengeActionDetect JsChallengeActionEnum = "DETECT" + JsChallengeActionBlock JsChallengeActionEnum = "BLOCK" +) + +var mappingJsChallengeAction = map[string]JsChallengeActionEnum{ + "DETECT": JsChallengeActionDetect, + "BLOCK": JsChallengeActionBlock, +} + +// GetJsChallengeActionEnumValues Enumerates the set of values for JsChallengeActionEnum +func GetJsChallengeActionEnumValues() []JsChallengeActionEnum { + values := make([]JsChallengeActionEnum, 0) + for _, v := range mappingJsChallengeAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/lifecycle_states.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/lifecycle_states.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/lifecycle_states.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/lifecycle_states.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// LifecycleStates The current status of the specified WAAS policy. +type LifecycleStates struct { +} + +func (m LifecycleStates) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_access_rules_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_access_rules_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_access_rules_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_access_rules_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListAccessRulesRequest wrapper for the ListAccessRules operation +type ListAccessRulesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListAccessRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAccessRulesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAccessRulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListAccessRulesResponse wrapper for the ListAccessRules operation +type ListAccessRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []AccessRule instances + Items []AccessRule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListAccessRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAccessRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_captchas_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_captchas_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_captchas_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_captchas_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListCaptchasRequest wrapper for the ListCaptchas operation +type ListCaptchasRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCaptchasRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCaptchasRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCaptchasRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListCaptchasResponse wrapper for the ListCaptchas operation +type ListCaptchasResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Captcha instances + Items []Captcha `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListCaptchasResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCaptchasResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_certificates_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_certificates_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_certificates_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_certificates_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListCertificatesRequest wrapper for the ListCertificates operation +type ListCertificatesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. This number is generated when the compartment is created. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The value by which certificate summaries are sorted in a paginated 'List' call. If unspecified, defaults to `timeCreated`. + SortBy ListCertificatesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. + SortOrder ListCertificatesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filter certificates using a list of certificates OCIDs. + Id []string `contributesTo:"query" name:"id" collectionFormat:"multi"` + + // Filter certificates using a list of display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // Filter certificates using a list of lifecycle states. + LifecycleState []string `contributesTo:"query" name:"lifecycleState" collectionFormat:"multi"` + + // A filter that matches certificates created on or after the specified date-time. + TimeCreatedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedGreaterThanOrEqualTo"` + + // A filter that matches certificates created before the specified date-time. + TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCertificatesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCertificatesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCertificatesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListCertificatesResponse wrapper for the ListCertificates operation +type ListCertificatesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []CertificateSummary instances + Items []CertificateSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListCertificatesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCertificatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCertificatesSortByEnum Enum with underlying type: string +type ListCertificatesSortByEnum string + +// Set of constants representing the allowable values for ListCertificatesSortByEnum +const ( + ListCertificatesSortById ListCertificatesSortByEnum = "id" + ListCertificatesSortByCompartmentid ListCertificatesSortByEnum = "compartmentId" + ListCertificatesSortByDisplayname ListCertificatesSortByEnum = "displayName" + ListCertificatesSortByNotvalidafter ListCertificatesSortByEnum = "notValidAfter" + ListCertificatesSortByTimecreated ListCertificatesSortByEnum = "timeCreated" +) + +var mappingListCertificatesSortBy = map[string]ListCertificatesSortByEnum{ + "id": ListCertificatesSortById, + "compartmentId": ListCertificatesSortByCompartmentid, + "displayName": ListCertificatesSortByDisplayname, + "notValidAfter": ListCertificatesSortByNotvalidafter, + "timeCreated": ListCertificatesSortByTimecreated, +} + +// GetListCertificatesSortByEnumValues Enumerates the set of values for ListCertificatesSortByEnum +func GetListCertificatesSortByEnumValues() []ListCertificatesSortByEnum { + values := make([]ListCertificatesSortByEnum, 0) + for _, v := range mappingListCertificatesSortBy { + values = append(values, v) + } + return values +} + +// ListCertificatesSortOrderEnum Enum with underlying type: string +type ListCertificatesSortOrderEnum string + +// Set of constants representing the allowable values for ListCertificatesSortOrderEnum +const ( + ListCertificatesSortOrderAsc ListCertificatesSortOrderEnum = "ASC" + ListCertificatesSortOrderDesc ListCertificatesSortOrderEnum = "DESC" +) + +var mappingListCertificatesSortOrder = map[string]ListCertificatesSortOrderEnum{ + "ASC": ListCertificatesSortOrderAsc, + "DESC": ListCertificatesSortOrderDesc, +} + +// GetListCertificatesSortOrderEnumValues Enumerates the set of values for ListCertificatesSortOrderEnum +func GetListCertificatesSortOrderEnumValues() []ListCertificatesSortOrderEnum { + values := make([]ListCertificatesSortOrderEnum, 0) + for _, v := range mappingListCertificatesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_edge_subnets_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_edge_subnets_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_edge_subnets_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_edge_subnets_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,119 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListEdgeSubnetsRequest wrapper for the ListEdgeSubnets operation +type ListEdgeSubnetsRequest struct { + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The value by which edge node subnets are sorted in a paginated 'List' call. If unspecified, defaults to `timeModified`. + SortBy ListEdgeSubnetsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. + SortOrder ListEdgeSubnetsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListEdgeSubnetsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListEdgeSubnetsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListEdgeSubnetsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListEdgeSubnetsResponse wrapper for the ListEdgeSubnets operation +type ListEdgeSubnetsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []EdgeSubnet instances + Items []EdgeSubnet `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, then a partial list might have been returned. Include this value as the `page` parameter for the subsequent `GET` request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListEdgeSubnetsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListEdgeSubnetsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListEdgeSubnetsSortByEnum Enum with underlying type: string +type ListEdgeSubnetsSortByEnum string + +// Set of constants representing the allowable values for ListEdgeSubnetsSortByEnum +const ( + ListEdgeSubnetsSortByCidr ListEdgeSubnetsSortByEnum = "cidr" + ListEdgeSubnetsSortByRegion ListEdgeSubnetsSortByEnum = "region" + ListEdgeSubnetsSortByTimemodified ListEdgeSubnetsSortByEnum = "timeModified" +) + +var mappingListEdgeSubnetsSortBy = map[string]ListEdgeSubnetsSortByEnum{ + "cidr": ListEdgeSubnetsSortByCidr, + "region": ListEdgeSubnetsSortByRegion, + "timeModified": ListEdgeSubnetsSortByTimemodified, +} + +// GetListEdgeSubnetsSortByEnumValues Enumerates the set of values for ListEdgeSubnetsSortByEnum +func GetListEdgeSubnetsSortByEnumValues() []ListEdgeSubnetsSortByEnum { + values := make([]ListEdgeSubnetsSortByEnum, 0) + for _, v := range mappingListEdgeSubnetsSortBy { + values = append(values, v) + } + return values +} + +// ListEdgeSubnetsSortOrderEnum Enum with underlying type: string +type ListEdgeSubnetsSortOrderEnum string + +// Set of constants representing the allowable values for ListEdgeSubnetsSortOrderEnum +const ( + ListEdgeSubnetsSortOrderAsc ListEdgeSubnetsSortOrderEnum = "ASC" + ListEdgeSubnetsSortOrderDesc ListEdgeSubnetsSortOrderEnum = "DESC" +) + +var mappingListEdgeSubnetsSortOrder = map[string]ListEdgeSubnetsSortOrderEnum{ + "ASC": ListEdgeSubnetsSortOrderAsc, + "DESC": ListEdgeSubnetsSortOrderDesc, +} + +// GetListEdgeSubnetsSortOrderEnumValues Enumerates the set of values for ListEdgeSubnetsSortOrderEnum +func GetListEdgeSubnetsSortOrderEnumValues() []ListEdgeSubnetsSortOrderEnum { + values := make([]ListEdgeSubnetsSortOrderEnum, 0) + for _, v := range mappingListEdgeSubnetsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_good_bots_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_good_bots_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_good_bots_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_good_bots_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListGoodBotsRequest wrapper for the ListGoodBots operation +type ListGoodBotsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListGoodBotsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListGoodBotsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListGoodBotsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListGoodBotsResponse wrapper for the ListGoodBots operation +type ListGoodBotsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []GoodBot instances + Items []GoodBot `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListGoodBotsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListGoodBotsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_protection_rules_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_protection_rules_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_protection_rules_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_protection_rules_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListProtectionRulesRequest wrapper for the ListProtectionRules operation +type ListProtectionRulesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Filter rules using a list of ModSecurity rule IDs. + ModSecurityRuleId []string `contributesTo:"query" name:"modSecurityRuleId" collectionFormat:"multi"` + + // Filter rules using a list of actions. + Action []ListProtectionRulesActionEnum `contributesTo:"query" name:"action" omitEmpty:"true" collectionFormat:"multi"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListProtectionRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListProtectionRulesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListProtectionRulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListProtectionRulesResponse wrapper for the ListProtectionRules operation +type ListProtectionRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ProtectionRule instances + Items []ProtectionRule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListProtectionRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListProtectionRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListProtectionRulesActionEnum Enum with underlying type: string +type ListProtectionRulesActionEnum string + +// Set of constants representing the allowable values for ListProtectionRulesActionEnum +const ( + ListProtectionRulesActionOff ListProtectionRulesActionEnum = "OFF" + ListProtectionRulesActionDetect ListProtectionRulesActionEnum = "DETECT" + ListProtectionRulesActionBlock ListProtectionRulesActionEnum = "BLOCK" +) + +var mappingListProtectionRulesAction = map[string]ListProtectionRulesActionEnum{ + "OFF": ListProtectionRulesActionOff, + "DETECT": ListProtectionRulesActionDetect, + "BLOCK": ListProtectionRulesActionBlock, +} + +// GetListProtectionRulesActionEnumValues Enumerates the set of values for ListProtectionRulesActionEnum +func GetListProtectionRulesActionEnumValues() []ListProtectionRulesActionEnum { + values := make([]ListProtectionRulesActionEnum, 0) + for _, v := range mappingListProtectionRulesAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_recommendations_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_recommendations_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_recommendations_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_recommendations_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListRecommendationsRequest wrapper for the ListRecommendations operation +type ListRecommendationsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter that matches recommended protection rules based on the selected action. If unspecified, rules with any action type are returned. + RecommendedAction ListRecommendationsRecommendedActionEnum `mandatory:"false" contributesTo:"query" name:"recommendedAction" omitEmpty:"true"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListRecommendationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListRecommendationsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRecommendationsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListRecommendationsResponse wrapper for the ListRecommendations operation +type ListRecommendationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Recommendation instances + Items []Recommendation `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListRecommendationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListRecommendationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListRecommendationsRecommendedActionEnum Enum with underlying type: string +type ListRecommendationsRecommendedActionEnum string + +// Set of constants representing the allowable values for ListRecommendationsRecommendedActionEnum +const ( + ListRecommendationsRecommendedActionDetect ListRecommendationsRecommendedActionEnum = "DETECT" + ListRecommendationsRecommendedActionBlock ListRecommendationsRecommendedActionEnum = "BLOCK" +) + +var mappingListRecommendationsRecommendedAction = map[string]ListRecommendationsRecommendedActionEnum{ + "DETECT": ListRecommendationsRecommendedActionDetect, + "BLOCK": ListRecommendationsRecommendedActionBlock, +} + +// GetListRecommendationsRecommendedActionEnumValues Enumerates the set of values for ListRecommendationsRecommendedActionEnum +func GetListRecommendationsRecommendedActionEnumValues() []ListRecommendationsRecommendedActionEnum { + values := make([]ListRecommendationsRecommendedActionEnum, 0) + for _, v := range mappingListRecommendationsRecommendedAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_threat_feeds_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_threat_feeds_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_threat_feeds_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_threat_feeds_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListThreatFeedsRequest wrapper for the ListThreatFeeds operation +type ListThreatFeedsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListThreatFeedsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListThreatFeedsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListThreatFeedsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListThreatFeedsResponse wrapper for the ListThreatFeeds operation +type ListThreatFeedsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ThreatFeed instances + Items []ThreatFeed `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListThreatFeedsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListThreatFeedsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waas_policies_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waas_policies_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waas_policies_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waas_policies_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,137 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWaasPoliciesRequest wrapper for the ListWaasPolicies operation +type ListWaasPoliciesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. This number is generated when the compartment is created. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The value by which policies are sorted in a paginated 'List' call. If unspecified, defaults to `timeCreated`. + SortBy ListWaasPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. + SortOrder ListWaasPoliciesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filter policies using a list of policy OCIDs. + Id []string `contributesTo:"query" name:"id" collectionFormat:"multi"` + + // Filter policies using a list of display names. + DisplayName []string `contributesTo:"query" name:"displayName" collectionFormat:"multi"` + + // Filter policies using a list of lifecycle states. + LifecycleState []string `contributesTo:"query" name:"lifecycleState" collectionFormat:"multi"` + + // A filter that matches policies created on or after the specified date and time. + TimeCreatedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedGreaterThanOrEqualTo"` + + // A filter that matches policies created before the specified date-time. + TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWaasPoliciesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWaasPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWaasPoliciesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWaasPoliciesResponse wrapper for the ListWaasPolicies operation +type ListWaasPoliciesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WaasPolicySummary instances + Items []WaasPolicySummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWaasPoliciesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWaasPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWaasPoliciesSortByEnum Enum with underlying type: string +type ListWaasPoliciesSortByEnum string + +// Set of constants representing the allowable values for ListWaasPoliciesSortByEnum +const ( + ListWaasPoliciesSortById ListWaasPoliciesSortByEnum = "id" + ListWaasPoliciesSortByDisplayname ListWaasPoliciesSortByEnum = "displayName" + ListWaasPoliciesSortByTimecreated ListWaasPoliciesSortByEnum = "timeCreated" +) + +var mappingListWaasPoliciesSortBy = map[string]ListWaasPoliciesSortByEnum{ + "id": ListWaasPoliciesSortById, + "displayName": ListWaasPoliciesSortByDisplayname, + "timeCreated": ListWaasPoliciesSortByTimecreated, +} + +// GetListWaasPoliciesSortByEnumValues Enumerates the set of values for ListWaasPoliciesSortByEnum +func GetListWaasPoliciesSortByEnumValues() []ListWaasPoliciesSortByEnum { + values := make([]ListWaasPoliciesSortByEnum, 0) + for _, v := range mappingListWaasPoliciesSortBy { + values = append(values, v) + } + return values +} + +// ListWaasPoliciesSortOrderEnum Enum with underlying type: string +type ListWaasPoliciesSortOrderEnum string + +// Set of constants representing the allowable values for ListWaasPoliciesSortOrderEnum +const ( + ListWaasPoliciesSortOrderAsc ListWaasPoliciesSortOrderEnum = "ASC" + ListWaasPoliciesSortOrderDesc ListWaasPoliciesSortOrderEnum = "DESC" +) + +var mappingListWaasPoliciesSortOrder = map[string]ListWaasPoliciesSortOrderEnum{ + "ASC": ListWaasPoliciesSortOrderAsc, + "DESC": ListWaasPoliciesSortOrderDesc, +} + +// GetListWaasPoliciesSortOrderEnumValues Enumerates the set of values for ListWaasPoliciesSortOrderEnum +func GetListWaasPoliciesSortOrderEnumValues() []ListWaasPoliciesSortOrderEnum { + values := make([]ListWaasPoliciesSortOrderEnum, 0) + for _, v := range mappingListWaasPoliciesSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_blocked_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_blocked_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_blocked_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_blocked_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWafBlockedRequestsRequest wrapper for the ListWafBlockedRequests operation +type ListWafBlockedRequestsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request. + TimeObservedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedGreaterThanOrEqualTo"` + + // A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. + TimeObservedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedLessThan"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Filter stats by the Web Application Firewall feature that triggered the block action. If unspecified, data for all WAF features will be returned. + WafFeature []ListWafBlockedRequestsWafFeatureEnum `contributesTo:"query" name:"wafFeature" omitEmpty:"true" collectionFormat:"multi"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWafBlockedRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWafBlockedRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWafBlockedRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWafBlockedRequestsResponse wrapper for the ListWafBlockedRequests operation +type ListWafBlockedRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WafBlockedRequest instances + Items []WafBlockedRequest `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, then a partial list might have been returned. Include this value as the page parameter for the subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWafBlockedRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWafBlockedRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWafBlockedRequestsWafFeatureEnum Enum with underlying type: string +type ListWafBlockedRequestsWafFeatureEnum string + +// Set of constants representing the allowable values for ListWafBlockedRequestsWafFeatureEnum +const ( + ListWafBlockedRequestsWafFeatureProtectionRules ListWafBlockedRequestsWafFeatureEnum = "PROTECTION_RULES" + ListWafBlockedRequestsWafFeatureJsChallenge ListWafBlockedRequestsWafFeatureEnum = "JS_CHALLENGE" + ListWafBlockedRequestsWafFeatureAccessRules ListWafBlockedRequestsWafFeatureEnum = "ACCESS_RULES" + ListWafBlockedRequestsWafFeatureThreatFeeds ListWafBlockedRequestsWafFeatureEnum = "THREAT_FEEDS" + ListWafBlockedRequestsWafFeatureHumanInteractionChallenge ListWafBlockedRequestsWafFeatureEnum = "HUMAN_INTERACTION_CHALLENGE" + ListWafBlockedRequestsWafFeatureDeviceFingerprintChallenge ListWafBlockedRequestsWafFeatureEnum = "DEVICE_FINGERPRINT_CHALLENGE" + ListWafBlockedRequestsWafFeatureCaptcha ListWafBlockedRequestsWafFeatureEnum = "CAPTCHA" + ListWafBlockedRequestsWafFeatureAddressRateLimiting ListWafBlockedRequestsWafFeatureEnum = "ADDRESS_RATE_LIMITING" +) + +var mappingListWafBlockedRequestsWafFeature = map[string]ListWafBlockedRequestsWafFeatureEnum{ + "PROTECTION_RULES": ListWafBlockedRequestsWafFeatureProtectionRules, + "JS_CHALLENGE": ListWafBlockedRequestsWafFeatureJsChallenge, + "ACCESS_RULES": ListWafBlockedRequestsWafFeatureAccessRules, + "THREAT_FEEDS": ListWafBlockedRequestsWafFeatureThreatFeeds, + "HUMAN_INTERACTION_CHALLENGE": ListWafBlockedRequestsWafFeatureHumanInteractionChallenge, + "DEVICE_FINGERPRINT_CHALLENGE": ListWafBlockedRequestsWafFeatureDeviceFingerprintChallenge, + "CAPTCHA": ListWafBlockedRequestsWafFeatureCaptcha, + "ADDRESS_RATE_LIMITING": ListWafBlockedRequestsWafFeatureAddressRateLimiting, +} + +// GetListWafBlockedRequestsWafFeatureEnumValues Enumerates the set of values for ListWafBlockedRequestsWafFeatureEnum +func GetListWafBlockedRequestsWafFeatureEnumValues() []ListWafBlockedRequestsWafFeatureEnum { + values := make([]ListWafBlockedRequestsWafFeatureEnum, 0) + for _, v := range mappingListWafBlockedRequestsWafFeature { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_logs_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_logs_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_logs_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_logs_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,226 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWafLogsRequest wrapper for the ListWafLogs operation +type ListWafLogsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `20`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter that matches log entries where the observed event occurred on or after a date and time specified in RFC 3339 format. If unspecified, defaults to two hours before receipt of the request. + TimeObservedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedGreaterThanOrEqualTo"` + + // A filter that matches log entries where the observed event occurred before a date and time, specified in RFC 3339 format. + TimeObservedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedLessThan"` + + // A full text search for logs. + TextContains *string `mandatory:"false" contributesTo:"query" name:"textContains"` + + // Filters logs by access rule key. + AccessRuleKey []string `contributesTo:"query" name:"accessRuleKey" collectionFormat:"multi"` + + // Filters logs by Web Application Firewall action. + Action []ListWafLogsActionEnum `contributesTo:"query" name:"action" omitEmpty:"true" collectionFormat:"multi"` + + // Filters logs by client IP address. + ClientAddress []string `contributesTo:"query" name:"clientAddress" collectionFormat:"multi"` + + // Filters logs by country code. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see ISO's website (https://www.iso.org/obp/ui/#search/code/). + CountryCode []string `contributesTo:"query" name:"countryCode" collectionFormat:"multi"` + + // Filter logs by country name. + CountryName []string `contributesTo:"query" name:"countryName" collectionFormat:"multi"` + + // Filter logs by device fingerprint. + Fingerprint []string `contributesTo:"query" name:"fingerprint" collectionFormat:"multi"` + + // Filter logs by HTTP method. + HttpMethod []ListWafLogsHttpMethodEnum `contributesTo:"query" name:"httpMethod" omitEmpty:"true" collectionFormat:"multi"` + + // Filter logs by incident key. + IncidentKey []string `contributesTo:"query" name:"incidentKey" collectionFormat:"multi"` + + // Filter by log type. + LogType []ListWafLogsLogTypeEnum `contributesTo:"query" name:"logType" omitEmpty:"true" collectionFormat:"multi"` + + // Filter by origin IP address. + OriginAddress []string `contributesTo:"query" name:"originAddress" collectionFormat:"multi"` + + // Filter by referrer. + Referrer []string `contributesTo:"query" name:"referrer" collectionFormat:"multi"` + + // Filter by request URL. + RequestUrl []string `contributesTo:"query" name:"requestUrl" collectionFormat:"multi"` + + // Filter by response code. + ResponseCode []int `contributesTo:"query" name:"responseCode" collectionFormat:"multi"` + + // Filter by threat feed key. + ThreatFeedKey []string `contributesTo:"query" name:"threatFeedKey" collectionFormat:"multi"` + + // Filter by user agent. + UserAgent []string `contributesTo:"query" name:"userAgent" collectionFormat:"multi"` + + // Filter by protection rule key. + ProtectionRuleKey []string `contributesTo:"query" name:"protectionRuleKey" collectionFormat:"multi"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWafLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWafLogsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWafLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWafLogsResponse wrapper for the ListWafLogs operation +type ListWafLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WafLog instances + Items []WafLog `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWafLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWafLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWafLogsActionEnum Enum with underlying type: string +type ListWafLogsActionEnum string + +// Set of constants representing the allowable values for ListWafLogsActionEnum +const ( + ListWafLogsActionBlock ListWafLogsActionEnum = "BLOCK" + ListWafLogsActionDetect ListWafLogsActionEnum = "DETECT" + ListWafLogsActionBypass ListWafLogsActionEnum = "BYPASS" + ListWafLogsActionLog ListWafLogsActionEnum = "LOG" + ListWafLogsActionRedirected ListWafLogsActionEnum = "REDIRECTED" +) + +var mappingListWafLogsAction = map[string]ListWafLogsActionEnum{ + "BLOCK": ListWafLogsActionBlock, + "DETECT": ListWafLogsActionDetect, + "BYPASS": ListWafLogsActionBypass, + "LOG": ListWafLogsActionLog, + "REDIRECTED": ListWafLogsActionRedirected, +} + +// GetListWafLogsActionEnumValues Enumerates the set of values for ListWafLogsActionEnum +func GetListWafLogsActionEnumValues() []ListWafLogsActionEnum { + values := make([]ListWafLogsActionEnum, 0) + for _, v := range mappingListWafLogsAction { + values = append(values, v) + } + return values +} + +// ListWafLogsHttpMethodEnum Enum with underlying type: string +type ListWafLogsHttpMethodEnum string + +// Set of constants representing the allowable values for ListWafLogsHttpMethodEnum +const ( + ListWafLogsHttpMethodOptions ListWafLogsHttpMethodEnum = "OPTIONS" + ListWafLogsHttpMethodGet ListWafLogsHttpMethodEnum = "GET" + ListWafLogsHttpMethodHead ListWafLogsHttpMethodEnum = "HEAD" + ListWafLogsHttpMethodPost ListWafLogsHttpMethodEnum = "POST" + ListWafLogsHttpMethodPut ListWafLogsHttpMethodEnum = "PUT" + ListWafLogsHttpMethodDelete ListWafLogsHttpMethodEnum = "DELETE" + ListWafLogsHttpMethodTrace ListWafLogsHttpMethodEnum = "TRACE" + ListWafLogsHttpMethodConnect ListWafLogsHttpMethodEnum = "CONNECT" +) + +var mappingListWafLogsHttpMethod = map[string]ListWafLogsHttpMethodEnum{ + "OPTIONS": ListWafLogsHttpMethodOptions, + "GET": ListWafLogsHttpMethodGet, + "HEAD": ListWafLogsHttpMethodHead, + "POST": ListWafLogsHttpMethodPost, + "PUT": ListWafLogsHttpMethodPut, + "DELETE": ListWafLogsHttpMethodDelete, + "TRACE": ListWafLogsHttpMethodTrace, + "CONNECT": ListWafLogsHttpMethodConnect, +} + +// GetListWafLogsHttpMethodEnumValues Enumerates the set of values for ListWafLogsHttpMethodEnum +func GetListWafLogsHttpMethodEnumValues() []ListWafLogsHttpMethodEnum { + values := make([]ListWafLogsHttpMethodEnum, 0) + for _, v := range mappingListWafLogsHttpMethod { + values = append(values, v) + } + return values +} + +// ListWafLogsLogTypeEnum Enum with underlying type: string +type ListWafLogsLogTypeEnum string + +// Set of constants representing the allowable values for ListWafLogsLogTypeEnum +const ( + ListWafLogsLogTypeAccess ListWafLogsLogTypeEnum = "ACCESS" + ListWafLogsLogTypeProtectionRules ListWafLogsLogTypeEnum = "PROTECTION_RULES" + ListWafLogsLogTypeJsChallenge ListWafLogsLogTypeEnum = "JS_CHALLENGE" + ListWafLogsLogTypeCaptcha ListWafLogsLogTypeEnum = "CAPTCHA" + ListWafLogsLogTypeAccessRules ListWafLogsLogTypeEnum = "ACCESS_RULES" + ListWafLogsLogTypeThreatFeeds ListWafLogsLogTypeEnum = "THREAT_FEEDS" + ListWafLogsLogTypeHumanInteractionChallenge ListWafLogsLogTypeEnum = "HUMAN_INTERACTION_CHALLENGE" + ListWafLogsLogTypeDeviceFingerprintChallenge ListWafLogsLogTypeEnum = "DEVICE_FINGERPRINT_CHALLENGE" + ListWafLogsLogTypeAddressRateLimiting ListWafLogsLogTypeEnum = "ADDRESS_RATE_LIMITING" +) + +var mappingListWafLogsLogType = map[string]ListWafLogsLogTypeEnum{ + "ACCESS": ListWafLogsLogTypeAccess, + "PROTECTION_RULES": ListWafLogsLogTypeProtectionRules, + "JS_CHALLENGE": ListWafLogsLogTypeJsChallenge, + "CAPTCHA": ListWafLogsLogTypeCaptcha, + "ACCESS_RULES": ListWafLogsLogTypeAccessRules, + "THREAT_FEEDS": ListWafLogsLogTypeThreatFeeds, + "HUMAN_INTERACTION_CHALLENGE": ListWafLogsLogTypeHumanInteractionChallenge, + "DEVICE_FINGERPRINT_CHALLENGE": ListWafLogsLogTypeDeviceFingerprintChallenge, + "ADDRESS_RATE_LIMITING": ListWafLogsLogTypeAddressRateLimiting, +} + +// GetListWafLogsLogTypeEnumValues Enumerates the set of values for ListWafLogsLogTypeEnum +func GetListWafLogsLogTypeEnumValues() []ListWafLogsLogTypeEnum { + values := make([]ListWafLogsLogTypeEnum, 0) + for _, v := range mappingListWafLogsLogType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWafRequestsRequest wrapper for the ListWafRequests operation +type ListWafRequestsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request. + TimeObservedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedGreaterThanOrEqualTo"` + + // A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. + TimeObservedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedLessThan"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWafRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWafRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWafRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWafRequestsResponse wrapper for the ListWafRequests operation +type ListWafRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WafRequest instances + Items []WafRequest `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWafRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWafRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_traffic_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_traffic_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_traffic_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_waf_traffic_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWafTrafficRequest wrapper for the ListWafTraffic operation +type ListWafTrafficRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request. + TimeObservedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedGreaterThanOrEqualTo"` + + // A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. + TimeObservedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedLessThan"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWafTrafficRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWafTrafficRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWafTrafficRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWafTrafficResponse wrapper for the ListWafTraffic operation +type ListWafTrafficResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WafTrafficDatum instances + Items []WafTrafficDatum `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, then a partial list might have been returned. Include this value as the page parameter for the subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWafTrafficResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWafTrafficResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_whitelists_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_whitelists_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_whitelists_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_whitelists_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWhitelistsRequest wrapper for the ListWhitelists operation +type ListWhitelistsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWhitelistsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWhitelistsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWhitelistsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWhitelistsResponse wrapper for the ListWhitelists operation +type ListWhitelistsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []Whitelist instances + Items []Whitelist `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWhitelistsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWhitelistsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_work_requests_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_work_requests_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_work_requests_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/list_work_requests_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +type ListWorkRequestsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"query" name:"waasPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. This number is generated when the compartment is created. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated call. In unspecified, defaults to `10`. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous paginated call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The value by which work requests are sorted in a paginated 'List' call. If unspecified, defaults to `timeAccepted`. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []WorkRequestSummary instances + Items []WorkRequestSummary `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortById ListWorkRequestsSortByEnum = "id" + ListWorkRequestsSortByStatus ListWorkRequestsSortByEnum = "status" + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" + ListWorkRequestsSortByTimestarted ListWorkRequestsSortByEnum = "timeStarted" + ListWorkRequestsSortByTimefinished ListWorkRequestsSortByEnum = "timeFinished" + ListWorkRequestsSortByOperationtype ListWorkRequestsSortByEnum = "operationType" +) + +var mappingListWorkRequestsSortBy = map[string]ListWorkRequestsSortByEnum{ + "id": ListWorkRequestsSortById, + "status": ListWorkRequestsSortByStatus, + "timeAccepted": ListWorkRequestsSortByTimeaccepted, + "timeStarted": ListWorkRequestsSortByTimestarted, + "timeFinished": ListWorkRequestsSortByTimefinished, + "operationType": ListWorkRequestsSortByOperationtype, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortBy { + values = append(values, v) + } + return values +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrder = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrder { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/origin.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/origin.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/origin.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/origin.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Origin A detailed description of your web application's origin host server. An origin must be defined to set up WAF rules. +type Origin struct { + + // The URI of the origin. Does not support paths. Port numbers should be specified in the `httpPort` and `httpsPort` fields. + Uri *string `mandatory:"true" json:"uri"` + + // The HTTP port on the origin that the web application listens on. If unspecified, defaults to `80`. + HttpPort *int `mandatory:"false" json:"httpPort"` + + // The HTTPS port on the origin that the web application listens on. If unspecified, defaults to `443`. + HttpsPort *int `mandatory:"false" json:"httpsPort"` + + // A list of HTTP headers to forward to your origin. + CustomHeaders []Header `mandatory:"false" json:"customHeaders"` +} + +func (m Origin) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/policy_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/policy_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/policy_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/policy_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// PolicyConfig The configuration details for the WAAS policy. +type PolicyConfig struct { + + // The OCID of the SSL certificate to use if HTTPS is supported. + CertificateId *string `mandatory:"false" json:"certificateId"` + + // Enable or disable HTTPS support. If true, a `certificateId` is required. If unspecified, defaults to `false`. + IsHttpsEnabled *bool `mandatory:"false" json:"isHttpsEnabled"` + + // Force HTTP to HTTPS redirection. If unspecified, defaults to `false`. + IsHttpsForced *bool `mandatory:"false" json:"isHttpsForced"` +} + +func (m PolicyConfig) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_action.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_action.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_action.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_action.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ProtectionRuleAction A protection rule key and the associated action to apply to that rule. +type ProtectionRuleAction struct { + + // The unique key of the protection rule. + Key *string `mandatory:"true" json:"key"` + + // The action to apply to the protection rule. If unspecified, defaults to `OFF`. + Action ProtectionRuleActionActionEnum `mandatory:"true" json:"action"` + + // The types of requests excluded from the protection rule action. If the requests matches the criteria in the `exclusions`, the protection rule action will not be executed. + Exclusions []ProtectionRuleExclusion `mandatory:"false" json:"exclusions"` +} + +func (m ProtectionRuleAction) String() string { + return common.PointerString(m) +} + +// ProtectionRuleActionActionEnum Enum with underlying type: string +type ProtectionRuleActionActionEnum string + +// Set of constants representing the allowable values for ProtectionRuleActionActionEnum +const ( + ProtectionRuleActionActionOff ProtectionRuleActionActionEnum = "OFF" + ProtectionRuleActionActionDetect ProtectionRuleActionActionEnum = "DETECT" + ProtectionRuleActionActionBlock ProtectionRuleActionActionEnum = "BLOCK" +) + +var mappingProtectionRuleActionAction = map[string]ProtectionRuleActionActionEnum{ + "OFF": ProtectionRuleActionActionOff, + "DETECT": ProtectionRuleActionActionDetect, + "BLOCK": ProtectionRuleActionActionBlock, +} + +// GetProtectionRuleActionActionEnumValues Enumerates the set of values for ProtectionRuleActionActionEnum +func GetProtectionRuleActionActionEnumValues() []ProtectionRuleActionActionEnum { + values := make([]ProtectionRuleActionActionEnum, 0) + for _, v := range mappingProtectionRuleActionAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_exclusion.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_exclusion.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_exclusion.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule_exclusion.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ProtectionRuleExclusion Allows specified types of requests to bypass the protection rule. If the requests matches any of the criteria in the `exclusions` field, the protection rule will not be executed. Rules can have more than one exclusion and exclusions are applied to requests disjunctively. +type ProtectionRuleExclusion struct { + + // The target of the exclusion. + Target ProtectionRuleExclusionTargetEnum `mandatory:"false" json:"target,omitempty"` + + Exclusions []string `mandatory:"false" json:"exclusions"` +} + +func (m ProtectionRuleExclusion) String() string { + return common.PointerString(m) +} + +// ProtectionRuleExclusionTargetEnum Enum with underlying type: string +type ProtectionRuleExclusionTargetEnum string + +// Set of constants representing the allowable values for ProtectionRuleExclusionTargetEnum +const ( + ProtectionRuleExclusionTargetRequestCookies ProtectionRuleExclusionTargetEnum = "REQUEST_COOKIES" + ProtectionRuleExclusionTargetRequestCookieNames ProtectionRuleExclusionTargetEnum = "REQUEST_COOKIE_NAMES" + ProtectionRuleExclusionTargetArgs ProtectionRuleExclusionTargetEnum = "ARGS" + ProtectionRuleExclusionTargetArgsNames ProtectionRuleExclusionTargetEnum = "ARGS_NAMES" +) + +var mappingProtectionRuleExclusionTarget = map[string]ProtectionRuleExclusionTargetEnum{ + "REQUEST_COOKIES": ProtectionRuleExclusionTargetRequestCookies, + "REQUEST_COOKIE_NAMES": ProtectionRuleExclusionTargetRequestCookieNames, + "ARGS": ProtectionRuleExclusionTargetArgs, + "ARGS_NAMES": ProtectionRuleExclusionTargetArgsNames, +} + +// GetProtectionRuleExclusionTargetEnumValues Enumerates the set of values for ProtectionRuleExclusionTargetEnum +func GetProtectionRuleExclusionTargetEnumValues() []ProtectionRuleExclusionTargetEnum { + values := make([]ProtectionRuleExclusionTargetEnum, 0) + for _, v := range mappingProtectionRuleExclusionTarget { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_rule.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ProtectionRule The protection rule settings. Protection rules can allow, block, or trigger an alert if a request meets the parameters of an applied rule. +type ProtectionRule struct { + + // The unique key of the protection rule. + Key *string `mandatory:"false" json:"key"` + + // The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation (https://www.modsecurity.org/CRS/Documentation/index.html). + ModSecurityRuleIds []string `mandatory:"false" json:"modSecurityRuleIds"` + + // The name of the protection rule. + Name *string `mandatory:"false" json:"name"` + + // The description of the protection rule. + Description *string `mandatory:"false" json:"description"` + + // The action to take when the traffic is detected as malicious. If unspecified, defaults to `OFF`. + Action ProtectionRuleActionEnum `mandatory:"false" json:"action,omitempty"` + + // The list of labels for the protection rule. + // **Note:** Protection rules with a `ResponseBody` label will have no effect unless `isResponseInspected` is true. + Labels []string `mandatory:"false" json:"labels"` + + Exclusions []ProtectionRuleExclusion `mandatory:"false" json:"exclusions"` +} + +func (m ProtectionRule) String() string { + return common.PointerString(m) +} + +// ProtectionRuleActionEnum Enum with underlying type: string +type ProtectionRuleActionEnum string + +// Set of constants representing the allowable values for ProtectionRuleActionEnum +const ( + ProtectionRuleActionOff ProtectionRuleActionEnum = "OFF" + ProtectionRuleActionDetect ProtectionRuleActionEnum = "DETECT" + ProtectionRuleActionBlock ProtectionRuleActionEnum = "BLOCK" +) + +var mappingProtectionRuleAction = map[string]ProtectionRuleActionEnum{ + "OFF": ProtectionRuleActionOff, + "DETECT": ProtectionRuleActionDetect, + "BLOCK": ProtectionRuleActionBlock, +} + +// GetProtectionRuleActionEnumValues Enumerates the set of values for ProtectionRuleActionEnum +func GetProtectionRuleActionEnumValues() []ProtectionRuleActionEnum { + values := make([]ProtectionRuleActionEnum, 0) + for _, v := range mappingProtectionRuleAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_settings.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_settings.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_settings.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/protection_settings.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ProtectionSettings The settings used for protection rules. +type ProtectionSettings struct { + + // If `action` is set to `BLOCK`, this specifies how the traffic is blocked when detected as malicious by a protection rule. If unspecified, defaults to `SET_RESPONSE_CODE`. + BlockAction ProtectionSettingsBlockActionEnum `mandatory:"false" json:"blockAction,omitempty"` + + // The response code returned when `action` is set to `BLOCK`, `blockAction` is set to `SET_RESPONSE_CODE`, and the traffic is detected as malicious by a protection rule. If unspecified, defaults to `403`. + BlockResponseCode *int `mandatory:"false" json:"blockResponseCode"` + + // The message to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the traffic is detected as malicious by a protection rule. If unspecified, defaults to 'Access to the website is blocked.' + BlockErrorPageMessage *string `mandatory:"false" json:"blockErrorPageMessage"` + + // The error code to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the traffic is detected as malicious by a protection rule. If unspecified, defaults to `403`. + BlockErrorPageCode *string `mandatory:"false" json:"blockErrorPageCode"` + + // The description text to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the traffic is detected as malicious by a protection rule. If unspecified, defaults to `Access blocked by website owner. Please contact support.` + BlockErrorPageDescription *string `mandatory:"false" json:"blockErrorPageDescription"` + + // The maximum number of arguments allowed to be passed to your application before an action is taken. If unspecified, defaults to `255`. + MaxArgumentCount *int `mandatory:"false" json:"maxArgumentCount"` + + // The maximum length allowed for each argument name, in characters. If unspecified, defaults to `400`. + MaxNameLengthPerArgument *int `mandatory:"false" json:"maxNameLengthPerArgument"` + + // The maximum length allowed for the sum of all argument names, in characters. If unspecified, defaults to `64000`. + MaxTotalNameLengthOfArguments *int `mandatory:"false" json:"maxTotalNameLengthOfArguments"` + + // The length of time to analyze traffic traffic, in days. After the analysis period, `WafRecommendations` will be populated. If unspecified, defaults to `10`. + // Use `GET /waasPolicies/{waasPolicyId}/wafRecommendations` to view WAF recommendations. + RecommendationsPeriodInDays *int `mandatory:"false" json:"recommendationsPeriodInDays"` + + // Inspects the response body of origin responses. Can be used to detect leakage of sensitive data. If unspecified, defaults to `false`. + // **Note:** Only origin responses with a Content-Type matching a value in `mediaTypes` will be inspected. + IsResponseInspected *bool `mandatory:"false" json:"isResponseInspected"` + + // The maximum response size to be fully inspected, in binary kilobytes (KiB). Anything over this limit will be partially inspected. If unspecified, defaults to `1024`. + MaxResponseSizeInKiB *int `mandatory:"false" json:"maxResponseSizeInKiB"` + + // The list of allowed HTTP methods. If unspecified, default to `[OPTIONS, GET, HEAD, POST]`. + AllowedHttpMethods []ProtectionSettingsAllowedHttpMethodsEnum `mandatory:"false" json:"allowedHttpMethods,omitempty"` + + // The list of media types to allow for inspection, if `isResponseInspected` is enabled. Only responses with MIME types in this list will be inspected. If unspecified, defaults to `[`text/html`, `text/plain`, `text/xml`]`. + // Supported MIME types include: + // - text/html + // - text/plain + // - text/asp + // - text/css + // - text/x-script + // - application/json + // - text/webviewhtml + // - text/x-java-source + // - application/x-javascript + // - application/javascript + // - application/ecmascript + // - text/javascript + // - text/ecmascript + // - text/x-script.perl + // - text/x-script.phyton + // - application/plain + // - application/xml + // - text/xml + MediaTypes []string `mandatory:"false" json:"mediaTypes"` +} + +func (m ProtectionSettings) String() string { + return common.PointerString(m) +} + +// ProtectionSettingsBlockActionEnum Enum with underlying type: string +type ProtectionSettingsBlockActionEnum string + +// Set of constants representing the allowable values for ProtectionSettingsBlockActionEnum +const ( + ProtectionSettingsBlockActionShowErrorPage ProtectionSettingsBlockActionEnum = "SHOW_ERROR_PAGE" + ProtectionSettingsBlockActionSetResponseCode ProtectionSettingsBlockActionEnum = "SET_RESPONSE_CODE" +) + +var mappingProtectionSettingsBlockAction = map[string]ProtectionSettingsBlockActionEnum{ + "SHOW_ERROR_PAGE": ProtectionSettingsBlockActionShowErrorPage, + "SET_RESPONSE_CODE": ProtectionSettingsBlockActionSetResponseCode, +} + +// GetProtectionSettingsBlockActionEnumValues Enumerates the set of values for ProtectionSettingsBlockActionEnum +func GetProtectionSettingsBlockActionEnumValues() []ProtectionSettingsBlockActionEnum { + values := make([]ProtectionSettingsBlockActionEnum, 0) + for _, v := range mappingProtectionSettingsBlockAction { + values = append(values, v) + } + return values +} + +// ProtectionSettingsAllowedHttpMethodsEnum Enum with underlying type: string +type ProtectionSettingsAllowedHttpMethodsEnum string + +// Set of constants representing the allowable values for ProtectionSettingsAllowedHttpMethodsEnum +const ( + ProtectionSettingsAllowedHttpMethodsOptions ProtectionSettingsAllowedHttpMethodsEnum = "OPTIONS" + ProtectionSettingsAllowedHttpMethodsGet ProtectionSettingsAllowedHttpMethodsEnum = "GET" + ProtectionSettingsAllowedHttpMethodsHead ProtectionSettingsAllowedHttpMethodsEnum = "HEAD" + ProtectionSettingsAllowedHttpMethodsPost ProtectionSettingsAllowedHttpMethodsEnum = "POST" + ProtectionSettingsAllowedHttpMethodsPut ProtectionSettingsAllowedHttpMethodsEnum = "PUT" + ProtectionSettingsAllowedHttpMethodsDelete ProtectionSettingsAllowedHttpMethodsEnum = "DELETE" + ProtectionSettingsAllowedHttpMethodsTrace ProtectionSettingsAllowedHttpMethodsEnum = "TRACE" + ProtectionSettingsAllowedHttpMethodsConnect ProtectionSettingsAllowedHttpMethodsEnum = "CONNECT" + ProtectionSettingsAllowedHttpMethodsPatch ProtectionSettingsAllowedHttpMethodsEnum = "PATCH" + ProtectionSettingsAllowedHttpMethodsPropfind ProtectionSettingsAllowedHttpMethodsEnum = "PROPFIND" +) + +var mappingProtectionSettingsAllowedHttpMethods = map[string]ProtectionSettingsAllowedHttpMethodsEnum{ + "OPTIONS": ProtectionSettingsAllowedHttpMethodsOptions, + "GET": ProtectionSettingsAllowedHttpMethodsGet, + "HEAD": ProtectionSettingsAllowedHttpMethodsHead, + "POST": ProtectionSettingsAllowedHttpMethodsPost, + "PUT": ProtectionSettingsAllowedHttpMethodsPut, + "DELETE": ProtectionSettingsAllowedHttpMethodsDelete, + "TRACE": ProtectionSettingsAllowedHttpMethodsTrace, + "CONNECT": ProtectionSettingsAllowedHttpMethodsConnect, + "PATCH": ProtectionSettingsAllowedHttpMethodsPatch, + "PROPFIND": ProtectionSettingsAllowedHttpMethodsPropfind, +} + +// GetProtectionSettingsAllowedHttpMethodsEnumValues Enumerates the set of values for ProtectionSettingsAllowedHttpMethodsEnum +func GetProtectionSettingsAllowedHttpMethodsEnumValues() []ProtectionSettingsAllowedHttpMethodsEnum { + values := make([]ProtectionSettingsAllowedHttpMethodsEnum, 0) + for _, v := range mappingProtectionSettingsAllowedHttpMethods { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/recommendation.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/recommendation.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/recommendation.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/recommendation.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Recommendation A recommended protection rule for a web application. This recommendation can be accepted to apply it to the Web Application Firewall configuration for this policy. +// Use the `POST /waasPolicies/{waasPolicyId}/actions/acceptWafConfigRecommendations` method to accept recommended protection rules. +type Recommendation struct { + + // The unique key for the recommended protection rule. + Key *string `mandatory:"false" json:"key"` + + // The list of the ModSecurity rule IDs associated with the protection rule. + // For more information about ModSecurity's open source WAF rules, see Mod Security's documentation (https://www.modsecurity.org/CRS/Documentation/index.html). + ModSecurityRuleIds []string `mandatory:"false" json:"modSecurityRuleIds"` + + // The name of the recommended protection rule. + Name *string `mandatory:"false" json:"name"` + + // The description of the recommended protection rule. + Description *string `mandatory:"false" json:"description"` + + // The list of labels for the recommended protection rule. + Labels []string `mandatory:"false" json:"labels"` + + // The recommended action to apply to the protection rule. + RecommendedAction *string `mandatory:"false" json:"recommendedAction"` +} + +func (m Recommendation) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed_action.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed_action.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed_action.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed_action.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ThreatFeedAction The action to take for a request that has been determined to be potentially malicious. +type ThreatFeedAction struct { + + // The unique key of the object for which the action applies. + Key *string `mandatory:"true" json:"key"` + + // The selected action. If unspecified, defaults to `OFF`. + Action ThreatFeedActionActionEnum `mandatory:"true" json:"action"` +} + +func (m ThreatFeedAction) String() string { + return common.PointerString(m) +} + +// ThreatFeedActionActionEnum Enum with underlying type: string +type ThreatFeedActionActionEnum string + +// Set of constants representing the allowable values for ThreatFeedActionActionEnum +const ( + ThreatFeedActionActionOff ThreatFeedActionActionEnum = "OFF" + ThreatFeedActionActionDetect ThreatFeedActionActionEnum = "DETECT" + ThreatFeedActionActionBlock ThreatFeedActionActionEnum = "BLOCK" +) + +var mappingThreatFeedActionAction = map[string]ThreatFeedActionActionEnum{ + "OFF": ThreatFeedActionActionOff, + "DETECT": ThreatFeedActionActionDetect, + "BLOCK": ThreatFeedActionActionBlock, +} + +// GetThreatFeedActionActionEnumValues Enumerates the set of values for ThreatFeedActionActionEnum +func GetThreatFeedActionActionEnumValues() []ThreatFeedActionActionEnum { + values := make([]ThreatFeedActionActionEnum, 0) + for _, v := range mappingThreatFeedActionAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/threat_feed.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// ThreatFeed The settings of the threat intelligence feed. You can block requests from IP addresses based on their reputations with various commercial and open source threat feeds. +type ThreatFeed struct { + + // The unique key of the threat intelligence feed. + Key *string `mandatory:"false" json:"key"` + + // The name of the threat intelligence feed. + Name *string `mandatory:"false" json:"name"` + + // The action to take when traffic is flagged as malicious by data from the threat intelligence feed. If unspecified, defaults to `OFF`. + Action ThreatFeedActionEnum `mandatory:"false" json:"action,omitempty"` + + // The description of the threat intelligence feed. + Description *string `mandatory:"false" json:"description"` +} + +func (m ThreatFeed) String() string { + return common.PointerString(m) +} + +// ThreatFeedActionEnum Enum with underlying type: string +type ThreatFeedActionEnum string + +// Set of constants representing the allowable values for ThreatFeedActionEnum +const ( + ThreatFeedActionOff ThreatFeedActionEnum = "OFF" + ThreatFeedActionDetect ThreatFeedActionEnum = "DETECT" + ThreatFeedActionBlock ThreatFeedActionEnum = "BLOCK" +) + +var mappingThreatFeedAction = map[string]ThreatFeedActionEnum{ + "OFF": ThreatFeedActionOff, + "DETECT": ThreatFeedActionDetect, + "BLOCK": ThreatFeedActionBlock, +} + +// GetThreatFeedActionEnumValues Enumerates the set of values for ThreatFeedActionEnum +func GetThreatFeedActionEnumValues() []ThreatFeedActionEnum { + values := make([]ThreatFeedActionEnum, 0) + for _, v := range mappingThreatFeedAction { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_access_rules_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_access_rules_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_access_rules_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_access_rules_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateAccessRulesRequest wrapper for the UpdateAccessRules operation +type UpdateAccessRulesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + AccessRules []AccessRule `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateAccessRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAccessRulesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAccessRulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateAccessRulesResponse wrapper for the UpdateAccessRules operation +type UpdateAccessRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateAccessRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAccessRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_captchas_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_captchas_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_captchas_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_captchas_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateCaptchasRequest wrapper for the UpdateCaptchas operation +type UpdateCaptchasRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // A list of CAPTCHA details. + Captchas []Captcha `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateCaptchasRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCaptchasRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCaptchasRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateCaptchasResponse wrapper for the UpdateCaptchas operation +type UpdateCaptchasResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateCaptchasResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCaptchasResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,31 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateCertificateDetails The data used to create a new SSL certificate. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateCertificateDetails struct { + + // A user-friendly name for the SSL certificate. The name can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateCertificateDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_certificate_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateCertificateRequest wrapper for the UpdateCertificate operation +type UpdateCertificateRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The new display name, freeform tags, and defined tags to apply to a certificate. + UpdateCertificateDetails `contributesTo:"body"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCertificateRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCertificateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateCertificateResponse wrapper for the UpdateCertificate operation +type UpdateCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_device_fingerprint_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_device_fingerprint_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_device_fingerprint_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_device_fingerprint_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateDeviceFingerprintChallengeRequest wrapper for the UpdateDeviceFingerprintChallenge operation +type UpdateDeviceFingerprintChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The device fingerprint challenge settings to be updated. + UpdateDeviceFingerprintChallengeDetails DeviceFingerprintChallenge `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateDeviceFingerprintChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDeviceFingerprintChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDeviceFingerprintChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateDeviceFingerprintChallengeResponse wrapper for the UpdateDeviceFingerprintChallenge operation +type UpdateDeviceFingerprintChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateDeviceFingerprintChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDeviceFingerprintChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_good_bots_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_good_bots_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_good_bots_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_good_bots_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateGoodBotsRequest wrapper for the UpdateGoodBots operation +type UpdateGoodBotsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + GoodBots []GoodBot `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateGoodBotsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateGoodBotsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateGoodBotsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateGoodBotsResponse wrapper for the UpdateGoodBots operation +type UpdateGoodBotsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateGoodBotsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateGoodBotsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_human_interaction_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_human_interaction_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_human_interaction_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_human_interaction_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateHumanInteractionChallengeRequest wrapper for the UpdateHumanInteractionChallenge operation +type UpdateHumanInteractionChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The human interaction challenge settings. + UpdateHumanInteractionChallengeDetails HumanInteractionChallenge `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateHumanInteractionChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateHumanInteractionChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHumanInteractionChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateHumanInteractionChallengeResponse wrapper for the UpdateHumanInteractionChallenge operation +type UpdateHumanInteractionChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateHumanInteractionChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHumanInteractionChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_js_challenge_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_js_challenge_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_js_challenge_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_js_challenge_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateJsChallengeRequest wrapper for the UpdateJsChallenge operation +type UpdateJsChallengeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The JavaScript challenge settings to be updated. + UpdateJsChallengeDetails JsChallenge `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateJsChallengeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateJsChallengeRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateJsChallengeRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateJsChallengeResponse wrapper for the UpdateJsChallenge operation +type UpdateJsChallengeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateJsChallengeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateJsChallengeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_policy_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_policy_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_policy_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_policy_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdatePolicyConfigRequest wrapper for the UpdatePolicyConfig operation +type UpdatePolicyConfigRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The new configuration to apply to a WAAS policy. + UpdatePolicyConfigDetails PolicyConfig `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdatePolicyConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdatePolicyConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePolicyConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdatePolicyConfigResponse wrapper for the UpdatePolicyConfig operation +type UpdatePolicyConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdatePolicyConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePolicyConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_rules_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_rules_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_rules_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_rules_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateProtectionRulesRequest wrapper for the UpdateProtectionRules operation +type UpdateProtectionRulesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + ProtectionRules []ProtectionRuleAction `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateProtectionRulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateProtectionRulesRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateProtectionRulesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateProtectionRulesResponse wrapper for the UpdateProtectionRules operation +type UpdateProtectionRulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateProtectionRulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateProtectionRulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_settings_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_settings_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_settings_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_protection_settings_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateProtectionSettingsRequest wrapper for the UpdateProtectionSettings operation +type UpdateProtectionSettingsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The details of the protection settings to be updated. + UpdateProtectionSettingsDetails ProtectionSettings `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateProtectionSettingsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateProtectionSettingsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateProtectionSettingsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateProtectionSettingsResponse wrapper for the UpdateProtectionSettings operation +type UpdateProtectionSettingsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateProtectionSettingsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateProtectionSettingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_threat_feeds_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_threat_feeds_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_threat_feeds_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_threat_feeds_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateThreatFeedsRequest wrapper for the UpdateThreatFeeds operation +type UpdateThreatFeedsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // A list of threat feeds for which to update the actions. + ThreatFeeds []ThreatFeedAction `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateThreatFeedsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateThreatFeedsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateThreatFeedsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateThreatFeedsResponse wrapper for the UpdateThreatFeeds operation +type UpdateThreatFeedsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateThreatFeedsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateThreatFeedsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// UpdateWaasPolicyDetails Updates the configuration details of a WAAS policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type UpdateWaasPolicyDetails struct { + + // A user-friendly name for the WAAS policy. The name is can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // An array of additional domains protected by this WAAS policy. + AdditionalDomains []string `mandatory:"false" json:"additionalDomains"` + + // A map of host to origin for the web application. The key should be a customer friendly name for the host, ex. primary, secondary, etc. + Origins map[string]Origin `mandatory:"false" json:"origins"` + + PolicyConfig *PolicyConfig `mandatory:"false" json:"policyConfig"` + + WafConfig *WafConfig `mandatory:"false" json:"wafConfig"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateWaasPolicyDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waas_policy_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateWaasPolicyRequest wrapper for the UpdateWaasPolicy operation +type UpdateWaasPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The details of the WAAS policy to update. + UpdateWaasPolicyDetails `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateWaasPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateWaasPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateWaasPolicyRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateWaasPolicyResponse wrapper for the UpdateWaasPolicy operation +type UpdateWaasPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateWaasPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateWaasPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_address_rate_limiting_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_address_rate_limiting_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_address_rate_limiting_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_address_rate_limiting_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateWafAddressRateLimitingRequest wrapper for the UpdateWafAddressRateLimiting operation +type UpdateWafAddressRateLimitingRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The address rate limiting settings. + UpdateWafAddressRateLimitingDetails AddressRateLimiting `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateWafAddressRateLimitingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateWafAddressRateLimitingRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateWafAddressRateLimitingRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateWafAddressRateLimitingResponse wrapper for the UpdateWafAddressRateLimiting operation +type UpdateWafAddressRateLimitingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateWafAddressRateLimitingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateWafAddressRateLimitingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_config_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_config_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_config_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_waf_config_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateWafConfigRequest wrapper for the UpdateWafConfig operation +type UpdateWafConfigRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + // The new Web Application Firewall configuration to apply to a WAAS policy. + UpdateWafConfigDetails WafConfig `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateWafConfigRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateWafConfigRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateWafConfigRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateWafConfigResponse wrapper for the UpdateWafConfig operation +type UpdateWafConfigResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateWafConfigResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateWafConfigResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_whitelists_request_response.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_whitelists_request_response.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_whitelists_request_response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/update_whitelists_request_response.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +// UpdateWhitelistsRequest wrapper for the UpdateWhitelists operation +type UpdateWhitelistsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"` + + Whitelists []Whitelist `contributesTo:"body"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations + // *Example:* If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateWhitelistsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateWhitelistsRequest) HTTPRequest(method, path string) (http.Request, error) { + return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateWhitelistsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// UpdateWhitelistsResponse wrapper for the UpdateWhitelists operation +type UpdateWhitelistsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateWhitelistsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateWhitelistsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_client.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_client.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_client.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,2167 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/common" + "net/http" +) + +//WaasClient a client for Waas +type WaasClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewWaasClientWithConfigurationProvider Creates a new default Waas client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewWaasClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client WaasClient, err error) { + baseClient, err := common.NewClientWithConfig(configProvider) + if err != nil { + return + } + + client = WaasClient{BaseClient: baseClient} + client.BasePath = "20181116" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *WaasClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).Endpoint("waas") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *WaasClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *WaasClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AcceptRecommendations Accepts a list of recommended Web Application Firewall protection rules. Web Application Firewall protection rule recommendations are sets of rules generated by observed traffic patterns through the Web Application Firewall and are meant to optimize the Web Application Firewall's security profile. Only the rules specified in the request body will be updated; all other rules will remain unchanged. +// Use the `GET /waasPolicies/{waasPolicyId}/wafConfig/recommendations` method to view a list of recommended Web Application Firewall protection rules. For more information, see WAF Protection Rules (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm). +func (client WaasClient) AcceptRecommendations(ctx context.Context, request AcceptRecommendationsRequest) (response AcceptRecommendationsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.acceptRecommendations, policy) + if err != nil { + if ociResponse != nil { + response = AcceptRecommendationsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(AcceptRecommendationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AcceptRecommendationsResponse") + } + return +} + +// acceptRecommendations implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) acceptRecommendations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/waasPolicies/{waasPolicyId}/actions/acceptWafConfigRecommendations") + if err != nil { + return nil, err + } + + var response AcceptRecommendationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CancelWorkRequest Cancels a specified work request. +func (client WaasClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = CancelWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCertificate Allows an SSL certificate to be added to a WAAS policy. The Web Application Firewall terminates SSL connections to inspect requests in runtime, and then re-encrypts requests before sending them to the origin for fulfillment. +// For more information, see WAF Settings (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafsettings.htm). +func (client WaasClient) CreateCertificate(ctx context.Context, request CreateCertificateRequest) (response CreateCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createCertificate, policy) + if err != nil { + if ociResponse != nil { + response = CreateCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCertificateResponse") + } + return +} + +// createCertificate implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) createCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/certificates") + if err != nil { + return nil, err + } + + var response CreateCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateWaasPolicy Creates a new Web Application Acceleration and Security (WAAS) policy in the specified compartment. A WAAS policy must be established before creating Web Application Firewall (WAF) rules. To use WAF rules, your web application's origin servers must defined in the `WaasPolicy` schema. +// A domain name must be specified when creating a WAAS policy. The domain name should be different from the origins specified in your `WaasPolicy`. Once domain name is entered and stored, it is unchangeable. +// Use the record data returned in the `cname` field of the `WaasPolicy` object to create a CNAME record in your DNS configuration that will direct your domain's traffic through the WAF. +// For the purposes of access control, you must provide the OCID of the compartment where you want the service to reside. For information about access control and compartments, see Overview of the IAM Service (https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm). +// You must specify a display name and domain for the WAAS policy. The display name does not have to be unique and can be changed. The domain name should be different from every origin specified in `WaasPolicy`. +// All Oracle Cloud Infrastructure resources, including WAAS policies, receive a unique, Oracle-assigned ID called an Oracle Cloud Identifier (OCID). When a resource is created, you can find its OCID in the response. You can also retrieve a resource's OCID by using a list API operation for that resource type, or by viewing the resource in the Console. Fore more information, see Resource Identifiers (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// **Note:** After sending the POST request, the new object's state will temporarily be `CREATING`. Ensure that the resource's state has changed to `ACTIVE` before use. +func (client WaasClient) CreateWaasPolicy(ctx context.Context, request CreateWaasPolicyRequest) (response CreateWaasPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createWaasPolicy, policy) + if err != nil { + if ociResponse != nil { + response = CreateWaasPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(CreateWaasPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateWaasPolicyResponse") + } + return +} + +// createWaasPolicy implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) createWaasPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPost, "/waasPolicies") + if err != nil { + return nil, err + } + + var response CreateWaasPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCertificate Deletes an SSL certificate from the WAAS service. +func (client WaasClient) DeleteCertificate(ctx context.Context, request DeleteCertificateRequest) (response DeleteCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.deleteCertificate, policy) + if err != nil { + if ociResponse != nil { + response = DeleteCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCertificateResponse") + } + return +} + +// deleteCertificate implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) deleteCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/certificates/{certificateId}") + if err != nil { + return nil, err + } + + var response DeleteCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteWaasPolicy Deletes a policy. +func (client WaasClient) DeleteWaasPolicy(ctx context.Context, request DeleteWaasPolicyRequest) (response DeleteWaasPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.deleteWaasPolicy, policy) + if err != nil { + if ociResponse != nil { + response = DeleteWaasPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(DeleteWaasPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteWaasPolicyResponse") + } + return +} + +// deleteWaasPolicy implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) deleteWaasPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/waasPolicies/{waasPolicyId}") + if err != nil { + return nil, err + } + + var response DeleteWaasPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCertificate Gets the details of an SSL certificate. +func (client WaasClient) GetCertificate(ctx context.Context, request GetCertificateRequest) (response GetCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCertificate, policy) + if err != nil { + if ociResponse != nil { + response = GetCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCertificateResponse") + } + return +} + +// getCertificate implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificates/{certificateId}") + if err != nil { + return nil, err + } + + var response GetCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDeviceFingerprintChallenge Gets the device fingerprint challenge settings in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetDeviceFingerprintChallenge(ctx context.Context, request GetDeviceFingerprintChallengeRequest) (response GetDeviceFingerprintChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDeviceFingerprintChallenge, policy) + if err != nil { + if ociResponse != nil { + response = GetDeviceFingerprintChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetDeviceFingerprintChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDeviceFingerprintChallengeResponse") + } + return +} + +// getDeviceFingerprintChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getDeviceFingerprintChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge") + if err != nil { + return nil, err + } + + var response GetDeviceFingerprintChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHumanInteractionChallenge Gets the human interaction challenge settings in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetHumanInteractionChallenge(ctx context.Context, request GetHumanInteractionChallengeRequest) (response GetHumanInteractionChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHumanInteractionChallenge, policy) + if err != nil { + if ociResponse != nil { + response = GetHumanInteractionChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetHumanInteractionChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHumanInteractionChallengeResponse") + } + return +} + +// getHumanInteractionChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getHumanInteractionChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge") + if err != nil { + return nil, err + } + + var response GetHumanInteractionChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetJsChallenge Gets the JavaScript challenge settings in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetJsChallenge(ctx context.Context, request GetJsChallengeRequest) (response GetJsChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getJsChallenge, policy) + if err != nil { + if ociResponse != nil { + response = GetJsChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetJsChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetJsChallengeResponse") + } + return +} + +// getJsChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getJsChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge") + if err != nil { + return nil, err + } + + var response GetJsChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPolicyConfig Gets the configuration of a WAAS policy. +func (client WaasClient) GetPolicyConfig(ctx context.Context, request GetPolicyConfigRequest) (response GetPolicyConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPolicyConfig, policy) + if err != nil { + if ociResponse != nil { + response = GetPolicyConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetPolicyConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPolicyConfigResponse") + } + return +} + +// getPolicyConfig implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getPolicyConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/policyConfig") + if err != nil { + return nil, err + } + + var response GetPolicyConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetProtectionRule Gets the details of a protection rule in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetProtectionRule(ctx context.Context, request GetProtectionRuleRequest) (response GetProtectionRuleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getProtectionRule, policy) + if err != nil { + if ociResponse != nil { + response = GetProtectionRuleResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetProtectionRuleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetProtectionRuleResponse") + } + return +} + +// getProtectionRule implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getProtectionRule(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules/{protectionRuleKey}") + if err != nil { + return nil, err + } + + var response GetProtectionRuleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetProtectionSettings Gets the protection settings in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetProtectionSettings(ctx context.Context, request GetProtectionSettingsRequest) (response GetProtectionSettingsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getProtectionSettings, policy) + if err != nil { + if ociResponse != nil { + response = GetProtectionSettingsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetProtectionSettingsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetProtectionSettingsResponse") + } + return +} + +// getProtectionSettings implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getProtectionSettings(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings") + if err != nil { + return nil, err + } + + var response GetProtectionSettingsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWaasPolicy Gets the details of a WAAS policy. +func (client WaasClient) GetWaasPolicy(ctx context.Context, request GetWaasPolicyRequest) (response GetWaasPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWaasPolicy, policy) + if err != nil { + if ociResponse != nil { + response = GetWaasPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWaasPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWaasPolicyResponse") + } + return +} + +// getWaasPolicy implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getWaasPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}") + if err != nil { + return nil, err + } + + var response GetWaasPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWafAddressRateLimiting Gets the address rate limiting settings of the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) GetWafAddressRateLimiting(ctx context.Context, request GetWafAddressRateLimitingRequest) (response GetWafAddressRateLimitingResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWafAddressRateLimiting, policy) + if err != nil { + if ociResponse != nil { + response = GetWafAddressRateLimitingResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWafAddressRateLimitingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWafAddressRateLimitingResponse") + } + return +} + +// getWafAddressRateLimiting implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getWafAddressRateLimiting(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting") + if err != nil { + return nil, err + } + + var response GetWafAddressRateLimitingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWafConfig Gets the Web Application Firewall configuration details for a WAAS policy. +func (client WaasClient) GetWafConfig(ctx context.Context, request GetWafConfigRequest) (response GetWafConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWafConfig, policy) + if err != nil { + if ociResponse != nil { + response = GetWafConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWafConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWafConfigResponse") + } + return +} + +// getWafConfig implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getWafConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig") + if err != nil { + return nil, err + } + + var response GetWafConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the details of a specified work request. +func (client WaasClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + response = GetWorkRequestResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) getWorkRequest(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}") + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAccessRules Gets the currently configured access rules for the Web Application Firewall configration of a specified WAAS policy. +// The order of the access rules is important. The rules will be checked in the order they are specified and the first matching rule will be used. +func (client WaasClient) ListAccessRules(ctx context.Context, request ListAccessRulesRequest) (response ListAccessRulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAccessRules, policy) + if err != nil { + if ociResponse != nil { + response = ListAccessRulesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListAccessRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAccessRulesResponse") + } + return +} + +// listAccessRules implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listAccessRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/accessRules") + if err != nil { + return nil, err + } + + var response ListAccessRulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCaptchas Gets the list of currently configured CAPTCHA challenges in the Web +// Application Firewall configuration of a WAAS policy. +// The order of the CAPTCHA challenges is important. The URL for each +// CAPTCHA will be checked in the order they are created. +func (client WaasClient) ListCaptchas(ctx context.Context, request ListCaptchasRequest) (response ListCaptchasResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCaptchas, policy) + if err != nil { + if ociResponse != nil { + response = ListCaptchasResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCaptchasResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCaptchasResponse") + } + return +} + +// listCaptchas implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listCaptchas(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/captchas") + if err != nil { + return nil, err + } + + var response ListCaptchasResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCertificates Gets a list of SSL certificates that can be used in a WAAS policy. +func (client WaasClient) ListCertificates(ctx context.Context, request ListCertificatesRequest) (response ListCertificatesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCertificates, policy) + if err != nil { + if ociResponse != nil { + response = ListCertificatesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListCertificatesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCertificatesResponse") + } + return +} + +// listCertificates implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listCertificates(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificates") + if err != nil { + return nil, err + } + + var response ListCertificatesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListEdgeSubnets Return the list of the tenant's edge node subnets. Use these CIDR blocks to restrict incoming traffic to your origin. These subnets are owned by OCI and forward traffic to customer origins. They are not associated with specific regions or compartments. +func (client WaasClient) ListEdgeSubnets(ctx context.Context, request ListEdgeSubnetsRequest) (response ListEdgeSubnetsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listEdgeSubnets, policy) + if err != nil { + if ociResponse != nil { + response = ListEdgeSubnetsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListEdgeSubnetsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListEdgeSubnetsResponse") + } + return +} + +// listEdgeSubnets implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listEdgeSubnets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/edgeSubnets") + if err != nil { + return nil, err + } + + var response ListEdgeSubnetsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListGoodBots Gets the list of good bots defined in the Web Application Firewall configuration for a WAAS policy. +// The list is sorted ascending by `key`. +func (client WaasClient) ListGoodBots(ctx context.Context, request ListGoodBotsRequest) (response ListGoodBotsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listGoodBots, policy) + if err != nil { + if ociResponse != nil { + response = ListGoodBotsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListGoodBotsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListGoodBotsResponse") + } + return +} + +// listGoodBots implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listGoodBots(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/goodBots") + if err != nil { + return nil, err + } + + var response ListGoodBotsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListProtectionRules Gets the list of protection rules in the Web Application Firewall configuration for a WAAS policy, including currently defined rules and recommended rules. +// The list is sorted ascending by `key`. +func (client WaasClient) ListProtectionRules(ctx context.Context, request ListProtectionRulesRequest) (response ListProtectionRulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listProtectionRules, policy) + if err != nil { + if ociResponse != nil { + response = ListProtectionRulesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListProtectionRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListProtectionRulesResponse") + } + return +} + +// listProtectionRules implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listProtectionRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules") + if err != nil { + return nil, err + } + + var response ListProtectionRulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListRecommendations Gets the list of recommended Web Application Firewall protection rules. +// Use the `POST /waasPolicies/{waasPolicyId}/actions/acceptWafConfigRecommendations` method to accept recommended Web Application Firewall protection rules. For more information, see WAF Protection Rules (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm). +// The list is sorted ascending by `key`. +func (client WaasClient) ListRecommendations(ctx context.Context, request ListRecommendationsRequest) (response ListRecommendationsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listRecommendations, policy) + if err != nil { + if ociResponse != nil { + response = ListRecommendationsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListRecommendationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListRecommendationsResponse") + } + return +} + +// listRecommendations implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listRecommendations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/recommendations") + if err != nil { + return nil, err + } + + var response ListRecommendationsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListThreatFeeds Gets the list of available web application threat intelligence feeds +// and the actions set for each feed. The list is sorted ascending by +// `key`. +func (client WaasClient) ListThreatFeeds(ctx context.Context, request ListThreatFeedsRequest) (response ListThreatFeedsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listThreatFeeds, policy) + if err != nil { + if ociResponse != nil { + response = ListThreatFeedsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListThreatFeedsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListThreatFeedsResponse") + } + return +} + +// listThreatFeeds implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listThreatFeeds(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds") + if err != nil { + return nil, err + } + + var response ListThreatFeedsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWaasPolicies Gets a list of WAAS policies. +func (client WaasClient) ListWaasPolicies(ctx context.Context, request ListWaasPoliciesRequest) (response ListWaasPoliciesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWaasPolicies, policy) + if err != nil { + if ociResponse != nil { + response = ListWaasPoliciesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWaasPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWaasPoliciesResponse") + } + return +} + +// listWaasPolicies implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWaasPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies") + if err != nil { + return nil, err + } + + var response ListWaasPoliciesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWafBlockedRequests Gets the number of blocked requests by a Web Application Firewall feature in five minute blocks, in ascending order by `timeObserved`. +func (client WaasClient) ListWafBlockedRequests(ctx context.Context, request ListWafBlockedRequestsRequest) (response ListWafBlockedRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWafBlockedRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWafBlockedRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWafBlockedRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWafBlockedRequestsResponse") + } + return +} + +// listWafBlockedRequests implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWafBlockedRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/reports/waf/blocked") + if err != nil { + return nil, err + } + + var response ListWafBlockedRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWafLogs Gets structured Web Application Firewall event logs for a WAAS +// policy. The list is sorted by the `timeObserved` starting from the +// oldest recorded event (ascending). +func (client WaasClient) ListWafLogs(ctx context.Context, request ListWafLogsRequest) (response ListWafLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWafLogs, policy) + if err != nil { + if ociResponse != nil { + response = ListWafLogsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWafLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWafLogsResponse") + } + return +} + +// listWafLogs implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWafLogs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafLogs") + if err != nil { + return nil, err + } + + var response ListWafLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWafRequests Gets the number of requests managed by a Web Application Firewall +// over a specified period of time, including blocked requests. Sorted +// by `timeObserved` with oldest requests first (ascending). +func (client WaasClient) ListWafRequests(ctx context.Context, request ListWafRequestsRequest) (response ListWafRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWafRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWafRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWafRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWafRequestsResponse") + } + return +} + +// listWafRequests implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWafRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/reports/waf/requests") + if err != nil { + return nil, err + } + + var response ListWafRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWafTraffic Gets the Web Application Firewall traffic data for a WAAS policy. +// Sorted by `timeObserved` with oldest data points first (ascending). +func (client WaasClient) ListWafTraffic(ctx context.Context, request ListWafTrafficRequest) (response ListWafTrafficResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWafTraffic, policy) + if err != nil { + if ociResponse != nil { + response = ListWafTrafficResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWafTrafficResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWafTrafficResponse") + } + return +} + +// listWafTraffic implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWafTraffic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/reports/waf/traffic") + if err != nil { + return nil, err + } + + var response ListWafTrafficResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWhitelists Gets the list of whitelists defined in the Web Application Firewall configuration for a WAAS policy. +func (client WaasClient) ListWhitelists(ctx context.Context, request ListWhitelistsRequest) (response ListWhitelistsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWhitelists, policy) + if err != nil { + if ociResponse != nil { + response = ListWhitelistsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWhitelistsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWhitelistsResponse") + } + return +} + +// listWhitelists implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWhitelists(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/waasPolicies/{waasPolicyId}/wafConfig/whitelists") + if err != nil { + return nil, err + } + + var response ListWhitelistsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Gets a list of subnets (CIDR notation) from which the WAAS EDGE may make requests. The subnets are owned by OCI and forward traffic to your origins. Allow traffic from these subnets to your origins. They are not associated with specific regions or compartments. +func (client WaasClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + response = ListWorkRequestsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) listWorkRequests(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests") + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateAccessRules Updates the list of access rules in the Web Application Firewall configuration for a specified WAAS policy. Access rules allow explicit actions to be defined and executed for requests that meet various conditions. A rule action can be set to allow, detect, or block requests. The detect setting allows the request to pass through the Web Application Firewall and is tagged with a `DETECT` flag in the Web Application Firewall's log. +// This operation can create, delete, update, and/or reorder access rules depending on the structure of the request body. +// Updating an existing access rule can be accomplished by changing the properties of the access rule object with a non-empty `key` property in the list. +// Reordering of access rules can be accomplished by changing the order of the access rules in the list when updating. +// Creating an access rule can be accomplished by adding a new access rule object to the list without a `key` property. A `key` will be generated for the new access rule upon update. +// Deleting an access rule can be accomplished by removing the existing access rule object from the list. Any existing access rule with a `key` that is not present in the list of access rules sent in the request will be deleted. +func (client WaasClient) UpdateAccessRules(ctx context.Context, request UpdateAccessRulesRequest) (response UpdateAccessRulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateAccessRules, policy) + if err != nil { + if ociResponse != nil { + response = UpdateAccessRulesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAccessRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAccessRulesResponse") + } + return +} + +// updateAccessRules implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateAccessRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/accessRules") + if err != nil { + return nil, err + } + + var response UpdateAccessRulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCaptchas Updates the list of CAPTCHA challenges in the Web Application Firewall configuration for a WAAS policy. +// This operation can create, update, or delete CAPTCHAs depending on the structure of the request body. +// Updating an existing CAPTCHA can be accomplished by changing the properties of the CAPTCHA object with a non-empty `key` property in the list. +// Creating a CAPTCHA can be accomplished by adding a new CAPTCHA object to the list without a `key` property. A `key` will be generated for the new CAPTCHA upon update. +// Deleting a CAPTCHA can be accomplished by removing the existing CAPTCHA object from the list. Any existing CAPTCHA with a `key` that is not present in the list of CAPTCHAs sent in the request will be deleted. +func (client WaasClient) UpdateCaptchas(ctx context.Context, request UpdateCaptchasRequest) (response UpdateCaptchasResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateCaptchas, policy) + if err != nil { + if ociResponse != nil { + response = UpdateCaptchasResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCaptchasResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCaptchasResponse") + } + return +} + +// updateCaptchas implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateCaptchas(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/captchas") + if err != nil { + return nil, err + } + + var response UpdateCaptchasResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCertificate It is not possible to update a certificate, only create and delete. Therefore, this operation can only update the display name, freeform tags, and defined tags of a certificate. +func (client WaasClient) UpdateCertificate(ctx context.Context, request UpdateCertificateRequest) (response UpdateCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCertificate, policy) + if err != nil { + if ociResponse != nil { + response = UpdateCertificateResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCertificateResponse") + } + return +} + +// updateCertificate implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateCertificate(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/certificates/{certificateId}") + if err != nil { + return nil, err + } + + var response UpdateCertificateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateDeviceFingerprintChallenge Updates the Device Fingerprint Challenge (DFC) settings in the Web Application Firewall configuration for a policy. The DFC generates a hashed signature of both virtual and real browsers based on 50+ attributes. These proprietary signatures are then leveraged for real-time correlation to identify and block malicious bots. +// The signature is based on a library of attributes detected via JavaScript listeners; the attributes include OS, screen resolution, fonts, UserAgent, IP address, etc. We are constantly making improvements and considering new libraries to include in our DFC build. We can also exclude attributes from the signature as needed. +// DFC collects attributes to generate a hashed signature about a client – if a fingerprint is not possible, then it will result in a block or alert action. Actions can be enforced across multiple devices if they share they have the same fingerprint. +func (client WaasClient) UpdateDeviceFingerprintChallenge(ctx context.Context, request UpdateDeviceFingerprintChallengeRequest) (response UpdateDeviceFingerprintChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateDeviceFingerprintChallenge, policy) + if err != nil { + if ociResponse != nil { + response = UpdateDeviceFingerprintChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDeviceFingerprintChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDeviceFingerprintChallengeResponse") + } + return +} + +// updateDeviceFingerprintChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateDeviceFingerprintChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge") + if err != nil { + return nil, err + } + + var response UpdateDeviceFingerprintChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateGoodBots Updates the list of good bots in the Web Application Firewall configuration for a policy. Only the fields specified in the request body will be updated, all other configuration properties will remain unchanged. +// Good bots allows you to manage access for bots from known providers, such as Google or Baidu. For more information about good bots, please see Bot Management (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm). +func (client WaasClient) UpdateGoodBots(ctx context.Context, request UpdateGoodBotsRequest) (response UpdateGoodBotsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateGoodBots, policy) + if err != nil { + if ociResponse != nil { + response = UpdateGoodBotsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateGoodBotsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateGoodBotsResponse") + } + return +} + +// updateGoodBots implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateGoodBots(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/goodBots") + if err != nil { + return nil, err + } + + var response UpdateGoodBotsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateHumanInteractionChallenge Updates the Human Interaction Challenge (HIC) settings in the Web Application Firewall configuration for a WAAS policy. HIC is a countermeasure that allows the proxy to check the user's browser for various behaviors that distinguish a human presence from a bot. +func (client WaasClient) UpdateHumanInteractionChallenge(ctx context.Context, request UpdateHumanInteractionChallengeRequest) (response UpdateHumanInteractionChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateHumanInteractionChallenge, policy) + if err != nil { + if ociResponse != nil { + response = UpdateHumanInteractionChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateHumanInteractionChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHumanInteractionChallengeResponse") + } + return +} + +// updateHumanInteractionChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateHumanInteractionChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge") + if err != nil { + return nil, err + } + + var response UpdateHumanInteractionChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateJsChallenge Updates the JavaScript challenge settings in the Web Application Firewall configuration for a WAAS policy. JavaScript Challenge validates that the client can accept JavaScript with a binary decision. For more information, see Bot Management (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm). +func (client WaasClient) UpdateJsChallenge(ctx context.Context, request UpdateJsChallengeRequest) (response UpdateJsChallengeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateJsChallenge, policy) + if err != nil { + if ociResponse != nil { + response = UpdateJsChallengeResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateJsChallengeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateJsChallengeResponse") + } + return +} + +// updateJsChallenge implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateJsChallenge(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge") + if err != nil { + return nil, err + } + + var response UpdateJsChallengeResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdatePolicyConfig Updates the configuration for a WAAS policy. Only the fields specified in the request body will be updated; all other properties will remain unchanged. +func (client WaasClient) UpdatePolicyConfig(ctx context.Context, request UpdatePolicyConfigRequest) (response UpdatePolicyConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updatePolicyConfig, policy) + if err != nil { + if ociResponse != nil { + response = UpdatePolicyConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdatePolicyConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePolicyConfigResponse") + } + return +} + +// updatePolicyConfig implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updatePolicyConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/policyConfig") + if err != nil { + return nil, err + } + + var response UpdatePolicyConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateProtectionRules Updates the action for each specified protection rule. Requests can either be allowed, blocked, or trigger an alert if they meet the parameters of an applied rule. For more information on protection rules, see WAF Protection Rules (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm). +// This operation can update or disable protection rules depending on the structure of the request body. +// Updating an existing protection rule can be accomplished by changing the properties of the protection rule object with a non-empty `key` property in the list. +func (client WaasClient) UpdateProtectionRules(ctx context.Context, request UpdateProtectionRulesRequest) (response UpdateProtectionRulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateProtectionRules, policy) + if err != nil { + if ociResponse != nil { + response = UpdateProtectionRulesResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateProtectionRulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateProtectionRulesResponse") + } + return +} + +// updateProtectionRules implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateProtectionRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules") + if err != nil { + return nil, err + } + + var response UpdateProtectionRulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateProtectionSettings Updates the protection settings in the Web Application Firewall configuration for a WAAS policy. Protection settings allow you define what action is taken when a request is blocked by the Web Application Firewall, such as returning a response code or block page. Only the fields specified in the request body will be updated; all other fields will remain unchanged. +func (client WaasClient) UpdateProtectionSettings(ctx context.Context, request UpdateProtectionSettingsRequest) (response UpdateProtectionSettingsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateProtectionSettings, policy) + if err != nil { + if ociResponse != nil { + response = UpdateProtectionSettingsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateProtectionSettingsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateProtectionSettingsResponse") + } + return +} + +// updateProtectionSettings implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateProtectionSettings(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings") + if err != nil { + return nil, err + } + + var response UpdateProtectionSettingsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateThreatFeeds Updates the action to take when a request's IP address matches an address in the specified threat intelligence feed. Threat intelligence feeds are compiled lists of IP addresses with malicious reputations based on internet intelligence. Only the threat feeds specified in the request body will be updated; all other threat feeds will remain unchanged. +func (client WaasClient) UpdateThreatFeeds(ctx context.Context, request UpdateThreatFeedsRequest) (response UpdateThreatFeedsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateThreatFeeds, policy) + if err != nil { + if ociResponse != nil { + response = UpdateThreatFeedsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateThreatFeedsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateThreatFeedsResponse") + } + return +} + +// updateThreatFeeds implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateThreatFeeds(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds") + if err != nil { + return nil, err + } + + var response UpdateThreatFeedsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateWaasPolicy Updates the details of a WAAS policy, including origins and tags. Only the fields specified in the request body will be updated; all other properties will remain unchanged. +// To update platform provided resources such as `GoodBots`, `ProtectionRules`, and `ThreatFeeds` first retrieve the list of available resources with the related list operation such as `GetThreatFeeds` or `GetProtectionRules`. +// The returned list will contain objects with `key` properties that can be used to update the resource during the `UpdateWaasPolicy` request. +func (client WaasClient) UpdateWaasPolicy(ctx context.Context, request UpdateWaasPolicyRequest) (response UpdateWaasPolicyResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateWaasPolicy, policy) + if err != nil { + if ociResponse != nil { + response = UpdateWaasPolicyResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateWaasPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateWaasPolicyResponse") + } + return +} + +// updateWaasPolicy implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateWaasPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}") + if err != nil { + return nil, err + } + + var response UpdateWaasPolicyResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateWafAddressRateLimiting Updates the address rate limiting settings in the Web Application Firewall configuration for a policy. Rate limiting allows you to configure a threshold for the number of requests from a unique IP address for the given period. You can also define the response code for the requests from the same address that exceed the threshold. +func (client WaasClient) UpdateWafAddressRateLimiting(ctx context.Context, request UpdateWafAddressRateLimitingRequest) (response UpdateWafAddressRateLimitingResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateWafAddressRateLimiting, policy) + if err != nil { + if ociResponse != nil { + response = UpdateWafAddressRateLimitingResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateWafAddressRateLimitingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateWafAddressRateLimitingResponse") + } + return +} + +// updateWafAddressRateLimiting implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateWafAddressRateLimiting(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting") + if err != nil { + return nil, err + } + + var response UpdateWafAddressRateLimitingResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateWafConfig Updates the Web Application Firewall configuration for a specified WAAS policy. +// To update platform provided resources such as `GoodBots`, `ProtectionRules`, and `ThreatFeeds` +// first retrieve the list of available resources with the related list operation such as +// `GetThreatFeeds` or `GetProtectionRules`. +// The returned list will contain objects with `key` properties that can be used to update the +// resource during the `UpdateWafConfig` request. +func (client WaasClient) UpdateWafConfig(ctx context.Context, request UpdateWafConfigRequest) (response UpdateWafConfigResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateWafConfig, policy) + if err != nil { + if ociResponse != nil { + response = UpdateWafConfigResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateWafConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateWafConfigResponse") + } + return +} + +// updateWafConfig implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateWafConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig") + if err != nil { + return nil, err + } + + var response UpdateWafConfigResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateWhitelists Updates the list of IP addresses that bypass the Web Application Firewall for a WAAS policy. Supports both single IP addresses or subnet masks (CIDR notation). +// This operation can create, delete, update, and/or reorder whitelists depending on the structure of the request body. +// Updating an existing whitelist can be accomplished by changing the properties of the whitelist object with a non-empty `key` property in the list. +// Reordering of whitelists can be accomplished by changing the order of the whitelists in the list when updating. +// Creating a whitelist can be accomplished by adding a new whitelist object to the list without a `key` property. A `key` will be generated for the new whitelist upon update. +// Deleting a whitelist can be accomplished by removing the existing whitelist object from the list. Any existing whitelist with a `key` that is not present in the list of whitelists sent in the request will be deleted. +func (client WaasClient) UpdateWhitelists(ctx context.Context, request UpdateWhitelistsRequest) (response UpdateWhitelistsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateWhitelists, policy) + if err != nil { + if ociResponse != nil { + response = UpdateWhitelistsResponse{RawResponse: ociResponse.HTTPResponse()} + } + return + } + if convertedResponse, ok := ociResponse.(UpdateWhitelistsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateWhitelistsResponse") + } + return +} + +// updateWhitelists implements the OCIOperation interface (enables retrying operations) +func (client WaasClient) updateWhitelists(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { + httpRequest, err := request.HTTPRequest(http.MethodPut, "/waasPolicies/{waasPolicyId}/wafConfig/whitelists") + if err != nil { + return nil, err + } + + var response UpdateWhitelistsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WaasPolicy The details of a Web Application Acceleration and Security (WAAS) policy. A policy describes how the WAAS service should operate for the configured web application. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type WaasPolicy struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy's compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name of the WAAS policy. The name can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The web application domain that the WAAS policy protects. + Domain *string `mandatory:"false" json:"domain"` + + // An array of additional domains for this web application. + AdditionalDomains []string `mandatory:"false" json:"additionalDomains"` + + // The CNAME record to add to your DNS configuration to route traffic for the domain, and all additional domains, through the WAF. + Cname *string `mandatory:"false" json:"cname"` + + // The current lifecycle state of the WAAS policy. + LifecycleState WaasPolicyLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The date and time the policy was created, expressed in RFC 3339 timestamp format. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // A map of host to origin for the web application. The key should be a customer friendly name for the host, ex. primary, secondary, etc. + Origins map[string]Origin `mandatory:"false" json:"origins"` + + PolicyConfig *PolicyConfig `mandatory:"false" json:"policyConfig"` + + WafConfig *WafConfig `mandatory:"false" json:"wafConfig"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m WaasPolicy) String() string { + return common.PointerString(m) +} + +// WaasPolicyLifecycleStateEnum Enum with underlying type: string +type WaasPolicyLifecycleStateEnum string + +// Set of constants representing the allowable values for WaasPolicyLifecycleStateEnum +const ( + WaasPolicyLifecycleStateCreating WaasPolicyLifecycleStateEnum = "CREATING" + WaasPolicyLifecycleStateActive WaasPolicyLifecycleStateEnum = "ACTIVE" + WaasPolicyLifecycleStateFailed WaasPolicyLifecycleStateEnum = "FAILED" + WaasPolicyLifecycleStateUpdating WaasPolicyLifecycleStateEnum = "UPDATING" + WaasPolicyLifecycleStateDeleting WaasPolicyLifecycleStateEnum = "DELETING" + WaasPolicyLifecycleStateDeleted WaasPolicyLifecycleStateEnum = "DELETED" +) + +var mappingWaasPolicyLifecycleState = map[string]WaasPolicyLifecycleStateEnum{ + "CREATING": WaasPolicyLifecycleStateCreating, + "ACTIVE": WaasPolicyLifecycleStateActive, + "FAILED": WaasPolicyLifecycleStateFailed, + "UPDATING": WaasPolicyLifecycleStateUpdating, + "DELETING": WaasPolicyLifecycleStateDeleting, + "DELETED": WaasPolicyLifecycleStateDeleted, +} + +// GetWaasPolicyLifecycleStateEnumValues Enumerates the set of values for WaasPolicyLifecycleStateEnum +func GetWaasPolicyLifecycleStateEnumValues() []WaasPolicyLifecycleStateEnum { + values := make([]WaasPolicyLifecycleStateEnum, 0) + for _, v := range mappingWaasPolicyLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waas_policy_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WaasPolicySummary Summary information about a WAAS policy. +// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. +type WaasPolicySummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy's compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name of the WAAS policy. The name can be changed and does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The web application domain that the WAAS policy protects. + Domain *string `mandatory:"false" json:"domain"` + + // The current lifecycle state of the WAAS policy. + LifecycleState WaasPolicySummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The date and time the policy was created, expressed in RFC 3339 timestamp format. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // A simple key-value pair without any defined schema. + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces. + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m WaasPolicySummary) String() string { + return common.PointerString(m) +} + +// WaasPolicySummaryLifecycleStateEnum Enum with underlying type: string +type WaasPolicySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for WaasPolicySummaryLifecycleStateEnum +const ( + WaasPolicySummaryLifecycleStateCreating WaasPolicySummaryLifecycleStateEnum = "CREATING" + WaasPolicySummaryLifecycleStateActive WaasPolicySummaryLifecycleStateEnum = "ACTIVE" + WaasPolicySummaryLifecycleStateFailed WaasPolicySummaryLifecycleStateEnum = "FAILED" + WaasPolicySummaryLifecycleStateUpdating WaasPolicySummaryLifecycleStateEnum = "UPDATING" + WaasPolicySummaryLifecycleStateDeleting WaasPolicySummaryLifecycleStateEnum = "DELETING" + WaasPolicySummaryLifecycleStateDeleted WaasPolicySummaryLifecycleStateEnum = "DELETED" +) + +var mappingWaasPolicySummaryLifecycleState = map[string]WaasPolicySummaryLifecycleStateEnum{ + "CREATING": WaasPolicySummaryLifecycleStateCreating, + "ACTIVE": WaasPolicySummaryLifecycleStateActive, + "FAILED": WaasPolicySummaryLifecycleStateFailed, + "UPDATING": WaasPolicySummaryLifecycleStateUpdating, + "DELETING": WaasPolicySummaryLifecycleStateDeleting, + "DELETED": WaasPolicySummaryLifecycleStateDeleted, +} + +// GetWaasPolicySummaryLifecycleStateEnumValues Enumerates the set of values for WaasPolicySummaryLifecycleStateEnum +func GetWaasPolicySummaryLifecycleStateEnumValues() []WaasPolicySummaryLifecycleStateEnum { + values := make([]WaasPolicySummaryLifecycleStateEnum, 0) + for _, v := range mappingWaasPolicySummaryLifecycleState { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_blocked_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_blocked_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_blocked_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_blocked_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafBlockedRequest The representation of WafBlockedRequest +type WafBlockedRequest struct { + + // The date and time the blocked requests were observed, expressed in RFC 3339 timestamp format. + TimeObserved *common.SDKTime `mandatory:"false" json:"timeObserved"` + + // The number of seconds the data covers. + TimeRangeInSeconds *int `mandatory:"false" json:"timeRangeInSeconds"` + + // The specific Web Application Firewall feature that blocked the requests, such as JavaScript Challenge or Access Control. + WafFeature WafBlockedRequestWafFeatureEnum `mandatory:"false" json:"wafFeature,omitempty"` + + // The count of blocked requests. + Count *int `mandatory:"false" json:"count"` +} + +func (m WafBlockedRequest) String() string { + return common.PointerString(m) +} + +// WafBlockedRequestWafFeatureEnum Enum with underlying type: string +type WafBlockedRequestWafFeatureEnum string + +// Set of constants representing the allowable values for WafBlockedRequestWafFeatureEnum +const ( + WafBlockedRequestWafFeatureProtectionRules WafBlockedRequestWafFeatureEnum = "PROTECTION_RULES" + WafBlockedRequestWafFeatureJsChallenge WafBlockedRequestWafFeatureEnum = "JS_CHALLENGE" + WafBlockedRequestWafFeatureAccessRules WafBlockedRequestWafFeatureEnum = "ACCESS_RULES" + WafBlockedRequestWafFeatureThreatFeeds WafBlockedRequestWafFeatureEnum = "THREAT_FEEDS" + WafBlockedRequestWafFeatureHumanInteractionChallenge WafBlockedRequestWafFeatureEnum = "HUMAN_INTERACTION_CHALLENGE" + WafBlockedRequestWafFeatureDeviceFingerprintChallenge WafBlockedRequestWafFeatureEnum = "DEVICE_FINGERPRINT_CHALLENGE" + WafBlockedRequestWafFeatureCaptcha WafBlockedRequestWafFeatureEnum = "CAPTCHA" + WafBlockedRequestWafFeatureAddressRateLimiting WafBlockedRequestWafFeatureEnum = "ADDRESS_RATE_LIMITING" +) + +var mappingWafBlockedRequestWafFeature = map[string]WafBlockedRequestWafFeatureEnum{ + "PROTECTION_RULES": WafBlockedRequestWafFeatureProtectionRules, + "JS_CHALLENGE": WafBlockedRequestWafFeatureJsChallenge, + "ACCESS_RULES": WafBlockedRequestWafFeatureAccessRules, + "THREAT_FEEDS": WafBlockedRequestWafFeatureThreatFeeds, + "HUMAN_INTERACTION_CHALLENGE": WafBlockedRequestWafFeatureHumanInteractionChallenge, + "DEVICE_FINGERPRINT_CHALLENGE": WafBlockedRequestWafFeatureDeviceFingerprintChallenge, + "CAPTCHA": WafBlockedRequestWafFeatureCaptcha, + "ADDRESS_RATE_LIMITING": WafBlockedRequestWafFeatureAddressRateLimiting, +} + +// GetWafBlockedRequestWafFeatureEnumValues Enumerates the set of values for WafBlockedRequestWafFeatureEnum +func GetWafBlockedRequestWafFeatureEnumValues() []WafBlockedRequestWafFeatureEnum { + values := make([]WafBlockedRequestWafFeatureEnum, 0) + for _, v := range mappingWafBlockedRequestWafFeature { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config_details.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config_details.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config_details.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config_details.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafConfigDetails The Web Application Firewall configuration for the WAAS policy creation. +type WafConfigDetails struct { + + // The access rules applied to the Web Application Firewall. Used for defining custom access policies with the combination of `ALLOW`, `DETECT`, and `BLOCK` rules, based on different criteria. + AccessRules []AccessRule `mandatory:"false" json:"accessRules"` + + // The IP address rate limiting settings used to limit the number of requests from an address. + AddressRateLimiting *AddressRateLimiting `mandatory:"false" json:"addressRateLimiting"` + + // A list of CAPTCHA challenge settings. These are used to challenge requests with a CAPTCHA to block bots. + Captchas []Captcha `mandatory:"false" json:"captchas"` + + // The device fingerprint challenge settings. Used to detect unique devices based on the device fingerprint information collected in order to block bots. + DeviceFingerprintChallenge *DeviceFingerprintChallenge `mandatory:"false" json:"deviceFingerprintChallenge"` + + // The human interaction challenge settings. Used to look for natural human interactions such as mouse movements, time on site, and page scrolling to identify bots. + HumanInteractionChallenge *HumanInteractionChallenge `mandatory:"false" json:"humanInteractionChallenge"` + + // The JavaScript challenge settings. Used to challenge requests with a JavaScript challenge and take the action if a browser has no JavaScript support in order to block bots. + JsChallenge *JsChallenge `mandatory:"false" json:"jsChallenge"` + + // The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but not on update. + Origin *string `mandatory:"false" json:"origin"` + + // The settings to apply to protection rules. + ProtectionSettings *ProtectionSettings `mandatory:"false" json:"protectionSettings"` + + // A list of IP addresses that bypass the Web Application Firewall. + Whitelists []Whitelist `mandatory:"false" json:"whitelists"` +} + +func (m WafConfigDetails) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_config.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafConfig The Web Application Firewall configuration for the WAAS policy. +type WafConfig struct { + + // The access rules applied to the Web Application Firewall. Used for defining custom access policies with the combination of `ALLOW`, `DETECT`, and `BLOCK` rules, based on different criteria. + AccessRules []AccessRule `mandatory:"false" json:"accessRules"` + + // The IP address rate limiting settings used to limit the number of requests from an address. + AddressRateLimiting *AddressRateLimiting `mandatory:"false" json:"addressRateLimiting"` + + // A list of CAPTCHA challenge settings. These are used to challenge requests with a CAPTCHA to block bots. + Captchas []Captcha `mandatory:"false" json:"captchas"` + + // The device fingerprint challenge settings. Used to detect unique devices based on the device fingerprint information collected in order to block bots. + DeviceFingerprintChallenge *DeviceFingerprintChallenge `mandatory:"false" json:"deviceFingerprintChallenge"` + + // A list of bots allowed to access the web application. + GoodBots []GoodBot `mandatory:"false" json:"goodBots"` + + // The human interaction challenge settings. Used to look for natural human interactions such as mouse movements, time on site, and page scrolling to identify bots. + HumanInteractionChallenge *HumanInteractionChallenge `mandatory:"false" json:"humanInteractionChallenge"` + + // The JavaScript challenge settings. Used to challenge requests with a JavaScript challenge and take the action if a browser has no JavaScript support in order to block bots. + JsChallenge *JsChallenge `mandatory:"false" json:"jsChallenge"` + + // The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but not on update. + Origin *string `mandatory:"false" json:"origin"` + + // A list of the protection rules and their details. + ProtectionRules []ProtectionRule `mandatory:"false" json:"protectionRules"` + + // The settings to apply to protection rules. + ProtectionSettings *ProtectionSettings `mandatory:"false" json:"protectionSettings"` + + // A list of threat intelligence feeds and the actions to apply to known malicious traffic based on internet intelligence. + ThreatFeeds []ThreatFeed `mandatory:"false" json:"threatFeeds"` + + // A list of IP addresses that bypass the Web Application Firewall. + Whitelists []Whitelist `mandatory:"false" json:"whitelists"` +} + +func (m WafConfig) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_log.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_log.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_log.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_log.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafLog A list of Web Application Firewall log entries. Each entry is a JSON object whose fields vary based on log type. Logs record what rules and countermeasures are triggered by requests and are used as a basis to move request handling into block mode. +type WafLog struct { + + // The action taken on the request. + Action *string `mandatory:"false" json:"action"` + + // The CAPTCHA action taken on the request. + CaptchaAction *string `mandatory:"false" json:"captchaAction"` + + // The CAPTCHA challenge answer that was expected. + CaptchaExpected *string `mandatory:"false" json:"captchaExpected"` + + // The CAPTCHA challenge answer that was received. + CaptchaReceived *string `mandatory:"false" json:"captchaReceived"` + + // The number of times the CAPTCHA challenge was failed. + CaptchaFailCount *string `mandatory:"false" json:"captchaFailCount"` + + // The IPv4 address of the requesting client. + ClientAddress *string `mandatory:"false" json:"clientAddress"` + + // The name of the country where the request was made. + CountryName *string `mandatory:"false" json:"countryName"` + + // The `User-Agent` header value of the request. + UserAgent *string `mandatory:"false" json:"userAgent"` + + // The domain where the request was sent. + Domain *string `mandatory:"false" json:"domain"` + + // A map of protection rule keys to detection message details. + ProtectionRuleDetections map[string]string `mandatory:"false" json:"protectionRuleDetections"` + + // The HTTP method of the request. + HttpMethod *string `mandatory:"false" json:"httpMethod"` + + // The path and query string of the request. + RequestUrl *string `mandatory:"false" json:"requestUrl"` + + // The map of header names to values of the request sent to the origin. + HttpHeaders map[string]string `mandatory:"false" json:"httpHeaders"` + + // The `Referrer` header value of the request. + Referrer *string `mandatory:"false" json:"referrer"` + + // The status code of the response. + ResponseCode *int `mandatory:"false" json:"responseCode"` + + // The size in bytes of the response. + ResponseSize *int `mandatory:"false" json:"responseSize"` + + // The incident key that matched the request. + IncidentKey *string `mandatory:"false" json:"incidentKey"` + + // TODO: what is this? MD5 hash of the request? SHA1? + Fingerprint *string `mandatory:"false" json:"fingerprint"` + + // The type of device that the request was made from. + Device *string `mandatory:"false" json:"device"` + + // The ISO 3166-1 country code of the request. + CountryCode *string `mandatory:"false" json:"countryCode"` + + // A map of header names to values of the original request. + RequestHeaders map[string]string `mandatory:"false" json:"requestHeaders"` + + // The `ThreatFeed` key that matched the request. + ThreatFeedKey *string `mandatory:"false" json:"threatFeedKey"` + + // The `AccessRule` key that matched the request. + AccessRuleKey *string `mandatory:"false" json:"accessRuleKey"` + + // The `AddressRateLimiting` key that matched the request. + AddressRateLimitingKey *string `mandatory:"false" json:"addressRateLimitingKey"` + + // The `Date` header value of the request. + Timestamp *string `mandatory:"false" json:"timestamp"` + + // The type of log of the request. + LogType *string `mandatory:"false" json:"logType"` + + // The address of the origin server where the request was sent. + OriginAddress *string `mandatory:"false" json:"originAddress"` + + // The amount of time it took the origin server to respond to the request. + // TODO: determine unit of time and example + OriginResponseTime *string `mandatory:"false" json:"originResponseTime"` +} + +func (m WafLog) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_meter_datum.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_meter_datum.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_meter_datum.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_meter_datum.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafMeterDatum The representation of WafMeterDatum +type WafMeterDatum struct { + + // The date and time the traffic was observed, rounded down to the start of a range, and expressed in RFC 3339 timestamp format. + TimeObserved *common.SDKTime `mandatory:"false" json:"timeObserved"` + + // The number of seconds this data covers. + TimeRangeInSeconds *int `mandatory:"false" json:"timeRangeInSeconds"` + + // The tenancy OCID of the data. + TenancyId *string `mandatory:"false" json:"tenancyId"` + + // The compartment OCID of the data. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The policy OCID of the data. + WaasPolicyId *string `mandatory:"false" json:"waasPolicyId"` + + // True if origin (endpoint) is an OCI resource. False if external. + IsOciOrigin *bool `mandatory:"false" json:"isOciOrigin"` + + // True if bot manager is enabled. + IsBotEnabled *bool `mandatory:"false" json:"isBotEnabled"` + + // The number of incoming requests. + RequestCount *int `mandatory:"false" json:"requestCount"` + + // Traffic in bytes. + TrafficInBytes *int `mandatory:"false" json:"trafficInBytes"` + + // The tag slug for the specified `waasPolicyId`. + TagSlug []byte `mandatory:"false" json:"tagSlug"` +} + +func (m WafMeterDatum) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafRequest A time series of request counts handled by the Web Application Firewall, including blocked requests. +type WafRequest struct { + + // The date and time the traffic was observed, rounded down to the start of a range, and expressed in RFC 3339 timestamp format. + TimeObserved *common.SDKTime `mandatory:"false" json:"timeObserved"` + + // The number of seconds this data covers. + TimeRangeInSeconds *int `mandatory:"false" json:"timeRangeInSeconds"` + + // The total number of requests received in this time period. + Count *int `mandatory:"false" json:"count"` +} + +func (m WafRequest) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_traffic_datum.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_traffic_datum.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_traffic_datum.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/waf_traffic_datum.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WafTrafficDatum A time series of traffic data for the Web Application Firewall configured for a policy. +type WafTrafficDatum struct { + + // The date and time the traffic was observed, rounded down to the start of the range, and expressed in RFC 3339 timestamp format. + TimeObserved *common.SDKTime `mandatory:"false" json:"timeObserved"` + + // The number of seconds this data covers. + TimeRangeInSeconds *int `mandatory:"false" json:"timeRangeInSeconds"` + + // The tenancy OCID of the data. + TenancyId *string `mandatory:"false" json:"tenancyId"` + + // The compartment OCID of the data. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The policy OCID of the data. + WaasPolicyId *string `mandatory:"false" json:"waasPolicyId"` + + // Traffic in bytes. + TrafficInBytes *int `mandatory:"false" json:"trafficInBytes"` +} + +func (m WafTrafficDatum) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/whitelist.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/whitelist.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/whitelist.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/whitelist.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// Whitelist An array of IP addresses that bypass the Web Application Firewall. Supports both single IP addresses or subnet masks (CIDR notation). +type Whitelist struct { + + // The unique name of the whitelist. + Name *string `mandatory:"true" json:"name"` + + // A set of IP addresses or CIDR notations to include in the whitelist. + Addresses []string `mandatory:"true" json:"addresses"` +} + +func (m Whitelist) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_error.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_error.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_error.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,30 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestError An object returned in the event of a work request error. +type WorkRequestError struct { + + // A machine-usable code for the error that occurred. + Code *string `mandatory:"false" json:"code"` + + // The error message. + Message *string `mandatory:"false" json:"message"` + + // The date and time the work request error happened, expressed in RFC 3339 timestamp format. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequest Many of the API requests you use to create and configure WAAS policies do not take effect immediately. In these cases, the request spawns an asynchronous work flow to fulfill the request. `WorkRequest` objects provide visibility for in-progress work flows. For more information about work requests, see Viewing the State of a Work Request (https://docs.cloud.oracle.com/Content/Balance/Tasks/viewingworkrequest.htm). +type WorkRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // A description of the operation requested by the work request. + OperationType WorkRequestOperationTypeEnum `mandatory:"true" json:"operationType"` + + // The current status of the work request. + Status WorkRequestStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the work request was created, in the format defined by RFC3339. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request moved from the `ACCEPTED` state to the `IN_PROGRESS` state, expressed in RFC 3339 timestamp format. + TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + + // The date and time the work request was fulfilled or terminated, expressed in RFC 3339 timestamp format. + TimeFinished *common.SDKTime `mandatory:"true" json:"timeFinished"` + + // The resources being used to complete the work request operation. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The percentage of work completed by the work request. + PercentComplete *int `mandatory:"false" json:"percentComplete"` + + // The list of log entries from the work request workflow. + Logs []WorkRequestLogEntry `mandatory:"false" json:"logs"` + + // The list of errors that occurred while fulfilling the work request. + Errors []WorkRequestError `mandatory:"false" json:"errors"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// WorkRequestOperationTypeEnum Enum with underlying type: string +type WorkRequestOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestOperationTypeEnum +const ( + WorkRequestOperationTypeCreateWaasPolicy WorkRequestOperationTypeEnum = "CREATE_WAAS_POLICY" + WorkRequestOperationTypeUpdateWaasPolicy WorkRequestOperationTypeEnum = "UPDATE_WAAS_POLICY" + WorkRequestOperationTypeDeleteWaasPolicy WorkRequestOperationTypeEnum = "DELETE_WAAS_POLICY" + WorkRequestOperationTypePurgeWaasPolicy WorkRequestOperationTypeEnum = "PURGE_WAAS_POLICY" +) + +var mappingWorkRequestOperationType = map[string]WorkRequestOperationTypeEnum{ + "CREATE_WAAS_POLICY": WorkRequestOperationTypeCreateWaasPolicy, + "UPDATE_WAAS_POLICY": WorkRequestOperationTypeUpdateWaasPolicy, + "DELETE_WAAS_POLICY": WorkRequestOperationTypeDeleteWaasPolicy, + "PURGE_WAAS_POLICY": WorkRequestOperationTypePurgeWaasPolicy, +} + +// GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum +func GetWorkRequestOperationTypeEnumValues() []WorkRequestOperationTypeEnum { + values := make([]WorkRequestOperationTypeEnum, 0) + for _, v := range mappingWorkRequestOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestStatusEnum Enum with underlying type: string +type WorkRequestStatusEnum string + +// Set of constants representing the allowable values for WorkRequestStatusEnum +const ( + WorkRequestStatusAccepted WorkRequestStatusEnum = "ACCEPTED" + WorkRequestStatusInProgress WorkRequestStatusEnum = "IN_PROGRESS" + WorkRequestStatusFailed WorkRequestStatusEnum = "FAILED" + WorkRequestStatusSucceeded WorkRequestStatusEnum = "SUCCEEDED" + WorkRequestStatusCanceling WorkRequestStatusEnum = "CANCELING" + WorkRequestStatusCanceled WorkRequestStatusEnum = "CANCELED" +) + +var mappingWorkRequestStatus = map[string]WorkRequestStatusEnum{ + "ACCEPTED": WorkRequestStatusAccepted, + "IN_PROGRESS": WorkRequestStatusInProgress, + "FAILED": WorkRequestStatusFailed, + "SUCCEEDED": WorkRequestStatusSucceeded, + "CANCELING": WorkRequestStatusCanceling, + "CANCELED": WorkRequestStatusCanceled, +} + +// GetWorkRequestStatusEnumValues Enumerates the set of values for WorkRequestStatusEnum +func GetWorkRequestStatusEnumValues() []WorkRequestStatusEnum { + values := make([]WorkRequestStatusEnum, 0) + for _, v := range mappingWorkRequestStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_log_entry.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_log_entry.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_log_entry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_log_entry.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,27 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestLogEntry A log message for a work request. +type WorkRequestLogEntry struct { + + // The log message. + Message *string `mandatory:"false" json:"message"` + + // The date and time the work request log event happend, expressed in RFC 3339 timestamp format. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_operation_types.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_operation_types.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_operation_types.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_operation_types.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestOperationTypes An enum value indicating the operation being performed by the work request. +type WorkRequestOperationTypes struct { +} + +func (m WorkRequestOperationTypes) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_resource.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_resource.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_resource.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestResource The resource on which the work request is operating. +type WorkRequestResource struct { + + // How the work request affects the resource. + ActionType WorkRequestResourceActionTypeEnum `mandatory:"false" json:"actionType,omitempty"` + + // The resource type the work request affects. + EntityType *string `mandatory:"false" json:"entityType"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource that the work request affects. + Identifier *string `mandatory:"false" json:"identifier"` + + // The URI path used while performing a `GET` to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// WorkRequestResourceActionTypeEnum Enum with underlying type: string +type WorkRequestResourceActionTypeEnum string + +// Set of constants representing the allowable values for WorkRequestResourceActionTypeEnum +const ( + WorkRequestResourceActionTypeInProgress WorkRequestResourceActionTypeEnum = "IN_PROGRESS" + WorkRequestResourceActionTypeCreated WorkRequestResourceActionTypeEnum = "CREATED" + WorkRequestResourceActionTypeUpdated WorkRequestResourceActionTypeEnum = "UPDATED" + WorkRequestResourceActionTypeDeleted WorkRequestResourceActionTypeEnum = "DELETED" + WorkRequestResourceActionTypeRelated WorkRequestResourceActionTypeEnum = "RELATED" + WorkRequestResourceActionTypePurged WorkRequestResourceActionTypeEnum = "PURGED" +) + +var mappingWorkRequestResourceActionType = map[string]WorkRequestResourceActionTypeEnum{ + "IN_PROGRESS": WorkRequestResourceActionTypeInProgress, + "CREATED": WorkRequestResourceActionTypeCreated, + "UPDATED": WorkRequestResourceActionTypeUpdated, + "DELETED": WorkRequestResourceActionTypeDeleted, + "RELATED": WorkRequestResourceActionTypeRelated, + "PURGED": WorkRequestResourceActionTypePurged, +} + +// GetWorkRequestResourceActionTypeEnumValues Enumerates the set of values for WorkRequestResourceActionTypeEnum +func GetWorkRequestResourceActionTypeEnumValues() []WorkRequestResourceActionTypeEnum { + values := make([]WorkRequestResourceActionTypeEnum, 0) + for _, v := range mappingWorkRequestResourceActionType { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_status_values.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_status_values.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_status_values.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_status_values.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,21 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestStatusValues The possible status values for a work request. +type WorkRequestStatusValues struct { +} + +func (m WorkRequestStatusValues) String() string { + return common.PointerString(m) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_summary.go juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_summary.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_summary.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/waas/work_request_summary.go 2019-06-28 17:13:01.000000000 +0000 @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. +// Code generated. DO NOT EDIT. + +// Web Application Acceleration and Security Services API +// +// OCI Web Application Acceleration and Security Services +// + +package waas + +import ( + "github.com/oracle/oci-go-sdk/common" +) + +// WorkRequestSummary The summarized details of a work request. +type WorkRequestSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // A description of the operation requested by the work request. + OperationType WorkRequestSummaryOperationTypeEnum `mandatory:"true" json:"operationType"` + + // The current status of the work request. + Status WorkRequestSummaryStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the work request was created, expressed in RFC 3339 timestamp format. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request moved from the `ACCEPTED` state to the `IN_PROGRESS` state, expressed in RFC 3339 timestamp format. + TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + + // The date and time the work request was fulfilled or terminated, in the format defined by RFC3339. + TimeFinished *common.SDKTime `mandatory:"true" json:"timeFinished"` + + // The resources being used to complete the work request operation. + Resources []WorkRequestResource `mandatory:"false" json:"resources"` + + // The percentage of work completed by the work request. + PercentComplete *int `mandatory:"false" json:"percentComplete"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// WorkRequestSummaryOperationTypeEnum Enum with underlying type: string +type WorkRequestSummaryOperationTypeEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryOperationTypeEnum +const ( + WorkRequestSummaryOperationTypeCreateWaasPolicy WorkRequestSummaryOperationTypeEnum = "CREATE_WAAS_POLICY" + WorkRequestSummaryOperationTypeUpdateWaasPolicy WorkRequestSummaryOperationTypeEnum = "UPDATE_WAAS_POLICY" + WorkRequestSummaryOperationTypeDeleteWaasPolicy WorkRequestSummaryOperationTypeEnum = "DELETE_WAAS_POLICY" + WorkRequestSummaryOperationTypePurgeWaasPolicy WorkRequestSummaryOperationTypeEnum = "PURGE_WAAS_POLICY" +) + +var mappingWorkRequestSummaryOperationType = map[string]WorkRequestSummaryOperationTypeEnum{ + "CREATE_WAAS_POLICY": WorkRequestSummaryOperationTypeCreateWaasPolicy, + "UPDATE_WAAS_POLICY": WorkRequestSummaryOperationTypeUpdateWaasPolicy, + "DELETE_WAAS_POLICY": WorkRequestSummaryOperationTypeDeleteWaasPolicy, + "PURGE_WAAS_POLICY": WorkRequestSummaryOperationTypePurgeWaasPolicy, +} + +// GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum +func GetWorkRequestSummaryOperationTypeEnumValues() []WorkRequestSummaryOperationTypeEnum { + values := make([]WorkRequestSummaryOperationTypeEnum, 0) + for _, v := range mappingWorkRequestSummaryOperationType { + values = append(values, v) + } + return values +} + +// WorkRequestSummaryStatusEnum Enum with underlying type: string +type WorkRequestSummaryStatusEnum string + +// Set of constants representing the allowable values for WorkRequestSummaryStatusEnum +const ( + WorkRequestSummaryStatusAccepted WorkRequestSummaryStatusEnum = "ACCEPTED" + WorkRequestSummaryStatusInProgress WorkRequestSummaryStatusEnum = "IN_PROGRESS" + WorkRequestSummaryStatusFailed WorkRequestSummaryStatusEnum = "FAILED" + WorkRequestSummaryStatusSucceeded WorkRequestSummaryStatusEnum = "SUCCEEDED" + WorkRequestSummaryStatusCanceling WorkRequestSummaryStatusEnum = "CANCELING" + WorkRequestSummaryStatusCanceled WorkRequestSummaryStatusEnum = "CANCELED" +) + +var mappingWorkRequestSummaryStatus = map[string]WorkRequestSummaryStatusEnum{ + "ACCEPTED": WorkRequestSummaryStatusAccepted, + "IN_PROGRESS": WorkRequestSummaryStatusInProgress, + "FAILED": WorkRequestSummaryStatusFailed, + "SUCCEEDED": WorkRequestSummaryStatusSucceeded, + "CANCELING": WorkRequestSummaryStatusCanceling, + "CANCELED": WorkRequestSummaryStatusCanceled, +} + +// GetWorkRequestSummaryStatusEnumValues Enumerates the set of values for WorkRequestSummaryStatusEnum +func GetWorkRequestSummaryStatusEnumValues() []WorkRequestSummaryStatusEnum { + values := make([]WorkRequestSummaryStatusEnum, 0) + for _, v := range mappingWorkRequestSummaryStatus { + values = append(values, v) + } + return values +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/wercker.yml juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/wercker.yml --- juju-core-2.6.2/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/wercker.yml 2019-05-14 17:32:27.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/github.com/oracle/oci-go-sdk/wercker.yml 2019-06-28 17:13:01.000000000 +0000 @@ -8,8 +8,9 @@ - script: name: golint-prepare code: | - go get github.com/golang/lint/golint - go install github.com/golang/lint/golint + go get golang.org/x/lint/golint + go install golang.org/x/lint/golint + go get -v github.com/stretchr/testify - script: name: symlinking src code diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/json.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/json.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/json.go 2019-05-14 17:31:50.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/json.go 2019-06-28 17:12:19.000000000 +0000 @@ -112,6 +112,10 @@ if err != nil { return nil, err } + // Image response id can be empty when using block device mapping. + if entity.Id == "" { + return data, nil + } id := convertId(entity.Id) return appendJSON(data, idTag, id) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/live_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/live_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/live_test.go 2019-05-14 17:31:50.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/live_test.go 2019-06-28 17:12:19.000000000 +0000 @@ -693,3 +693,57 @@ c.Assert(server.Metadata["k1"], gc.Equals, "v1.replacement") c.Assert(server.Metadata["k2"], gc.Equals, "v2.replacement") } + +func (s *LiveTests) TestCreateServerBlockDeviceMappingLocal(c *gc.C) { + entity, err := s.nova.RunServer(nova.RunServerOpts{ + Name: "inst-block-device-mapping-local", + FlavorId: s.testFlavorId, + AvailabilityZone: s.testAvailabilityZone, + Networks: []nova.ServerNetworks{{ + NetworkId: s.testNetwork, + }}, + ImageId: s.testImageId, + BlockDeviceMappings: []nova.BlockDeviceMapping{{ + BootIndex: 0, + SourceType: "image", + UUID: s.testImageId, + DestinationType: "local", + DeleteOnTermination: true, + }}, + }) + c.Assert(err, gc.IsNil) + defer s.nova.DeleteServer(entity.Id) + s.waitTestServerCompleteBuilding(c, entity.Id) + + server, err := s.nova.GetServer(entity.Id) + c.Assert(err, gc.IsNil) + c.Assert(server, gc.NotNil) + c.Assert(server.Status, gc.Equals, nova.StatusActive) +} + +func (s *LiveTests) TestCreateServerBlockDeviceMappingVolume(c *gc.C) { + entity, err := s.nova.RunServer(nova.RunServerOpts{ + Name: "inst-block-device-mapping-volume", + FlavorId: s.testFlavorId, + AvailabilityZone: s.testAvailabilityZone, + Networks: []nova.ServerNetworks{{ + NetworkId: s.testNetwork, + }}, + BlockDeviceMappings: []nova.BlockDeviceMapping{{ + BootIndex: 0, + SourceType: "image", + UUID: s.testImageId, + DestinationType: "volume", + VolumeSize: 20, + DeleteOnTermination: true, + }}, + }) + c.Assert(err, gc.IsNil) + defer s.nova.DeleteServer(entity.Id) + s.waitTestServerCompleteBuilding(c, entity.Id) + + server, err := s.nova.GetServer(entity.Id) + c.Assert(err, gc.IsNil) + c.Assert(server, gc.NotNil) + c.Assert(server.Status, gc.Equals, nova.StatusActive) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/nova.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/nova.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/nova.go 2019-05-14 17:31:50.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/nova/nova.go 2019-06-28 17:12:19.000000000 +0000 @@ -325,15 +325,34 @@ // RunServerOpts defines required and optional arguments for RunServer(). type RunServerOpts struct { - Name string `json:"name"` // Required - FlavorId string `json:"flavorRef"` // Required - ImageId string `json:"imageRef"` // Required - UserData []byte `json:"user_data,omitempty"` // Optional - SecurityGroupNames []SecurityGroupName `json:"security_groups,omitempty"` // Optional - Networks []ServerNetworks `json:"networks"` // Optional - AvailabilityZone string `json:"availability_zone,omitempty"` // Optional - Metadata map[string]string `json:"metadata,omitempty"` // Optional - ConfigDrive bool `json:"config_drive,omitempty"` // Optional + Name string `json:"name"` // Required + FlavorId string `json:"flavorRef"` // Required + ImageId string `json:"imageRef,omitempty"` // Optional + UserData []byte `json:"user_data,omitempty"` // Optional + SecurityGroupNames []SecurityGroupName `json:"security_groups,omitempty"` // Optional + Networks []ServerNetworks `json:"networks"` // Optional + AvailabilityZone string `json:"availability_zone,omitempty"` // Optional + Metadata map[string]string `json:"metadata,omitempty"` // Optional + ConfigDrive bool `json:"config_drive,omitempty"` // Optional + BlockDeviceMappings []BlockDeviceMapping `json:"block_device_mapping_v2,omitempty"` // Optional +} + +// BlockDeviceMapping defines block devices to be attached to the Server created by RunServer(). +// See: https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail +type BlockDeviceMapping struct { + BootIndex int `json:"boot_index"` + UUID string `json:"uuid,omitempty"` + SourceType string `json:"source_type,omitempty"` + DestinationType string `json:"destination_type,omitempty"` + VolumeSize int `json:"volume_size,omitempty"` + VolumeType string `json:"volume_type,omitempty"` + DeleteOnTermination bool `json:"delete_on_termination,omitempty"` + DeviceName string `json:"device_name,omitempty"` + DeviceType string `json:"device_type,omitempty"` + DiskBus string `json:"disk_bus,omitempty"` + GuestFormat string `json:"guest_format,omitempty"` + NoDevice bool `json:"no_device,omitempty"` + Tag string `json:"tag,omitempty"` } // RunServer creates a new server, based on the given RunServerOpts. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service.go 2019-05-14 17:31:50.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service.go 2019-06-28 17:12:19.000000000 +0000 @@ -93,9 +93,9 @@ } // Real openstack instances have flavours "out of the box". So we add some here. defaultFlavors := []nova.FlavorDetail{ - {Id: "1", Name: "m1.tiny", RAM: 512, VCPUs: 1}, - {Id: "2", Name: "m1.small", RAM: 2048, VCPUs: 1}, - {Id: "3", Name: "m1.medium", RAM: 4096, VCPUs: 2}, + {Id: "1", Name: "m1.tiny", RAM: 512, VCPUs: 1, Disk: 5}, + {Id: "2", Name: "m1.small", RAM: 2048, VCPUs: 1, Disk: 10}, + {Id: "3", Name: "m1.medium", RAM: 4096, VCPUs: 2, Disk: 15}, } // Real openstack instances have a default security group "out of the box". So we add it here. defaultSecurityGroups := []nova.SecurityGroup{ diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service_http.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service_http.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service_http.go 2019-05-14 17:31:50.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/goose.v2/testservices/novaservice/service_http.go 2019-06-28 17:12:19.000000000 +0000 @@ -602,13 +602,14 @@ func (n *Nova) handleRunServer(body []byte, w http.ResponseWriter, r *http.Request) error { var req struct { Server struct { - FlavorRef string - ImageRef string - Name string - Metadata map[string]string - SecurityGroups []map[string]string `json:"security_groups"` - Networks []map[string]string - AvailabilityZone string `json:"availability_zone"` + FlavorRef string + ImageRef string + Name string + Metadata map[string]string + SecurityGroups []map[string]string `json:"security_groups"` + Networks []map[string]string + AvailabilityZone string `json:"availability_zone"` + BlockDeviceMapping []nova.BlockDeviceMapping `json:"block_device_mapping_v2,omitempty"` } } if err := json.Unmarshal(body, &req); err != nil { @@ -617,7 +618,7 @@ if req.Server.Name == "" { return errBadRequestSrvName } - if req.Server.ImageRef == "" { + if req.Server.ImageRef == "" && req.Server.BlockDeviceMapping == nil { return errBadRequestSrvImage } if req.Server.FlavorRef == "" { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/actions.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/actions.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/actions.go 2019-05-14 17:32:11.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/actions.go 2019-06-28 17:12:00.000000000 +0000 @@ -94,7 +94,7 @@ return schema.InsertDefaults(target) } -// ReadActions builds an Actions spec from a charm's actions.yaml. +// ReadActionsYaml builds an Actions spec from a charm's actions.yaml. func ReadActionsYaml(r io.Reader) (*Actions, error) { data, err := ioutil.ReadAll(r) if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata.go 2019-05-14 17:32:11.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata.go 2019-06-28 17:12:00.000000000 +0000 @@ -136,6 +136,11 @@ // not referred to by a unit placement directive. Machines map[string]*MachineSpec `bson:",omitempty" json:",omitempty" yaml:",omitempty"` + // Saas holds one entry for each software as a service (SAAS) for cross + // model relation (CMR). These will be mapped to the consuming side when + // deploying a bundle. + Saas map[string]*SaasSpec `bson:"saas,omitempty" json:"saas,omitempty" yaml:"saas,omitempty"` + // Series holds the default series to use when // the bundle chooses charms. Series string `bson:",omitempty" json:",omitempty" yaml:",omitempty"` @@ -168,6 +173,12 @@ return d.unmarshaledWithServices } +// SaasSpec represents a single software as a service (SAAS) node. +// This will be mapped to consuming of offers from a bundle deployment. +type SaasSpec struct { + URL string `bson:",omitempty" json:",omitempty" yaml:",omitempty"` +} + // MachineSpec represents a notional machine that will be mapped // onto an actual machine at bundle deployment time. type MachineSpec struct { @@ -297,9 +308,28 @@ // EndpointBindings maps how endpoints are bound to spaces EndpointBindings map[string]string `bson:"bindings,omitempty" json:"bindings,omitempty" yaml:"bindings,omitempty"` + // Offers holds one entry for each exported offer for this application + // where the key is the offer name. + Offers map[string]*OfferSpec `bson:"offers,omitempty" json:"offers,omitempty" yaml:"offers,omitempty"` + // Plan specifies the plan under which the application is to be deployed. // If "default", the default plan will be used for the charm Plan string `bson:"plan,omitempty" json:"plan,omitempty" yaml:"plan,omitempty"` + + // RequiresTrust indicates that the application requires access to + // cloud credentials and must therefore be explicitly trusted by the + // operator before it can be deployed. + RequiresTrust bool `bson:"trust,omitempty" json:"trust,omitempty" yaml:"trust,omitempty"` +} + +// OfferSpec describes an offer for a particular application. +type OfferSpec struct { + // The list of endpoints exposed via the offer. + Endpoints []string `bson:"endpoints" json:"endpoints" yaml:"endpoints"` + + // The access control list for this offer. The keys are users and the + // values are access permissions. + ACL map[string]string `bson:"acl,omitempty" json:"acl,omitempty" yaml:"acl,omitempty"` } // ReadBundleData reads bundle data from the given reader. @@ -481,6 +511,7 @@ if bd.Series != "" && !IsValidSeries(bd.Series) { verifier.addErrorf("bundle declares an invalid series %q", bd.Series) } + verifier.verifySaas() verifier.verifyMachines() verifier.verifyApplications() verifier.verifyRelations() @@ -499,8 +530,32 @@ validMachineId = regexp.MustCompile("^" + names.NumberSnippet + "$") validStorageName = regexp.MustCompile("^" + names.StorageNameSnippet + "$") validDeviceName = regexp.MustCompile("^" + "(?:[a-z][a-z0-9]*(?:-[a-z0-9]*[a-z][a-z0-9]*)*)" + "$") + + // When the operator consumes the offer a pseudo-application with the + // offer name will be created by the controller. So using the application + // name regex makes sense here. Likewise we can use the relation regex + // to validate the endpoint name. + validOfferName = regexp.MustCompile("^" + names.ApplicationSnippet + "$") + validOfferEndpointName = regexp.MustCompile("^" + names.RelationSnippet + "$") ) +func (verifier *bundleDataVerifier) verifySaas() { + for name, saas := range verifier.bd.Saas { + if _, ok := verifier.bd.Applications[name]; ok { + verifier.addErrorf("application %[1]q already exists with SAAS %[1]q name", name) + } + if !validOfferName.MatchString(name) { + verifier.addErrorf("invalid SAAS name %q found", name) + } + if saas == nil { + continue + } + if saas.URL != "" && !IsValidOfferURL(saas.URL) { + verifier.addErrorf("invalid offer URL %q for SAAS %s", saas.URL, name) + } + } +} + func (verifier *bundleDataVerifier) verifyMachines() { for id, m := range verifier.bd.Machines { if !validMachineId.MatchString(id) { @@ -529,6 +584,9 @@ if app.Charm == "" { verifier.addErrorf("empty charm path") } + if _, ok := verifier.bd.Saas[name]; ok { + verifier.addErrorf("SAAS %[1]q already exists with application %[1]q name", name) + } // Charm may be a local directory or a charm URL. var curl *URL var err error @@ -583,6 +641,18 @@ verifier.addErrorf("invalid device %q in application %q: %v", deviceName, name, err) } } + // Check the offers. + for offerName, oSpec := range app.Offers { + if !validOfferName.MatchString(offerName) { + verifier.addErrorf("invalid offer name %q in application %q", offerName, name) + } + + for _, endpoint := range oSpec.Endpoints { + if !validOfferEndpointName.MatchString(endpoint) { + verifier.addErrorf("invalid endpoint name %q for offer %q in application %q", endpoint, offerName, name) + } + } + } if verifier.charms != nil { if ch, ok := verifier.charms[app.Charm]; ok { if ch.Meta().Subordinate { @@ -692,9 +762,17 @@ relParseErr = true continue } - if _, ok := verifier.bd.Applications[ep.application]; !ok { + // with the introduction of the SAAS block to bundles, we should + // test that not only is the expected application is in the + // applications block, but if it's not, is it in the SAAS offering. + _, foundApp := verifier.bd.Applications[ep.application] + _, foundSaas := verifier.bd.Saas[ep.application] + if !foundApp && !foundSaas { verifier.addErrorf("relation %q refers to application %q not defined in this bundle", relPair, ep.application) } + if foundApp && foundSaas { + verifier.addErrorf("ambiguous relation %q refers to a application and a SAAS in this bundle", ep.application) + } epPair[i] = ep } if relParseErr { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata_test.go 2019-05-14 17:32:11.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/bundledata_test.go 2019-06-28 17:12:00.000000000 +0000 @@ -230,6 +230,122 @@ }, }, }, +}, { + about: "application requiring explicit trust", + data: ` +applications: + aws-integrator: + charm: cs:~containers/aws-integrator + num_units: 1 + trust: true +`, + expectedBD: &charm.BundleData{ + Applications: map[string]*charm.ApplicationSpec{ + "aws-integrator": { + Charm: "cs:~containers/aws-integrator", + NumUnits: 1, + RequiresTrust: true, + }, + }, + }, +}, { + about: "application defining offers", + data: ` +applications: + apache2: + charm: "cs:apache2-26" + num_units: 1 + offers: + offer1: + endpoints: + - "apache-website" + - "apache-proxy" + acl: + admin: "admin" + foo: "consume" + offer2: + endpoints: + - "apache-website" +`, + expectedBD: &charm.BundleData{ + Applications: map[string]*charm.ApplicationSpec{ + "apache2": { + Charm: "cs:apache2-26", + NumUnits: 1, + Offers: map[string]*charm.OfferSpec{ + "offer1": &charm.OfferSpec{ + Endpoints: []string{ + "apache-website", + "apache-proxy", + }, + ACL: map[string]string{ + "admin": "admin", + "foo": "consume", + }, + }, + "offer2": &charm.OfferSpec{ + Endpoints: []string{ + "apache-website", + }, + }, + }, + }, + }, + }, +}, { + about: "saas offerings", + data: ` +saas: + apache2: + url: production:admin/info.apache +applications: + apache2: + charm: "cs:apache2-26" + num_units: 1 +`, + expectedBD: &charm.BundleData{ + Saas: map[string]*charm.SaasSpec{ + "apache2": { + URL: "production:admin/info.apache", + }, + }, + Applications: map[string]*charm.ApplicationSpec{ + "apache2": { + Charm: "cs:apache2-26", + NumUnits: 1, + }, + }, + }, +}, { + about: "saas offerings with relations", + data: ` +saas: + mysql: + url: production:admin/info.mysql +applications: + wordpress: + charm: "cs:trusty/wordpress-5" + num_units: 1 +relations: +- - wordpress:db + - mysql:db +`, + expectedBD: &charm.BundleData{ + Saas: map[string]*charm.SaasSpec{ + "mysql": { + URL: "production:admin/info.mysql", + }, + }, + Applications: map[string]*charm.ApplicationSpec{ + "wordpress": { + Charm: "cs:trusty/wordpress-5", + NumUnits: 1, + }, + }, + Relations: [][]string{ + {"wordpress:db", "mysql:db"}, + }, + }, }} func (*bundleDataSuite) TestParse(c *gc.C) { @@ -339,12 +455,17 @@ data: ` series: "9wrong" +saas: + apache2: + url: '!some-bogus/url' + riak: + url: production:admin/info.riak machines: 0: - constraints: 'bad constraints' - annotations: - foo: bar - series: 'bad series' + constraints: 'bad constraints' + annotations: + foo: bar + series: 'bad series' bogus: 3: applications: @@ -405,9 +526,11 @@ - ["mysql:db", "mediawiki:db"] - ["mediawiki/db", "mysql:db"] - ["wordpress", "mysql"] + - ["wordpress:db", "riak:db"] `, errors: []string{ `bundle declares an invalid series "9wrong"`, + `invalid offer URL "!some-bogus/url" for SAAS apache2`, `invalid storage name "no_underscores" in application "ceph"`, `invalid storage "invalid-storage" in application "ceph-osd": bad storage constraint`, `machine "3" is not referred to by a placement directive`, @@ -432,10 +555,30 @@ `invalid placement syntax "bad placement"`, `invalid relation syntax "mediawiki/db"`, `invalid series bad series for machine "0"`, + `ambiguous relation "riak" refers to a application and a SAAS in this bundle`, + `SAAS "riak" already exists with application "riak" name`, + `application "riak" already exists with SAAS "riak" name`, }, }, { about: "mediawiki should be ok", data: mediawikiBundle, +}, { + about: "malformed offer and endpoint names", + data: ` +applications: + aws-integrator: + charm: cs:~containers/aws-integrator + num_units: 1 + trust: true + offers: + $bad-name: + endpoints: + - "nope!" +`, + errors: []string{ + `invalid offer name "$bad-name" in application "aws-integrator"`, + `invalid endpoint name "nope!" for offer "$bad-name" in application "aws-integrator"`, + }, }} func (*bundleDataSuite) TestVerifyErrors(c *gc.C) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/charmdir.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/charmdir.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/charmdir.go 2019-05-14 17:32:11.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/charmdir.go 2019-06-28 17:12:00.000000000 +0000 @@ -30,6 +30,7 @@ .svn .hg .bzr +.tox /build/ /revision diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl.go 2019-06-28 17:12:00.000000000 +0000 @@ -0,0 +1,170 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package charm + +import ( + "fmt" + "regexp" + "strings" + + "github.com/juju/errors" + names "gopkg.in/juju/names.v2" +) + +// OfferURL represents the location of an offered application and its +// associated exported endpoints. +type OfferURL struct { + // Source represents where the offer is hosted. + // If empty, the model is another model in the same controller. + Source string // "" or "" or "" + + // User is the user whose namespace in which the offer is made. + // Where a model is specified, the user is the model owner. + User string + + // ModelName is the name of the model providing the exported endpoints. + // It is only used for local URLs or for specifying models in the same + // controller. + ModelName string + + // ApplicationName is the name of the application providing the exported endpoints. + ApplicationName string +} + +// Path returns the path component of the URL. +func (u *OfferURL) Path() string { + var parts []string + if u.User != "" { + parts = append(parts, u.User) + } + if u.ModelName != "" { + parts = append(parts, u.ModelName) + } + path := strings.Join(parts, "/") + path = fmt.Sprintf("%s.%s", path, u.ApplicationName) + if u.Source == "" { + return path + } + return fmt.Sprintf("%s:%s", u.Source, path) +} + +func (u *OfferURL) String() string { + return u.Path() +} + +// AsLocal returns a copy of the URL with an empty (local) source. +func (u *OfferURL) AsLocal() *OfferURL { + localURL := *u + localURL.Source = "" + return &localURL +} + +// HasEndpoint returns whether this offer URL includes an +// endpoint name in the application name. +func (u *OfferURL) HasEndpoint() bool { + return strings.Contains(u.ApplicationName, ":") +} + +// modelApplicationRegexp parses urls of the form controller:user/model.application[:relname] +var modelApplicationRegexp = regexp.MustCompile(`(/?((?P[^/]+)/)?(?P[^.]*)(\.(?P[^:]*(:.*)?))?)?`) + +// IsValidOfferURL ensures that a URL string is a valid OfferURL. +func IsValidOfferURL(urlStr string) bool { + _, err := ParseOfferURL(urlStr) + return err == nil +} + +// ParseOfferURL parses the specified URL string into an OfferURL. +// The URL string is of one of the forms: +// . +// .: +// /. +// /.: +// :/. +// :/.: +func ParseOfferURL(urlStr string) (*OfferURL, error) { + return parseOfferURL(urlStr) +} + +// parseOfferURL parses the specified URL string into an OfferURL. +func parseOfferURL(urlStr string) (*OfferURL, error) { + urlParts, err := parseOfferURLParts(urlStr, false) + if err != nil { + return nil, err + } + url := OfferURL(*urlParts) + return &url, nil +} + +// OfferURLParts contains various attributes of a URL. +type OfferURLParts OfferURL + +// ParseOfferURLParts parses a partial URL, filling out what parts are supplied. +// This method is used to generate a filter used to query matching offer URLs. +func ParseOfferURLParts(urlStr string) (*OfferURLParts, error) { + return parseOfferURLParts(urlStr, true) +} + +var endpointRegexp = regexp.MustCompile(`^[a-zA-Z0-9]+$`) + +func maybeParseSource(urlStr string) (source, rest string) { + parts := strings.Split(urlStr, ":") + switch len(parts) { + case 3: + return parts[0], parts[1] + ":" + parts[2] + case 2: + if endpointRegexp.MatchString(parts[1]) { + return "", urlStr + } + return parts[0], parts[1] + } + return "", urlStr +} + +func parseOfferURLParts(urlStr string, allowIncomplete bool) (*OfferURLParts, error) { + var result OfferURLParts + source, urlParts := maybeParseSource(urlStr) + + valid := !strings.HasPrefix(urlStr, ":") + valid = valid && modelApplicationRegexp.MatchString(urlParts) + if valid { + result.Source = source + result.User = modelApplicationRegexp.ReplaceAllString(urlParts, "$user") + result.ModelName = modelApplicationRegexp.ReplaceAllString(urlParts, "$model") + result.ApplicationName = modelApplicationRegexp.ReplaceAllString(urlParts, "$application") + } + if !valid || strings.Contains(result.ModelName, "/") || strings.Contains(result.ApplicationName, "/") { + // TODO(wallyworld) - update error message when we support multi-controller and JAAS CMR + return nil, errors.Errorf("application offer URL has invalid form, must be [.: %q", urlStr) + } + if !allowIncomplete && result.ModelName == "" { + return nil, errors.Errorf("application offer URL is missing model") + } + if !allowIncomplete && result.ApplicationName == "" { + return nil, errors.Errorf("application offer URL is missing application") + } + + // Application name part may contain a relation name part, so strip that bit out + // before validating the name. + appName := strings.Split(result.ApplicationName, ":")[0] + // Validate the resulting URL part values. + if result.User != "" && !names.IsValidUser(result.User) { + return nil, errors.NotValidf("user name %q", result.User) + } + if result.ModelName != "" && !names.IsValidModelName(result.ModelName) { + return nil, errors.NotValidf("model name %q", result.ModelName) + } + if appName != "" && !names.IsValidApplication(appName) { + return nil, errors.NotValidf("application name %q", appName) + } + return &result, nil +} + +// MakeURL constructs an offer URL from the specified components. +func MakeURL(user, model, application, controller string) string { + base := fmt.Sprintf("%s/%s.%s", user, model, application) + if controller == "" { + return base + } + return fmt.Sprintf("%s:%s", controller, base) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/offerurl_test.go 2019-06-28 17:12:00.000000000 +0000 @@ -0,0 +1,179 @@ +// Copyright 2019 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. +package charm_test + +import ( + "fmt" + "regexp" + "strings" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + charm "gopkg.in/juju/charm.v6" +) + +type OfferURLSuite struct{} + +var _ = gc.Suite(&OfferURLSuite{}) + +var offerURLTests = []struct { + s, err string + exact string + url *charm.OfferURL +}{{ + s: "controller:user/modelname.applicationname", + url: &charm.OfferURL{"controller", "user", "modelname", "applicationname"}, +}, { + s: "controller:user/modelname.applicationname:rel", + url: &charm.OfferURL{"controller", "user", "modelname", "applicationname:rel"}, +}, { + s: "modelname.applicationname", + url: &charm.OfferURL{"", "", "modelname", "applicationname"}, +}, { + s: "modelname.applicationname:rel", + url: &charm.OfferURL{"", "", "modelname", "applicationname:rel"}, +}, { + s: "user/modelname.applicationname:rel", + url: &charm.OfferURL{"", "user", "modelname", "applicationname:rel"}, +}, { + s: "/modelname.applicationname", + url: &charm.OfferURL{"", "", "modelname", "applicationname"}, + exact: "modelname.applicationname", +}, { + s: "/modelname.applicationname:rel", + url: &charm.OfferURL{"", "", "modelname", "applicationname:rel"}, + exact: "modelname.applicationname:rel", +}, { + s: "user/modelname.applicationname", + url: &charm.OfferURL{"", "user", "modelname", "applicationname"}, +}, { + s: "controller:modelname", + err: `application offer URL is missing application`, +}, { + s: "controller:user/modelname", + err: `application offer URL is missing application`, +}, { + s: "model", + err: `application offer URL is missing application`, +}, { + s: "/user/model", + err: `application offer URL is missing application`, +}, { + s: "model.application@bad", + err: `application name "application@bad" not valid`, +}, { + s: "user[bad/model.application", + err: `user name "user\[bad" not valid`, +}, { + s: "user/[badmodel.application", + err: `model name "\[badmodel" not valid`, +}} + +func (s *OfferURLSuite) TestParseURL(c *gc.C) { + for i, t := range offerURLTests { + c.Logf("test %d: %q", i, t.s) + url, err := charm.ParseOfferURL(t.s) + + match := t.s + if t.exact != "" { + match = t.exact + } + if t.url != nil { + c.Assert(err, gc.IsNil) + c.Check(url, gc.DeepEquals, t.url) + c.Check(url.String(), gc.Equals, match) + } + if t.err != "" { + t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) + c.Check(err, gc.ErrorMatches, t.err) + c.Check(url, gc.IsNil) + } + } +} + +var urlPartsTests = []struct { + s, err string + url *charm.OfferURLParts +}{{ + s: "controller:/user/modelname.applicationname", + url: &charm.OfferURLParts{"controller", "user", "modelname", "applicationname"}, +}, { + s: "user/modelname.applicationname", + url: &charm.OfferURLParts{"", "user", "modelname", "applicationname"}, +}, { + s: "user/modelname", + url: &charm.OfferURLParts{"", "user", "modelname", ""}, +}, { + s: "modelname.application", + url: &charm.OfferURLParts{"", "", "modelname", "application"}, +}, { + s: "controller:/modelname", + url: &charm.OfferURLParts{"controller", "", "modelname", ""}, +}, { + s: "controller:", + url: &charm.OfferURLParts{Source: "controller"}, +}, { + s: "", + url: &charm.OfferURLParts{}, +}, { + s: "user/prod/applicationname/extra", + err: `application offer URL has invalid form, must be \[.: "user/prod/applicationname/extra"`, +}, { + s: "controller:/user/modelname.application@bad", + err: `application name "application@bad" not valid`, +}, { + s: "controller:/user[bad/modelname.application", + err: `user name "user\[bad" not valid`, +}, { + s: ":foo", + err: `application offer URL has invalid form, must be \[.: $URL`, +}} + +func (s *OfferURLSuite) TestParseURLParts(c *gc.C) { + for i, t := range urlPartsTests { + c.Logf("test %d: %q", i, t.s) + url, err := charm.ParseOfferURLParts(t.s) + + if t.url != nil { + c.Check(err, gc.IsNil) + c.Check(url, gc.DeepEquals, t.url) + } + if t.err != "" { + t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) + c.Assert(err, gc.ErrorMatches, t.err) + c.Assert(url, gc.IsNil) + } + } +} + +func (s *OfferURLSuite) TestHasEndpoint(c *gc.C) { + url, err := charm.ParseOfferURL("model.application:endpoint") + c.Assert(err, jc.ErrorIsNil) + c.Check(url.HasEndpoint(), jc.IsTrue) + url, err = charm.ParseOfferURL("model.application") + c.Assert(err, jc.ErrorIsNil) + c.Check(url.HasEndpoint(), jc.IsFalse) + url, err = charm.ParseOfferURL("controller:/user/model.application:thing") + c.Assert(err, jc.ErrorIsNil) + c.Check(url.HasEndpoint(), jc.IsTrue) + url, err = charm.ParseOfferURL("controller:/user/model.application") + c.Assert(err, jc.ErrorIsNil) + c.Check(url.HasEndpoint(), jc.IsFalse) +} + +func (s *OfferURLSuite) TestMakeURL(c *gc.C) { + url := charm.MakeURL("user", "model", "app", "") + c.Assert(url, gc.Equals, "user/model.app") + url = charm.MakeURL("user", "model", "app", "ctrl") + c.Assert(url, gc.Equals, "ctrl:user/model.app") +} + +func (s *OfferURLSuite) TestAsLocal(c *gc.C) { + url, err := charm.ParseOfferURL("source:model.application:endpoint") + c.Assert(err, jc.ErrorIsNil) + expected, err := charm.ParseOfferURL("model.application:endpoint") + c.Assert(err, jc.ErrorIsNil) + original := *url + c.Assert(url.AsLocal(), gc.DeepEquals, expected) + c.Assert(*url, gc.DeepEquals, original) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine.go 2019-05-14 17:32:20.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine.go 2019-06-28 17:12:14.000000000 +0000 @@ -64,6 +64,14 @@ // for consecutive start attempts. BackoffFactor float64 + // BackoffResetTime determines if a worker is running for longer than + // this time, then any failure will be treated as a 'fresh' failure. + // Eg, if this is set to 1 minute, and a service starts and bounces within + // the first minute of running, then we will exponentially back off the next + // start. However, if it successfully runs for 2 minutes, then any failure + // will be immediately retried. + BackoffResetTime time.Duration + // MaxDelay is the maximum delay that the engine will wait after // the exponential backoff due to consecutive start attempts. MaxDelay time.Duration @@ -93,6 +101,9 @@ if config.BackoffFactor != 0 && config.BackoffFactor < 1 { return errors.Errorf("BackoffFactor %v must be >= 1", config.BackoffFactor) } + if config.BackoffResetTime < 0 { + return errors.New("BackoffResetTime is negative") + } if config.MaxDelay < 0 { return errors.New("MaxDelay is negative") } @@ -376,11 +387,7 @@ // ...then update the info, copy it back to the engine, and start a worker // goroutine based on current known state. info.starting = true - if delay > 0 { - // Don't record the first attempt during manifold install. - // This is to avoid the extra backoff on the first failure. - info.startAttempts++ - } + info.startAttempts++ info.err = nil info.abort = make(chan struct{}) engine.current[name] = info @@ -390,9 +397,14 @@ // which should make bugs more obvious if delay > time.Duration(0) { if engine.config.BackoffFactor > 0 { - delay = time.Duration(float64(delay) * math.Pow(engine.config.BackoffFactor, float64(info.startAttempts-1))) - if engine.config.MaxDelay > 0 && delay > engine.config.MaxDelay { + // Use the float64 values for max comparison. Otherwise when casting + // the float back to a duration we hit the int64 max which is negative. + maxDelay := float64(engine.config.MaxDelay) + floatDelay := float64(delay) * math.Pow(engine.config.BackoffFactor, float64(info.recentErrors-1)) + if engine.config.MaxDelay > 0 && floatDelay > maxDelay { delay = engine.config.MaxDelay + } else { + delay = time.Duration(floatDelay) } } // Fuzz to ±10% of final duration. @@ -543,7 +555,6 @@ worker.Kill() default: // It's fine to use this worker; update info and copy back. - engine.config.Logger.Debugf("%q manifold worker started", name) info.worker = worker info.starting = false info.startCount++ @@ -551,6 +562,7 @@ info.startAttempts = 0 info.resourceLog = resourceLog info.startedTime = engine.config.Clock.Now().UTC() + engine.config.Logger.Debugf("%q manifold worker started at %v", name, info.startedTime) engine.current[name] = info // Any manifold that declares this one as an input needs to be restarted. @@ -571,16 +583,30 @@ switch errors.Cause(err) { case nil: engine.config.Logger.Debugf("%q manifold worker completed successfully", name) + info.recentErrors = 0 case errAborted: // The start attempt was aborted, so we haven't really started. engine.config.Logger.Tracef("%q manifold worker bounced while starting", name) // If we have been aborted while trying to start, we are more likely // to be able to start, so reset the start attempts. info.startAttempts = 0 + info.recentErrors = 1 case ErrMissing: engine.config.Logger.Tracef("%q manifold worker failed to start: %v", name, err) + // missing a dependency does (not?) trigger exponential backoff + info.recentErrors = 1 default: engine.config.Logger.Debugf("%q manifold worker stopped: %v", name, err) + now := engine.config.Clock.Now().UTC() + timeSinceStarted := now.Sub(info.startedTime) + // startedTime is Zero, then we haven't even successfully started, so treat + // it the same way as a successful start followed by a quick failure. + if info.startedTime.IsZero() || timeSinceStarted < engine.config.BackoffResetTime { + info.recentErrors++ + } else { + // we were able to successfully run for long enough to reset the attempt count + info.recentErrors = 1 + } } if filter := engine.manifolds[name].Filter; filter != nil { @@ -601,6 +627,7 @@ // Keep the start count and start attempts but clear the start timestamps. startAttempts: info.startAttempts, startCount: info.startCount, + recentErrors: info.recentErrors, } if engine.isDying() { engine.config.Logger.Tracef("permanently stopped %q manifold worker (shutting down)", name) @@ -729,6 +756,7 @@ startedTime time.Time startCount int startAttempts int + recentErrors int } // stopped returns true unless the worker is either assigned or starting. diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine_test.go 2019-05-14 17:32:20.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/engine_test.go 2019-06-28 17:12:14.000000000 +0000 @@ -13,7 +13,7 @@ "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - worker "gopkg.in/juju/worker.v1" + "gopkg.in/juju/worker.v1" "gopkg.in/juju/worker.v1/dependency" "gopkg.in/juju/worker.v1/workertest" @@ -696,6 +696,10 @@ }, "BackoffFactor 0.9 must be >= 1", }, { func(config *dependency.EngineConfig) { + config.BackoffResetTime = -time.Minute + }, "BackoffResetTime is negative", + }, { + func(config *dependency.EngineConfig) { config.MaxDelay = -time.Second }, "MaxDelay is negative", }, { @@ -770,6 +774,7 @@ config := s.fix.defaultEngineConfig(clock) config.ErrorDelay = time.Second config.BackoffFactor = 2.0 + config.BackoffResetTime = time.Minute config.MaxDelay = 3 * time.Second s.fix.config = &config @@ -783,25 +788,135 @@ mh.AssertStartAttempt(c) // Advance further than 1.1 * ErrorDelay to account for max fuzz. - clock.WaitAdvance(1200*time.Millisecond, testing.ShortWait, 1) + c.Assert(clock.WaitAdvance(1200*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertStartAttempt(c) + + // Advance the clock to before 0.9 * 2 * ErrorDelay to ensure + // that we don't have another start attempt. + c.Assert(clock.WaitAdvance(1700*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertNoStartAttempt(c) + + // Advance further to 1.1 * 2 * ErrorDelay from the previous failed + // start, to account for max fuzz. + c.Assert(clock.WaitAdvance(600*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertStartAttempt(c) + + // Finally hit MaxDelay, so ensure we don't start before 0.9 * MaxDelay. + // But do start after 1.1 * MaxDelay. + c.Assert(clock.WaitAdvance(2600*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertNoStartAttempt(c) + c.Assert(clock.WaitAdvance(800*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertStartAttempt(c) + }) +} + +func (s *EngineSuite) TestBackoffFactorOnError(c *gc.C) { + clock := testclock.NewClock(time.Now()) + config := s.fix.defaultEngineConfig(clock) + config.ErrorDelay = time.Second + config.BackoffFactor = 2.0 + config.BackoffResetTime = time.Minute + config.MaxDelay = 3 * time.Second + s.fix.config = &config + + s.fix.run(c, func(engine *dependency.Engine) { + + mh := newManifoldHarness() + err := engine.Install("task", mh.Manifold()) + c.Assert(err, jc.ErrorIsNil) + // We should get the task start called. + mh.AssertStartAttempt(c) + // Inject an immedate error after start + mh.InjectError(c, errors.Errorf("initial boom")) + + // Advance further than 1.1 * ErrorDelay to account for max fuzz. + c.Assert(clock.WaitAdvance(1200*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) mh.AssertStartAttempt(c) + // Wait a bit, but less than BackoffResetTime, and trigger another + // error. It is ok that nothing is Waiting, because it is only after the + // error happens that the clock is consulted + clock.Advance(1000 * time.Millisecond) + mh.InjectError(c, errors.Errorf("later boom")) // Advance the clock to before 0.9 * 2 * ErrorDelay to ensure // that we don't have another start attempt. - clock.WaitAdvance(1700*time.Millisecond, testing.ShortWait, 1) + c.Assert(clock.WaitAdvance(1700*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) mh.AssertNoStartAttempt(c) // Advance further to 1.1 * 2 * ErrorDelay from the previous failed // start, to account for max fuzz. - clock.WaitAdvance(600*time.Millisecond, testing.ShortWait, 1) + c.Assert(clock.WaitAdvance(600*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) mh.AssertStartAttempt(c) + // Again wait a bit, to be clear that the time we wait before + // starting is based on when it died, not when we last started it. + clock.Advance(5000 * time.Millisecond) + mh.InjectError(c, errors.Errorf("last boom")) // Finally hit MaxDelay, so ensure we don't start before 0.9 * MaxDelay. // But do start after 1.1 * MaxDelay. - clock.WaitAdvance(2600*time.Millisecond, testing.ShortWait, 1) + c.Assert(clock.WaitAdvance(2600*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) mh.AssertNoStartAttempt(c) - clock.WaitAdvance(800*time.Millisecond, testing.ShortWait, 1) + c.Assert(clock.WaitAdvance(800*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertStartAttempt(c) + + // We need to advance the clock after we have recorded startTime, which + // means we need to wait for the engine to notice the started event, + // process it, and be ready to process the next event. Installing another + // manifold is done in the same loop. + err = engine.Install("task2", mh.Manifold()) + c.Assert(err, jc.ErrorIsNil) + + // Now advance longer than the BackoffResetTime, indicating the + // worker was running successfully for "long enough" before we + // trigger a failure + clock.Advance(2 * time.Minute) + mh.InjectError(c, errors.Errorf("after successful run")) + // Ensure we try to start after a short fuzzed delay + c.Assert(clock.WaitAdvance(1200*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + mh.AssertStartAttempt(c) + }) +} + +func (s *EngineSuite) TestBackoffFactorOverflow(c *gc.C) { + clock := testclock.NewClock(time.Now()) + config := s.fix.defaultEngineConfig(clock) + config.ErrorDelay = time.Second + config.BackoffFactor = 100.0 + config.BackoffResetTime = time.Minute + config.MaxDelay = time.Minute + s.fix.config = &config + + s.fix.run(c, func(engine *dependency.Engine) { + + // What we are testing here is that the first error delay is + // approximately one second, then ten seconds, then it maxes + // out at one minute + + mh := newManifoldHarness() + mh.startError = errors.New("boom") + err := engine.Install("task", mh.Manifold()) + c.Assert(err, jc.ErrorIsNil) + // We should get the task start called, but it returns an error. + c.Logf("install start attempt") mh.AssertStartAttempt(c) + + // Advance further than 1.1 * ErrorDelay to account for max fuzz. + c.Assert(clock.WaitAdvance(1200*time.Millisecond, testing.ShortWait, 1), jc.ErrorIsNil) + c.Logf("first failure start attempt") + mh.AssertStartAttempt(c) + + // Now we are at the max of one minute delay. + // Here we are now testing nested math. + // The time.Duration of the full calculation wraps and becomes negative + // after 6 failures. + // The total time becomes +Inf after 151 iterations + // The pow calculation becomes +Inf after 156 iterations. + // So to be safe, lets iterate a couple of hundred times. + for i := 3; i < 200; i++ { + c.Assert(clock.WaitAdvance(70*time.Second, testing.ShortWait, 1), jc.ErrorIsNil) + c.Logf("%d failure start attempt", i) + mh.AssertStartAttempt(c) + } }) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/util_test.go juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/util_test.go --- juju-core-2.6.2/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/util_test.go 2019-05-14 17:32:20.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/vendor/gopkg.in/juju/worker.v1/dependency/util_test.go 2019-06-28 17:12:14.000000000 +0000 @@ -43,13 +43,16 @@ func (fix *engineFixture) defaultEngineConfig(clock clock.Clock) dependency.EngineConfig { return dependency.EngineConfig{ - IsFatal: fix.isFatalFunc(), - WorstError: fix.worstErrorFunc(), - Filter: fix.filter, // can be nil anyway - ErrorDelay: testing.ShortWait / 2, - BounceDelay: testing.ShortWait / 10, - Clock: clock, - Logger: loggo.GetLogger("test"), + IsFatal: fix.isFatalFunc(), + WorstError: fix.worstErrorFunc(), + Filter: fix.filter, // can be nil anyway + ErrorDelay: testing.ShortWait / 2, + BounceDelay: testing.ShortWait / 10, + BackoffFactor: 0, + MaxDelay: time.Second, + BackoffResetTime: time.Minute, + Clock: clock, + Logger: loggo.GetLogger("test"), } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/version/version.go juju-core-2.6.5/src/github.com/juju/juju/version/version.go --- juju-core-2.6.2/src/github.com/juju/juju/version/version.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/version/version.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,7 +19,7 @@ // The presence and format of this constant is very important. // The debian/rules build recipe uses this value for the version // number of the release package. -const version = "2.6.2" +const version = "2.6.5" // The version that we switched over from old style numbering to new style. var switchOverVersion = semversion.MustParse("1.19.9") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasoperator/caasoperator.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasoperator/caasoperator.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasoperator/caasoperator.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasoperator/caasoperator.go 2019-06-28 17:10:43.000000000 +0000 @@ -285,6 +285,12 @@ } func (op *caasOperator) loop() (err error) { + defer func() { + if errors.IsNotFound(err) { + err = jworker.ErrTerminateAgent + } + }() + localState, err := op.init() if err != nil { return err @@ -308,7 +314,7 @@ if watcher != nil { // watcher added to catacomb, will kill operator if there's an error. - worker.Stop(watcher) + _ = worker.Stop(watcher) } var err error watcher, err = remotestate.NewWatcher( @@ -330,7 +336,9 @@ if err != nil { return errors.Trace(err) } - op.catacomb.Add(jujuUnitsWatcher) + if err := op.catacomb.Add(jujuUnitsWatcher); err != nil { + return errors.Trace(err) + } if err := op.setStatus(status.Active, ""); err != nil { return errors.Trace(err) @@ -404,7 +412,9 @@ return err } } else { - aliveUnits[unitId] = make(chan struct{}) + if _, ok := aliveUnits[unitId]; !ok { + aliveUnits[unitId] = make(chan struct{}) + } } // Start a worker to manage any new units. if _, err := op.runner.Worker(unitId, op.catacomb.Dying()); err == nil || unitLife == life.Dead { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasoperator/caasoperator_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasoperator/caasoperator_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasoperator/caasoperator_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasoperator/caasoperator_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -336,8 +336,13 @@ func (s *WorkerSuite) TestWorkerSetsStatus(c *gc.C) { w, err := caasoperator.NewWorker(s.config) c.Assert(err, jc.ErrorIsNil) - workertest.CleanKill(c, w) + defer workertest.CleanKill(c, w) + for attempt := coretesting.LongAttempt.Start(); attempt.Next(); { + if len(s.client.Calls()) == 6 { + break + } + } s.client.CheckCallNames(c, "Charm", "SetStatus", "SetVersion", "WatchUnits", "SetStatus", "Watch") s.client.CheckCall(c, 1, "SetStatus", "gitlab", status.Maintenance, "downloading charm (cs:gitlab-1)", map[string]interface{}(nil)) } @@ -372,3 +377,13 @@ s.client.CheckCall(c, 0, "Life", "gitlab/0") s.client.CheckCall(c, 1, "RemoveUnit", "gitlab/0") } + +func (s *WorkerSuite) TestRemovedApplication(c *gc.C) { + s.client.SetErrors(errors.NotFoundf("app")) + w, err := caasoperator.NewWorker(s.config) + c.Assert(err, jc.ErrorIsNil) + defer workertest.DirtyKill(c, w) + + err = workertest.CheckKilled(c, w) + c.Assert(err, gc.ErrorMatches, "agent should be terminated") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/application_worker.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/application_worker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/application_worker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/application_worker.go 2019-06-28 17:10:43.000000000 +0000 @@ -160,7 +160,8 @@ return errors.Trace(err) } logger.Debugf("service for %v: %+v", aw.application, service) - if err := aw.clusterChanged(service, lastReportedStatus); err != nil { + if err := aw.clusterChanged(service, lastReportedStatus, true); err != nil { + // TODO(caas): change the shouldSetScale to false here once appDeploymentWatcher can get all events from k8s. return errors.Trace(err) } case _, ok := <-appDeploymentWatcher.Changes(): @@ -177,6 +178,16 @@ } haveNewStatus := true if service.Id != "" { + // update svc info (addresses etc.) cloudservices. + err = updateApplicationService( + names.NewApplicationTag(aw.application), service, aw.applicationUpdater, + ) + if errors.IsForbidden(err) { + // ignore errors raised from SetScale because disordered events could happen often. + logger.Warningf("%v", err) + } else if err != nil { + return errors.Trace(err) + } lastStatus, ok := lastReportedStatus[service.Id] lastReportedStatus[service.Id] = service.Status if ok { @@ -196,7 +207,7 @@ } lastReportedScale = *service.Scale } - if err := aw.clusterChanged(service, lastReportedStatus); err != nil { + if err := aw.clusterChanged(service, lastReportedStatus, true); err != nil { return errors.Trace(err) } case _, ok := <-appOperatorWatcher.Changes(): @@ -221,24 +232,29 @@ } } } - } } -func (aw *applicationWorker) clusterChanged(service *caas.Service, lastReportedStatus map[string]status.StatusInfo) error { +func (aw *applicationWorker) clusterChanged( + service *caas.Service, + lastReportedStatus map[string]status.StatusInfo, + shouldSetScale bool, +) error { units, err := aw.containerBroker.Units(aw.application) if err != nil { return errors.Trace(err) } - logger.Debugf("units for %v: %+v", aw.application, units) serviceStatus := service.Status var scale *int - if service != nil { + var generation *int64 + if service != nil && shouldSetScale { + generation = service.Generation scale = service.Scale } args := params.UpdateApplicationUnits{ ApplicationTag: names.NewApplicationTag(aw.application).String(), Scale: scale, + Generation: generation, Status: params.EntityStatus{ Status: serviceStatus.Status, Info: serviceStatus.Message, @@ -295,15 +311,20 @@ Data: info.Volume.Status.Data, }, }) - } args.Units = append(args.Units, unitParams) } if err := aw.unitUpdater.UpdateUnits(args); err != nil { + if errors.IsForbidden(err) { + // ignore errors raised from SetScale because disordered events could happen often. + logger.Warningf("%v", err) + return nil + } // We can ignore not found errors as the worker will get stopped anyway. if !errors.IsNotFound(err) { return errors.Trace(err) } + logger.Warningf("update units %v", err) } return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/deployment_worker.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/deployment_worker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/deployment_worker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/deployment_worker.go 2019-06-28 17:10:43.000000000 +0000 @@ -79,7 +79,7 @@ gotSpecNotify := false serviceUpdated := false - scale := 0 + desiredScale := 0 for { select { case <-w.catacomb.Dying(): @@ -89,12 +89,12 @@ return errors.New("watcher closed channel") } var err error - scale, err = w.applicationGetter.ApplicationScale(w.application) + desiredScale, err = w.applicationGetter.ApplicationScale(w.application) if err != nil { return errors.Trace(err) } - logger.Debugf("scale changed to %d", scale) - if scale > 0 && specChan == nil { + logger.Debugf("desiredScale changed to %d", desiredScale) + if desiredScale > 0 && specChan == nil { var err error cw, err = w.provisioningInfoGetter.WatchPodSpec(w.application) if err != nil { @@ -109,7 +109,7 @@ } gotSpecNotify = true } - if scale > 0 && !gotSpecNotify { + if desiredScale > 0 && !gotSpecNotify { continue } info, err := w.provisioningInfoGetter.ProvisioningInfo(w.application) @@ -120,7 +120,7 @@ } else if err != nil { return errors.Trace(err) } - if scale == 0 { + if desiredScale == 0 { if cw != nil { worker.Stop(cw) specChan = nil @@ -133,13 +133,13 @@ currentScale = 0 continue } - specStr := info.PodSpec - if scale == currentScale && specStr == currentSpec { + specStr := info.PodSpec + if desiredScale == currentScale && specStr == currentSpec { continue } - currentScale = scale + currentScale = desiredScale currentSpec = specStr appConfig, err := w.applicationGetter.ApplicationConfig(w.application) @@ -168,7 +168,7 @@ ServiceType: caas.ServiceType(info.DeploymentInfo.ServiceType), }, } - err = w.broker.EnsureService(w.application, w.provisioningStatusSetter.SetOperatorStatus, serviceParams, currentScale, appConfig) + err = w.broker.EnsureService(w.application, w.provisioningStatusSetter.SetOperatorStatus, serviceParams, desiredScale, appConfig) if err != nil { // Some errors we don't want to exit the worker. if provider.MaskError(err) { @@ -177,21 +177,33 @@ } return errors.Trace(err) } - logger.Debugf("created/updated deployment for %s for %v units", w.application, currentScale) + logger.Debugf("ensured deployment for %s for %v units", w.application, desiredScale) if !serviceUpdated && !spec.OmitServiceFrontend { service, err := w.broker.GetService(w.application, false) if err != nil && !errors.IsNotFound(err) { return errors.Annotate(err, "cannot get new service details") } - err = w.applicationUpdater.UpdateApplicationService(params.UpdateApplicationServiceArg{ - ApplicationTag: names.NewApplicationTag(w.application).String(), - ProviderId: service.Id, - Addresses: params.FromNetworkAddresses(service.Addresses...), - }) - if err != nil { + if err = updateApplicationService( + names.NewApplicationTag(w.application), service, w.applicationUpdater, + ); err != nil { return errors.Trace(err) } serviceUpdated = true } } } + +func updateApplicationService(appTag names.ApplicationTag, svc *caas.Service, updater ApplicationUpdater) error { + if svc == nil || svc.Id == "" { + return nil + } + return updater.UpdateApplicationService( + params.UpdateApplicationServiceArg{ + ApplicationTag: appTag.String(), + ProviderId: svc.Id, + Addresses: params.FromNetworkAddresses(svc.Addresses...), + Scale: svc.Scale, + Generation: svc.Generation, + }, + ) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/mock_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -67,7 +67,7 @@ } func (m *mockServiceBroker) GetService(appName string, includeClusterIP bool) (*caas.Service, error) { - m.MethodCall(m, "Service", appName) + m.MethodCall(m, "GetService", appName) scale := 4 return &caas.Service{ Id: "id", Scale: &scale, Addresses: []network.Address{{Value: "10.0.0.1"}}, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/worker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/worker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/caasunitprovisioner/worker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/caasunitprovisioner/worker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -277,10 +277,10 @@ s.podSpecGetter.CheckCall(c, 2, "ProvisioningInfo", "gitlab") s.lifeGetter.CheckCallNames(c, "Life") s.lifeGetter.CheckCall(c, 0, "Life", "gitlab") - s.serviceBroker.CheckCallNames(c, "WatchService", "EnsureService", "Service") + s.serviceBroker.CheckCallNames(c, "WatchService", "EnsureService", "GetService") s.serviceBroker.CheckCall(c, 1, "EnsureService", "gitlab", expectedServiceParams, 1, application.ConfigAttributes{"juju-external-hostname": "exthost"}) - s.serviceBroker.CheckCall(c, 2, "Service", "gitlab") + s.serviceBroker.CheckCall(c, 2, "GetService", "gitlab") s.serviceBroker.ResetCalls() // Add another unit. @@ -323,11 +323,16 @@ "gitlab", &newExpectedParams, 1, application.ConfigAttributes{"juju-external-hostname": "exthost"}) } +func intPtr(i int) *int { + return &i +} + func (s *WorkerSuite) TestScaleChangedInCluster(c *gc.C) { w := s.setupNewUnitScenario(c) defer workertest.CleanKill(c, w) s.containerBroker.ResetCalls() + s.applicationUpdater.ResetCalls() s.serviceBroker.ResetCalls() s.serviceBroker.serviceStatus = status.StatusInfo{ Status: status.Active, @@ -341,20 +346,35 @@ } for a := coretesting.LongAttempt.Start(); a.Next(); { - if len(s.containerBroker.Calls()) > 0 { + if len(s.serviceBroker.Calls()) > 0 { break } } - s.containerBroker.CheckCallNames(c, "Units") - c.Assert(s.containerBroker.Calls()[0].Args, jc.DeepEquals, []interface{}{"gitlab"}) + s.serviceBroker.CheckCallNames(c, "GetService") + c.Assert(s.serviceBroker.Calls()[0].Args, jc.DeepEquals, []interface{}{"gitlab"}) + + select { + case <-s.serviceUpdated: + s.applicationUpdater.CheckCallNames(c, "UpdateApplicationService") + c.Assert(s.applicationUpdater.Calls()[0].Args, jc.DeepEquals, []interface{}{ + params.UpdateApplicationServiceArg{ + ApplicationTag: names.NewApplicationTag("gitlab").String(), + ProviderId: "id", + Addresses: []params.Address{{Value: "10.0.0.1"}}, + Scale: intPtr(4), + }, + }) + case <-time.After(coretesting.LongWait): + c.Fatal("timed out waiting for service to be updated") + } for a := coretesting.LongAttempt.Start(); a.Next(); { - if len(s.serviceBroker.Calls()) > 0 { + if len(s.containerBroker.Calls()) > 0 { break } } - s.serviceBroker.CheckCallNames(c, "Service") - c.Assert(s.serviceBroker.Calls()[0].Args, jc.DeepEquals, []interface{}{"gitlab"}) + s.containerBroker.CheckCallNames(c, "Units") + c.Assert(s.containerBroker.Calls()[0].Args, jc.DeepEquals, []interface{}{"gitlab"}) for a := coretesting.LongAttempt.Start(); a.Next(); { if len(s.unitUpdater.Calls()) > 0 { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -22,7 +22,7 @@ // The named dependencies will be exposed to the start func as resources. APICallerName string - ClockName string + Clock clock.Clock // The remaining dependencies will be used with the resources to configure // and create the worker. The period must be greater than 0; the NewFacade @@ -39,12 +39,10 @@ return dependency.Manifold{ Inputs: []string{ config.APICallerName, - config.ClockName, }, Start: func(context dependency.Context) (worker.Worker, error) { - var clock clock.Clock - if err := context.Get(config.ClockName, &clock); err != nil { - return nil, errors.Trace(err) + if config.Clock == nil { + return nil, errors.NotValidf("nil Clock") } var apiCaller base.APICaller if err := context.Get(config.APICallerName, &apiCaller); err != nil { @@ -57,7 +55,7 @@ worker, err := config.NewWorker(charmrevision.Config{ RevisionUpdater: facade, - Clock: clock, + Clock: config.Clock, Period: config.Period, }) if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/charmrevision/charmrevisionmanifold/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -29,10 +29,9 @@ func (s *ManifoldSuite) TestManifold(c *gc.C) { manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "billy", - ClockName: "bob", }) - c.Check(manifold.Inputs, jc.DeepEquals, []string{"billy", "bob"}) + c.Check(manifold.Inputs, jc.DeepEquals, []string{"billy"}) c.Check(manifold.Start, gc.NotNil) c.Check(manifold.Output, gc.IsNil) } @@ -40,12 +39,11 @@ func (s *ManifoldSuite) TestMissingAPICaller(c *gc.C) { manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "api-caller", - ClockName: "clock", + Clock: fakeClock{}, }) _, err := manifold.Start(dt.StubContext(nil, map[string]interface{}{ "api-caller": dependency.ErrMissing, - "clock": fakeClock{}, })) c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing) } @@ -53,14 +51,13 @@ func (s *ManifoldSuite) TestMissingClock(c *gc.C) { manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "api-caller", - ClockName: "clock", }) _, err := manifold.Start(dt.StubContext(nil, map[string]interface{}{ "api-caller": fakeAPICaller{}, - "clock": dependency.ErrMissing, })) - c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing) + c.Check(err, jc.Satisfies, errors.IsNotValid) + c.Check(err.Error(), gc.Equals, "nil Clock not valid") } func (s *ManifoldSuite) TestNewFacadeError(c *gc.C) { @@ -69,7 +66,7 @@ stub := testing.Stub{} manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "api-caller", - ClockName: "clock", + Clock: fakeClock{}, NewFacade: func(apiCaller base.APICaller) (charmrevisionmanifold.Facade, error) { stub.AddCall("NewFacade", apiCaller) return nil, errors.New("blefgh") @@ -78,7 +75,6 @@ _, err := manifold.Start(dt.StubContext(nil, map[string]interface{}{ "api-caller": fakeAPICaller, - "clock": fakeClock{}, })) c.Check(err, gc.ErrorMatches, "cannot create facade: blefgh") stub.CheckCalls(c, []testing.StubCall{{ @@ -94,7 +90,7 @@ stub := testing.Stub{} manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "api-caller", - ClockName: "clock", + Clock: fakeClock, NewFacade: func(apiCaller base.APICaller) (charmrevisionmanifold.Facade, error) { stub.AddCall("NewFacade", apiCaller) return fakeFacade, nil @@ -107,7 +103,6 @@ _, err := manifold.Start(dt.StubContext(nil, map[string]interface{}{ "api-caller": fakeAPICaller, - "clock": fakeClock, })) c.Check(err, gc.ErrorMatches, "cannot create worker: snrght") stub.CheckCalls(c, []testing.StubCall{{ @@ -129,7 +124,7 @@ stub := testing.Stub{} manifold := charmrevisionmanifold.Manifold(charmrevisionmanifold.ManifoldConfig{ APICallerName: "api-caller", - ClockName: "clock", + Clock: fakeClock, Period: 10 * time.Minute, NewFacade: func(apiCaller base.APICaller) (charmrevisionmanifold.Facade, error) { stub.AddCall("NewFacade", apiCaller) @@ -143,7 +138,6 @@ w, err := manifold.Start(dt.StubContext(nil, map[string]interface{}{ "api-caller": fakeAPICaller, - "clock": fakeClock, })) c.Check(w, gc.Equals, fakeWorker) c.Check(err, jc.ErrorIsNil) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/containerbroker/mocks/environs_mock.go juju-core-2.6.5/src/github.com/juju/juju/worker/containerbroker/mocks/environs_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/containerbroker/mocks/environs_mock.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/containerbroker/mocks/environs_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,14 +5,16 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" - instance "github.com/juju/juju/core/instance" - lxdprofile "github.com/juju/juju/core/lxdprofile" - environs "github.com/juju/juju/environs" - context "github.com/juju/juju/environs/context" - instances "github.com/juju/juju/environs/instances" + "reflect" + + "github.com/golang/mock/gomock" charm_v6 "gopkg.in/juju/charm.v6" - reflect "reflect" + + "github.com/juju/juju/core/instance" + "github.com/juju/juju/core/lxdprofile" + "github.com/juju/juju/environs" + "github.com/juju/juju/environs/context" + "github.com/juju/juju/environs/instances" ) // MockLXDProfiler is a mock of LXDProfiler interface @@ -112,6 +114,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockInstanceBroker)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockInstanceBroker) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockInstanceBrokerMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockInstanceBroker)(nil).AllRunningInstances), arg0) +} + // MaintainInstance mocks base method func (m *MockInstanceBroker) MaintainInstance(arg0 context.ProviderCallContext, arg1 environs.StartInstanceParams) error { ret := m.ctrl.Call(m, "MaintainInstance", arg0, arg1) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/manifold.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -// Copyright 2017 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package dblogpruner - -import ( - "time" - - "github.com/juju/clock" - "github.com/juju/errors" - "gopkg.in/juju/worker.v1" - "gopkg.in/juju/worker.v1/dependency" - - workerstate "github.com/juju/juju/worker/state" -) - -// ManifoldConfig holds the information necessary to run a log pruner -// worker in a dependency.Engine. -type ManifoldConfig struct { - ClockName string - StateName string - - PruneInterval time.Duration - NewWorker func(Config) (worker.Worker, error) -} - -func (config ManifoldConfig) Validate() error { - if config.ClockName == "" { - return errors.NotValidf("empty ClockName") - } - if config.StateName == "" { - return errors.NotValidf("empty StateName") - } - if config.PruneInterval <= 0 { - return errors.NotValidf("non-positive PruneInterval") - } - if config.NewWorker == nil { - return errors.NotValidf("nil NewWorker") - } - return nil -} - -// Manifold returns a dependency.Manifold that will run a log pruner -// worker. -func Manifold(config ManifoldConfig) dependency.Manifold { - return dependency.Manifold{ - Inputs: []string{ - config.ClockName, - config.StateName, - }, - Start: config.start, - } -} - -// start is a method on ManifoldConfig because it's more readable than a closure. -func (config ManifoldConfig) start(context dependency.Context) (worker.Worker, error) { - if err := config.Validate(); err != nil { - return nil, errors.Trace(err) - } - - var clock clock.Clock - if err := context.Get(config.ClockName, &clock); err != nil { - return nil, errors.Trace(err) - } - - var stTracker workerstate.StateTracker - if err := context.Get(config.StateName, &stTracker); err != nil { - return nil, errors.Trace(err) - } - statePool, err := stTracker.Use() - if err != nil { - return nil, errors.Trace(err) - } - - worker, err := config.NewWorker(Config{ - State: statePool.SystemState(), - Clock: clock, - PruneInterval: config.PruneInterval, - }) - if err != nil { - stTracker.Done() - return nil, errors.Trace(err) - } - - go func() { - worker.Wait() - stTracker.Done() - }() - return worker, nil -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/manifold_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -// Copyright 2017 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package dblogpruner_test - -import ( - "time" - - "github.com/juju/errors" - "github.com/juju/testing" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - "gopkg.in/juju/worker.v1" - "gopkg.in/juju/worker.v1/workertest" - - "github.com/juju/juju/worker/dblogpruner" -) - -type ManifoldSuite struct { - testing.IsolationSuite - stub testing.Stub - config dblogpruner.ManifoldConfig - worker worker.Worker -} - -var _ = gc.Suite(&ManifoldSuite{}) - -func (s *ManifoldSuite) SetUpTest(c *gc.C) { - s.IsolationSuite.SetUpTest(c) - s.stub.ResetCalls() - s.config = s.validConfig() - s.worker = worker.NewRunner(worker.RunnerParams{}) - s.AddCleanup(func(c *gc.C) { workertest.DirtyKill(c, s.worker) }) -} - -func (s *ManifoldSuite) validConfig() dblogpruner.ManifoldConfig { - return dblogpruner.ManifoldConfig{ - ClockName: "clock", - StateName: "state", - PruneInterval: time.Hour, - NewWorker: func(config dblogpruner.Config) (worker.Worker, error) { - s.stub.AddCall("NewWorker", config) - return s.worker, s.stub.NextErr() - }, - } -} - -func (s *ManifoldSuite) TestValid(c *gc.C) { - c.Check(s.config.Validate(), jc.ErrorIsNil) -} - -func (s *ManifoldSuite) TestMissingClockName(c *gc.C) { - s.config.ClockName = "" - s.checkNotValid(c, "empty ClockName not valid") -} - -func (s *ManifoldSuite) TestMissingStateName(c *gc.C) { - s.config.StateName = "" - s.checkNotValid(c, "empty StateName not valid") -} - -func (s *ManifoldSuite) TestZeroPruneInterval(c *gc.C) { - s.config.PruneInterval = 0 - s.checkNotValid(c, "non-positive PruneInterval not valid") -} - -func (s *ManifoldSuite) TestMissingNewWorker(c *gc.C) { - s.config.NewWorker = nil - s.checkNotValid(c, "nil NewWorker not valid") -} - -func (s *ManifoldSuite) checkNotValid(c *gc.C, expect string) { - err := s.config.Validate() - c.Check(err, gc.ErrorMatches, expect) - c.Check(err, jc.Satisfies, errors.IsNotValid) -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/worker.go juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/worker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/worker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/worker.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package dblogpruner - -import ( - "sync" - "time" - - "github.com/juju/clock" - "github.com/juju/errors" - "github.com/juju/loggo" - "gopkg.in/juju/worker.v1" - "gopkg.in/tomb.v2" - - "github.com/juju/juju/state" -) - -var logger = loggo.GetLogger("juju.worker.dblogpruner") - -type Config struct { - State *state.State - Clock clock.Clock - PruneInterval time.Duration -} - -func (config Config) Validate() error { - if config.State == nil { - return errors.NotValidf("nil State") - } - if config.Clock == nil { - return errors.NotValidf("nil Clock") - } - if config.PruneInterval <= 0 { - return errors.NotValidf("non-positive PruneInterval") - } - return nil -} - -// NewWorker returns a worker which periodically wakes up to remove old log -// entries stored in MongoDB. This worker must not be run in more than one -// agent concurrently. -func NewWorker(config Config) (worker.Worker, error) { - if err := config.Validate(); err != nil { - return nil, errors.Trace(err) - } - w := &pruneWorker{ - config: config, - } - w.tomb.Go(w.loop) - return w, nil -} - -type pruneWorker struct { - tomb tomb.Tomb - mu sync.Mutex - config Config - current report -} - -func (w *pruneWorker) Report() map[string]interface{} { - w.mu.Lock() - report := w.current - w.mu.Unlock() - - // The keys used give a nice output when alphabetical - // which is how the report yaml gets serialised. - result := map[string]interface{}{ - "prune-age": report.maxLogAge, - "prune-size": report.maxCollectionMB, - } - if !report.lastPrune.IsZero() { - result["last-prune"] = report.lastPrune.Round(time.Second) - } - if !report.nextPrune.IsZero() { - result["next-prune"] = report.nextPrune.Round(time.Second) - } - if report.message != "" { - result["summary"] = report.message - } - if report.pruning { - result["pruning-in-progress"] = true - } - return result -} - -type reportRequest struct { - response chan<- report -} - -type report struct { - lastPrune time.Time - nextPrune time.Time - maxLogAge time.Duration - maxCollectionMB int - message string - pruning bool -} - -func (w *pruneWorker) loop() error { - controllerConfigWatcher := w.config.State.WatchControllerConfig() - defer worker.Stop(controllerConfigWatcher) - - var prune <-chan time.Time - for { - select { - case <-w.tomb.Dying(): - return tomb.ErrDying - - case _, ok := <-controllerConfigWatcher.Changes(): - if !ok { - return errors.New("controller configuration watcher closed") - } - controllerConfig, err := w.config.State.ControllerConfig() - if err != nil { - return errors.Annotate(err, "cannot load controller configuration") - } - newMaxAge := controllerConfig.MaxLogsAge() - newMaxCollectionMB := controllerConfig.MaxLogSizeMB() - if newMaxAge != w.current.maxLogAge || newMaxCollectionMB != w.current.maxCollectionMB { - w.mu.Lock() - w.current.maxLogAge = newMaxAge - w.current.maxCollectionMB = newMaxCollectionMB - w.mu.Unlock() - logger.Infof("log pruning config: max age: %v, max collection size %dM", newMaxAge, newMaxCollectionMB) - } - if prune == nil { - // We defer starting the timer until the - // controller configuration watcher fires - // for the first time, and we have correct - // configuration values for pruning below. - prune = w.config.Clock.After(w.config.PruneInterval) - w.mu.Lock() - w.current.nextPrune = w.config.Clock.Now().Add(w.config.PruneInterval) - w.mu.Unlock() - } - - case <-prune: - now := w.config.Clock.Now() - prune = w.config.Clock.After(w.config.PruneInterval) - w.mu.Lock() - w.current.lastPrune = now - w.current.nextPrune = now.Add(w.config.PruneInterval) - w.current.pruning = true - w.mu.Unlock() - - minLogTime := now.Add(-w.current.maxLogAge) - message, err := state.PruneLogs(w.config.State, minLogTime, w.current.maxCollectionMB, logger) - if err != nil { - return errors.Trace(err) - } - w.mu.Lock() - w.current.pruning = false - w.current.message = message - w.mu.Unlock() - } - } -} - -// Kill implements Worker.Kill(). -func (w *pruneWorker) Kill() { - w.tomb.Kill(nil) -} - -// Wait implements Worker.Wait(). -func (w *pruneWorker) Wait() error { - return w.tomb.Wait() -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/worker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/worker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/dblogpruner/worker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/dblogpruner/worker_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the AGPLv3, see LICENCE file for details. - -package dblogpruner_test - -import ( - stdtesting "testing" - "time" - - "github.com/juju/clock" - "github.com/juju/clock/testclock" - "github.com/juju/loggo" - jujutesting "github.com/juju/testing" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - "gopkg.in/juju/names.v2" - "gopkg.in/juju/worker.v1" - "gopkg.in/juju/worker.v1/workertest" - "gopkg.in/mgo.v2" - "gopkg.in/mgo.v2/bson" - - "github.com/juju/juju/state" - statetesting "github.com/juju/juju/state/testing" - "github.com/juju/juju/testing" - "github.com/juju/juju/version" - "github.com/juju/juju/worker/dblogpruner" -) - -func TestPackage(t *stdtesting.T) { - testing.MgoTestPackage(t) -} - -var _ = gc.Suite(&suite{}) - -type suite struct { - jujutesting.MgoSuite - testing.BaseSuite - - state *state.State - pruner worker.Worker - logsColl *mgo.Collection - controllerColl *mgo.Collection -} - -func (s *suite) SetUpSuite(c *gc.C) { - s.MgoSuite.SetUpSuite(c) - s.BaseSuite.SetUpSuite(c) -} - -func (s *suite) TearDownSuite(c *gc.C) { - s.BaseSuite.TearDownSuite(c) - s.MgoSuite.TearDownSuite(c) -} - -func (s *suite) SetUpTest(c *gc.C) { - s.MgoSuite.SetUpTest(c) - s.BaseSuite.SetUpTest(c) -} - -func (s *suite) TearDownTest(c *gc.C) { - s.BaseSuite.TearDownTest(c) - s.MgoSuite.TearDownTest(c) -} - -func (s *suite) setupState(c *gc.C, maxLogAge, maxCollectionMB string) { - controllerConfig := map[string]interface{}{ - "max-logs-age": maxLogAge, - "max-logs-size": maxCollectionMB, - } - - ctlr := statetesting.InitializeWithArgs(c, statetesting.InitializeArgs{ - Owner: names.NewLocalUserTag("test-admin"), - Clock: testclock.NewClock(testing.NonZeroTime()), - ControllerConfig: controllerConfig, - }) - s.AddCleanup(func(*gc.C) { ctlr.Close() }) - s.state = ctlr.SystemState() - s.logsColl = s.state.MongoSession().DB("logs").C("logs." + s.state.ModelUUID()) -} - -func (s *suite) startWorker(c *gc.C) { - pruner, err := dblogpruner.NewWorker(dblogpruner.Config{ - State: s.state, - Clock: clock.WallClock, - PruneInterval: time.Millisecond, - }) - c.Assert(err, jc.ErrorIsNil) - s.pruner = pruner - s.AddCleanup(func(c *gc.C) { workertest.CleanKill(c, s.pruner) }) -} - -func (s *suite) TestWorkerHasReport(c *gc.C) { - s.setupState(c, "24h", "1024M") - s.startWorker(c) - - type reporter interface { - Report() map[string]interface{} - } - - r, ok := s.pruner.(reporter) - c.Assert(ok, jc.IsTrue) - report := r.Report() - // We can't generally check on particular values except that there are keys for - // prune-age and prune-size. - _, ok = report["prune-age"] - c.Assert(ok, jc.IsTrue) - _, ok = report["prune-size"] - c.Assert(ok, jc.IsTrue) -} - -func (s *suite) TestPrunesOldLogs(c *gc.C) { - maxLogAge := 24 * time.Hour - s.setupState(c, "24h", "1000P") - s.startWorker(c) - - now := time.Now() - addLogsToPrune := func(count int) { - // Add messages beyond the prune threshold. - tPrune := now.Add(-maxLogAge - 1) - s.addLogs(c, tPrune, "prune", count) - } - addLogsToKeep := func(count int) { - // Add messages within the prune threshold. - s.addLogs(c, now, "keep", count) - } - for i := 0; i < 10; i++ { - addLogsToKeep(5) - addLogsToPrune(5) - } - - // Wait for all logs with the message "prune" to be removed. - for attempt := testing.LongAttempt.Start(); attempt.Next(); { - pruneRemaining, err := s.logsColl.Find(bson.M{"x": "prune"}).Count() - c.Assert(err, jc.ErrorIsNil) - if pruneRemaining == 0 { - // All the "keep" messages should still be there. - keepCount, err := s.logsColl.Find(bson.M{"x": "keep"}).Count() - c.Assert(err, jc.ErrorIsNil) - c.Assert(keepCount, gc.Equals, 50) - return - } - } - c.Fatal("pruning didn't happen as expected") -} - -type storageEngine struct { - Name string `bson:"name"` -} -type serverStatus struct { - StorageEngine storageEngine `bson:"storageEngine"` -} - -func (s *suite) TestPrunesLogsBySize(c *gc.C) { - s.setupState(c, "999h", "2M") - var res serverStatus - err := s.Session.Run(bson.M{"serverStatus": 1}, &res) - c.Assert(err, jc.ErrorIsNil) - startingLogCount := 25000 - // wiredTiger compresses the size on disk by default, so it takes more - // effort to get the logs to be pruned. - if res.StorageEngine.Name == "wiredTiger" { - startingLogCount *= 2 - } - s.addLogs(c, time.Now(), "stuff", startingLogCount) - - s.startWorker(c) - for attempt := testing.LongAttempt.Start(); attempt.Next(); { - count, err := s.logsColl.Count() - c.Assert(err, jc.ErrorIsNil) - // The space used by MongoDB by the collection isn't that - // predictable, so just treat any pruning due to size as - // success. - if count < startingLogCount { - return - } - } - c.Fatal("pruning didn't happen as expected") -} - -func (s *suite) addLogs(c *gc.C, t0 time.Time, text string, count int) { - dbLogger := state.NewDbLogger(s.state) - defer dbLogger.Close() - - for offset := 0; offset < count; offset++ { - t := t0.Add(-time.Duration(offset) * time.Second) - dbLogger.Log([]state.LogRecord{{ - Time: t, - Entity: names.NewMachineTag("0"), - Version: version.Current, - Module: "some.module", - Location: "foo.go:42", - Level: loggo.INFO, - Message: text, - }}) - } -} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/globalclockupdater/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/globalclockupdater/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/globalclockupdater/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/globalclockupdater/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,7 +18,7 @@ // ManifoldConfig holds the information necessary to run a GlobalClockUpdater // worker in a dependency.Engine. type ManifoldConfig struct { - ClockName string + Clock clock.Clock StateName string LeaseManagerName string RaftName string @@ -30,8 +30,8 @@ } func (config ManifoldConfig) Validate() error { - if config.ClockName == "" { - return errors.NotValidf("empty ClockName") + if config.Clock == nil { + return errors.NotValidf("nil Clock") } if config.StateName == "" && config.LeaseManagerName == "" { return errors.NotValidf("both StateName and LeaseManagerName empty") @@ -60,7 +60,7 @@ // Manifold returns a dependency.Manifold that will run a global clock // updater worker. func Manifold(config ManifoldConfig) dependency.Manifold { - inputs := []string{config.ClockName} + inputs := []string{} if config.StateName != "" { inputs = append(inputs, config.StateName) } else { @@ -81,11 +81,6 @@ return nil, errors.Trace(err) } - var clock clock.Clock - if err := context.Get(config.ClockName, &clock); err != nil { - return nil, errors.Trace(err) - } - if config.RaftName != "" { // We don't need anything from raft directly, but if it's set // ensure it's running before continuing. @@ -120,7 +115,7 @@ worker, err := config.NewWorker(Config{ NewUpdater: updaterFunc, - LocalClock: clock, + LocalClock: config.Clock, UpdateInterval: config.UpdateInterval, BackoffDelay: config.BackoffDelay, Logger: config.Logger, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/globalclockupdater/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/globalclockupdater/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/globalclockupdater/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/globalclockupdater/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -39,7 +39,7 @@ s.stub.ResetCalls() s.logger = loggo.GetLogger("globalclockupdater_test") s.config = globalclockupdater.ManifoldConfig{ - ClockName: "clock", + Clock: fakeClock{}, StateName: "state", NewWorker: s.newWorker, UpdateInterval: time.Second, @@ -63,7 +63,7 @@ func (s *ManifoldSuite) TestInputs(c *gc.C) { manifold := globalclockupdater.Manifold(s.config) - expectInputs := []string{"clock", "state"} + expectInputs := []string{"state"} c.Check(manifold.Inputs, jc.SameContents, expectInputs) } @@ -71,7 +71,7 @@ s.config.StateName = "" s.config.LeaseManagerName = "lease-manager" manifold := globalclockupdater.Manifold(s.config) - expectInputs := []string{"clock", "lease-manager"} + expectInputs := []string{"lease-manager"} c.Check(manifold.Inputs, jc.SameContents, expectInputs) } @@ -80,13 +80,13 @@ s.config.LeaseManagerName = "lease-manager" s.config.RaftName = "raft" manifold := globalclockupdater.Manifold(s.config) - expectInputs := []string{"clock", "lease-manager", "raft"} + expectInputs := []string{"lease-manager", "raft"} c.Check(manifold.Inputs, jc.SameContents, expectInputs) } -func (s *ManifoldSuite) TestStartValidateClockName(c *gc.C) { - s.config.ClockName = "" - s.testStartValidateConfig(c, "empty ClockName not valid") +func (s *ManifoldSuite) TestStartValidateClock(c *gc.C) { + s.config.Clock = nil + s.testStartValidateConfig(c, "nil Clock not valid") } func (s *ManifoldSuite) TestStartValidateStateName(c *gc.C) { @@ -117,7 +117,6 @@ func (s *ManifoldSuite) testStartValidateConfig(c *gc.C, expect string) { manifold := globalclockupdater.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": nil, "state": nil, }) worker, err := manifold.Start(context) @@ -125,23 +124,11 @@ c.Check(worker, gc.IsNil) } -func (s *ManifoldSuite) TestStartMissingClock(c *gc.C) { - manifold := globalclockupdater.Manifold(s.config) - context := dt.StubContext(nil, map[string]interface{}{ - "clock": dependency.ErrMissing, - }) - - worker, err := manifold.Start(context) - c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing) - c.Check(worker, gc.IsNil) -} - func (s *ManifoldSuite) TestStartMissingLeaseManager(c *gc.C) { s.config.StateName = "" s.config.LeaseManagerName = "lease-manager" manifold := globalclockupdater.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": fakeClock{}, "lease-manager": dependency.ErrMissing, }) @@ -157,7 +144,6 @@ s.config.RaftName = "raft" manifold := globalclockupdater.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": fakeClock{}, "lease-manager": &updater, "raft": dependency.ErrMissing, }) @@ -170,7 +156,6 @@ func (s *ManifoldSuite) TestStartMissingState(c *gc.C) { manifold := globalclockupdater.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": fakeClock{}, "state": dependency.ErrMissing, }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mocks/environs_mock.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mocks/environs_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mocks/environs_mock.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mocks/environs_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,18 +5,20 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" - constraints "github.com/juju/juju/core/constraints" - instance "github.com/juju/juju/core/instance" - lxdprofile "github.com/juju/juju/core/lxdprofile" - environs "github.com/juju/juju/environs" - config "github.com/juju/juju/environs/config" - context "github.com/juju/juju/environs/context" - instances "github.com/juju/juju/environs/instances" - storage "github.com/juju/juju/storage" - version "github.com/juju/version" + "reflect" + + "github.com/golang/mock/gomock" + "github.com/juju/version" charm_v6 "gopkg.in/juju/charm.v6" - reflect "reflect" + + "github.com/juju/juju/core/constraints" + "github.com/juju/juju/core/instance" + "github.com/juju/juju/core/lxdprofile" + "github.com/juju/juju/environs" + "github.com/juju/juju/environs/config" + "github.com/juju/juju/environs/context" + "github.com/juju/juju/environs/instances" + "github.com/juju/juju/storage" ) // MockEnviron is a mock of Environ interface @@ -67,6 +69,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockEnviron)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockEnviron) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockEnvironMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockEnviron)(nil).AllRunningInstances), arg0) +} + // Bootstrap mocks base method func (m *MockEnviron) Bootstrap(arg0 environs.BootstrapContext, arg1 context.ProviderCallContext, arg2 environs.BootstrapParams) (*environs.BootstrapResult, error) { ret := m.ctrl.Call(m, "Bootstrap", arg0, arg1, arg2) @@ -393,6 +408,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllInstances", reflect.TypeOf((*MockInstanceBroker)(nil).AllInstances), arg0) } +// AllRunningInstances mocks base method +func (m *MockInstanceBroker) AllRunningInstances(arg0 context.ProviderCallContext) ([]instances.Instance, error) { + ret := m.ctrl.Call(m, "AllRunningInstances", arg0) + ret0, _ := ret[0].([]instances.Instance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AllRunningInstances indicates an expected call of AllRunningInstances +func (mr *MockInstanceBrokerMockRecorder) AllRunningInstances(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllRunningInstances", reflect.TypeOf((*MockInstanceBroker)(nil).AllRunningInstances), arg0) +} + // MaintainInstance mocks base method func (m *MockInstanceBroker) MaintainInstance(arg0 context.ProviderCallContext, arg1 environs.StartInstanceParams) error { ret := m.ctrl.Call(m, "MaintainInstance", arg0, arg1) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mocks/machinemutater_mock.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mocks/machinemutater_mock.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mocks/machinemutater_mock.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mocks/machinemutater_mock.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,6 +8,7 @@ gomock "github.com/golang/mock/gomock" instancemutater "github.com/juju/juju/api/instancemutater" params "github.com/juju/juju/apiserver/params" + instance "github.com/juju/juju/core/instance" status "github.com/juju/juju/core/status" watcher "github.com/juju/juju/core/watcher" names_v2 "gopkg.in/juju/names.v2" @@ -50,6 +51,19 @@ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CharmProfilingInfo", reflect.TypeOf((*MockMutaterMachine)(nil).CharmProfilingInfo)) } +// ContainerType mocks base method +func (m *MockMutaterMachine) ContainerType() (instance.ContainerType, error) { + ret := m.ctrl.Call(m, "ContainerType") + ret0, _ := ret[0].(instance.ContainerType) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerType indicates an expected call of ContainerType +func (mr *MockMutaterMachineMockRecorder) ContainerType() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerType", reflect.TypeOf((*MockMutaterMachine)(nil).ContainerType)) +} + // InstanceId mocks base method func (m *MockMutaterMachine) InstanceId() (string, error) { ret := m.ctrl.Call(m, "InstanceId") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mutater.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mutater.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mutater.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mutater.go 2019-06-28 17:10:43.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/juju/api/instancemutater" "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/instance" "github.com/juju/juju/core/lxdprofile" "github.com/juju/juju/core/status" "github.com/juju/juju/core/watcher" @@ -69,8 +70,18 @@ if err != nil { return errors.Trace(err) } - id := api.Tag().Id() + + // Ensure we do not watch any KVM containers. + containerType, err := api.ContainerType() + if err != nil { + return errors.Trace(err) + } + if containerType == instance.KVM { + m.logger.Tracef("ignoring KVM container machine-%s", id) + continue + } + c = make(chan struct{}) m.machines[tag] = c diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mutater_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mutater_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/mutater_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/mutater_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -46,7 +46,7 @@ startingProfiles := []string{"default", "juju-testme"} finishingProfiles := append(startingProfiles, "juju-testme-lxd-profile-1") - s.ignoreLogging(c)() + s.ignoreLogging(c) s.expectRefreshLifeAliveStatusIdle() s.expectLXDProfileNames(startingProfiles, nil) s.expectAssignLXDProfiles(finishingProfiles, nil) @@ -63,7 +63,7 @@ startingProfiles := []string{"default", "juju-testme"} - s.ignoreLogging(c)() + s.ignoreLogging(c) s.expectRefreshLifeDead() info := s.info(startingProfiles, 1, false) @@ -77,7 +77,7 @@ startingProfiles := []string{"default", "juju-testme"} finishingProfiles := append(startingProfiles, "juju-testme-lxd-profile-1") - s.ignoreLogging(c)() + s.ignoreLogging(c) s.expectRefreshLifeAliveStatusIdle() s.expectLXDProfileNames(startingProfiles, nil) s.expectAssignLXDProfiles(finishingProfiles, errors.New("fail me")) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/worker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/worker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancemutater/worker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancemutater/worker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -20,6 +20,7 @@ apiinstancemutater "github.com/juju/juju/api/instancemutater" "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/instance" "github.com/juju/juju/core/lxdprofile" "github.com/juju/juju/core/status" "github.com/juju/juju/core/watcher" @@ -186,52 +187,49 @@ func (s *workerEnvironSuite) TestFullWorkflow(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectMachineCharmProfilingInfo(0, 3), - s.expectLXDProfileNamesTrue, - s.expectSetCharmProfiles(0), - s.expectAssignLXDProfiles, - s.expectAliveAndSetModificationStatusIdle(0), - s.expectModificationStatusApplied(0), - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectMachineCharmProfilingInfo(0, 3) + s.expectLXDProfileNamesTrue() + s.expectSetCharmProfiles(0) + s.expectAssignLXDProfiles() + s.expectAliveAndSetModificationStatusIdle(0) + s.expectModificationStatusApplied(0) + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerEnvironSuite) TestVerifyCurrentProfilesTrue(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectAliveAndSetModificationStatusIdle(0), - s.expectMachineCharmProfilingInfo(0, 2), - s.expectLXDProfileNamesTrue, - s.expectModificationStatusApplied(0), - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectAliveAndSetModificationStatusIdle(0) + s.expectMachineCharmProfilingInfo(0, 2) + s.expectLXDProfileNamesTrue() + s.expectModificationStatusApplied(0) + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerEnvironSuite) TestRemoveAllCharmProfiles(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectAliveAndSetModificationStatusIdle(0), - s.expectCharmProfilingInfoRemove(0), - s.expectLXDProfileNamesTrue, - s.expectRemoveAllCharmProfiles(0), - s.expectModificationStatusApplied(0), - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectAliveAndSetModificationStatusIdle(0) + s.expectCharmProfilingInfoRemove(0) + s.expectLXDProfileNamesTrue() + s.expectRemoveAllCharmProfiles(0) + s.expectModificationStatusApplied(0) + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerEnvironSuite) TestMachineNotifyTwice(c *gc.C) { @@ -241,44 +239,42 @@ // machine notifications are sent. The 2nd group must // be after machine 0 gets Life() == Alive. var group sync.WaitGroup - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachinesWaitGroup([][]string{{"0", "1"}, {"0"}}, &group), - s.expectFacadeMachineTag(0), - s.expectFacadeMachineTag(1), - s.notifyMachineAppLXDProfile(0, 1), - s.notifyMachineAppLXDProfile(1, 1), - s.expectAliveAndSetModificationStatusIdle(1), - s.expectMachineCharmProfilingInfo(0, 2), - s.expectMachineCharmProfilingInfo(1, 2), - s.expectLXDProfileNamesTrue, - s.expectLXDProfileNamesTrue, - s.expectMachineAliveStatusIdleMachineDead(0, &group), - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyMachinesWaitGroup([][]string{{"0", "1"}, {"0"}}, &group) + s.expectFacadeMachineTag(0) + s.expectFacadeMachineTag(1) + s.notifyMachineAppLXDProfile(0, 1) + s.notifyMachineAppLXDProfile(1, 1) + s.expectAliveAndSetModificationStatusIdle(1) + s.expectMachineCharmProfilingInfo(0, 2) + s.expectMachineCharmProfilingInfo(1, 2) + s.expectLXDProfileNamesTrue() + s.expectLXDProfileNamesTrue() + s.expectMachineAliveStatusIdleMachineDead(0, &group) + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerEnvironSuite) TestNoChangeFoundOne(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectCharmProfilingInfoSimpleNoChange(0), - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectCharmProfilingInfoSimpleNoChange(0) + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerEnvironSuite) TestNoMachineFound(c *gc.C) { defer s.setup(c, 1).Finish() - w, err := s.workerErrorForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeReturnsNoMachine, - ) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeReturnsNoMachine() + + w, err := s.workerErrorForScenario(c) // Since we don't use cleanKill() nor errorKill() // here, but do waitDone() before checking errors. @@ -299,30 +295,26 @@ func (s *workerEnvironSuite) TestCharmProfilingInfoNotProvisioned(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectCharmProfileInfoNotProvisioned(0), - ) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectCharmProfileInfoNotProvisioned(0) - err := s.errorKill(c, w) + err := s.errorKill(c, s.workerForScenario(c)) c.Assert(err, gc.IsNil) } func (s *workerEnvironSuite) TestCharmProfilingInfoError(c *gc.C) { defer s.setup(c, 1).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyMachines([][]string{{"0"}}), - s.expectFacadeMachineTag(0), - s.notifyMachineAppLXDProfile(0, 1), - s.expectCharmProfileInfoError(0), - ) + s.ignoreLogging(c) + s.notifyMachines([][]string{{"0"}}) + s.expectFacadeMachineTag(0) + s.notifyMachineAppLXDProfile(0, 1) + s.expectCharmProfileInfoError(0) - err := s.errorKill(c, w) + err := s.errorKill(c, s.workerForScenario(c)) c.Assert(err, jc.Satisfies, params.IsCodeNotSupported) } @@ -342,13 +334,14 @@ s.appLXDProfileWorker[i] = workermocks.NewMockWorker(ctrl) } + s.expectContainerTypeNone() return ctrl } // workerForScenario creates worker config based on the suite's mocks. // Any supplied behaviour functions are executed, then a new worker // is started successfully and returned. -func (s *workerSuite) workerForScenario(c *gc.C, behaviours ...func()) worker.Worker { +func (s *workerSuite) workerForScenario(c *gc.C) worker.Worker { config := instancemutater.Config{ Facade: s.facade, Logger: s.logger, @@ -358,10 +351,6 @@ GetRequiredLXDProfiles: s.getRequiredLXDProfiles, } - for _, b := range behaviours { - b() - } - w, err := s.newWorkerFunc(config) c.Assert(err, jc.ErrorIsNil) return w @@ -370,7 +359,7 @@ // workerErrorForScenario creates worker config based on the suite's mocks. // Any supplied behaviour functions are executed, then a new worker is // started and returned with any error in creation. -func (s *workerSuite) workerErrorForScenario(c *gc.C, behaviours ...func()) (worker.Worker, error) { +func (s *workerSuite) workerErrorForScenario(c *gc.C) (worker.Worker, error) { config := instancemutater.Config{ Facade: s.facade, Logger: s.logger, @@ -379,19 +368,13 @@ Tag: s.machineTag, } - for _, b := range behaviours { - b() - } - return s.newWorkerFunc(config) } -func (s *workerSuite) expectFacadeMachineTag(machine int) func() { - return func() { - tag := names.NewMachineTag(strconv.Itoa(machine)) - s.facade.EXPECT().Machine(tag).Return(s.machine[machine], nil).AnyTimes() - s.machine[machine].EXPECT().Tag().Return(tag).AnyTimes() - } +func (s *workerSuite) expectFacadeMachineTag(machine int) { + tag := names.NewMachineTag(strconv.Itoa(machine)) + s.facade.EXPECT().Machine(tag).Return(s.machine[machine], nil).AnyTimes() + s.machine[machine].EXPECT().Tag().Return(tag).AnyTimes() } func (s *workerSuite) expectFacadeReturnsNoMachine() { @@ -399,13 +382,17 @@ s.facade.EXPECT().Machine(s.machineTag).Return(nil, errors.NewNotFound(nil, "machine")).Do(do) } -func (s *workerSuite) expectCharmProfilingInfoSimpleNoChange(machine int) func() { - return func() { - do := s.workGroupAddGetDoneFunc() - s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, nil).Do(do) +func (s *workerSuite) expectContainerTypeNone() { + for _, m := range s.machine { + m.EXPECT().ContainerType().Return(instance.NONE, nil).AnyTimes() } } +func (s *workerSuite) expectCharmProfilingInfoSimpleNoChange(machine int) { + do := s.workGroupAddGetDoneFunc() + s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, nil).Do(do) +} + func (s *workerSuite) workGroupAddGetDoneFunc() func(_ ...interface{}) { s.doneWG.Add(1) return func(_ ...interface{}) { s.doneWG.Done() } @@ -415,97 +402,86 @@ s.broker.EXPECT().LXDProfileNames("juju-23423-0").Return([]string{"default", "juju-testing", "juju-testing-one-2"}, nil) } -func (s *workerSuite) expectMachineCharmProfilingInfo(machine, rev int) func() { - return s.expectCharmProfilingInfo(s.machine[machine], rev) +func (s *workerSuite) expectMachineCharmProfilingInfo(machine, rev int) { + s.expectCharmProfilingInfo(s.machine[machine], rev) } -func (s *workerSuite) expectCharmProfilingInfo(mock *mocks.MockMutaterMachine, rev int) func() { - return func() { - mock.EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{ - CurrentProfiles: []string{"default", "juju-testing", "juju-testing-one-2"}, - InstanceId: "juju-23423-0", - ModelName: "testing", - ProfileChanges: []apiinstancemutater.UnitProfileChanges{ - { - ApplicationName: "one", - Revision: rev, - Profile: lxdprofile.Profile{ - Config: map[string]string{"hi": "bye"}, - }, +func (s *workerSuite) expectCharmProfilingInfo(mock *mocks.MockMutaterMachine, rev int) { + mock.EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{ + CurrentProfiles: []string{"default", "juju-testing", "juju-testing-one-2"}, + InstanceId: "juju-23423-0", + ModelName: "testing", + ProfileChanges: []apiinstancemutater.UnitProfileChanges{ + { + ApplicationName: "one", + Revision: rev, + Profile: lxdprofile.Profile{ + Config: map[string]string{"hi": "bye"}, }, }, - }, nil) - } + }, + }, nil) } -func (s *workerSuite) expectCharmProfilingInfoRemove(machine int) func() { - return func() { - s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{ - CurrentProfiles: []string{"default", "juju-testing", "juju-testing-one-2"}, - InstanceId: "juju-23423-0", - ModelName: "testing", - ProfileChanges: []apiinstancemutater.UnitProfileChanges{}, - }, nil) - } +func (s *workerSuite) expectCharmProfilingInfoRemove(machine int) { + s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{ + CurrentProfiles: []string{"default", "juju-testing", "juju-testing-one-2"}, + InstanceId: "juju-23423-0", + ModelName: "testing", + ProfileChanges: []apiinstancemutater.UnitProfileChanges{}, + }, nil) } -func (s *workerSuite) expectCharmProfileInfoNotProvisioned(machine int) func() { - return func() { - do := s.workGroupAddGetDoneFunc() - err := params.Error{ - Message: "machine 0 not provisioned", - Code: params.CodeNotProvisioned, - } - s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, err).Do(do) +func (s *workerSuite) expectCharmProfileInfoNotProvisioned(machine int) { + do := s.workGroupAddGetDoneFunc() + err := params.Error{ + Message: "machine 0 not provisioned", + Code: params.CodeNotProvisioned, } + s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, err).Do(do) } -func (s *workerSuite) expectCharmProfileInfoError(machine int) func() { - return func() { - do := s.workGroupAddGetDoneFunc() - err := params.Error{ - Message: "machine 0 not supported", - Code: params.CodeNotSupported, - } - s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, err).Do(do) +func (s *workerSuite) expectCharmProfileInfoError(machine int) { + do := s.workGroupAddGetDoneFunc() + err := params.Error{ + Message: "machine 0 not supported", + Code: params.CodeNotSupported, } + s.machine[machine].EXPECT().CharmProfilingInfo().Return(&apiinstancemutater.UnitProfileInfo{}, err).Do(do) + } -func (s *workerSuite) expectAliveAndSetModificationStatusIdle(machine int) func() { - return func() { - mExp := s.machine[machine].EXPECT() - mExp.Refresh().Return(nil) - mExp.Life().Return(params.Alive) - mExp.SetModificationStatus(status.Idle, "", nil).Return(nil) - } +func (s *workerSuite) expectAliveAndSetModificationStatusIdle(machine int) { + mExp := s.machine[machine].EXPECT() + mExp.Refresh().Return(nil) + mExp.Life().Return(params.Alive) + mExp.SetModificationStatus(status.Idle, "", nil).Return(nil) + } -func (s *workerSuite) expectMachineAliveStatusIdleMachineDead(machine int, group *sync.WaitGroup) func() { - return func() { - mExp := s.machine[machine].EXPECT() +func (s *workerSuite) expectMachineAliveStatusIdleMachineDead(machine int, group *sync.WaitGroup) { + s.doneWG.Add(1) + do := s.workGroupAddGetDoneFunc() - group.Add(1) - notificationSync := func(_ ...interface{}) { group.Done() } + mExp := s.machine[machine].EXPECT() - mExp.Refresh().Return(nil).Times(2) - o1 := mExp.Life().Return(params.Alive).Do(notificationSync) + group.Add(1) + notificationSync := func(_ ...interface{}) { group.Done() } - mExp.SetModificationStatus(status.Idle, "", nil).Return(nil) + mExp.Refresh().Return(nil).Times(2) + o1 := mExp.Life().Return(params.Alive).Do(notificationSync) - do := s.workGroupAddGetDoneFunc() - s.machine[0].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil) - s.machine[1].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) + mExp.SetModificationStatus(status.Idle, "", nil).Return(nil) - s.doneWG.Add(1) - mExp.Life().Return(params.Dead).After(o1).Do(do) - } + s.machine[0].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil) + s.machine[1].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) + + mExp.Life().Return(params.Dead).After(o1).Do(do) } -func (s *workerSuite) expectModificationStatusApplied(machine int) func() { - return func() { - do := s.workGroupAddGetDoneFunc() - s.machine[machine].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) - } +func (s *workerSuite) expectModificationStatusApplied(machine int) { + do := s.workGroupAddGetDoneFunc() + s.machine[machine].EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) } func (s *workerSuite) expectAssignLXDProfiles() { @@ -513,103 +489,90 @@ s.broker.EXPECT().AssignLXDProfiles("juju-23423-0", profiles, gomock.Any()).Return(profiles, nil) } -func (s *workerSuite) expectSetCharmProfiles(machine int) func() { - return func() { - s.machine[machine].EXPECT().SetCharmProfiles([]string{"default", "juju-testing", "juju-testing-one-3"}) - } +func (s *workerSuite) expectSetCharmProfiles(machine int) { + s.machine[machine].EXPECT().SetCharmProfiles([]string{"default", "juju-testing", "juju-testing-one-3"}) } -func (s *workerSuite) expectRemoveAllCharmProfiles(machine int) func() { - return func() { - profiles := []string{"default", "juju-testing"} - s.machine[machine].EXPECT().SetCharmProfiles(profiles) - s.broker.EXPECT().AssignLXDProfiles("juju-23423-0", profiles, gomock.Any()).Return(profiles, nil) - } +func (s *workerSuite) expectRemoveAllCharmProfiles(machine int) { + profiles := []string{"default", "juju-testing"} + s.machine[machine].EXPECT().SetCharmProfiles(profiles) + s.broker.EXPECT().AssignLXDProfiles("juju-23423-0", profiles, gomock.Any()).Return(profiles, nil) } // notifyMachines returns a suite behaviour that will cause the instance mutator // watcher to send a number of notifications equal to the supplied argument. // Once notifications have been consumed, we notify via the suite's channel. -func (s *workerSuite) notifyMachines(values [][]string) func() { +func (s *workerSuite) notifyMachines(values [][]string) { ch := make(chan []string) + s.doneWG.Add(1) + go func() { + for _, v := range values { + ch <- v + } + s.doneWG.Done() + }() - return func() { - s.doneWG.Add(1) - go func() { - for _, v := range values { - ch <- v - } - s.doneWG.Done() - }() - - s.machinesWorker.EXPECT().Kill().AnyTimes() - s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() - - s.facade.EXPECT().WatchMachines().Return( - &fakeStringsWatcher{ - Worker: s.machinesWorker, - ch: ch, - }, nil) - } + s.machinesWorker.EXPECT().Kill().AnyTimes() + s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() + + s.facade.EXPECT().WatchMachines().Return( + &fakeStringsWatcher{ + Worker: s.machinesWorker, + ch: ch, + }, nil) } -func (s *workerSuite) notifyMachinesWaitGroup(values [][]string, group *sync.WaitGroup) func() { +func (s *workerSuite) notifyMachinesWaitGroup(values [][]string, group *sync.WaitGroup) { ch := make(chan []string) + s.doneWG.Add(1) + go func() { + for _, v := range values { + ch <- v + group.Wait() + } + s.doneWG.Done() + }() - return func() { - s.doneWG.Add(1) - go func() { - for _, v := range values { - ch <- v - group.Wait() - } - s.doneWG.Done() - }() - - s.machinesWorker.EXPECT().Kill().AnyTimes() - s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() - - s.facade.EXPECT().WatchMachines().Return( - &fakeStringsWatcher{ - Worker: s.machinesWorker, - ch: ch, - }, nil) - } + s.machinesWorker.EXPECT().Kill().AnyTimes() + s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() + + s.facade.EXPECT().WatchMachines().Return( + &fakeStringsWatcher{ + Worker: s.machinesWorker, + ch: ch, + }, nil) } // notifyAppLXDProfile returns a suite behaviour that will cause the instance mutator // watcher to send a number of notifications equal to the supplied argument. // Once notifications have been consumed, we notify via the suite's channel. -func (s *workerSuite) notifyMachineAppLXDProfile(machine, times int) func() { - return s.notifyAppLXDProfile(s.machine[machine], machine, times) +func (s *workerSuite) notifyMachineAppLXDProfile(machine, times int) { + s.notifyAppLXDProfile(s.machine[machine], machine, times) } -func (s *workerContainerSuite) notifyContainerAppLXDProfile(times int) func() { - return s.notifyAppLXDProfile(s.container, 0, times) +func (s *workerContainerSuite) notifyContainerAppLXDProfile(times int) { + s.notifyAppLXDProfile(s.lxdContainer, 0, times) } -func (s *workerSuite) notifyAppLXDProfile(mock *mocks.MockMutaterMachine, which, times int) func() { +func (s *workerSuite) notifyAppLXDProfile(mock *mocks.MockMutaterMachine, which, times int) { ch := make(chan struct{}) + s.doneWG.Add(1) + go func() { + for i := 0; i < times; i += 1 { + ch <- struct{}{} + } + s.doneWG.Done() + }() - return func() { - s.doneWG.Add(1) - go func() { - for i := 0; i < times; i += 1 { - ch <- struct{}{} - } - s.doneWG.Done() - }() - - w := s.appLXDProfileWorker[which] - w.EXPECT().Kill().AnyTimes() - w.EXPECT().Wait().Return(nil).AnyTimes() - - mock.EXPECT().WatchLXDProfileVerificationNeeded().Return( - &fakeNotifyWatcher{ - Worker: w, - ch: ch, - }, nil) - } + w := s.appLXDProfileWorker[which] + w.EXPECT().Kill().AnyTimes() + w.EXPECT().Wait().Return(nil).AnyTimes() + + mock.EXPECT().WatchLXDProfileVerificationNeeded().Return( + &fakeNotifyWatcher{ + Worker: w, + ch: ch, + }, nil) } // cleanKill waits for notifications to be processed, then waits for the input @@ -651,19 +614,18 @@ // ignoreLogging turns the suite's mock Logger into a sink, with no validation. // Logs are still emitted via the test Logger. -func (s *loggerSuite) ignoreLogging(c *gc.C) func() { +func (s *loggerSuite) ignoreLogging(c *gc.C) { warnIt := func(message string, args ...interface{}) { logIt(c, loggo.WARNING, message, args) } debugIt := func(message string, args ...interface{}) { logIt(c, loggo.DEBUG, message, args) } errorIt := func(message string, args ...interface{}) { logIt(c, loggo.ERROR, message, args) } traceIt := func(message string, args ...interface{}) { logIt(c, loggo.TRACE, message, args) } - return func() { - e := s.logger.EXPECT() - e.Warningf(gomock.Any(), gomock.Any()).AnyTimes().Do(warnIt) - e.Debugf(gomock.Any(), gomock.Any()).AnyTimes().Do(debugIt) - e.Errorf(gomock.Any(), gomock.Any()).AnyTimes().Do(errorIt) - e.Tracef(gomock.Any(), gomock.Any()).AnyTimes().Do(traceIt) - } + e := s.logger.EXPECT() + e.Warningf(gomock.Any(), gomock.Any()).AnyTimes().Do(warnIt) + e.Debugf(gomock.Any(), gomock.Any()).AnyTimes().Do(debugIt) + e.Errorf(gomock.Any(), gomock.Any()).AnyTimes().Do(errorIt) + e.Tracef(gomock.Any(), gomock.Any()).AnyTimes().Do(traceIt) + } func logIt(c *gc.C, level loggo.Level, message string, args interface{}) { @@ -681,8 +643,10 @@ type workerContainerSuite struct { workerSuite - containerTag names.Tag - container *mocks.MockMutaterMachine + lxdContainerTag names.Tag + kvmContainerTag names.Tag + lxdContainer *mocks.MockMutaterMachine + kvmContainer *mocks.MockMutaterMachine } var _ = gc.Suite(&workerContainerSuite{}) @@ -690,7 +654,8 @@ func (s *workerContainerSuite) SetUpTest(c *gc.C) { s.workerSuite.SetUpTest(c) - s.containerTag = names.NewMachineTag("0/lxd/0") + s.lxdContainerTag = names.NewMachineTag("0/lxd/0") + s.kvmContainerTag = names.NewMachineTag("0/kvm/0") s.newWorkerFunc = instancemutater.NewContainerWorker s.getRequiredLXDProfiles = func(modelName string) []string { return []string{"default"} @@ -699,49 +664,51 @@ // TestFullWorkflow uses the the expectation scenarios from each of the tests // below to compose a test of the whole instance mutator scenario, from start -// below to compose a test of the whole instance mutator scenario, from start // to finish for a ContainerWorker. func (s *workerContainerSuite) TestFullWorkflow(c *gc.C) { defer s.setup(c).Finish() - w := s.workerForScenario(c, - s.ignoreLogging(c), - s.notifyContainers(0, [][]string{{"0/lxd/0"}}), - s.expectFacadeMachineTag(0), - s.expectFacadeContainerTag, - s.notifyContainerAppLXDProfile(1), - s.expectContainerTag, - s.expectContainerCharmProfilingInfo(3), - s.expectLXDProfileNamesTrue, - s.expectContainerSetCharmProfiles, - s.expectAssignLXDProfiles, - s.expectContainerAliveAndSetModificationStatusIdle, - s.expectContainerModificationStatusApplied, - ) - s.cleanKill(c, w) + s.ignoreLogging(c) + s.notifyContainers(0, [][]string{{"0/lxd/0", "0/kvm/0"}}) + s.expectFacadeMachineTag(0) + s.expectFacadeContainerTags() + s.expectContainerTypes() + s.notifyContainerAppLXDProfile(1) + s.expectContainerCharmProfilingInfo(3) + s.expectLXDProfileNamesTrue() + s.expectContainerSetCharmProfiles() + s.expectAssignLXDProfiles() + s.expectContainerAliveAndSetModificationStatusIdle() + s.expectContainerModificationStatusApplied() + + s.cleanKill(c, s.workerForScenario(c)) } func (s *workerContainerSuite) setup(c *gc.C) *gomock.Controller { ctrl := s.workerSuite.setup(c, 1) - s.container = mocks.NewMockMutaterMachine(ctrl) + s.lxdContainer = mocks.NewMockMutaterMachine(ctrl) + s.kvmContainer = mocks.NewMockMutaterMachine(ctrl) return ctrl } -func (s *workerContainerSuite) expectFacadeContainerTag() { - s.facade.EXPECT().Machine(s.containerTag).Return(s.container, nil).AnyTimes() - s.container.EXPECT().Tag().Return(s.containerTag).AnyTimes() +func (s *workerContainerSuite) expectFacadeContainerTags() { + s.facade.EXPECT().Machine(s.lxdContainerTag).Return(s.lxdContainer, nil).AnyTimes() + s.lxdContainer.EXPECT().Tag().Return(s.lxdContainerTag).AnyTimes() + s.facade.EXPECT().Machine(s.kvmContainerTag).Return(s.kvmContainer, nil).AnyTimes() + s.kvmContainer.EXPECT().Tag().Return(s.kvmContainerTag).AnyTimes() } -func (s *workerContainerSuite) expectContainerTag() { - s.container.EXPECT().Tag().Return(s.containerTag).AnyTimes() +func (s *workerContainerSuite) expectContainerTypes() { + s.lxdContainer.EXPECT().ContainerType().Return(instance.LXD, nil).AnyTimes() + s.kvmContainer.EXPECT().ContainerType().Return(instance.KVM, nil).AnyTimes() } -func (s *workerContainerSuite) expectContainerCharmProfilingInfo(rev int) func() { - return s.expectCharmProfilingInfo(s.container, rev) +func (s *workerContainerSuite) expectContainerCharmProfilingInfo(rev int) { + s.expectCharmProfilingInfo(s.lxdContainer, rev) } func (s *workerContainerSuite) expectContainerAliveAndSetModificationStatusIdle() { - cExp := s.container.EXPECT() + cExp := s.lxdContainer.EXPECT() cExp.Refresh().Return(nil) cExp.Life().Return(params.Alive) cExp.SetModificationStatus(status.Idle, gomock.Any(), gomock.Any()).Return(nil) @@ -749,7 +716,7 @@ func (s *workerContainerSuite) expectContainerModificationStatusApplied() { do := s.workGroupAddGetDoneFunc() - s.container.EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) + s.lxdContainer.EXPECT().SetModificationStatus(status.Applied, "", nil).Return(nil).Do(do) } func (s *workerContainerSuite) expectAssignLXDProfiles() { @@ -758,33 +725,30 @@ } func (s *workerContainerSuite) expectContainerSetCharmProfiles() { - s.container.EXPECT().SetCharmProfiles([]string{"default", "juju-testing-one-3"}) + s.lxdContainer.EXPECT().SetCharmProfiles([]string{"default", "juju-testing-one-3"}) } // notifyContainers returns a suite behaviour that will cause the instance mutator // watcher to send a number of notifications equal to the supplied argument. // Once notifications have been consumed, we notify via the suite's channel. -func (s *workerContainerSuite) notifyContainers(machine int, values [][]string) func() { +func (s *workerContainerSuite) notifyContainers(machine int, values [][]string) { ch := make(chan []string) + s.doneWG.Add(1) + go func() { + for _, v := range values { + ch <- v + } + s.doneWG.Done() + }() - return func() { - s.doneWG.Add(1) - go func() { - for _, v := range values { - ch <- v - } - s.doneWG.Done() - }() - - s.machinesWorker.EXPECT().Kill().AnyTimes() - s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() - - s.machine[machine].EXPECT().WatchContainers().Return( - &fakeStringsWatcher{ - Worker: s.machinesWorker, - ch: ch, - }, nil) - } + s.machinesWorker.EXPECT().Kill().AnyTimes() + s.machinesWorker.EXPECT().Wait().Return(nil).AnyTimes() + + s.machine[machine].EXPECT().WatchContainers().Return( + &fakeStringsWatcher{ + Worker: s.machinesWorker, + ch: ch, + }, nil) } type fakeStringsWatcher struct { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancepoller/machine_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancepoller/machine_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancepoller/machine_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancepoller/machine_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -31,7 +31,16 @@ coretesting.BaseSuite } -var testAddrs = network.NewAddresses("127.0.0.1") +var testAddrs = []network.Address{ + network.NewAddress("127.0.0.1"), + { + Value: "10.6.6.6", + Type: network.IPv4Address, + Scope: network.ScopeCloudLocal, + SpaceName: "test-space", + SpaceProviderId: "1", + }, +} func (s *machineSuite) TestSetsInstanceInfoInitially(c *gc.C) { context := &testMachineContext{ @@ -46,10 +55,10 @@ } died := make(chan machine) - clock := newTestClock() - go runMachine(context, m, nil, died, clock) - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + clk := newTestClock() + go runMachine(context, m, nil, died, clk) + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) killMachineLoop(c, m, context.dyingc, died) c.Assert(context.killErr, gc.Equals, nil) @@ -71,10 +80,10 @@ } died := make(chan machine) - clock := newTestClock() - go runMachine(context, m, nil, died, clock) - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + clk := newTestClock() + go runMachine(context, m, nil, died, clk) + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) killMachineLoop(c, m, context.dyingc, died) c.Assert(context.killErr, gc.Equals, nil) @@ -99,15 +108,15 @@ instId, instStatus string, machineStatus status.Status, ) { - clock := newTestClock() - testRunMachine(c, addrs, instId, instStatus, machineStatus, clock, func() { - c.Assert(clock.WaitAdvance( + clk := newTestClock() + testRunMachine(c, addrs, instId, instStatus, machineStatus, clk, func() { + c.Assert(clk.WaitAdvance( time.Duration(float64(ShortPoll)*ShortPollBackoff), coretesting.ShortWait, 1), jc.ErrorIsNil, ) }) - clock.CheckCall(c, 0, "After", time.Duration(float64(ShortPoll)*ShortPollBackoff)) - clock.CheckCall(c, 1, "After", time.Duration(float64(ShortPoll)*ShortPollBackoff*ShortPollBackoff)) + clk.CheckCall(c, 0, "After", time.Duration(float64(ShortPoll)*ShortPollBackoff)) + clk.CheckCall(c, 1, "After", time.Duration(float64(ShortPoll)*ShortPollBackoff*ShortPollBackoff)) } func (s *machineSuite) TestNoPollWhenNotProvisioned(c *gc.C) { @@ -133,12 +142,12 @@ } died := make(chan machine) - clock := testclock.NewClock(time.Time{}) + clk := testclock.NewClock(time.Time{}) changed := make(chan struct{}) - go runMachine(context, m, changed, died, clock) + go runMachine(context, m, changed, died, clk) expectPoll := func() { - c.Assert(clock.WaitAdvance(ShortPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + c.Assert(clk.WaitAdvance(ShortPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) } expectPoll() @@ -175,23 +184,23 @@ 900 * time.Second, // limit is 15 minutes (LongPoll) } - clock := newTestClock() - testRunMachine(c, nil, "i1234", "", status.Started, clock, func() { + clk := newTestClock() + testRunMachine(c, nil, "i1234", "", status.Started, clk, func() { for _, d := range pollDurations { - c.Assert(clock.WaitAdvance(d, coretesting.ShortWait, 1), jc.ErrorIsNil) + c.Assert(clk.WaitAdvance(d, coretesting.ShortWait, 1), jc.ErrorIsNil) } }) for i, d := range pollDurations { - clock.CheckCall(c, i, "After", d) + clk.CheckCall(c, i, "After", d) } } func (s *machineSuite) TestLongPollIntervalWhenHasAllInstanceInfo(c *gc.C) { - clock := newTestClock() - testRunMachine(c, testAddrs, "i1234", "running", status.Started, clock, func() { - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + clk := newTestClock() + testRunMachine(c, testAddrs, "i1234", "running", status.Started, clk, func() { + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) }) - clock.CheckCall(c, 0, "After", LongPoll) + clk.CheckCall(c, 0, "After", LongPoll) } func testRunMachine( @@ -248,10 +257,10 @@ } died := make(chan machine) changed := make(chan struct{}) - clock := newTestClock() - go runMachine(context, m, changed, died, clock) + clk := newTestClock() + go runMachine(context, m, changed, died, clk) - c.Assert(clock.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) + c.Assert(clk.WaitAdvance(LongPoll, coretesting.ShortWait, 1), jc.ErrorIsNil) select { case <-died: c.Fatalf("machine died prematurely") @@ -496,8 +505,8 @@ } func newTestClock() *testClock { - clock := testclock.NewClock(time.Time{}) - return &testClock{Clock: clock} + clk := testclock.NewClock(time.Time{}) + return &testClock{Clock: clk} } func (t *testClock) After(d time.Duration) <-chan time.Time { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/instancepoller/updater.go juju-core-2.6.5/src/github.com/juju/juju/worker/instancepoller/updater.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/instancepoller/updater.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/instancepoller/updater.go 2019-06-28 17:10:43.000000000 +0000 @@ -189,17 +189,15 @@ pollInstance := func() error { instInfo, err := pollInstanceInfo(context, m) if err != nil { - return err + return errors.Trace(err) } machineStatus := status.Pending - if err == nil { - if statusInfo, err := m.Status(); err != nil { - logger.Warningf("cannot get current machine status for machine %v: %v", m.Id(), err) - } else { - // TODO(perrito666) add status validation. - machineStatus = status.Status(statusInfo.Status) - } + if statusInfo, err := m.Status(); err != nil { + logger.Warningf("cannot get current machine status for machine %v: %v", m.Id(), err) + } else { + // TODO(perrito666) add status validation. + machineStatus = status.Status(statusInfo.Status) } // the extra condition below (checking allocating/pending) is here to improve user experience @@ -292,6 +290,7 @@ if err != nil { return instanceInfo{}, err } + if !addressesEqual(providerAddresses, instInfo.addresses) { logger.Infof("machine %q has new addresses: %v", m.Id(), instInfo.addresses) if err := m.SetProviderAddresses(instInfo.addresses...); err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/config.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/config.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/config.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/config.go 2019-06-28 17:10:43.000000000 +0000 @@ -63,6 +63,10 @@ // logging purposes. EntityUUID string + // LogDir is the directory to write a debugging log file in the + // case that the worker times out waiting to shut down. + LogDir string + PrometheusRegisterer prometheus.Registerer } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager_async_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager_async_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager_async_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager_async_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -191,8 +191,9 @@ // Stopping the worker should cancel the retry. c.Assert(worker.Stop(manager), jc.ErrorIsNil) - // Advance the clock to trigger the next expire retry - c.Assert(clock.WaitAdvance(50*time.Millisecond, coretesting.ShortWait, 1), jc.ErrorIsNil) + // Advance the clock to trigger the next expire retry (second + // expected timer is the shutdown timeout check). + c.Assert(clock.WaitAdvance(50*time.Millisecond, coretesting.ShortWait, 2), jc.ErrorIsNil) // Allow some wallclock time for a non-cancelled retry to // happen if stopping the worker didn't cancel it. This is not diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,9 +4,15 @@ package lease import ( + "fmt" + "io" + "os" + "path/filepath" + "runtime/pprof" "sort" "strings" "sync" + "sync/atomic" "time" "github.com/juju/clock" @@ -31,6 +37,12 @@ // Retrying 10 times starting at 50ms and backing off 1.6x gives us a total // delay time of about 9s. retryBackoffFactor = 1.6 + + // maxShutdownWait is the maximum time to wait for the async + // claims and expires to complete before stopping the worker + // anyway. Picked to be slightly quicker than the httpserver + // shutdown timeout. + maxShutdownWait = 55 * time.Second ) // errStopped is returned to clients when an operation cannot complete because @@ -137,6 +149,14 @@ // wg is used to ensure that all child goroutines are finished // before we stop. wg sync.WaitGroup + + // outstandingClaims tracks how many unfinished claim goroutines + // are running (for debugging purposes). + outstandingClaims int64 + + // outstandingExpires tracks how many unfinished expire goroutines + // are running (for debugging purposes). + outstandingExpires int64 } // Kill is part of the worker.Worker interface. @@ -158,7 +178,7 @@ defer manager.config.PrometheusRegisterer.Unregister(collector) } - defer manager.wg.Wait() + defer manager.waitForGoroutines() blocks := make(blocks) manager.setupInitialTimer() for { @@ -186,7 +206,7 @@ case <-manager.expireDone: manager.checkBlocks(blocks) case claim := <-manager.claims: - manager.wg.Add(1) + manager.startingClaim() go manager.retryingClaim(claim) case pin := <-manager.pins: manager.handlePin(pin) @@ -242,7 +262,7 @@ // claiming party when it eventually succeeds or fails, or if it times // out after a number of retries. func (manager *Manager) retryingClaim(claim claim) { - defer manager.wg.Done() + defer manager.finishedClaim() var ( err error success bool @@ -393,7 +413,7 @@ // is just an opportunity to check for blocks that need to be // notified. if !manager.config.Store.Autoexpire() { - manager.wg.Add(1) + manager.startingExpire() go manager.retryingExpire(now) // We wait for manager.retryingExpire to finish before we checkBlocks } else { @@ -486,7 +506,7 @@ // retryingExpire runs expire and retries any timeouts. func (manager *Manager) retryingExpire(now time.Time) { manager.config.Logger.Tracef("[%s] expire looking for leases to expire\n", manager.logContext) - defer manager.wg.Done() + defer manager.finishedExpire() var err error for a := manager.startRetry(); a.Next(); { err = manager.expire(now) @@ -606,7 +626,7 @@ func (manager *Manager) leases(namespace, modelUUID string) map[string]string { leases := make(map[string]string) - for key, lease := range manager.config.Store.Leases() { + for key, lease := range manager.config.Store.LeaseGroup(namespace, modelUUID) { leases[key.Lease] = lease.Holder } return leases @@ -621,3 +641,85 @@ } return a.Namespace < b.Namespace } + +func (manager *Manager) startingClaim() { + atomic.AddInt64(&manager.outstandingClaims, 1) + manager.wg.Add(1) +} + +func (manager *Manager) finishedClaim() { + manager.wg.Done() + atomic.AddInt64(&manager.outstandingClaims, -1) +} + +func (manager *Manager) startingExpire() { + atomic.AddInt64(&manager.outstandingExpires, 1) + manager.wg.Add(1) +} + +func (manager *Manager) finishedExpire() { + manager.wg.Done() + atomic.AddInt64(&manager.outstandingExpires, -1) +} + +// Report is part of dependency.Reporter +func (manager *Manager) Report() map[string]interface{} { + out := make(map[string]interface{}) + out["entity-uuid"] = manager.config.EntityUUID + out["outstanding-claims"] = atomic.LoadInt64(&manager.outstandingClaims) + out["outstanding-expires"] = atomic.LoadInt64(&manager.outstandingExpires) + return out +} + +func (manager *Manager) waitForGoroutines() { + // Wait for the waitgroup to finish, but only up to a point. + groupDone := make(chan struct{}) + go func() { + manager.wg.Wait() + close(groupDone) + }() + + select { + case <-groupDone: + return + case <-manager.config.Clock.After(maxShutdownWait): + } + msg := "timeout waiting for lease manager shutdown" + dumpFile, err := manager.dumpDebug() + logger := manager.config.Logger + if err == nil { + logger.Warningf("%v\ndebug info written to %v", msg, dumpFile) + } else { + logger.Warningf("%v\nerror writing debug info: %v", msg, err) + } + +} + +func (manager *Manager) dumpDebug() (string, error) { + dumpFile, err := os.OpenFile(filepath.Join(manager.config.LogDir, "lease-manager-debug.log"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) + if err != nil { + return "", errors.Trace(err) + } + defer dumpFile.Close() + claims := atomic.LoadInt64(&manager.outstandingClaims) + expires := atomic.LoadInt64(&manager.outstandingExpires) + template := ` +lease manager state dump %v +entity-uuid: %v +outstanding-claims: %v +outstanding-expires: %v + +`[1:] + message := fmt.Sprintf(template, + time.Now().Format(time.RFC3339), + manager.config.EntityUUID, + claims, + expires, + ) + if _, err = io.WriteString(dumpFile, message); err != nil { + return "", errors.Annotate(err, "writing state to debug log file") + } + // Including the goroutines because the httpserver won't dump them + // anymore if this worker stops happily. + return dumpFile.Name(), pprof.Lookup("goroutine").WriteTo(dumpFile, 1) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager_leases_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager_leases_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manager_leases_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manager_leases_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,7 @@ package lease_test import ( + "fmt" "time" "github.com/juju/clock/testclock" @@ -32,15 +33,29 @@ } func (s *LeasesSuite) TestLeases(c *gc.C) { - fix := &Fixture{ - leases: map[corelease.Key]corelease.Info{ - key(s.appName): { - Holder: "redis/0", - Expiry: offset(time.Second), - Trapdoor: corelease.LockedTrapdoor, - }, + leases := map[corelease.Key]corelease.Info{ + key(s.appName): { + Holder: "redis/0", + Expiry: offset(time.Second), + Trapdoor: corelease.LockedTrapdoor, }, } + // Add enough leases for other models and namespaces to ensure + // that we would definitely fail if the Leases method does the + // wrong thing. + bad := corelease.Info{ + Holder: "redis/1", + Expiry: offset(time.Second), + Trapdoor: corelease.LockedTrapdoor, + } + for i := 0; i < 100; i++ { + otherNS := fmt.Sprintf("ns%d", i) + leases[key(otherNS, "modelUUID", s.appName)] = bad + otherModel := fmt.Sprintf("model%d", i) + leases[key("namespace", otherModel, s.appName)] = bad + } + + fix := &Fixture{leases: leases} fix.RunTest(c, func(manager *lease.Manager, _ *testclock.Clock) { leases := getReader(c, manager).Leases() c.Check(leases, gc.DeepEquals, map[string]string{s.appName: "redis/0"}) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manifold/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manifold/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/manifold/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/manifold/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -59,6 +59,7 @@ FSM *raftlease.FSM RequestTopic string Logger lease.Logger + LogDir string PrometheusRegisterer prometheus.Registerer NewWorker func(lease.ManagerConfig) (worker.Worker, error) NewStore func(raftlease.StoreConfig) *raftlease.Store @@ -158,6 +159,7 @@ Logger: s.config.Logger, MaxSleep: MaxSleep, EntityUUID: controllerUUID, + LogDir: s.config.LogDir, PrometheusRegisterer: s.config.PrometheusRegisterer, }) if err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/lease/util_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/lease/util_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/lease/util_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/lease/util_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -123,6 +123,17 @@ return result } +// LeaseGroup is part of the lease.Store interface. +func (store *Store) LeaseGroup(namespace, modelUUID string) map[lease.Key]lease.Info { + results := make(map[lease.Key]lease.Info) + for key, info := range store.Leases() { + if key.Namespace == namespace && key.ModelUUID == modelUUID { + results[key] = info + } + } + return results +} + func (store *Store) closeIfEmpty() { // This must be called with the lock held. if store.runningCalls > 1 { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/logger/logger.go juju-core-2.6.5/src/github.com/juju/juju/worker/logger/logger.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/logger/logger.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/logger/logger.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,35 +12,56 @@ "github.com/juju/juju/core/watcher" ) -var log = loggo.GetLogger("juju.worker.logger") - // LoggerAPI represents the API calls the logger makes. type LoggerAPI interface { LoggingConfig(agentTag names.Tag) (string, error) WatchLoggingConfig(agentTag names.Tag) (watcher.NotifyWatcher, error) } -// Logger is responsible for updating the loggo configuration when the +// WorkerConfig contains the information required for the Logger worker +// to operate. +type WorkerConfig struct { + Context *loggo.Context + API LoggerAPI + Tag names.Tag + Logger Logger + Override string + + Callback func(string) error +} + +// Validate ensures all the necessary fields have values. +func (c *WorkerConfig) Validate() error { + if c.Context == nil { + return errors.NotValidf("missing logging context") + } + if c.API == nil { + return errors.NotValidf("missing api") + } + if c.Logger == nil { + return errors.NotValidf("missing logger") + } + return nil +} + +// loggerWorker is responsible for updating the loggo configuration when the // environment watcher tells the agent that the value has changed. -type Logger struct { - api LoggerAPI - tag names.Tag - updateCallback func(string) error - lastConfig string - configOverride string +type loggerWorker struct { + config WorkerConfig + lastConfig string } // NewLogger returns a worker.Worker that uses the notify watcher returned // from the setup. -func NewLogger(api LoggerAPI, tag names.Tag, loggingOverride string, updateCallback func(string) error) (worker.Worker, error) { - logger := &Logger{ - api: api, - tag: tag, - updateCallback: updateCallback, - lastConfig: loggo.LoggerInfo(), - configOverride: loggingOverride, +func NewLogger(config WorkerConfig) (worker.Worker, error) { + if err := config.Validate(); err != nil { + return nil, errors.Trace(err) + } + logger := &loggerWorker{ + config: config, + lastConfig: config.Context.Config().String(), } - log.Debugf("initial log config: %q", logger.lastConfig) + config.Logger.Debugf("initial log config: %q", logger.lastConfig) w, err := watcher.NewNotifyWorker(watcher.NotifyConfig{ Handler: logger, @@ -51,57 +72,65 @@ return w, nil } -func (logger *Logger) setLogging() { +func (l *loggerWorker) setLogging() { loggingConfig := "" + logger := l.config.Logger - if logger.configOverride != "" { - log.Debugf("overriding logging config with override from agent.conf %q", logger.configOverride) - loggingConfig = logger.configOverride + if override := l.config.Override; override != "" { + logger.Debugf("overriding logging config with override from agent.conf %q", override) + loggingConfig = override } else { - modelLoggingConfig, err := logger.api.LoggingConfig(logger.tag) + modelLoggingConfig, err := l.config.API.LoggingConfig(l.config.Tag) if err != nil { - log.Errorf("%v", err) + logger.Errorf("%v", err) return } loggingConfig = modelLoggingConfig } - if loggingConfig != logger.lastConfig { - log.Debugf("reconfiguring logging from %q to %q", logger.lastConfig, loggingConfig) - loggo.DefaultContext().ResetLoggerLevels() - if err := loggo.ConfigureLoggers(loggingConfig); err != nil { + if loggingConfig != l.lastConfig { + logger.Debugf("reconfiguring logging from %q to %q", l.lastConfig, loggingConfig) + context := l.config.Context + context.ResetLoggerLevels() + if err := context.ConfigureLoggers(loggingConfig); err != nil { // This shouldn't occur as the loggingConfig should be // validated by the original Config before it gets here. - log.Warningf("configure loggers failed: %v", err) + logger.Warningf("configure loggers failed: %v", err) // Try to reset to what we had before - loggo.ConfigureLoggers(logger.lastConfig) + context.ConfigureLoggers(l.lastConfig) return } - logger.lastConfig = loggingConfig + l.lastConfig = loggingConfig // Save the logging config in the agent.conf file. - if logger.updateCallback != nil { - err := logger.updateCallback(loggingConfig) + if callback := l.config.Callback; callback != nil { + err := callback(loggingConfig) if err != nil { - log.Errorf("%v", err) + logger.Errorf("%v", err) } } } } -func (logger *Logger) SetUp() (watcher.NotifyWatcher, error) { - log.Debugf("logger setup") +// SetUp is called by the NotifyWorker when the worker starts, and it is +// required to return a notify watcher that is used as the event source +// for the Handle method. +func (l *loggerWorker) SetUp() (watcher.NotifyWatcher, error) { + l.config.Logger.Infof("logger worker started") // We need to set this up initially as the NotifyWorker sucks up the first // event. - logger.setLogging() - return logger.api.WatchLoggingConfig(logger.tag) + l.setLogging() + return l.config.API.WatchLoggingConfig(l.config.Tag) } -func (logger *Logger) Handle(_ <-chan struct{}) error { - logger.setLogging() +// Handle is called by the NotifyWorker whenever the notify event is fired. +func (l *loggerWorker) Handle(_ <-chan struct{}) error { + l.setLogging() return nil } -func (logger *Logger) TearDown() error { +// TearDown is called by the NotifyWorker when the worker is being stopped. +func (l *loggerWorker) TearDown() error { // Nothing to cleanup, only state is the watcher + l.config.Logger.Infof("logger worker stopped") return nil } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/logger/logger_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/logger/logger_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/logger/logger_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/logger/logger_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "time" + "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/testing" jc "github.com/juju/testing/checkers" @@ -17,44 +18,72 @@ "github.com/juju/juju/worker/logger" ) -// worstCase is used for timeouts when timing out -// will fail the test. Raising this value should -// not affect the overall running time of the tests -// unless they fail. -const worstCase = 5 * time.Second - type LoggerSuite struct { testing.IsolationSuite - loggerAPI *mockAPI + context *loggo.Context agent names.Tag + loggerAPI *mockAPI + config logger.WorkerConfig - value string - override string + value string } var _ = gc.Suite(&LoggerSuite{}) func (s *LoggerSuite) SetUpTest(c *gc.C) { s.IsolationSuite.SetUpTest(c) + s.context = loggo.NewContext(loggo.DEBUG) + s.agent = names.NewMachineTag("42") s.loggerAPI = &mockAPI{ - // IsolationSuite setup resets logging info, so just grab that. - config: loggo.LoggerInfo(), + config: s.context.Config().String(), watcher: &mockNotifyWatcher{}, } - s.agent = names.NewMachineTag("42") + s.config = logger.WorkerConfig{ + Context: s.context, + API: s.loggerAPI, + Tag: s.agent, + Logger: loggo.GetLogger("test"), + Callback: func(v string) error { + s.value = v + return nil + }, + } s.value = "" - s.override = "" +} + +func (s *LoggerSuite) TestMissingContext(c *gc.C) { + s.config.Context = nil + w, err := logger.NewLogger(s.config) + c.Assert(w, gc.IsNil) + c.Assert(err, jc.Satisfies, errors.IsNotValid) + c.Assert(err.Error(), gc.Equals, "missing logging context not valid") +} + +func (s *LoggerSuite) TestMissingAPI(c *gc.C) { + s.config.API = nil + w, err := logger.NewLogger(s.config) + c.Assert(w, gc.IsNil) + c.Assert(err, jc.Satisfies, errors.IsNotValid) + c.Assert(err.Error(), gc.Equals, "missing api not valid") +} + +func (s *LoggerSuite) TestMissingLogger(c *gc.C) { + s.config.Logger = nil + w, err := logger.NewLogger(s.config) + c.Assert(w, gc.IsNil) + c.Assert(err, jc.Satisfies, errors.IsNotValid) + c.Assert(err.Error(), gc.Equals, "missing logger not valid") } func (s *LoggerSuite) waitLoggingInfo(c *gc.C, expected string) { - timeout := time.After(worstCase) + timeout := time.After(testing.LongWait) for { select { case <-timeout: c.Fatalf("timeout while waiting for logging info to change") case <-time.After(10 * time.Millisecond): - loggerInfo := loggo.LoggerInfo() + loggerInfo := s.context.Config().String() if loggerInfo != expected { c.Logf("logging is %q, still waiting", loggerInfo) continue @@ -65,10 +94,7 @@ } func (s *LoggerSuite) makeLogger(c *gc.C) worker.Worker { - w, err := logger.NewLogger(s.loggerAPI, s.agent, s.override, func(v string) error { - s.value = v - return nil - }) + w, err := logger.NewLogger(s.config) c.Assert(err, jc.ErrorIsNil) return w } @@ -79,13 +105,13 @@ } func (s *LoggerSuite) TestInitialState(c *gc.C) { - expected := s.loggerAPI.config + expected := s.context.Config().String() initial := "=DEBUG;wibble=ERROR" c.Assert(expected, gc.Not(gc.Equals), initial) - loggo.DefaultContext().ResetLoggerLevels() - err := loggo.ConfigureLoggers(initial) + s.context.ResetLoggerLevels() + err := s.context.ConfigureLoggers(initial) c.Assert(err, jc.ErrorIsNil) loggingWorker := s.makeLogger(c) @@ -99,10 +125,10 @@ } func (s *LoggerSuite) TestConfigOverride(c *gc.C) { - s.override = "test=TRACE" + s.config.Override = "test=TRACE" - loggo.DefaultContext().ResetLoggerLevels() - err := loggo.ConfigureLoggers("=DEBUG;wibble=ERROR") + s.context.ResetLoggerLevels() + err := s.context.ConfigureLoggers("=DEBUG;wibble=ERROR") c.Assert(err, jc.ErrorIsNil) loggingWorker := s.makeLogger(c) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/logger/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/logger/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/logger/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/logger/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,6 +4,7 @@ package logger import ( + "github.com/juju/loggo" "gopkg.in/juju/worker.v1" "gopkg.in/juju/worker.v1/dependency" @@ -12,11 +13,22 @@ "github.com/juju/juju/api/logger" ) +// Logger represents a loggo logger for the purpose of recording what is going +// on. +type Logger interface { + Debugf(string, ...interface{}) + Infof(string, ...interface{}) + Warningf(string, ...interface{}) + Errorf(string, ...interface{}) +} + // ManifoldConfig defines the names of the manifolds on which a // Manifold will depend. type ManifoldConfig struct { AgentName string APICallerName string + LoggingContext *loggo.Context + Logger Logger UpdateAgentFunc func(string) error } @@ -42,7 +54,15 @@ } loggerFacade := logger.NewState(apiCaller) - return NewLogger(loggerFacade, currentConfig.Tag(), loggingOverride, config.UpdateAgentFunc) + workerConfig := WorkerConfig{ + Context: config.LoggingContext, + API: loggerFacade, + Tag: currentConfig.Tag(), + Logger: config.Logger, + Override: loggingOverride, + Callback: config.UpdateAgentFunc, + } + return NewLogger(workerConfig) }, } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/machiner.go juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/machiner.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/machiner.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/machiner.go 2019-06-28 17:10:43.000000000 +0000 @@ -32,10 +32,6 @@ // ClearMachineAddressesOnStart indicates whether or not to clear // the machine's machine addresses when the worker starts. ClearMachineAddressesOnStart bool - - // NotifyMachineDead will, if non-nil, be called after the machine - // is transitioned to the Dead lifecycle state. - NotifyMachineDead func() error } // Validate reports whether or not the configuration is valid. @@ -197,15 +193,6 @@ } return errors.Trace(err) } - // Report on the machine's death. It is important that we do this after - // the machine is Dead, because this is the mechanism we use to clean up - // the machine (uninstall). If we were to report before marking the machine - // as Dead, then we would risk uninstalling prematurely. - if mr.config.NotifyMachineDead != nil { - if err := mr.config.NotifyMachineDead(); err != nil { - return errors.Annotate(err, "reporting machine death") - } - } return jworker.ErrTerminateAgent } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/machiner_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/machiner_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/machiner_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/machiner_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -80,15 +80,12 @@ s.accessor.SetErrors( ¶ms.Error{Code: params.CodeNotFound}, // Machine ) - var machineDead machineDeathTracker w, err := machiner.NewMachiner(machiner.Config{ s.accessor, s.machineTag, false, - machineDead.machineDead, }) c.Assert(err, jc.ErrorIsNil) err = stopWorker(w) c.Assert(errors.Cause(err), gc.Equals, jworker.ErrTerminateAgent) - c.Assert(bool(machineDead), jc.IsFalse) } func (s *MachinerSuite) TestMachinerMachineRefreshNotFound(c *gc.C) { @@ -108,22 +105,13 @@ nil, // Watch ¶ms.Error{Code: code}, // Refresh ) - var machineDead machineDeathTracker w, err := machiner.NewMachiner(machiner.Config{ s.accessor, s.machineTag, false, - machineDead.machineDead, }) c.Assert(err, jc.ErrorIsNil) s.accessor.machine.watcher.changes <- struct{}{} err = stopWorker(w) c.Assert(errors.Cause(err), gc.Equals, jworker.ErrTerminateAgent) - - // the "machineDead" callback should not be invoked - // because we don't know whether the agent is - // legitimately not found or unauthorized; we err on - // the side of caution, in case the password got mucked - // up, or state got mucked up (e.g. during an upgrade). - c.Assert(bool(machineDead), jc.IsFalse) } func (s *MachinerSuite) TestMachinerSetStatusStopped(c *gc.C) { @@ -240,7 +228,6 @@ worker, err := machiner.NewMachiner(machiner.Config{ s.accessor, s.machineTag, false, - func() error { return nil }, }) c.Assert(err, jc.ErrorIsNil) s.accessor.machine.watcher.changes <- struct{}{} @@ -286,8 +273,7 @@ } func (s *MachinerSuite) TestRunStop(c *gc.C) { - var machineDead machineDeathTracker - mr := s.makeMachiner(c, false, machineDead.machineDead) + mr := s.makeMachiner(c, false) c.Assert(worker.Stop(mr), jc.ErrorIsNil) s.accessor.machine.CheckCallNames(c, "SetMachineAddresses", @@ -297,7 +283,7 @@ } func (s *MachinerSuite) TestStartSetsStatus(c *gc.C) { - mr := s.makeMachiner(c, false, nil) + mr := s.makeMachiner(c, false) err := stopWorker(mr) c.Assert(err, jc.ErrorIsNil) s.accessor.machine.CheckCallNames(c, @@ -312,15 +298,12 @@ } func (s *MachinerSuite) TestSetDead(c *gc.C) { - var machineDead machineDeathTracker - s.accessor.machine.life = params.Dying - mr := s.makeMachiner(c, false, machineDead.machineDead) + mr := s.makeMachiner(c, false) s.accessor.machine.watcher.changes <- struct{}{} err := stopWorker(mr) c.Assert(err, gc.Equals, jworker.ErrTerminateAgent) - c.Assert(bool(machineDead), jc.IsTrue) } func (s *MachinerSuite) TestSetMachineAddresses(c *gc.C) { @@ -370,7 +353,7 @@ c.Assert(err, jc.ErrorIsNil) s.PatchValue(&network.LXCNetDefaultConfig, lxcFakeNetConfig) - mr := s.makeMachiner(c, false, nil) + mr := s.makeMachiner(c, false) c.Assert(stopWorker(mr), jc.ErrorIsNil) s.accessor.machine.CheckCall(c, 0, "SetMachineAddresses", []network.Address{ network.NewScopedAddress("10.0.0.1", network.ScopeCloudLocal), @@ -382,14 +365,14 @@ func (s *MachinerSuite) TestSetMachineAddressesEmpty(c *gc.C) { s.addresses = []net.Addr{} - mr := s.makeMachiner(c, false, nil) + mr := s.makeMachiner(c, false) c.Assert(stopWorker(mr), jc.ErrorIsNil) // No call to SetMachineAddresses s.accessor.machine.CheckCallNames(c, "SetStatus", "Watch") } func (s *MachinerSuite) TestMachineAddressesWithClearFlag(c *gc.C) { - mr := s.makeMachiner(c, true, nil) + mr := s.makeMachiner(c, true) c.Assert(stopWorker(mr), jc.ErrorIsNil) s.accessor.machine.CheckCall(c, 0, "SetMachineAddresses", []network.Address(nil)) } @@ -399,8 +382,7 @@ return []params.NetworkConfig{}, nil }) - var machineDead machineDeathTracker - mr := s.makeMachiner(c, false, machineDead.machineDead) + mr := s.makeMachiner(c, false) s.accessor.machine.watcher.changes <- struct{}{} c.Assert(stopWorker(mr), jc.ErrorIsNil) @@ -418,8 +400,7 @@ return []params.NetworkConfig{{}}, nil }) - var machineDead machineDeathTracker - mr := s.makeMachiner(c, false, machineDead.machineDead) + mr := s.makeMachiner(c, false) s.accessor.machine.watcher.changes <- struct{}{} c.Assert(stopWorker(mr), jc.ErrorIsNil) @@ -438,8 +419,7 @@ return nil, errors.New("no config!") }) - var machineDead machineDeathTracker - mr := s.makeMachiner(c, false, machineDead.machineDead) + mr := s.makeMachiner(c, false) s.accessor.machine.watcher.changes <- struct{}{} c.Assert(stopWorker(mr), gc.ErrorMatches, "cannot discover observed network config: no config!") @@ -450,34 +430,21 @@ "Refresh", "Life", ) - c.Assert(bool(machineDead), jc.IsFalse) } func (s *MachinerSuite) makeMachiner( c *gc.C, ignoreAddresses bool, - machineDead func() error, ) worker.Worker { - if machineDead == nil { - machineDead = func() error { return nil } - } w, err := machiner.NewMachiner(machiner.Config{ MachineAccessor: s.accessor, Tag: s.machineTag, ClearMachineAddressesOnStart: ignoreAddresses, - NotifyMachineDead: machineDead, }) c.Assert(err, jc.ErrorIsNil) return w } -type machineDeathTracker bool - -func (t *machineDeathTracker) machineDead() error { - *t = true - return nil -} - func stopWorker(w worker.Worker) error { w.Kill() return w.Wait() diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/machiner/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/machiner/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -90,9 +90,6 @@ MachineAccessor: accessor, Tag: tag.(names.MachineTag), ClearMachineAddressesOnStart: ignoreMachineAddresses, - NotifyMachineDead: func() error { - return agent.SetCanUninstall(a) - }, }) if err != nil { return nil, errors.Annotate(err, "cannot start machiner worker") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/modelcache/worker.go juju-core-2.6.5/src/github.com/juju/juju/worker/modelcache/worker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/modelcache/worker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/modelcache/worker.go 2019-06-28 17:10:43.000000000 +0000 @@ -16,6 +16,7 @@ "github.com/juju/juju/core/life" "github.com/juju/juju/core/lxdprofile" "github.com/juju/juju/core/network" + "github.com/juju/juju/core/settings" "github.com/juju/juju/core/status" "github.com/juju/juju/state" "github.com/juju/juju/state/multiwatcher" @@ -162,14 +163,28 @@ c.watcher = c.config.WatcherFactory() c.mu.Unlock() - err := c.processWatcher(watcherChanges) - if err == nil { - // We are done, so exit + // processWatcher only returns nil if we are dying. + // That condition will be handled at the top of the loop. + if err := c.processWatcher(watcherChanges); err != nil { + // If the backing watcher has stopped and the watcher's tomb + // error is nil, this means a legitimate clean stop. If we have + // been told to die, then we exit cleanly. Otherwise die with an + // error and let the dependency engine handle starting us up + // again. + if state.IsErrStopped(err) { + select { + case <-c.catacomb.Dying(): + return + default: + c.catacomb.Kill(err) + return + } + } + + // For any other errors, get a new watcher. + c.config.Logger.Errorf("watcher error: %v, getting new watcher", err) _ = c.watcher.Stop() - return } - c.config.Logger.Errorf("watcher error, %v, getting new watcher", err) - _ = c.watcher.Stop() } }() @@ -178,7 +193,8 @@ case <-c.catacomb.Dying(): return c.catacomb.ErrDying() case deltas := <-watcherChanges: - // Process changes and send info down changes channel + // Translate multi-watcher deltas into cache changes + // and supply them via the changes channel. for _, d := range deltas { if logger := c.config.Logger; logger.IsTraceEnabled() { logger.Tracef(pretty.Sprint(d)) @@ -188,7 +204,7 @@ select { case c.changes <- value: case <-c.catacomb.Dying(): - return nil + return c.catacomb.ErrDying() } } } @@ -203,12 +219,9 @@ for { deltas, err := c.watcher.Next() if err != nil { - if errors.Cause(err) == state.ErrStopped { - return nil - } else { - return errors.Trace(err) - } + return errors.Trace(err) } + select { case <-c.catacomb.Dying(): return nil @@ -221,127 +234,219 @@ id := d.Entity.EntityId() switch id.Kind { case "model": - if d.Removed { - return cache.RemoveModel{ - ModelUUID: id.ModelUUID, - } - } - value, ok := d.Entity.(*multiwatcher.ModelInfo) - if !ok { - c.config.Logger.Errorf("unexpected type %T", d.Entity) - return nil - } - return cache.ModelChange{ - ModelUUID: value.ModelUUID, - Name: value.Name, - Life: life.Value(value.Life), - Owner: value.Owner, - Config: value.Config, - Status: coreStatus(value.Status), - // TODO: constraints, sla - } + return c.translateModel(d) case "application": - if d.Removed { - return cache.RemoveApplication{ - ModelUUID: id.ModelUUID, - Name: id.Id, - } - } - value, ok := d.Entity.(*multiwatcher.ApplicationInfo) - if !ok { - c.config.Logger.Errorf("unexpected type %T", d.Entity) - return nil - } - return cache.ApplicationChange{ - ModelUUID: value.ModelUUID, - Name: value.Name, - Exposed: value.Exposed, - CharmURL: value.CharmURL, - Life: life.Value(value.Life), - MinUnits: value.MinUnits, - Constraints: value.Constraints, - Config: value.Config, - Subordinate: value.Subordinate, - Status: coreStatus(value.Status), - WorkloadVersion: value.WorkloadVersion, - } + return c.translateApplication(d) case "machine": - if d.Removed { - return cache.RemoveMachine{ - ModelUUID: id.ModelUUID, - Id: id.Id, - } - } - value, ok := d.Entity.(*multiwatcher.MachineInfo) - if !ok { - c.config.Logger.Errorf("unexpected type %T", d.Entity) - return nil - } - return cache.MachineChange{ - ModelUUID: value.ModelUUID, - Id: value.Id, - InstanceId: value.InstanceId, - AgentStatus: coreStatus(value.AgentStatus), - Life: life.Value(value.Life), - Config: value.Config, - Series: value.Series, - SupportedContainers: value.SupportedContainers, - SupportedContainersKnown: value.SupportedContainersKnown, - HardwareCharacteristics: value.HardwareCharacteristics, - CharmProfiles: value.CharmProfiles, - Addresses: coreNetworkAddresses(value.Addresses), - HasVote: value.HasVote, - WantsVote: value.WantsVote, - } + return c.translateMachine(d) case "unit": - if d.Removed { - return cache.RemoveUnit{ - ModelUUID: id.ModelUUID, - Name: id.Id, - } + return c.translateUnit(d) + case "charm": + return c.translateCharm(d) + case "generation": + // Generation deltas are processed as cache branch changes, + // as only "in-flight" branches should ever be in the cache. + return c.translateBranch(d) + default: + return nil + } +} + +func (c *cacheWorker) translateModel(d multiwatcher.Delta) interface{} { + e := d.Entity + + if d.Removed { + return cache.RemoveModel{ + ModelUUID: e.EntityId().ModelUUID, } - value, ok := d.Entity.(*multiwatcher.UnitInfo) - if !ok { - c.config.Logger.Errorf("unexpected type %T", d.Entity) - return nil + } + + value, ok := e.(*multiwatcher.ModelInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) + return nil + } + + return cache.ModelChange{ + ModelUUID: value.ModelUUID, + Name: value.Name, + Life: life.Value(value.Life), + Owner: value.Owner, + Config: value.Config, + Status: coreStatus(value.Status), + // TODO: constraints, sla + } +} + +func (c *cacheWorker) translateApplication(d multiwatcher.Delta) interface{} { + e := d.Entity + id := e.EntityId() + + if d.Removed { + return cache.RemoveApplication{ + ModelUUID: id.ModelUUID, + Name: id.Id, } - return cache.UnitChange{ - ModelUUID: value.ModelUUID, - Name: value.Name, - Application: value.Application, - Series: value.Series, - CharmURL: value.CharmURL, - Life: life.Value(value.Life), - PublicAddress: value.PublicAddress, - PrivateAddress: value.PrivateAddress, - MachineId: value.MachineId, - Ports: coreNetworkPorts(value.Ports), - PortRanges: coreNetworkPortRanges(value.PortRanges), - Principal: value.Principal, - Subordinate: value.Subordinate, - WorkloadStatus: coreStatus(value.WorkloadStatus), - AgentStatus: coreStatus(value.AgentStatus), + } + + value, ok := e.(*multiwatcher.ApplicationInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) + return nil + } + + return cache.ApplicationChange{ + ModelUUID: value.ModelUUID, + Name: value.Name, + Exposed: value.Exposed, + CharmURL: value.CharmURL, + Life: life.Value(value.Life), + MinUnits: value.MinUnits, + Constraints: value.Constraints, + Config: value.Config, + Subordinate: value.Subordinate, + Status: coreStatus(value.Status), + WorkloadVersion: value.WorkloadVersion, + } +} + +func (c *cacheWorker) translateMachine(d multiwatcher.Delta) interface{} { + e := d.Entity + id := e.EntityId() + + if d.Removed { + return cache.RemoveMachine{ + ModelUUID: id.ModelUUID, + Id: id.Id, } - case "charm": - if d.Removed { - return cache.RemoveCharm{ - ModelUUID: id.ModelUUID, - CharmURL: id.Id, - } + } + + value, ok := e.(*multiwatcher.MachineInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) + return nil + } + + return cache.MachineChange{ + ModelUUID: value.ModelUUID, + Id: value.Id, + InstanceId: value.InstanceId, + AgentStatus: coreStatus(value.AgentStatus), + Life: life.Value(value.Life), + Config: value.Config, + Series: value.Series, + ContainerType: value.ContainerType, + SupportedContainers: value.SupportedContainers, + SupportedContainersKnown: value.SupportedContainersKnown, + HardwareCharacteristics: value.HardwareCharacteristics, + CharmProfiles: value.CharmProfiles, + Addresses: coreNetworkAddresses(value.Addresses), + HasVote: value.HasVote, + WantsVote: value.WantsVote, + } +} + +func (c *cacheWorker) translateUnit(d multiwatcher.Delta) interface{} { + e := d.Entity + id := e.EntityId() + + if d.Removed { + return cache.RemoveUnit{ + ModelUUID: id.ModelUUID, + Name: id.Id, } - value, ok := d.Entity.(*multiwatcher.CharmInfo) - if !ok { - c.config.Logger.Errorf("unexpected type %T", d.Entity) - return nil + } + + value, ok := e.(*multiwatcher.UnitInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) + return nil + } + + return cache.UnitChange{ + ModelUUID: value.ModelUUID, + Name: value.Name, + Application: value.Application, + Series: value.Series, + CharmURL: value.CharmURL, + Life: life.Value(value.Life), + PublicAddress: value.PublicAddress, + PrivateAddress: value.PrivateAddress, + MachineId: value.MachineId, + Ports: coreNetworkPorts(value.Ports), + PortRanges: coreNetworkPortRanges(value.PortRanges), + Principal: value.Principal, + Subordinate: value.Subordinate, + WorkloadStatus: coreStatus(value.WorkloadStatus), + AgentStatus: coreStatus(value.AgentStatus), + } +} + +func (c *cacheWorker) translateCharm(d multiwatcher.Delta) interface{} { + e := d.Entity + id := e.EntityId() + + if d.Removed { + return cache.RemoveCharm{ + ModelUUID: id.ModelUUID, + CharmURL: id.Id, } - return cache.CharmChange{ - ModelUUID: value.ModelUUID, - CharmURL: value.CharmURL, - LXDProfile: coreLXDProfile(value.LXDProfile), + } + + value, ok := e.(*multiwatcher.CharmInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) + return nil + } + + return cache.CharmChange{ + ModelUUID: value.ModelUUID, + CharmURL: value.CharmURL, + LXDProfile: coreLXDProfile(value.LXDProfile), + DefaultConfig: value.DefaultConfig, + } +} + +func (c *cacheWorker) translateBranch(d multiwatcher.Delta) interface{} { + e := d.Entity + id := e.EntityId() + + if d.Removed { + return cache.RemoveBranch{ + ModelUUID: id.ModelUUID, + Id: id.Id, } - default: + } + + value, ok := e.(*multiwatcher.GenerationInfo) + if !ok { + c.config.Logger.Errorf("unexpected type %T", e) return nil } + + // Branches differ slightly from other cached entities. + // If a branch has been committed or aborted, it will have a non-zero + // value for completion, indicating that it is no longer active and should + // be removed from the cache. + if value.Completed > 0 { + return cache.RemoveBranch{ + ModelUUID: id.ModelUUID, + Id: id.Id, + } + } + + return cache.BranchChange{ + ModelUUID: value.ModelUUID, + Name: value.Name, + Id: value.Id, + AssignedUnits: value.AssignedUnits, + Config: coreItemChanges(value.Config), + Created: value.Created, + CreatedBy: value.CreatedBy, + Completed: value.Completed, + CompletedBy: value.CompletedBy, + GenerationId: value.GenerationId, + } } // Kill is part of the worker.Worker interface. @@ -410,3 +515,24 @@ Devices: delta.Devices, } } + +func coreItemChanges(delta map[string][]multiwatcher.ItemChange) map[string]settings.ItemChanges { + if delta == nil { + return nil + } + + cfg := make(map[string]settings.ItemChanges, len(delta)) + for k, v := range delta { + changes := make(settings.ItemChanges, len(v)) + for i, ch := range v { + changes[i] = settings.ItemChange{ + Type: ch.Type, + Key: ch.Key, + NewValue: ch.NewValue, + OldValue: ch.OldValue, + } + } + cfg[k] = changes + } + return cfg +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/modelcache/worker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/modelcache/worker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/modelcache/worker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/modelcache/worker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,7 @@ "gopkg.in/juju/worker.v1/workertest" "github.com/juju/juju/core/cache" + "github.com/juju/juju/core/cache/cachetest" "github.com/juju/juju/core/life" "github.com/juju/juju/state" "github.com/juju/juju/state/multiwatcher" @@ -88,7 +89,7 @@ var controller *cache.Controller var empty worker.Worker err := modelcache.ExtractCacheController(empty, &controller) - c.Assert(err.Error(), gc.Equals, "in should be a *modelcache.cacheWorker; got ") + c.Assert(err, gc.ErrorMatches, `in should be a \*modelcache.cacheWorker; got `) } func (s *WorkerSuite) start(c *gc.C) worker.Worker { @@ -119,7 +120,7 @@ } func (s *WorkerSuite) TestInitialModel(c *gc.C) { - changes := s.captureEvents(c, modelEvents) + changes := s.captureEvents(c, cachetest.ModelEvents) s.start(c) obtained := s.nextChange(c, changes) @@ -129,7 +130,7 @@ } func (s *WorkerSuite) TestModelConfigChange(c *gc.C) { - changes := s.captureEvents(c, modelEvents) + changes := s.captureEvents(c, cachetest.ModelEvents) w := s.start(c) // discard initial event s.nextChange(c, changes) @@ -158,14 +159,14 @@ } func (s *WorkerSuite) TestNewModel(c *gc.C) { - changes := s.captureEvents(c, modelEvents) + changes := s.captureEvents(c, cachetest.ModelEvents) w := s.start(c) // grab and discard the event for the initial model s.nextChange(c, changes) newState := s.Factory.MakeModel(c, nil) s.State.StartSync() - defer newState.Close() + defer func() { _ = newState.Close() }() obtained := s.nextChange(c, changes) expected, err := newState.Model() @@ -177,7 +178,7 @@ } func (s *WorkerSuite) TestRemovedModel(c *gc.C) { - changes := s.captureEvents(c, modelEvents) + changes := s.captureEvents(c, cachetest.ModelEvents) w := s.start(c) // grab and discard the event for the initial model @@ -185,7 +186,7 @@ st := s.Factory.MakeModel(c, nil) s.State.StartSync() - defer st.Close() + defer func() { _ = st.Close() }() // grab and discard the event for the new model s.nextChange(c, changes) @@ -222,7 +223,7 @@ } func (s *WorkerSuite) TestAddApplication(c *gc.C) { - changes := s.captureEvents(c, applicationEvents) + changes := s.captureEvents(c, cachetest.ApplicationEvents) w := s.start(c) app := s.Factory.MakeApplication(c, &factory.ApplicationParams{}) @@ -246,7 +247,7 @@ } func (s *WorkerSuite) TestRemoveApplication(c *gc.C) { - changes := s.captureEvents(c, applicationEvents) + changes := s.captureEvents(c, cachetest.ApplicationEvents) w := s.start(c) app := s.Factory.MakeApplication(c, &factory.ApplicationParams{}) @@ -275,7 +276,7 @@ } func (s *WorkerSuite) TestAddMachine(c *gc.C) { - changes := s.captureEvents(c, machineEvents) + changes := s.captureEvents(c, cachetest.MachineEvents) w := s.start(c) machine := s.Factory.MakeMachine(c, &factory.MachineParams{}) @@ -299,7 +300,7 @@ } func (s *WorkerSuite) TestRemoveMachine(c *gc.C) { - changes := s.captureEvents(c, machineEvents) + changes := s.captureEvents(c, cachetest.MachineEvents) w := s.start(c) machine := s.Factory.MakeMachine(c, &factory.MachineParams{}) @@ -333,7 +334,7 @@ } func (s *WorkerSuite) TestAddCharm(c *gc.C) { - changes := s.captureEvents(c, charmEvents) + changes := s.captureEvents(c, cachetest.CharmEvents) w := s.start(c) charm := s.Factory.MakeCharm(c, &factory.CharmParams{}) @@ -357,7 +358,7 @@ } func (s *WorkerSuite) TestRemoveCharm(c *gc.C) { - changes := s.captureEvents(c, charmEvents) + changes := s.captureEvents(c, cachetest.CharmEvents) w := s.start(c) charm := s.Factory.MakeCharm(c, &factory.CharmParams{}) @@ -389,7 +390,7 @@ } func (s *WorkerSuite) TestAddUnit(c *gc.C) { - changes := s.captureEvents(c, unitEvents) + changes := s.captureEvents(c, cachetest.UnitEvents) w := s.start(c) unit := s.Factory.MakeUnit(c, &factory.UnitParams{}) @@ -414,7 +415,7 @@ } func (s *WorkerSuite) TestRemoveUnit(c *gc.C) { - changes := s.captureEvents(c, unitEvents) + changes := s.captureEvents(c, cachetest.UnitEvents) w := s.start(c) unit := s.Factory.MakeUnit(c, &factory.UnitParams{}) @@ -442,6 +443,68 @@ } } +func (s *WorkerSuite) TestAddBranch(c *gc.C) { + changes := s.captureEvents(c, cachetest.BranchEvents) + w := s.start(c) + + branchName := "test-branch" + c.Assert(s.State.AddBranch(branchName, "test-user"), jc.ErrorIsNil) + s.State.StartSync() + + change := s.nextChange(c, changes) + obtained, ok := change.(cache.BranchChange) + c.Assert(ok, jc.IsTrue) + c.Check(obtained.Name, gc.Equals, "test-branch") + + controller := s.getController(c, w) + modUUIDs := controller.ModelUUIDs() + c.Check(modUUIDs, gc.HasLen, 1) + + mod, err := controller.Model(modUUIDs[0]) + c.Assert(err, jc.ErrorIsNil) + + _, err = mod.Branch(branchName) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *WorkerSuite) TestRemoveBranch(c *gc.C) { + changes := s.captureEvents(c, cachetest.BranchEvents) + w := s.start(c) + + branchName := "test-branch" + c.Assert(s.State.AddBranch(branchName, "test-user"), jc.ErrorIsNil) + s.State.StartSync() + _ = s.nextChange(c, changes) + + controller := s.getController(c, w) + modUUID := controller.ModelUUIDs()[0] + + branch, err := s.State.Branch(branchName) + c.Assert(err, jc.ErrorIsNil) + + // Generation docs are not deleted from the DB in any current workflow. + // Committing the branch so that it is no longer active should cause + // a removal message to be emitted. + _, err = branch.Commit("test-user") + c.Assert(err, jc.ErrorIsNil) + + s.State.StartSync() + + // We will either get our branch event, + // or time-out after processing all the changes. + for { + change := s.nextChange(c, changes) + if _, ok := change.(cache.RemoveBranch); ok { + mod, err := controller.Model(modUUID) + c.Assert(err, jc.ErrorIsNil) + + _, err = mod.Branch(branchName) + c.Check(errors.IsNotFound(err), jc.IsTrue) + return + } + } +} + func (s *WorkerSuite) TestWatcherErrorCacheMarkSweep(c *gc.C) { // Some state to close over. fakeModelSent := false @@ -480,7 +543,7 @@ } } - changes := s.captureEvents(c, modelEvents, applicationEvents) + changes := s.captureEvents(c, cachetest.ModelEvents, cachetest.ApplicationEvents) w := s.start(c) s.State.StartSync() @@ -515,6 +578,23 @@ c.Check(cachedApp, gc.NotNil) } +func (s *WorkerSuite) TestWatcherErrorStoppedKillsWorker(c *gc.C) { + mw := s.StatePool.SystemState().WatchAllModels(s.StatePool) + s.config.WatcherFactory = func() modelcache.BackingWatcher { return mw } + + config := s.config + config.Notify = s.notify + w, err := modelcache.NewWorker(config) + c.Assert(err, jc.ErrorIsNil) + + // Stop the backing multiwatcher. + c.Assert(mw.Stop(), jc.ErrorIsNil) + + // Check that the worker is killed. + err = workertest.CheckKilled(c, w) + c.Assert(err, jc.Satisfies, state.IsErrStopped) +} + func (s *WorkerSuite) captureEvents(c *gc.C, matchers ...func(interface{}) bool) <-chan interface{} { events := make(chan interface{}) s.notify = func(change interface{}) { @@ -548,56 +628,6 @@ return obtained } -var modelEvents = func(change interface{}) bool { - switch change.(type) { - case cache.ModelChange: - return true - case cache.RemoveModel: - return true - } - return false -} - -var applicationEvents = func(change interface{}) bool { - switch change.(type) { - case cache.ApplicationChange: - return true - case cache.RemoveApplication: - return true - } - return false -} - -var machineEvents = func(change interface{}) bool { - switch change.(type) { - case cache.MachineChange: - return true - case cache.RemoveMachine: - return true - } - return false -} - -var charmEvents = func(change interface{}) bool { - switch change.(type) { - case cache.CharmChange: - return true - case cache.RemoveCharm: - return true - } - return false -} - -var unitEvents = func(change interface{}) bool { - switch change.(type) { - case cache.UnitChange: - return true - case cache.RemoveUnit: - return true - } - return false -} - type noopRegisterer struct { prometheus.Registerer } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/modelupgrader/worker.go juju-core-2.6.5/src/github.com/juju/juju/worker/modelupgrader/worker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/modelupgrader/worker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/modelupgrader/worker.go 2019-06-28 17:10:43.000000000 +0000 @@ -97,6 +97,9 @@ } targetVersion, err := config.Facade.ModelTargetEnvironVersion(config.ModelTag) if err != nil { + if params.IsCodeNotFound(err) { + return nil, ErrModelRemoved + } return nil, errors.Trace(err) } if config.Environ != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/modelupgrader/worker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/modelupgrader/worker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/modelupgrader/worker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/modelupgrader/worker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -4,15 +4,15 @@ package modelupgrader_test import ( - "errors" "sync" + "github.com/juju/errors" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/names.v2" "gopkg.in/juju/worker.v1/workertest" - tomb "gopkg.in/tomb.v2" + "gopkg.in/tomb.v2" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/core/status" @@ -58,6 +58,28 @@ mockGateUnlocker.CheckCallNames(c, "Unlock") } +func (*WorkerSuite) TestNewWorkerModelRemovedUninstalls(c *gc.C) { + mockFacade := mockFacade{current: 123, target: 124} + mockFacade.SetErrors(¶ms.Error{Code: params.CodeNotFound}) + mockEnviron := mockEnviron{} + mockGateUnlocker := mockGateUnlocker{} + w, err := modelupgrader.NewWorker(modelupgrader.Config{ + Facade: &mockFacade, + Environ: &mockEnviron, + GateUnlocker: &mockGateUnlocker, + ControllerTag: coretesting.ControllerTag, + ModelTag: coretesting.ModelTag, + CredentialAPI: &credentialAPIForTest{}, + }) + c.Assert(errors.Cause(err), gc.ErrorMatches, modelupgrader.ErrModelRemoved.Error()) + workertest.CheckNilOrKill(c, w) + mockFacade.CheckCalls(c, []testing.StubCall{ + {"ModelTargetEnvironVersion", []interface{}{coretesting.ModelTag}}, + }) + mockEnviron.CheckNoCalls(c) + mockGateUnlocker.CheckNoCalls(c) +} + func (*WorkerSuite) TestNonUpgradeable(c *gc.C) { mockFacade := mockFacade{current: 123, target: 124} mockEnviron := struct{ environs.Environ }{} // not an Upgrader diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/container_initialisation.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/container_initialisation.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/container_initialisation.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/container_initialisation.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,6 +8,7 @@ "sync/atomic" "github.com/juju/errors" + "github.com/juju/loggo" "gopkg.in/juju/worker.v1" "github.com/juju/juju/agent" @@ -31,6 +32,7 @@ // to create containers and start a suitable provisioner. type ContainerSetup struct { runner *worker.Runner + logger Logger supportedContainers []instance.ContainerType provisioner *apiprovisioner.State machine apiprovisioner.MachineProvisioner @@ -52,6 +54,7 @@ // ContainerSetupParams are used to initialise a container setup handler. type ContainerSetupParams struct { Runner *worker.Runner + Logger Logger WorkerName string SupportedContainers []instance.ContainerType Machine apiprovisioner.MachineProvisioner @@ -66,6 +69,7 @@ func NewContainerSetupHandler(params ContainerSetupParams) watcher.StringsHandler { return &ContainerSetup{ runner: params.Runner, + logger: params.Logger, machine: params.Machine, supportedContainers: params.SupportedContainers, provisioner: params.Provisioner, @@ -101,7 +105,7 @@ return nil } - logger.Infof("initial container setup with ids: %v", containerIds) + cs.logger.Infof("initial container setup with ids: %v", containerIds) for _, id := range containerIds { containerType := state.ContainerTypeFromId(id) // If this container type has been dealt with, do nothing. @@ -109,7 +113,7 @@ continue } if err := cs.initialiseAndStartProvisioner(abort, containerType); err != nil { - logger.Errorf("starting container provisioner for %v: %v", containerType, err) + cs.logger.Errorf("starting container provisioner for %v: %v", containerType, err) // Just because dealing with one type of container fails, we won't // exit the entire function because we still want to try and start // other container types. So we take note of and return the first @@ -130,7 +134,7 @@ defer func() { if resultError != nil { - logger.Warningf("not stopping machine agent container watcher due to error: %v", resultError) + cs.logger.Warningf("not stopping machine agent container watcher due to error: %v", resultError) return } if atomic.AddInt32(&cs.numberProvisioners, 1) == int32(len(cs.supportedContainers)) { @@ -138,12 +142,12 @@ // This worker has done its job so stop it. // We do not expect there will be an error, and there's not much we can do anyway. if err := cs.runner.StopWorker(cs.workerName); err != nil { - logger.Warningf("stopping machine agent container watcher: %v", err) + cs.logger.Warningf("stopping machine agent container watcher: %v", err) } } }() - logger.Debugf("setup and start provisioner for %s containers", containerType) + cs.logger.Debugf("setup and start provisioner for %s containers", containerType) // Do an early check. if containerType != instance.LXD && containerType != instance.KVM { @@ -185,6 +189,9 @@ containerType, cs.provisioner, cs.config, + // Container provisioners are always good using the global logging + // context. + loggo.GetLogger("juju.worker.provisioner"), instanceBroker, toolsFinder, getDistributionGroupFinder(cs.provisioner), @@ -215,7 +222,7 @@ } if len(observedConfig) > 0 { machineTag := cs.machine.MachineTag() - logger.Tracef("updating observed network config for %q %s containers to %#v", + cs.logger.Tracef("updating observed network config for %q %s containers to %#v", machineTag, containerType, observedConfig) if err := cs.provisioner.SetHostMachineNetworkConfig(machineTag, observedConfig); err != nil { return errors.Trace(err) @@ -275,6 +282,7 @@ containerType instance.ContainerType, provisioner *apiprovisioner.State, config agent.Config, + logger Logger, broker environs.InstanceBroker, toolsFinder ToolsFinder, distributionGroupFinder DistributionGroupFinder, @@ -288,6 +296,7 @@ return runner.StartWorker(workerName, func() (worker.Worker, error) { w, err := NewContainerProvisioner(containerType, provisioner, + logger, config, broker, toolsFinder, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/container_initialisation_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/container_initialisation_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/container_initialisation_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/container_initialisation_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "time" "github.com/golang/mock/gomock" + "github.com/juju/loggo" jc "github.com/juju/testing/checkers" "github.com/juju/utils" "github.com/pkg/errors" @@ -153,6 +154,7 @@ args := provisioner.ContainerSetupParams{ Runner: runner, + Logger: loggo.GetLogger("test"), WorkerName: watcherName, SupportedContainers: instance.ContainerTypes, Machine: s.machine, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/containerprovisioner_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/containerprovisioner_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/containerprovisioner_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/containerprovisioner_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -9,6 +9,7 @@ "time" "github.com/juju/errors" + "github.com/juju/loggo" jc "github.com/juju/testing/checkers" "github.com/juju/utils/arch" gc "gopkg.in/check.v1" @@ -106,7 +107,9 @@ machineTag := names.NewMachineTag("0") agentConfig := s.AgentConfigForTag(c, machineTag) toolsFinder := (*provisioner.GetToolsFinder)(s.provisioner) - w, err := provisioner.NewContainerProvisioner(instance.KVM, s.provisioner, agentConfig, broker, + w, err := provisioner.NewContainerProvisioner( + instance.KVM, s.provisioner, loggo.GetLogger("test"), + agentConfig, broker, toolsFinder, &mockDistributionGroupFinder{}, &credentialAPIForTest{}) c.Assert(err, jc.ErrorIsNil) return w diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/logging.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/logging.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/logging.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/logging.go 2019-06-28 17:10:43.000000000 +0000 @@ -14,7 +14,7 @@ // stack of the error to be printed out at error severity if and only if the // "log-error-stack" feature flag has been specified. The passed in error // is also the return value of this function. -func loggedErrorStack(err error) error { +func loggedErrorStack(logger Logger, err error) error { if featureflag.Enabled(feature.LogErrorStack) { logger.Errorf("error stack:\n%s", errors.ErrorStack(err)) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/logging_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/logging_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/logging_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/logging_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "errors" + "github.com/juju/loggo" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -17,18 +18,20 @@ type logSuite struct { testing.LoggingSuite jujutesting.JujuOSEnvSuite + logger loggo.Logger } func (l *logSuite) SetUpTest(c *gc.C) { l.LoggingSuite.SetUpTest(c) l.JujuOSEnvSuite.SetUpTest(c) + l.logger = loggo.GetLogger("juju.provisioner") } var _ = gc.Suite(&logSuite{}) -func (*logSuite) TestFlagNotSet(c *gc.C) { +func (s *logSuite) TestFlagNotSet(c *gc.C) { err := errors.New("test error") - err2 := loggedErrorStack(err) + err2 := loggedErrorStack(s.logger, err) c.Assert(err, gc.Equals, err2) c.Assert(c.GetTestLog(), gc.Equals, "") } @@ -36,7 +39,7 @@ func (s *logSuite) TestFlagSet(c *gc.C) { s.SetFeatureFlags(feature.LogErrorStack) err := errors.New("test error") - err2 := loggedErrorStack(err) + err2 := loggedErrorStack(s.logger, err) c.Assert(err, gc.Equals, err2) expected := "ERROR juju.provisioner error stack:\ntest error" c.Assert(c.GetTestLog(), jc.Contains, expected) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -15,6 +15,15 @@ "github.com/juju/juju/worker/common" ) +// Logger defines the logging methods that the worker uses. +type Logger interface { + Tracef(string, ...interface{}) + Debugf(string, ...interface{}) + Infof(string, ...interface{}) + Warningf(string, ...interface{}) + Errorf(string, ...interface{}) +} + // ManifoldConfig defines an environment provisioner's dependencies. It's not // currently clear whether it'll be easier to extend this type to include all // provisioners, or to create separate (Environ|Container)Manifold[Config]s; @@ -24,8 +33,9 @@ AgentName string APICallerName string EnvironName string + Logger Logger - NewProvisionerFunc func(*apiprovisioner.State, agent.Config, environs.Environ, common.CredentialAPI) (Provisioner, error) + NewProvisionerFunc func(*apiprovisioner.State, agent.Config, Logger, environs.Environ, common.CredentialAPI) (Provisioner, error) NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error) } @@ -62,7 +72,7 @@ return nil, errors.Trace(err) } - w, err := config.NewProvisionerFunc(api, agentConfig, environ, credentialAPI) + w, err := config.NewProvisionerFunc(api, agentConfig, config.Logger, environ, credentialAPI) if err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,6 +5,7 @@ import ( "github.com/juju/errors" + "github.com/juju/loggo" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -29,10 +30,11 @@ func (s *ManifoldSuite) makeManifold() dependency.Manifold { fakeNewProvFunc := func( - apiSt *apiprovisioner.State, - agentConf agent.Config, - environ environs.Environ, - credentialAPI common.CredentialAPI, + *apiprovisioner.State, + agent.Config, + provisioner.Logger, + environs.Environ, + common.CredentialAPI, ) (provisioner.Provisioner, error) { s.stub.AddCall("NewProvisionerFunc") return struct{ provisioner.Provisioner }{}, nil @@ -40,6 +42,7 @@ return provisioner.Manifold(provisioner.ManifoldConfig{ AgentName: "agent", APICallerName: "api-caller", + Logger: loggo.GetLogger("test"), EnvironName: "environ", NewProvisionerFunc: fakeNewProvFunc, NewCredentialValidatorFacade: func(base.APICaller) (common.CredentialAPI, error) { return nil, nil }, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner.go 2019-06-28 17:10:43.000000000 +0000 @@ -8,7 +8,6 @@ "time" "github.com/juju/errors" - "github.com/juju/loggo" "gopkg.in/juju/names.v2" "gopkg.in/juju/worker.v1" "gopkg.in/juju/worker.v1/catacomb" @@ -24,8 +23,6 @@ "github.com/juju/juju/worker/common" ) -var logger = loggo.GetLogger("juju.provisioner") - // Ensure our structs implement the required Provisioner interface. var _ Provisioner = (*environProvisioner)(nil) var _ Provisioner = (*containerProvisioner)(nil) @@ -64,6 +61,7 @@ Provisioner st *apiprovisioner.State agentConfig agent.Config + logger Logger broker environs.InstanceBroker distributionGroupFinder DistributionGroupFinder toolsFinder ToolsFinder @@ -169,6 +167,7 @@ task, err := NewProvisionerTask( controllerCfg.ControllerUUID(), machineTag, + p.logger, harvestMode, p.st, p.distributionGroupFinder, @@ -190,15 +189,21 @@ // NewEnvironProvisioner returns a new Provisioner for an environment. // When new machines are added to the state, it allocates instances // from the environment and allocates them to the new machines. -func NewEnvironProvisioner(st *apiprovisioner.State, +func NewEnvironProvisioner( + st *apiprovisioner.State, agentConfig agent.Config, + logger Logger, environ environs.Environ, credentialAPI common.CredentialAPI, ) (Provisioner, error) { + if logger == nil { + return nil, errors.NotValidf("missing logger") + } p := &environProvisioner{ provisioner: provisioner{ st: st, agentConfig: agentConfig, + logger: logger, toolsFinder: getToolsFinder(st), distributionGroupFinder: getDistributionGroupFinder(st), callContext: common.NewCloudCallContext(credentialAPI, nil), @@ -227,7 +232,7 @@ var modelConfigChanges <-chan struct{} modelWatcher, err := p.st.WatchForModelConfigChanges() if err != nil { - return loggedErrorStack(errors.Trace(err)) + return loggedErrorStack(p.logger, errors.Trace(err)) } if err := p.catacomb.Add(modelWatcher); err != nil { return errors.Trace(err) @@ -239,7 +244,7 @@ harvestMode := modelConfig.ProvisionerHarvestMode() task, err := p.getStartTask(harvestMode) if err != nil { - return loggedErrorStack(errors.Trace(err)) + return loggedErrorStack(p.logger, errors.Trace(err)) } if err := p.catacomb.Add(task); err != nil { return errors.Trace(err) @@ -289,6 +294,7 @@ func NewContainerProvisioner( containerType instance.ContainerType, st *apiprovisioner.State, + logger Logger, agentConfig agent.Config, broker environs.InstanceBroker, toolsFinder ToolsFinder, @@ -299,6 +305,7 @@ provisioner: provisioner{ st: st, agentConfig: agentConfig, + logger: logger, broker: broker, toolsFinder: toolsFinder, distributionGroupFinder: distributionGroupFinder, @@ -337,7 +344,7 @@ task, err := p.getStartTask(harvestMode) if err != nil { - return loggedErrorStack(errors.Trace(err)) + return loggedErrorStack(p.logger, errors.Trace(err)) } if err := p.catacomb.Add(task); err != nil { return errors.Trace(err) @@ -370,11 +377,11 @@ } result, err := p.st.Machines(machineTag) if err != nil { - logger.Errorf("error retrieving %s from state", machineTag) + p.logger.Errorf("error retrieving %s from state", machineTag) return nil, err } if result[0].Err != nil { - logger.Errorf("%s is not in state", machineTag) + p.logger.Errorf("%s is not in state", machineTag) return nil, err } p.machine = result[0].Machine diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_task.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_task.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_task.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_task.go 2019-06-28 17:10:43.000000000 +0000 @@ -75,6 +75,7 @@ func NewProvisionerTask( controllerUUID string, machineTag names.MachineTag, + logger Logger, harvestMode config.HarvestMode, machineGetter MachineGetter, distributionGroupFinder DistributionGroupFinder, @@ -97,6 +98,7 @@ task := &provisionerTask{ controllerUUID: controllerUUID, machineTag: machineTag, + logger: logger, machineGetter: machineGetter, distributionGroupFinder: distributionGroupFinder, toolsFinder: toolsFinder, @@ -132,6 +134,7 @@ type provisionerTask struct { controllerUUID string machineTag names.MachineTag + logger Logger machineGetter MachineGetter distributionGroupFinder DistributionGroupFinder toolsFinder ToolsFinder @@ -177,7 +180,7 @@ for { select { case <-task.catacomb.Dying(): - logger.Infof("Shutting down provisioner task %s", task.machineTag) + task.logger.Infof("Shutting down provisioner task %s", task.machineTag) return task.catacomb.ErrDying() case ids, ok := <-task.machineChanges: if !ok { @@ -193,10 +196,10 @@ if harvestMode == task.harvestMode { break } - logger.Infof("harvesting mode changed to %s", harvestMode) + task.logger.Infof("harvesting mode changed to %s", harvestMode) task.harvestMode = harvestMode if harvestMode.HarvestUnknown() { - logger.Infof("harvesting unknown machines") + task.logger.Infof("harvesting unknown machines") if err := task.processMachines(nil); err != nil { return errors.Annotate(err, "failed to process machines after safe mode disabled") } @@ -222,24 +225,24 @@ if err != nil { return nil } - logger.Tracef("processMachinesWithTransientErrors(%v)", results) + task.logger.Tracef("processMachinesWithTransientErrors(%v)", results) var pending []apiprovisioner.MachineProvisioner for _, result := range results { if result.Status.Error != nil { - logger.Errorf("cannot retry provisioning of machine %q: %v", result.Machine.Id(), result.Status.Error) + task.logger.Errorf("cannot retry provisioning of machine %q: %v", result.Machine.Id(), result.Status.Error) continue } machine := result.Machine if err := machine.SetStatus(status.Pending, "", nil); err != nil { - logger.Errorf("cannot reset status of machine %q: %v", machine.Id(), err) + task.logger.Errorf("cannot reset status of machine %q: %v", machine.Id(), err) continue } if err := machine.SetInstanceStatus(status.Provisioning, "", nil); err != nil { - logger.Errorf("cannot reset instance status of machine %q: %v", machine.Id(), err) + task.logger.Errorf("cannot reset instance status of machine %q: %v", machine.Id(), err) continue } if err := machine.SetModificationStatus(status.Idle, "", nil); err != nil { - logger.Errorf("cannot reset modification status of machine %q: %v", machine.Id(), err) + task.logger.Errorf("cannot reset modification status of machine %q: %v", machine.Id(), err) continue } task.machinesMutex.Lock() @@ -251,7 +254,7 @@ } func (task *provisionerTask) processMachines(ids []string) error { - logger.Tracef("processMachines(%v)", ids) + task.logger.Tracef("processMachines(%v)", ids) // Populate the tasks maps of current instances and machines. if err := task.populateMachineMaps(ids); err != nil { @@ -273,7 +276,7 @@ return err } if !task.harvestMode.HarvestUnknown() { - logger.Infof( + task.logger.Infof( "%s is set to %s; unknown instances not stopped %v", config.ProvisionerHarvestModeKey, task.harvestMode.String(), @@ -282,7 +285,7 @@ unknown = nil } if task.harvestMode.HarvestNone() || !task.harvestMode.HarvestDestroyed() { - logger.Infof( + task.logger.Infof( `%s is set to "%s"; will not harvest %s`, config.ProvisionerHarvestModeKey, task.harvestMode.String(), @@ -292,10 +295,10 @@ } if len(stopping) > 0 { - logger.Infof("stopping known instances %v", stopping) + task.logger.Infof("stopping known instances %v", stopping) } if len(unknown) > 0 { - logger.Infof("stopping unknown instances %v", instanceIds(unknown)) + task.logger.Infof("stopping unknown instances %v", instanceIds(unknown)) } // It's important that we stop unknown instances before starting // pending ones, because if we start an instance and then fail to @@ -307,9 +310,9 @@ // Remove any dead machines from state. for _, machine := range dead { - logger.Infof("removing dead machine %q", machine.Id()) + task.logger.Infof("removing dead machine %q", machine.Id()) if err := machine.MarkForRemoval(); err != nil { - logger.Errorf("failed to remove dead machine %q", machine.Id()) + task.logger.Errorf("failed to remove dead machine %q", machine.Id()) } task.removeMachineFromAZMap(machine) task.machinesMutex.Lock() @@ -337,7 +340,7 @@ func (task *provisionerTask) populateMachineMaps(ids []string) error { task.instances = make(map[instance.Id]instances.Instance) - instances, err := task.broker.AllInstances(task.cloudCallCtx) + instances, err := task.broker.AllRunningInstances(task.cloudCallCtx) if err != nil { return errors.Annotate(err, "failed to get all instances from broker") } @@ -362,7 +365,7 @@ case result.Err == nil: task.machines[result.Machine.Id()] = result.Machine case params.IsCodeNotFoundOrCodeUnauthorized(result.Err): - logger.Debugf("machine %q not found in state", ids[i]) + task.logger.Debugf("machine %q not found in state", ids[i]) delete(task.machines, ids[i]) default: return errors.Annotatef(result.Err, "failed to get machine %v", ids[i]) @@ -379,11 +382,11 @@ for _, id := range ids { machine, found := task.machines[id] if !found { - logger.Infof("machine %q not found", id) + task.logger.Infof("machine %q not found", id) continue } var classification MachineClassification - classification, err = classifyMachine(machine) + classification, err = classifyMachine(task.logger, machine) if err != nil { return // return the error } @@ -396,8 +399,8 @@ maintain = append(maintain, machine) } } - logger.Tracef("pending machines: %v", pending) - logger.Tracef("dead machines: %v", dead) + task.logger.Tracef("pending machines: %v", pending) + task.logger.Tracef("dead machines: %v", dead) return } @@ -419,7 +422,7 @@ Maintain MachineClassification = "Maintain" ) -func classifyMachine(machine ClassifiableMachine) ( +func classifyMachine(logger Logger, machine ClassifiableMachine) ( MachineClassification, error) { switch machine.Life() { case params.Dying: @@ -512,7 +515,7 @@ if err == nil { keep, _ := machine.KeepInstance() if keep { - logger.Debugf("machine %v is dead but keep-instance is true", instId) + task.logger.Debugf("machine %v is dead but keep-instance is true", instId) continue } inst, found := task.instances[instId] @@ -725,7 +728,7 @@ func (task *provisionerTask) maintainMachines(machines []apiprovisioner.MachineProvisioner) error { for _, m := range machines { - logger.Infof("maintainMachines: %v", m) + task.logger.Infof("maintainMachines: %v", m) startInstanceParams := environs.StartInstanceParams{} startInstanceParams.InstanceConfig = &instancecfg.InstanceConfig{} startInstanceParams.InstanceConfig.MachineId = m.Id() @@ -891,7 +894,6 @@ return a } - logger.Debugf("applying availability zone constraints: %s", strings.Join(*cons.Zones, ", ")) filtered := a[:0] for _, azm := range a { for _, zone := range *cons.Zones { @@ -980,7 +982,7 @@ } func (task *provisionerTask) setErrorStatus(message string, machine apiprovisioner.MachineProvisioner, err error) error { - logger.Errorf(message, machine, err) + task.logger.Errorf(message, machine, err) errForStatus := errors.Cause(err) if err2 := machine.SetInstanceStatus(status.ProvisioningError, errForStatus.Error(), nil); err2 != nil { // Something is wrong with this machine, better report it back. @@ -1084,7 +1086,7 @@ // TODO (jam): 2017-01-19 Should we be setting this earlier in the cycle? if err := machine.SetInstanceStatus(status.Provisioning, "starting", nil); err != nil { - logger.Errorf("%v", err) + task.logger.Errorf("%v", err) } // TODO ProvisionerParallelization 2017-10-03 @@ -1104,7 +1106,7 @@ return task.setErrorStatus("cannot start instance for machine %q: %v", machine, err) } if startInstanceParams.AvailabilityZone != "" { - logger.Infof("trying machine %s StartInstance in availability zone %s", + task.logger.Infof("trying machine %s StartInstance in availability zone %s", machine, startInstanceParams.AvailabilityZone) } @@ -1127,7 +1129,7 @@ azRemaining, err2 := task.markMachineFailedInAZ(machine, startInstanceParams.AvailabilityZone) if err2 != nil { if err = task.setErrorStatus("cannot start instance: %v", machine, err2); err != nil { - logger.Errorf("setting error status: %s", err) + task.logger.Errorf("setting error status: %s", err) } return err2 } @@ -1137,7 +1139,7 @@ machine, startInstanceParams.AvailabilityZone, task.retryStartInstanceStrategy.retryDelay, err, ) - logger.Debugf("%s", retryMsg) + task.logger.Debugf("%s", retryMsg) // There's still more zones to try, so don't decrement "attemptsLeft" yet. retrying = false } else { @@ -1152,12 +1154,12 @@ "failed to start machine %s (%s), retrying in %v (%d more attempts)", machine, err.Error(), task.retryStartInstanceStrategy.retryDelay, attemptsLeft, ) - logger.Warningf("%s", retryMsg) + task.logger.Warningf("%s", retryMsg) attemptsLeft-- } if err3 := machine.SetInstanceStatus(status.Provisioning, retryMsg, nil); err3 != nil { - logger.Warningf("failed to set instance status: %v", err3) + task.logger.Warningf("failed to set instance status: %v", err3) } select { @@ -1191,15 +1193,15 @@ ); err != nil { // We need to stop the instance right away here, set error status and go on. if err2 := task.setErrorStatus("cannot register instance for machine %v: %v", machine, err); err2 != nil { - logger.Errorf("%v", errors.Annotate(err2, "cannot set machine's status")) + task.logger.Errorf("%v", errors.Annotate(err2, "cannot set machine's status")) } if err2 := task.broker.StopInstances(task.cloudCallCtx, result.Instance.Id()); err2 != nil { - logger.Errorf("%v", errors.Annotate(err2, "after failing to set instance info")) + task.logger.Errorf("%v", errors.Annotate(err2, "after failing to set instance info")) } return errors.Annotate(err, "cannot set instance info") } - logger.Infof( + task.logger.Infof( "started machine %s as instance %s with hardware %q, network config %+v, "+ "volumes %v, volume attachments %v, subnets to zones %v, lxd profiles %v", machine, @@ -1223,7 +1225,7 @@ return lxdprofile.LXDProfileNames(profileNames) } } else { - logger.Tracef("failed to gather profile names, broker didn't conform to LXDProfileNameRetriever") + task.logger.Tracef("failed to gather profile names, broker didn't conform to LXDProfileNameRetriever") } } return machineProfiles diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_task_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_task_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_task_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_task_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -12,6 +12,7 @@ "github.com/golang/mock/gomock" "github.com/juju/errors" + "github.com/juju/loggo" "github.com/juju/testing" jc "github.com/juju/testing/checkers" "github.com/juju/version" @@ -159,13 +160,13 @@ s.sendModelMachinesChange(c, "0", "1") - s.waitForTask(c, []string{"AllInstances", "StopInstances"}) + s.waitForTask(c, []string{"AllRunningInstances", "StopInstances"}) workertest.CleanKill(c, task) close(s.instanceBroker.callsChan) s.machineGetter.CheckCallNames(c, "Machines") s.instanceBroker.CheckCalls(c, []testing.StubCall{ - {"AllInstances", []interface{}{s.callCtx}}, + {"AllRunningInstances", []interface{}{s.callCtx}}, {"StopInstances", []interface{}{s.callCtx, []instance.Id{"zero"}}}, }) c.Assert(m0.markForRemoval, jc.IsTrue) @@ -348,7 +349,7 @@ broker := mocks.NewMockZonedEnviron(ctrl) exp := broker.EXPECT() - exp.AllInstances(s.callCtx).Return(s.instances, nil) + exp.AllRunningInstances(s.callCtx).Return(s.instances, nil) exp.InstanceAvailabilityZoneNames(s.callCtx, instanceIds).Return([]string{}, nil) exp.AvailabilityZones(s.callCtx).Return(zones, nil) return broker @@ -410,6 +411,7 @@ w, err := provisioner.NewProvisionerTask( coretesting.ControllerTag.Id(), names.NewMachineTag("0"), + loggo.GetLogger("test"), harvestingMethod, s.machineGetter, distributionGroupFinder, @@ -432,6 +434,7 @@ task, err := provisioner.NewProvisionerTask( coretesting.ControllerTag.Id(), names.NewMachineTag("0"), + loggo.GetLogger("test"), config.HarvestAll, s.machineGetter, &mockDistributionGroupFinder{groups: distributionGroups}, @@ -491,6 +494,12 @@ return t.allInstancesFunc(ctx) } +func (t *testInstanceBroker) AllRunningInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) { + t.AddCall("AllRunningInstances", ctx) + t.callsChan <- "AllRunningInstances" + return t.allInstancesFunc(ctx) +} + func (t *testInstanceBroker) MaintainInstance(ctx context.ProviderCallContext, args environs.StartInstanceParams) error { t.AddCall("MaintainInstance", ctx, args) t.callsChan <- "MaintainInstance" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/provisioner/provisioner_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/provisioner/provisioner_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/collections/set" "github.com/juju/errors" + "github.com/juju/loggo" "github.com/juju/os/series" jc "github.com/juju/testing/checkers" "github.com/juju/utils" @@ -468,7 +469,7 @@ machineTag := names.NewMachineTag("0") agentConfig := s.AgentConfigForTag(c, machineTag) apiState := apiprovisioner.NewState(s.st) - w, err := provisioner.NewEnvironProvisioner(apiState, agentConfig, s.Environ, &credentialAPIForTest{}) + w, err := provisioner.NewEnvironProvisioner(apiState, agentConfig, loggo.GetLogger("test"), s.Environ, &credentialAPIForTest{}) c.Assert(err, jc.ErrorIsNil) return w } @@ -990,7 +991,7 @@ c.Logf("%s: %s", id, t.description) machine := MockMachine{t.life, t.status, id, s2e(t.idErr), s2e(t.ensureDeadErr), s2e(t.statusErr)} - classification, err := provisioner.ClassifyMachine(&machine) + classification, err := provisioner.ClassifyMachine(loggo.GetLogger("test"), &machine) if err != nil { c.Assert(err, gc.ErrorMatches, fmt.Sprintf(t.expectErrFmt, machine.Id())) } else { @@ -1360,6 +1361,7 @@ w, err := provisioner.NewProvisionerTask( s.ControllerConfig.ControllerUUID(), names.NewMachineTag("0"), + loggo.GetLogger("test"), harvestingMethod, machineGetter, distributionGroupFinder, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/pruner/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/pruner/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/pruner/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/pruner/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -18,7 +18,6 @@ // statushistorypruner worker depends. type ManifoldConfig struct { APICallerName string - EnvironName string ClockName string PruneInterval time.Duration NewWorker func(Config) (worker.Worker, error) @@ -28,7 +27,7 @@ // Manifold returns a Manifold that encapsulates the statushistorypruner worker. func Manifold(config ManifoldConfig) dependency.Manifold { return dependency.Manifold{ - Inputs: []string{config.APICallerName, config.EnvironName, config.ClockName}, + Inputs: []string{config.APICallerName, config.ClockName}, Start: config.start, } } @@ -65,9 +64,6 @@ if config.APICallerName == "" { return errors.NotValidf("empty APICallerName") } - if config.EnvironName == "" { - return errors.NotValidf("empty EnvironName") - } if config.ClockName == "" { return errors.NotValidf("empty ClockName") } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/pruner/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/pruner/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/pruner/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/pruner/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -35,7 +35,6 @@ func (s *ManifoldConfigSuite) validConfig() pruner.ManifoldConfig { return pruner.ManifoldConfig{ APICallerName: "api-caller", - EnvironName: "environ", ClockName: "clock", NewWorker: func(pruner.Config) (worker.Worker, error) { return nil, nil }, NewFacade: func(caller base.APICaller) pruner.Facade { return nil }, @@ -51,11 +50,6 @@ s.checkNotValid(c, "empty APICallerName not valid") } -func (s *ManifoldConfigSuite) TestMissingEnvironName(c *gc.C) { - s.config.EnvironName = "" - s.checkNotValid(c, "empty EnvironName not valid") -} - func (s *ManifoldConfigSuite) TestMissingClockName(c *gc.C) { s.config.ClockName = "" s.checkNotValid(c, "empty ClockName not valid") diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/singular/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/singular/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/singular/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/singular/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -19,7 +19,7 @@ // ManifoldConfig holds the information necessary to run a FlagWorker in // a dependency.Engine. type ManifoldConfig struct { - ClockName string + Clock clock.Clock APICallerName string Duration time.Duration Claimant names.MachineTag @@ -29,10 +29,26 @@ NewWorker func(FlagConfig) (worker.Worker, error) } +// Validate ensures the required values are set. +func (config *ManifoldConfig) Validate() error { + if config.Clock == nil { + return errors.NotValidf("nil Clock") + } + if config.APICallerName == "" { + return errors.NotValidf("missing APICallerName") + } + if config.NewFacade == nil { + return errors.NotValidf("nil NewFacade") + } + if config.NewWorker == nil { + return errors.NotValidf("nil NewWorker") + } + return nil +} + // start is a method on ManifoldConfig because it's more readable than a closure. func (config ManifoldConfig) start(context dependency.Context) (worker.Worker, error) { - var clock clock.Clock - if err := context.Get(config.ClockName, &clock); err != nil { + if err := config.Validate(); err != nil { return nil, errors.Trace(err) } var apiCaller base.APICaller @@ -45,7 +61,7 @@ return nil, errors.Trace(err) } flag, err := config.NewWorker(FlagConfig{ - Clock: clock, + Clock: config.Clock, Facade: facade, Duration: config.Duration, }) @@ -75,7 +91,6 @@ func Manifold(config ManifoldConfig) dependency.Manifold { return dependency.Manifold{ Inputs: []string{ - config.ClockName, config.APICallerName, }, Start: config.start, diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/singular/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/singular/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/singular/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/singular/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -24,16 +24,65 @@ type ManifoldSuite struct { testing.IsolationSuite + + config singular.ManifoldConfig } var _ = gc.Suite(&ManifoldSuite{}) +func (s *ManifoldSuite) SetUpTest(c *gc.C) { + s.IsolationSuite.SetUpTest(c) + + s.config = singular.ManifoldConfig{ + Clock: testclock.NewClock(time.Now()), + APICallerName: "api-caller", + Duration: time.Minute, + NewFacade: func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { + return nil, errors.NotImplementedf("NewFacade") + }, + NewWorker: func(config singular.FlagConfig) (worker.Worker, error) { + return nil, errors.NotImplementedf("NewWorker") + }, + } +} + +func (s *ManifoldSuite) TestValidate(c *gc.C) { + c.Check(s.config.Validate(), jc.ErrorIsNil) +} + +func (s *ManifoldSuite) TestValidateMissingClock(c *gc.C) { + s.config.Clock = nil + err := s.config.Validate() + c.Check(err, jc.Satisfies, errors.IsNotValid) + c.Check(err.Error(), gc.Equals, "nil Clock not valid") +} + +func (s *ManifoldSuite) TestValidateMissingAPICallerName(c *gc.C) { + s.config.APICallerName = "" + err := s.config.Validate() + c.Check(err, jc.Satisfies, errors.IsNotValid) + c.Check(err.Error(), gc.Equals, "missing APICallerName not valid") +} + +func (s *ManifoldSuite) TestValidateMissingNewFacade(c *gc.C) { + s.config.NewFacade = nil + err := s.config.Validate() + c.Check(err, jc.Satisfies, errors.IsNotValid) + c.Check(err.Error(), gc.Equals, "nil NewFacade not valid") +} + +func (s *ManifoldSuite) TestValidateMissingNewWorker(c *gc.C) { + s.config.NewWorker = nil + err := s.config.Validate() + c.Check(err, jc.Satisfies, errors.IsNotValid) + c.Check(err.Error(), gc.Equals, "nil NewWorker not valid") +} + func (s *ManifoldSuite) TestInputs(c *gc.C) { manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "harriet", APICallerName: "kim", }) - expectInputs := []string{"harriet", "kim"} + expectInputs := []string{"kim"} c.Check(manifold.Inputs, jc.DeepEquals, expectInputs) } @@ -69,25 +118,18 @@ func (s *ManifoldSuite) TestStartMissingClock(c *gc.C) { manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", APICallerName: "api-caller", }) - context := dt.StubContext(nil, map[string]interface{}{ - "clock": dependency.ErrMissing, - }) + context := dt.StubContext(nil, map[string]interface{}{}) worker, err := manifold.Start(context) - c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing) + c.Check(errors.Cause(err), gc.ErrorMatches, `nil Clock not valid`) c.Check(worker, gc.IsNil) } func (s *ManifoldSuite) TestStartMissingAPICaller(c *gc.C) { - manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", - APICallerName: "api-caller", - }) + manifold := singular.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": &fakeClock{}, "api-caller": dependency.ErrMissing, }) @@ -98,20 +140,16 @@ func (s *ManifoldSuite) TestStartNewFacadeError(c *gc.C) { expectAPICaller := &fakeAPICaller{} - manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", - APICallerName: "api-caller", - Claimant: names.NewMachineTag("123"), - Entity: coretesting.ModelTag, - NewFacade: func(apiCaller base.APICaller, claimant names.MachineTag, entity names.Tag) (singular.Facade, error) { - c.Check(apiCaller, gc.Equals, expectAPICaller) - c.Check(claimant.String(), gc.Equals, "machine-123") - c.Check(entity, gc.Equals, coretesting.ModelTag) - return nil, errors.New("grark plop") - }, - }) + s.config.Claimant = names.NewMachineTag("123") + s.config.Entity = coretesting.ModelTag + s.config.NewFacade = func(apiCaller base.APICaller, claimant names.MachineTag, entity names.Tag) (singular.Facade, error) { + c.Check(apiCaller, gc.Equals, expectAPICaller) + c.Check(claimant.String(), gc.Equals, "machine-123") + c.Check(entity, gc.Equals, coretesting.ModelTag) + return nil, errors.New("grark plop") + } + manifold := singular.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": &fakeClock{}, "api-caller": expectAPICaller, }) @@ -122,22 +160,17 @@ func (s *ManifoldSuite) TestStartNewWorkerError(c *gc.C) { expectFacade := &fakeFacade{} - manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", - APICallerName: "api-caller", - Duration: time.Minute, - NewFacade: func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { - return expectFacade, nil - }, - NewWorker: func(config singular.FlagConfig) (worker.Worker, error) { - c.Check(config.Facade, gc.Equals, expectFacade) - err := config.Validate() - c.Check(err, jc.ErrorIsNil) - return nil, errors.New("blomp tik") - }, - }) + s.config.NewFacade = func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { + return expectFacade, nil + } + s.config.NewWorker = func(config singular.FlagConfig) (worker.Worker, error) { + c.Check(config.Facade, gc.Equals, expectFacade) + err := config.Validate() + c.Check(err, jc.ErrorIsNil) + return nil, errors.New("blomp tik") + } + manifold := singular.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": &fakeClock{}, "api-caller": &fakeAPICaller{}, }) @@ -149,18 +182,14 @@ func (s *ManifoldSuite) TestStartSuccess(c *gc.C) { var stub testing.Stub expectWorker := newStubWorker(&stub) - manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", - APICallerName: "api-caller", - NewFacade: func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { - return &fakeFacade{}, nil - }, - NewWorker: func(_ singular.FlagConfig) (worker.Worker, error) { - return expectWorker, nil - }, - }) + s.config.NewFacade = func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { + return &fakeFacade{}, nil + } + s.config.NewWorker = func(_ singular.FlagConfig) (worker.Worker, error) { + return expectWorker, nil + } + manifold := singular.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": &fakeClock{}, "api-caller": &fakeAPICaller{}, }) @@ -180,19 +209,15 @@ var stub testing.Stub stub.SetErrors(singular.ErrRefresh) errWorker := newStubWorker(&stub) + s.config.NewFacade = func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { + return &fakeFacade{}, nil + } + s.config.NewWorker = func(_ singular.FlagConfig) (worker.Worker, error) { + return errWorker, nil + } - manifold := singular.Manifold(singular.ManifoldConfig{ - ClockName: "clock", - APICallerName: "api-caller", - NewFacade: func(base.APICaller, names.MachineTag, names.Tag) (singular.Facade, error) { - return &fakeFacade{}, nil - }, - NewWorker: func(_ singular.FlagConfig) (worker.Worker, error) { - return errWorker, nil - }, - }) + manifold := singular.Manifold(s.config) context := dt.StubContext(nil, map[string]interface{}{ - "clock": &fakeClock{}, "api-caller": &fakeAPICaller{}, }) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/manifold.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/manifold.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/manifold.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/manifold.go 2019-06-28 17:10:43.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/juju/api/base" "github.com/juju/juju/environs" + envcontext "github.com/juju/juju/environs/context" "github.com/juju/juju/worker/common" ) @@ -19,6 +20,7 @@ APICallerName string CloudDestroyerName string + Logger Logger NewFacade func(base.APICaller) (Facade, error) NewWorker func(Config) (worker.Worker, error) NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error) @@ -31,7 +33,12 @@ return nil, errors.Trace(err) } var destroyer environs.CloudDestroyer - if err := context.Get(config.CloudDestroyerName, &destroyer); err != nil { + if err := context.Get(config.CloudDestroyerName, &destroyer); isErrMissing(err) { + // Rather than bailing out, we continue with a destroyer that + // always fails. This means that the undertaker will still + // remove the model in the force-destroy case. + destroyer = &unavailableDestroyer{} + } else if err != nil { return nil, errors.Trace(err) } @@ -49,6 +56,7 @@ Facade: facade, Destroyer: destroyer, CredentialAPI: credentialAPI, + Logger: config.Logger, }) if err != nil { return nil, errors.Trace(err) @@ -67,3 +75,18 @@ Start: config.start, } } + +func isErrMissing(err error) bool { + return errors.Cause(err) == dependency.ErrMissing +} + +// unavailableDestroyer is an environs.CloudDestroyer that always +// fails to destroy. We use it when the real environ isn't available +// because the cloud credentials are invalid so that the undertaker +// can still remove the model if destruction is forced. +type unavailableDestroyer struct{} + +// Destroy is part of environs.CloudDestroyer. +func (*unavailableDestroyer) Destroy(ctx envcontext.ProviderCallContext) error { + return errors.New("cloud environment unavailable") +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/manifold_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/manifold_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/manifold_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/manifold_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -22,6 +22,7 @@ type manifoldSuite struct { testing.IsolationSuite modelType string + logger fakeLogger } type CAASManifoldSuite struct { @@ -60,6 +61,7 @@ return undertaker.ManifoldConfig{ APICallerName: "api-caller", CloudDestroyerName: destroyerName, + Logger: &s.logger, NewCredentialValidatorFacade: func(base.APICaller) (common.CredentialAPI, error) { return &fakeCredentialAPI{}, nil }, @@ -87,15 +89,6 @@ c.Check(worker, gc.IsNil) } -func (s *manifoldSuite) TestEnvironMissing(c *gc.C) { - resources := resourcesMissing("environ", "broker") - manifold := undertaker.Manifold(s.namesConfig()) - - worker, err := manifold.Start(resources.Context()) - c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing) - c.Check(worker, gc.IsNil) -} - func (s *manifoldSuite) TestNewFacadeError(c *gc.C) { resources := resourcesMissing() config := s.namesConfig() @@ -145,13 +138,40 @@ c.Check(worker, gc.IsNil) } +func (s *manifoldSuite) TestNewWorkerEnvironMissing(c *gc.C) { + // If the environ tracker isn't available the undertaker can still + // start, but the destroyer it gets passed will always return an + // error. + expectWorker := &fakeWorker{} + config := s.namesConfig() + var gotConfig undertaker.Config + config.NewFacade = func(_ base.APICaller) (undertaker.Facade, error) { + return &fakeFacade{}, nil + } + config.NewWorker = func(workerConfig undertaker.Config) (worker.Worker, error) { + gotConfig = workerConfig + return expectWorker, nil + } + + resources := resourcesMissing("environ", "broker") + manifold := undertaker.Manifold(config) + + worker, err := manifold.Start(resources.Context()) + c.Assert(err, jc.ErrorIsNil) + c.Assert(worker, gc.Equals, expectWorker) + err = gotConfig.Destroyer.Destroy(nil) + c.Assert(err, gc.ErrorMatches, "cloud environment unavailable") +} + func (s *manifoldSuite) TestNewWorkerSuccess(c *gc.C) { expectWorker := &fakeWorker{} config := s.namesConfig() + var gotConfig undertaker.Config config.NewFacade = func(_ base.APICaller) (undertaker.Facade, error) { return &fakeFacade{}, nil } - config.NewWorker = func(_ undertaker.Config) (worker.Worker, error) { + config.NewWorker = func(workerConfig undertaker.Config) (worker.Worker, error) { + gotConfig = workerConfig return expectWorker, nil } manifold := undertaker.Manifold(config) @@ -160,6 +180,7 @@ worker, err := manifold.Start(resources.Context()) c.Check(err, jc.ErrorIsNil) c.Check(worker, gc.Equals, expectWorker) + c.Assert(gotConfig.Logger, gc.Equals, &s.logger) } func resourcesMissing(missing ...string) dt.StubResources { @@ -203,3 +224,11 @@ func (*fakeCredentialAPI) InvalidateModelCredential(reason string) error { return nil } + +type fakeLogger struct { + stub testing.Stub +} + +func (l *fakeLogger) Errorf(format string, args ...interface{}) { + l.stub.AddCall("Errorf", format, args) +} diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/mock_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/mock_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/mock_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/mock_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -88,9 +88,10 @@ info params.UndertakerModelInfoResult errors []error dirty bool + logger fakeLogger } -func (fix fixture) cleanup(c *gc.C, w worker.Worker) { +func (fix *fixture) cleanup(c *gc.C, w worker.Worker) { if fix.dirty { workertest.DirtyKill(c, w) } else { @@ -98,7 +99,7 @@ } } -func (fix fixture) run(c *gc.C, test func(worker.Worker)) *testing.Stub { +func (fix *fixture) run(c *gc.C, test func(worker.Worker)) *testing.Stub { stub := &testing.Stub{} environOrBroker := &mockDestroyer{ stub: stub, @@ -112,6 +113,7 @@ Facade: facade, Destroyer: environOrBroker, CredentialAPI: &fakeCredentialAPI{}, + Logger: &fix.logger, }) c.Assert(err, jc.ErrorIsNil) defer fix.cleanup(c, w) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/undertaker.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/undertaker.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/undertaker.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/undertaker.go 2019-06-28 17:10:43.000000000 +0000 @@ -28,12 +28,18 @@ SetStatus(status status.Status, message string, data map[string]interface{}) error } +// Logger defines a way to report non-fatal errors. +type Logger interface { + Errorf(string, ...interface{}) +} + // Config holds the resources and configuration necessary to run an // undertaker worker. type Config struct { Facade Facade Destroyer environs.CloudDestroyer CredentialAPI common.CredentialAPI + Logger Logger } // Validate returns an error if the config cannot be expected to drive @@ -48,6 +54,9 @@ if config.Destroyer == nil { return errors.NotValidf("nil Destroyer") } + if config.Logger == nil { + return errors.NotValidf("nil Logger") + } return nil } @@ -153,8 +162,12 @@ ); err != nil { return errors.Trace(err) } - if err := u.config.Destroyer.Destroy(u.getCallCtx()); err != nil { - return errors.Trace(err) + err = u.config.Destroyer.Destroy(u.getCallCtx()) + if err != nil { + if !modelInfo.ForceDestroyed { + return errors.Trace(err) + } + u.config.Logger.Errorf("error tearing down cloud environment for force-destroyed model %q (%s): %v", modelInfo.GlobalName, modelInfo.UUID, err) } // Finally, the model is going to be dead, and be removed. if err := u.config.Facade.RemoveModel(); err != nil { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/undertaker_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/undertaker_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/undertaker_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/undertaker_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -6,6 +6,7 @@ import ( "github.com/juju/errors" "github.com/juju/testing" + jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/juju/worker.v1" "gopkg.in/juju/worker.v1/workertest" @@ -177,6 +178,20 @@ stub.CheckCallNames(c, "ModelInfo", "SetStatus", "Destroy") } +func (s *UndertakerSuite) TestDestroyErrorForced(c *gc.C) { + s.fix.errors = []error{nil, nil, errors.New("pow")} + s.fix.info.Result.Life = "dead" + s.fix.info.Result.ForceDestroyed = true + stub := s.fix.run(c, func(w worker.Worker) { + err := workertest.CheckKilled(c, w) + c.Assert(err, jc.ErrorIsNil) + }) + // Removal continues despite the error calling destroy. + stub.CheckCallNames(c, "ModelInfo", "SetStatus", "Destroy", "RemoveModel") + // Logged the failed destroy call. + s.fix.logger.stub.CheckCallNames(c, "Errorf") +} + func (s *UndertakerSuite) TestRemoveModelErrorFatal(c *gc.C) { s.fix.errors = []error{nil, nil, nil, errors.New("pow")} s.fix.info.Result.Life = "dead" diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/validate_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/validate_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/undertaker/validate_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/undertaker/validate_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,11 +36,18 @@ checkInvalid(c, config, "nil CredentialAPI not valid") } +func (*ValidateSuite) TestNilLogger(c *gc.C) { + config := validConfig() + config.Logger = nil + checkInvalid(c, config, "nil Logger not valid") +} + func validConfig() undertaker.Config { return undertaker.Config{ Facade: &fakeFacade{}, Destroyer: &fakeEnviron{}, CredentialAPI: &fakeCredentialAPI{}, + Logger: &fakeLogger{}, } } diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/deploy_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/deploy_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/deploy_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/deploy_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -27,7 +27,14 @@ c *gc.C, newDeploy newDeploy, kind operation.Kind, ) { callbacks := &DeployCallbacks{} - factory := operation.NewFactory(operation.FactoryParams{Callbacks: callbacks}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + factory := operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + Callbacks: callbacks, + }) op, err := newDeploy(factory, curl("cs:quantal/hive-23")) c.Assert(err, jc.ErrorIsNil) newState, err := op.Prepare(operation.State{ @@ -478,7 +485,14 @@ func (s *DeploySuite) TestCommitQueueInstallHook(c *gc.C) { callbacks := NewDeployCommitCallbacks(nil) - factory := operation.NewFactory(operation.FactoryParams{Callbacks: callbacks}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + factory := operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + Callbacks: callbacks, + }) op, err := factory.NewInstall(curl("cs:quantal/x-0")) c.Assert(err, jc.ErrorIsNil) newState, err := op.Commit(operation.State{ @@ -496,7 +510,15 @@ func (s *DeploySuite) testCommitQueueUpgradeHook(c *gc.C, newDeploy newDeploy) { callbacks := NewDeployCommitCallbacks(nil) - factory := operation.NewFactory(operation.FactoryParams{Callbacks: callbacks}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + factory := operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + Callbacks: callbacks, + }) + op, err := newDeploy(factory, curl("cs:quantal/x-0")) c.Assert(err, jc.ErrorIsNil) newState, err := op.Commit(operation.State{ @@ -526,7 +548,15 @@ func (s *DeploySuite) testCommitInterruptedHook(c *gc.C, newDeploy newDeploy) { callbacks := NewDeployCommitCallbacks(nil) - factory := operation.NewFactory(operation.FactoryParams{Callbacks: callbacks}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + factory := operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + Callbacks: callbacks, + }) + op, err := newDeploy(factory, curl("cs:quantal/x-0")) c.Assert(err, jc.ErrorIsNil) newState, err := op.Commit(operation.State{ @@ -556,7 +586,13 @@ } func (s *DeploySuite) testDoesNotNeedGlobalMachineLock(c *gc.C, newDeploy newDeploy) { - factory := operation.NewFactory(operation.FactoryParams{}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + factory := operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + }) op, err := newDeploy(factory, curl("cs:quantal/x-0")) c.Assert(err, jc.ErrorIsNil) c.Assert(op.NeedsGlobalMachineLock(), jc.IsFalse) diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/factory.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/factory.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/factory.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/factory.go 2019-06-28 17:10:43.000000000 +0000 @@ -36,6 +36,9 @@ // newDeploy is the common code for creating arbitrary deploy operations. func (f *factory) newDeploy(kind Kind, charmURL *corecharm.URL, revert, resolved bool) (Operation, error) { + if f.config.Deployer == nil { + return nil, errors.New("deployer required") + } if charmURL == nil { return nil, errors.New("charm url required") } else if kind != Install && kind != Upgrade { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/factory_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/factory_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/operation/factory_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/operation/factory_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -28,7 +28,13 @@ // verifying that inadequate args to the factory methods will produce // the expected errors; and that the results of same get a string // representation that does not depend on the factory attributes. - s.factory = operation.NewFactory(operation.FactoryParams{}) + deployer := &MockDeployer{ + MockNotifyRevert: &MockNoArgs{}, + MockNotifyResolved: &MockNoArgs{}, + } + s.factory = operation.NewFactory(operation.FactoryParams{ + Deployer: deployer, + }) } func (s *FactorySuite) testNewDeployError(c *gc.C, newDeploy newDeploy) { diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/resolver.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/resolver.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/resolver.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/resolver.go 2019-06-28 17:10:43.000000000 +0000 @@ -5,6 +5,7 @@ import ( "github.com/juju/errors" + "gopkg.in/juju/charm.v6" "gopkg.in/juju/charm.v6/hooks" "github.com/juju/juju/apiserver/params" @@ -44,6 +45,16 @@ } } +func (s *uniterResolver) upgradeOpForModel(opFactory operation.Factory, curl *charm.URL) (operation.Operation, error) { + // Only IAAS models will react to a charm modified change. + // For CAAS models, the operator will unpack the new charm and + // inform the uniter workers to run the upgrade hook. + if s.config.ModelType == model.IAAS { + return opFactory.NewUpgrade(curl) + } + return opFactory.NewNoOpUpgrade(curl) +} + func (s *uniterResolver) NextOp( localState resolver.LocalState, remoteState remotestate.Snapshot, @@ -70,7 +81,7 @@ } // continue upgrading the charm logger.Infof("resuming charm upgrade") - return opFactory.NewUpgrade(localState.CharmURL) + return s.upgradeOpForModel(opFactory, localState.CharmURL) } if localState.Restart { @@ -149,14 +160,22 @@ remoteState remotestate.Snapshot, opFactory operation.Factory, ) (operation.Operation, error) { + // Only IAAS models deal with conflicted upgrades. + // TODO(caas) - what to do here. if remoteState.ResolvedMode != params.ResolvedNone { if err := s.config.ClearResolved(); err != nil { return nil, errors.Trace(err) } - return opFactory.NewResolvedUpgrade(localState.CharmURL) + if s.config.ModelType == model.IAAS { + return opFactory.NewResolvedUpgrade(localState.CharmURL) + } + return opFactory.NewNoOpUpgrade(localState.CharmURL) } if remoteState.ForceCharmUpgrade && charmModified(localState, remoteState) { - return opFactory.NewRevertUpgrade(remoteState.CharmURL) + if s.config.ModelType == model.IAAS { + return opFactory.NewRevertUpgrade(remoteState.CharmURL) + } + return opFactory.NewNoOpUpgrade(remoteState.CharmURL) } return nil, resolver.ErrWaiting } @@ -173,7 +192,7 @@ } if remoteState.ForceCharmUpgrade && charmModified(localState, remoteState) { - return opFactory.NewUpgrade(remoteState.CharmURL) + return s.upgradeOpForModel(opFactory, remoteState.CharmURL) } switch remoteState.ResolvedMode { @@ -274,14 +293,8 @@ return opFactory.NewRunHook(hook.Info{Kind: hooks.Install}) } - // Only IAAS models will react to a charm modified change. - // For CAAS models, the operator will unpack the new charm and - // inform the uniter workers to run the upgrade hook. if charmModified(localState, remoteState) { - if s.config.ModelType == model.IAAS { - return opFactory.NewUpgrade(remoteState.CharmURL) - } - return opFactory.NewNoOpUpgrade(remoteState.CharmURL) + return s.upgradeOpForModel(opFactory, remoteState.CharmURL) } configHashChanged := localState.ConfigHash != remoteState.ConfigHash diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/runner/context/leader.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/runner/context/leader.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/runner/context/leader.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/runner/context/leader.go 2019-06-28 17:10:43.000000000 +0000 @@ -74,10 +74,6 @@ // `apiserver/leadership.LeadershipSettingsAccessor.Merge`, and as of // 2015-02-19 it's better to stay eager. err := ctx.ensureLeader() - if err == errIsMinion { - logger.Warningf("skipping write settings; not the leader") - return nil - } if err == nil { // Clear local settings; if we need them again we should use the values // as merged by the server. But we don't need to get them again right now; diff -Nru juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/runner/context/leader_test.go juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/runner/context/leader_test.go --- juju-core-2.6.2/src/github.com/juju/juju/worker/uniter/runner/context/leader_test.go 2019-05-14 17:30:43.000000000 +0000 +++ juju-core-2.6.5/src/github.com/juju/juju/worker/uniter/runner/context/leader_test.go 2019-06-28 17:10:43.000000000 +0000 @@ -201,17 +201,16 @@ s.CheckCalls(c, []testing.StubCall{{ FuncName: "ClaimLeader", }}, func() { - // We are not the leader. + // The first call fails... s.tracker.results = []StubTicket{false} err := s.context.WriteLeaderSettings(map[string]string{"blah": "blah"}) - // No error, no call to Merge. - c.Check(err, jc.ErrorIsNil) + c.Check(err, gc.ErrorMatches, "cannot write settings: not the leader") }) s.CheckCalls(c, nil, func() { - // ctx.isMinion is now true. No call to claim leader. + // The second doesn't even try. err := s.context.WriteLeaderSettings(map[string]string{"blah": "blah"}) - c.Check(err, jc.ErrorIsNil) + c.Check(err, gc.ErrorMatches, "cannot write settings: not the leader") }) }